backlight: pwm_bl: Disable PWM on shutdown, suspend and remove
authorUwe Kleine-König <u.kleine-koenig@pengutronix.de>
Mon, 9 Oct 2023 09:32:23 +0000 (11:32 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:20 +0000 (11:59 +0100)
commit80d5b1bf02b8b6721c9d5450a1914a1d4cb8b50b
treeb8c5ac18b5907be95cb454d6be00d85bb8db6b33
parent35edb7a6b758ecbc7b2682c973ae5362381248a7
backlight: pwm_bl: Disable PWM on shutdown, suspend and remove

[ Upstream commit 40da4737717b252fd01d92ff38d3b95a491167cc ]

Since commit 00e7e698bff1 ("backlight: pwm_bl: Configure pwm only once
per backlight toggle") calling pwm_backlight_power_off() doesn't disable
the PWM any more. However this is necessary to suspend because PWM
drivers usually refuse to suspend if they are still enabled.

Also adapt shutdown and remove callbacks to disable the PWM for similar
reasons.

Fixes: 00e7e698bff1 ("backlight: pwm_bl: Configure pwm only once per backlight toggle")
Reported-by: Aisheng Dong <aisheng.dong@nxp.com>
Tested-by: Aisheng Dong <aisheng.dong@nxp.com>
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Daniel Thompson <daniel.thompson@linaro.org>
Link: https://lore.kernel.org/r/20231009093223.227286-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/backlight/pwm_bl.c