]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: Add notification support
authorGuenter Roeck <linux@roeck-us.net>
Thu, 28 May 2020 14:28:04 +0000 (17:28 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 28 May 2020 14:59:45 +0000 (07:59 -0700)
commit12f802f3ab54d2da56ef4ea8b46edba13f8267a4
tree7e554027392438688d0e5dc0b21286d3fd2b16c9
parentc92e951323f2ec2dbfb15521334cb0d4301d43de
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>
drivers/hwmon/hwmon.c
include/linux/hwmon.h