aboutsummaryrefslogtreecommitdiff
path: root/drivers/pwm/pwm-ep93xx.c
diff options
context:
space:
mode:
authorAlexander Sverdlin2021-06-14 01:30:41 +0200
committerThierry Reding2021-06-30 19:12:20 +0200
commitb235f8a39fc3ee09c804bf711c3039f92d867549 (patch)
treeab1bb9f1145ac35e60d35e8f87224baab9601172 /drivers/pwm/pwm-ep93xx.c
parent72cce47fe8f8dec55de8cd4574c574dec5195252 (diff)
pwm: ep93xx: Prepare clock before using it
Use clk_prepare_enable()/clk_disable_unprepare() in preparation for switch to Common Clock Framework. Signed-off-by: Alexander Sverdlin <alexander.sverdlin@gmail.com> Reviewed-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
Diffstat (limited to 'drivers/pwm/pwm-ep93xx.c')
-rw-r--r--drivers/pwm/pwm-ep93xx.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/drivers/pwm/pwm-ep93xx.c b/drivers/pwm/pwm-ep93xx.c
index 3354b734f28f..70fa2957f9d3 100644
--- a/drivers/pwm/pwm-ep93xx.c
+++ b/drivers/pwm/pwm-ep93xx.c
@@ -68,7 +68,7 @@ static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
if (state->polarity != pwm->state.polarity) {
if (enabled) {
writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_ENABLE);
- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);
enabled = false;
}
@@ -76,7 +76,7 @@ static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
* The clock needs to be enabled to access the PWM registers.
* Polarity can only be changed when the PWM is disabled.
*/
- ret = clk_enable(ep93xx_pwm->clk);
+ ret = clk_prepare_enable(ep93xx_pwm->clk);
if (ret)
return ret;
@@ -85,13 +85,13 @@ static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
else
writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_INVERT);
- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);
}
if (!state->enabled) {
if (enabled) {
writew(0x0, ep93xx_pwm->base + EP93XX_PWMx_ENABLE);
- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);
}
return 0;
@@ -111,7 +111,7 @@ static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
* Configuration can be changed at any time.
*/
if (!pwm_is_enabled(pwm)) {
- ret = clk_enable(ep93xx_pwm->clk);
+ ret = clk_prepare_enable(ep93xx_pwm->clk);
if (ret)
return ret;
}
@@ -142,14 +142,14 @@ static int ep93xx_pwm_apply(struct pwm_chip *chip, struct pwm_device *pwm,
}
if (!pwm_is_enabled(pwm))
- clk_disable(ep93xx_pwm->clk);
+ clk_disable_unprepare(ep93xx_pwm->clk);
if (ret)
return ret;
}
if (!enabled) {
- ret = clk_enable(ep93xx_pwm->clk);
+ ret = clk_prepare_enable(ep93xx_pwm->clk);
if (ret)
return ret;