summaryrefslogtreecommitdiff
path: root/include/linux/hwmon.h
diff options
context:
space:
mode:
authorGuenter Roeck <linux@roeck-us.net>2020-05-28 17:28:04 +0300
committerGuenter Roeck <linux@roeck-us.net>2020-05-28 07:59:45 -0700
commit1597b374af22266266e1e20612208c4b11359ad4 (patch)
tree7e554027392438688d0e5dc0b21286d3fd2b16c9 /include/linux/hwmon.h
parentddc65caa56660813af1c8cff979bdc80f81456f2 (diff)
downloadlwn-1597b374af22266266e1e20612208c4b11359ad4.tar.gz
lwn-1597b374af22266266e1e20612208c4b11359ad4.zip
hwmon: Add notification support
For hwmon drivers using the hwmon_device_register_with_info() API, it is desirable to have a generic notification mechanism available. This mechanism can be used to notify userspace as well as the thermal subsystem if the driver experiences any events, such as warning or critical alarms. Implement hwmon_notify_event() to provide this mechanism. The function generates a sysfs event and a udev event. If the device is registered with the thermal subsystem and the event is associated with a temperature sensor, also notify the thermal subsystem that a thermal event occurred. Signed-off-by: Guenter Roeck <linux@roeck-us.net> Signed-off-by: Serge Semin <Sergey.Semin@baikalelectronics.ru> Cc: Maxim Kaurkin <Maxim.Kaurkin@baikalelectronics.ru> Cc: Alexey Malahov <Alexey.Malahov@baikalelectronics.ru> Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de> Cc: Arnd Bergmann <arnd@arndb.de> Cc: Rob Herring <robh+dt@kernel.org> Cc: linux-mips@vger.kernel.org Cc: devicetree@vger.kernel.org Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Diffstat (limited to 'include/linux/hwmon.h')
-rw-r--r--include/linux/hwmon.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/hwmon.h b/include/linux/hwmon.h
index 5e609f25878c..363d4a814aa1 100644
--- a/include/linux/hwmon.h
+++ b/include/linux/hwmon.h
@@ -436,6 +436,9 @@ devm_hwmon_device_register_with_info(struct device *dev,
void hwmon_device_unregister(struct device *dev);
void devm_hwmon_device_unregister(struct device *dev);
+int hwmon_notify_event(struct device *dev, enum hwmon_sensor_types type,
+ u32 attr, int channel);
+
/**
* hwmon_is_bad_char - Is the char invalid in a hwmon name
* @ch: the char to be considered