hwmon: (pwm-fan) Switch regulator dynamically
authorAlexander Stein <alexander.stein@ew.tq-group.com>
Wed, 14 Sep 2022 15:31:37 +0000 (17:31 +0200)
committerGuenter Roeck <linux@roeck-us.net>
Sun, 25 Sep 2022 21:22:11 +0000 (14:22 -0700)
commitb99152d4f04b379e31db6c1a2dda6b272c92039b
tree4dfa123fcc39be37b006ac865a4d277859503e97
parent9db6e7f500541b797acc207c790024f6179e2e6c
hwmon: (pwm-fan) Switch regulator dynamically

This adds the enable attribute which is used to select if zero PWM duty
means to switch off regulator and PWM or to keep them enabled but
at inactive PWM output level.
Depending on the select enable mode, turn off the regulator and PWM if
the PWM duty is zero, or keep them enabled.
This is especially important for fan using inverted PWM signal polarity.
Having regulator supplied and PWM disabled, some PWM controllers provide
the active, rather than inactive signal.

With this change the shutdown as well as suspend/resume paths require
modifcations as well.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20220914153137.613982-6-alexander.stein@ew.tq-group.com
Signed-off-by: Guenter Roeck <linux@roeck-us.net>
Documentation/hwmon/pwm-fan.rst
drivers/hwmon/pwm-fan.c