diff options
author | Hien Dang <hien.dang.eb@renesas.com> | 2018-03-13 04:18:17 -0400 |
---|---|---|
committer | Thierry Reding <thierry.reding@gmail.com> | 2018-03-27 19:26:15 -0400 |
commit | f2e6142cdc10b1b7edea8d65b07293f152e4d110 (patch) | |
tree | 19a3b4396e782441b97b9c9534669e29f306b90d | |
parent | aa7c49328bd84cda3c4674b70eb10db0a94f89ab (diff) |
pwm: rcar: Use PM Runtime to control module clock
Runtime PM API (pm_runtime_get_sync/pm_runtime_put) should be used
to control module clock instead of clk_prepare_enable and
clk_disable_unprepare.
Signed-off-by: Hien Dang <hien.dang.eb@renesas.com>
Signed-off-by: Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Thierry Reding <thierry.reding@gmail.com>
-rw-r--r-- | drivers/pwm/pwm-rcar.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/drivers/pwm/pwm-rcar.c b/drivers/pwm/pwm-rcar.c index 0fcf94ffad32..f4d8767f804e 100644 --- a/drivers/pwm/pwm-rcar.c +++ b/drivers/pwm/pwm-rcar.c | |||
@@ -134,16 +134,12 @@ static int rcar_pwm_set_counter(struct rcar_pwm_chip *rp, int div, int duty_ns, | |||
134 | 134 | ||
135 | static int rcar_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) | 135 | static int rcar_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) |
136 | { | 136 | { |
137 | struct rcar_pwm_chip *rp = to_rcar_pwm_chip(chip); | 137 | return pm_runtime_get_sync(chip->dev); |
138 | |||
139 | return clk_prepare_enable(rp->clk); | ||
140 | } | 138 | } |
141 | 139 | ||
142 | static void rcar_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) | 140 | static void rcar_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) |
143 | { | 141 | { |
144 | struct rcar_pwm_chip *rp = to_rcar_pwm_chip(chip); | 142 | pm_runtime_put(chip->dev); |
145 | |||
146 | clk_disable_unprepare(rp->clk); | ||
147 | } | 143 | } |
148 | 144 | ||
149 | static int rcar_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, | 145 | static int rcar_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, |