Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 358728
b: refs/heads/master
c: 0074b49
h: refs/heads/master
v: v3
  • Loading branch information
Philip, Avinash authored and Thierry Reding committed Jan 14, 2013
1 parent ff73763 commit cfa1027
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 3ccb1c1702ed4bb07006d20c8173899a69dae242
refs/heads/master: 0074b49b3fa0886047413dbca0508594b1d80c61
10 changes: 8 additions & 2 deletions trunk/drivers/pwm/pwm-tiehrpwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ static int ehrpwm_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
{
struct ehrpwm_pwm_chip *pc = to_ehrpwm_pwm_chip(chip);
unsigned short aqcsfrc_val, aqcsfrc_mask;
int ret;

/* Leave clock enabled on enabling PWM */
pm_runtime_get_sync(chip->dev);
Expand All @@ -341,7 +342,12 @@ static int ehrpwm_pwm_enable(struct pwm_chip *chip, struct pwm_device *pwm)
configure_polarity(pc, pwm->hwpwm);

/* Enable TBCLK before enabling PWM device */
clk_enable(pc->tbclk);
ret = clk_prepare_enable(pc->tbclk);
if (ret) {
pr_err("Failed to enable TBCLK for %s\n",
dev_name(pc->chip.dev));
return ret;
}

/* Enable time counter for free_run */
ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_FREE_RUN);
Expand Down Expand Up @@ -372,7 +378,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(pc->tbclk);
clk_disable_unprepare(pc->tbclk);

/* Stop Time base counter */
ehrpwm_modify(pc->mmio_base, TBCTL, TBCTL_RUN_MASK, TBCTL_STOP_NEXT);
Expand Down

0 comments on commit cfa1027

Please sign in to comment.