Commit f2e6142c authored by Hien Dang's avatar Hien Dang Committed by Thierry Reding

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: default avatarHien Dang <hien.dang.eb@renesas.com>
Signed-off-by: default avatarYoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: default avatarThierry Reding <thierry.reding@gmail.com>
parent aa7c4932
...@@ -134,16 +134,12 @@ static int rcar_pwm_set_counter(struct rcar_pwm_chip *rp, int div, int duty_ns, ...@@ -134,16 +134,12 @@ static int rcar_pwm_set_counter(struct rcar_pwm_chip *rp, int div, int duty_ns,
static int rcar_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm) static int rcar_pwm_request(struct pwm_chip *chip, struct pwm_device *pwm)
{ {
struct rcar_pwm_chip *rp = to_rcar_pwm_chip(chip); return pm_runtime_get_sync(chip->dev);
return clk_prepare_enable(rp->clk);
} }
static void rcar_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm) static void rcar_pwm_free(struct pwm_chip *chip, struct pwm_device *pwm)
{ {
struct rcar_pwm_chip *rp = to_rcar_pwm_chip(chip); pm_runtime_put(chip->dev);
clk_disable_unprepare(rp->clk);
} }
static int rcar_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm, static int rcar_pwm_config(struct pwm_chip *chip, struct pwm_device *pwm,
......
Markdown is supported
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