]> git.baikalelectronics.ru Git - kernel.git/commit
hwmon: Support set_trips() of thermal device ops
authorDmitry Osipenko <digetx@gmail.com>
Wed, 23 Jun 2021 04:22:31 +0000 (07:22 +0300)
committerGuenter Roeck <linux@roeck-us.net>
Thu, 24 Jun 2021 14:15:28 +0000 (07:15 -0700)
commit7a761718839723d0a0f70f9a2750d3274b884741
treef1adb2f16605173f4f7aa66c457de9a85f17ff6d
parent3233080722930c8fcd00af2daff6697ecee1ac13
hwmon: Support set_trips() of thermal device ops

Support set_trips() callback of thermal device ops. This allows HWMON
device to operatively notify thermal core about temperature changes, which
is very handy to have in a case where HWMON sensor is used by CPU thermal
zone that performs passive cooling and emergency shutdown on overheat.
Thermal core will be able to react faster to temperature changes.

The set_trips() callback is entirely optional. If HWMON sensor doesn't
support setting thermal trips, then the callback is a NO-OP. The dummy
callback has no effect on the thermal core. The temperature trips are
either complement the temperature polling mechanism of thermal core or
replace the polling if sensor can set the trips and polling is disabled
by a particular device in a device-tree.

Signed-off-by: Dmitry Osipenko <digetx@gmail.com>
Link: https://lore.kernel.org/r/20210623042231.16008-3-digetx@gmail.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
drivers/hwmon/hwmon.c