Skip to content
Commit 3008d20f authored by Matthias Schiffer's avatar Matthias Schiffer Committed by Guenter Roeck
Browse files

hwmon: (pwm-fan) Explicitly switch off fan power when setting pwm1_enable to 0

When pwm1_enable is changed from 1 to 0 while pwm1 == 0, the regulator
is not switched off as expected. The reason is that when the fan is
already off, ctx->enabled is false, so pwm_fan_power_off() will be a
no-op.

Handle this case explicitly in pwm_fan_update_enable() by calling
pwm_fan_switch_power() directly.

Fixes: b99152d4

 ("hwmon: (pwm-fan) Switch regulator dynamically")
Signed-off-by: default avatarMatthias Schiffer <matthias.schiffer@ew.tq-group.com>
Link: https://lore.kernel.org/r/20221013135951.4902-1-matthias.schiffer@ew.tq-group.com
Signed-off-by: default avatarGuenter Roeck <linux@roeck-us.net>
parent b6291023
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment