Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 188383
b: refs/heads/master
c: e79032a
h: refs/heads/master
i:
  188381: 8181328
  188379: 862ec20
  188375: b855ba8
  188367: d59e9a2
  188351: b265c99
v: v3
  • Loading branch information
Vasily Khoruzhick authored and Ben Dooks committed Mar 15, 2010
1 parent 801fbe3 commit 3a50c83
Show file tree
Hide file tree
Showing 2 changed files with 36 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 664e87e47e086962a832f9a613a8fd4042a02ac1
refs/heads/master: e79032aa75af76a14e2cdd973b199855e7761881
35 changes: 35 additions & 0 deletions trunk/arch/arm/plat-samsung/pwm.c
Original file line number Diff line number Diff line change
Expand Up @@ -379,13 +379,48 @@ static int __devexit s3c_pwm_remove(struct platform_device *pdev)
return 0;
}

#ifdef CONFIG_PM
static int s3c_pwm_suspend(struct platform_device *pdev, pm_message_t state)
{
struct pwm_device *pwm = platform_get_drvdata(pdev);

/* No one preserve these values during suspend so reset them
* Otherwise driver leaves PWM unconfigured if same values
* passed to pwm_config
*/
pwm->period_ns = 0;
pwm->duty_ns = 0;

return 0;
}

static int s3c_pwm_resume(struct platform_device *pdev)
{
struct pwm_device *pwm = platform_get_drvdata(pdev);
unsigned long tcon;

/* Restore invertion */
tcon = __raw_readl(S3C2410_TCON);
tcon |= pwm_tcon_invert(pwm);
__raw_writel(tcon, S3C2410_TCON);

return 0;
}

#else
#define s3c_pwm_suspend NULL
#define s3c_pwm_resume NULL
#endif

static struct platform_driver s3c_pwm_driver = {
.driver = {
.name = "s3c24xx-pwm",
.owner = THIS_MODULE,
},
.probe = s3c_pwm_probe,
.remove = __devexit_p(s3c_pwm_remove),
.suspend = s3c_pwm_suspend,
.resume = s3c_pwm_resume,
};

static int __init pwm_init(void)
Expand Down

0 comments on commit 3a50c83

Please sign in to comment.