pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume
Subsystems (2)
Florian Fainelli
maintainerPATCH 1/1 pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume
The suspend/resume functions currently utilize clk_disable()/clk_enable() respectively which may be no-ops with certain clock providers such as SCMI. Fix this to use clk_disable_unprepare() and clk_prepare_enable() respectively as we should.
--- drivers/pwm/pwm-brcmstb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/pwm/pwm-brcmstb.c +2 -2
@@ -288,7 +288,7 @@ static int brcmstb_pwm_suspend(struct device *dev) {struct brcmstb_pwm *p =dev_get_drvdata (dev); -clk_disable (p->clk); +clk_disable_unprepare (p->clk);return 0 ; }
@@ -297,7 +297,7 @@ static int brcmstb_pwm_resume(struct device *dev) {struct brcmstb_pwm *p =dev_get_drvdata (dev); -clk_enable (p->clk); +clk_prepare_enable (p->clk);return 0 ; }
Signature · 1 line
2.34.1
Hello Florian,
Quoted 25 lines · Florian Fainelli
The suspend/resume functions currently utilize clk_disable()/clk_enable() respectively which may be no-ops with certain clock providers such as SCMI. Fix this to use
clk_disable_unprepare()andclk_prepare_enable()respectively as we should.Fixes 3a9f5957020f ("pwm: Add Broadcom BCM7038 PWM controller support")Signed-off-by Florian Fainelli <[email protected]>--- drivers/pwm/pwm-brcmstb.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/pwm/pwm-brcmstb.c +1
-1@@ -288,7 +288,7 @@ static int brcmstb_pwm_suspend(struct device *dev) {struct brcmstb_pwm *p =dev_get_drvdata (dev); -clk_disable (p->clk); +clk_disable_unprepare (p->clk);return 0 ; }
drivers/pwm/pwm-brcmstb.c static int brcmstb_pwm_resume(struct device *dev) · line 300
Quoted 5 lines
drivers/pwm/pwm-brcmstb.c +1
-1@@ -297,7 +297,7 @@ static int brcmstb_pwm_resume(struct device *dev) {struct brcmstb_pwm *p =dev_get_drvdata (dev); -clk_enable (p->clk); +clk_prepare_enable (p->clk);
While at it: Add another patch that checks the return value of clk_prepare_enable()?
Orthogonally to that, the patch looks fine:
Best regards
Uwe
Signature · 2 lines
Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ |
_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Thierry Reding
AppliedQuoted 6 lines · Florian Fainelli
The suspend/resume functions currently utilize clk_disable()/clk_enable() respectively which may be no-ops with certain clock providers such as SCMI. Fix this to use
clk_disable_unprepare()andclk_prepare_enable()respectively as we should.
Applied, thanks!
[1/1] pwm: brcmstb: Utilize appropriate clock APIs in suspend/resume
commit: 4da07e8a22919fde057b554716e4c5a640d4d805
Best regards,
Signature · 1 line
Thierry Reding <[email protected]>