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)
commita5f6c0f85a09f46c88c0ac53f3d2f70eef105a65
treef1adb2f16605173f4f7aa66c457de9a85f17ff6d
parentb50aa49638c7e12abf4ecc483f4e928c5cccc1b0
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