diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-10 11:14:56 -0700 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2013-07-10 11:14:56 -0700 |
commit | 34ae0a6f05aee9f51fca17001b4a90703d434ae1 (patch) | |
tree | 3ccc8bedae647eb37f46e8ff9f39cdcd84a2f2ac /drivers/pwm/pwm-tiehrpwm.c | |
parent | 7d3107d26b522a0fe92af6279256fa65fe3db771 (diff) | |
parent | b388f15fd14c3ae62deb9a059464aa99b524ea4a (diff) |
Merge tag 'for-3.11-rc1' of git://gitorious.org/linux-pwm/linux-pwm
Pull pwm changes from Thierry Reding:
"A new driver supports driving PWM signals using the TPU unit found on
various Renesas SoCs. Furthermore support is added for the NXP
PCA9685 LED controller. Another big chunk is the sysfs interface
which has been in the works for quite some time.
The remaining patches are a random assortment of cleanups and fixes"
* tag 'for-3.11-rc1' of git://gitorious.org/linux-pwm/linux-pwm:
pwm: pwm-tiehrpwm: Use clk_enable/disable instead clk_prepare/unprepare.
pwm: pca9685: Fix wrong argument to set MODE1_SLEEP bit
pwm: renesas-tpu: Add MODULE_ALIAS to make module auto loading work
pwm: renesas-tpu: fix return value check in tpu_probe()
pwm: Add Renesas TPU PWM driver
pwm: Add sysfs interface
pwm: Fill in missing .owner fields
pwm: add pca9685 driver
pwm: atmel-tcb: prepare clk before calling enable
pwm: devm: alloc correct pointer size
pwm: mxs: Let device core handle pinctrl
MAINTAINERS: Update PWM subsystem entry
Diffstat (limited to 'drivers/pwm/pwm-tiehrpwm.c')
-rw-r--r-- | drivers/pwm/pwm-tiehrpwm.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/drivers/pwm/pwm-tiehrpwm.c b/drivers/pwm/pwm-tiehrpwm.c index 48a485c2e422..aa4c5586f53b 100644 --- a/drivers/pwm/pwm-tiehrpwm.c +++ b/drivers/pwm/pwm-tiehrpwm.c @@ -359,7 +359,7 @@ static int ehrpwm_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm) configure_polarity(pc, pwm->hwpwm); /* Enable TBCLK before enabling PWM device */ - ret = clk_prepare_enable(pc->tbclk); + ret = clk_enable(pc->tbclk); if (ret) { pr_err("Failed to enable TBCLK for %s\n", dev_name(pc->chip.dev)); @@ -395,7 +395,7 @@ static void ehrpwm_pwm_disable(struct pwm_chip *chip, struct pwm_device *pwm) ehrpwm_modify(pc->mmio_base, AQCSFRC, aqcsfrc_mask, aqcsfrc_val); /* Disabling TBCLK on PWM disable */ - clk_disable_unprepare(pc->tbclk); + clk_disable(pc->tbclk); /* Stop Time base counter */ ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_STOP_NEXT); @@ -482,6 +482,12 @@ static int ehrpwm_pwm_probe(struct platform_device *pdev) return PTR_ERR(pc->tbclk); } + ret = clk_prepare(pc->tbclk); + if (ret < 0) { + dev_err(&pdev->dev, "clk_prepare() failed: %d\n", ret); + return ret; + } + ret = pwmchip_add(&pc->chip); if (ret < 0) { dev_err(&pdev->dev, "pwmchip_add() failed: %d\n", ret); @@ -508,6 +514,7 @@ pwmss_clk_failure: pm_runtime_put_sync(&pdev->dev); pm_runtime_disable(&pdev->dev); pwmchip_remove(&pc->chip); + clk_unprepare(pc->tbclk); return ret; } @@ -515,6 +522,8 @@ static int ehrpwm_pwm_remove(struct platform_device *pdev) { struct ehrpwm_pwm_chip *pc = platform_get_drvdata(pdev); + clk_unprepare(pc->tbclk); + pm_runtime_get_sync(&pdev->dev); /* * Due to hardware misbehaviour, acknowledge of the stop_req |