STRUCT HWMON_OPS(9)
π NAME π
okay so bestie, welcome to struct hwmon_ops(9) β straight out of the Kernel API Manual β and it's literally the hwmon device operations struct, the whole vibe checklist for how your hardware-monitoring device behaves. periodt. π‘οΈβ¨
β¨ SYNOPSIS β¨
here's the exact shape of it, no cap, copy it character for character:
struct hwmon_ops {
umode_t visible;
umode_t (*is_visible)(const void *drvdata, enum hwmon_sensor_types
type, u32 attr, int channel);
int (*read)(struct device *dev, enum hwmon_sensor_types type, u32
attr, int channel, long *val);
int (*read_string)(struct device *dev, enum hwmon_sensor_types type,
u32 attr, int channel, const char **str);
int (*write)(struct device *dev, enum hwmon_sensor_types type, u32
attr, int channel, long val);
};
like, that's the whole struct. slay. π
π MEMBERS π
visibleβ the static visibility field, iykyk. if it's non-zero, thenis_visiblegets ignored. that's it, that's the rule. πis_visibleβ the callback that returns attribute visibility. it's mandatory unless... yeah. the parameters are:const void *drvdata: a pointer to the driver-private data structure that gets passed as an argument tohwmon_device_register_with_info. π«Άreadβ the read callback for data attributes. mandatory if readable data attributes are present. the parameters are: πread_stringβ the read callback for string attributes. mandatory if string attributes are present. the parameters are: πwriteβ the write callback for data attributes. mandatory if writeable data attributes are present. the parameters are: βοΈ
ngl bestie, those last three all say "Parameters are:" and then the manpage just... moves on. so we're matching energy and not inventing anything extra. no cap, no made-up deets. π
π SEE ALSO π
- the kernel file
./include/linux/hwmon.h struct hwmon_channel_info(9)struct hwmon_chip_info(9)hwmon_is_bad_char(9)
go read those next, bestie, they're iconic. π
and that's the whole page, fr fr β brought to you by the source at ./include/linux, dated October 2026, with the title struct hwmon_ops(9) up top where it belongs. mwah. ππ¦π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms