Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 100903
b: refs/heads/master
c: c860d70
h: refs/heads/master
i:
  100901: 58e0aed
  100899: d8ca343
  100895: 9316dde
v: v3
  • Loading branch information
Robert Jarzmik authored and Russell King committed Jul 3, 2008
1 parent 31ddad4 commit 4fc561a
Show file tree
Hide file tree
Showing 2 changed files with 15 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: b5f0228afa7810f3cad1f2f741cc747a2378b890
refs/heads/master: c860d701cc5f77b74c481dcbd25b2d8b31c622fc
16 changes: 14 additions & 2 deletions trunk/arch/arm/mach-pxa/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ struct pwm_device {

const char *label;
struct clk *clk;
int clk_enabled;
void __iomem *mmio_base;

unsigned int use_count;
Expand Down Expand Up @@ -87,13 +88,23 @@ EXPORT_SYMBOL(pwm_config);

int pwm_enable(struct pwm_device *pwm)
{
return clk_enable(pwm->clk);
int rc = 0;

if (!pwm->clk_enabled) {
rc = clk_enable(pwm->clk);
if (!rc)
pwm->clk_enabled = 1;
}
return rc;
}
EXPORT_SYMBOL(pwm_enable);

void pwm_disable(struct pwm_device *pwm)
{
clk_disable(pwm->clk);
if (pwm->clk_enabled) {
clk_disable(pwm->clk);
pwm->clk_enabled = 0;
}
}
EXPORT_SYMBOL(pwm_disable);

Expand Down Expand Up @@ -161,6 +172,7 @@ static struct pwm_device *pwm_probe(struct platform_device *pdev,
ret = PTR_ERR(pwm->clk);
goto err_free;
}
pwm->clk_enabled = 0;

pwm->use_count = 0;
pwm->pwm_id = pwm_id;
Expand Down

0 comments on commit 4fc561a

Please sign in to comment.