diff options
| author | Ingo Molnar <mingo@elte.hu> | 2009-08-24 12:25:44 +0200 | 
|---|---|---|
| committer | Ingo Molnar <mingo@elte.hu> | 2009-08-24 12:25:54 +0200 | 
| commit | 5f9ece02401116b29eb04396b99ea092acb75dd8 (patch) | |
| tree | e10386e2dc63c275646b4eb0bed857da7bf86c6a /drivers/clocksource/sh_cmt.c | |
| parent | 9f51e24ee8b5a1595b6a5ac0c2be278a16488e75 (diff) | |
| parent | 422bef879e84104fee6dc68ded0e371dbeb5f88e (diff) | |
| download | olio-linux-3.10-5f9ece02401116b29eb04396b99ea092acb75dd8.tar.xz olio-linux-3.10-5f9ece02401116b29eb04396b99ea092acb75dd8.zip  | |
Merge commit 'v2.6.31-rc7' into x86/cleanups
Merge reason: we were on -rc1 before - go up to -rc7
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'drivers/clocksource/sh_cmt.c')
| -rw-r--r-- | drivers/clocksource/sh_cmt.c | 28 | 
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/clocksource/sh_cmt.c b/drivers/clocksource/sh_cmt.c index 2964f5f4a7e..6b3e0c2f33e 100644 --- a/drivers/clocksource/sh_cmt.c +++ b/drivers/clocksource/sh_cmt.c @@ -40,6 +40,7 @@ struct sh_cmt_priv {  	struct platform_device *pdev;  	unsigned long flags; +	unsigned long flags_suspend;  	unsigned long match_value;  	unsigned long next_match_value;  	unsigned long max_match_value; @@ -667,11 +668,38 @@ static int __devexit sh_cmt_remove(struct platform_device *pdev)  	return -EBUSY; /* cannot unregister clockevent and clocksource */  } +static int sh_cmt_suspend(struct device *dev) +{ +	struct platform_device *pdev = to_platform_device(dev); +	struct sh_cmt_priv *p = platform_get_drvdata(pdev); + +	/* save flag state and stop CMT channel */ +	p->flags_suspend = p->flags; +	sh_cmt_stop(p, p->flags); +	return 0; +} + +static int sh_cmt_resume(struct device *dev) +{ +	struct platform_device *pdev = to_platform_device(dev); +	struct sh_cmt_priv *p = platform_get_drvdata(pdev); + +	/* start CMT channel from saved state */ +	sh_cmt_start(p, p->flags_suspend); +	return 0; +} + +static struct dev_pm_ops sh_cmt_dev_pm_ops = { +	.suspend = sh_cmt_suspend, +	.resume = sh_cmt_resume, +}; +  static struct platform_driver sh_cmt_device_driver = {  	.probe		= sh_cmt_probe,  	.remove		= __devexit_p(sh_cmt_remove),  	.driver		= {  		.name	= "sh_cmt", +		.pm	= &sh_cmt_dev_pm_ops,  	}  };  |