aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/mfd/mcp-sa11x0.c
diff options
context:
space:
mode:
authorRussell King <rmk+kernel@arm.linux.org.uk>2012-01-21 04:34:30 -0500
committerRussell King <rmk+kernel@arm.linux.org.uk>2012-02-03 12:38:10 -0500
commit2796e397373a15ece69267ed1bbb9f61435a3ac7 (patch)
tree7b7c3a102ae64306a2205758c6140bc98cee44a3 /drivers/mfd/mcp-sa11x0.c
parent45c7f75fd4b57035cd35954986a2faefb07dac9d (diff)
MFD: mcp-sa11x0: convert to use dev_pm_ops
Convert the sa11x0 MCP driver to use dev_pm_ops rather than the legacy members in the platform driver. Acked-by: Jochen Friedrich <jochen@scram.de> Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'drivers/mfd/mcp-sa11x0.c')
-rw-r--r--drivers/mfd/mcp-sa11x0.c18
1 files changed, 12 insertions, 6 deletions
diff --git a/drivers/mfd/mcp-sa11x0.c b/drivers/mfd/mcp-sa11x0.c
index 4d06db72bb9c..46167f676129 100644
--- a/drivers/mfd/mcp-sa11x0.c
+++ b/drivers/mfd/mcp-sa11x0.c
@@ -19,6 +19,7 @@
19#include <linux/delay.h> 19#include <linux/delay.h>
20#include <linux/spinlock.h> 20#include <linux/spinlock.h>
21#include <linux/platform_device.h> 21#include <linux/platform_device.h>
22#include <linux/pm.h>
22#include <linux/mfd/mcp.h> 23#include <linux/mfd/mcp.h>
23 24
24#include <mach/hardware.h> 25#include <mach/hardware.h>
@@ -266,33 +267,38 @@ static int mcp_sa11x0_remove(struct platform_device *dev)
266 return 0; 267 return 0;
267} 268}
268 269
269static int mcp_sa11x0_suspend(struct platform_device *dev, pm_message_t state) 270#ifdef CONFIG_PM_SLEEP
271static int mcp_sa11x0_suspend(struct device *dev)
270{ 272{
271 struct mcp_sa11x0 *m = priv(platform_get_drvdata(dev)); 273 struct mcp_sa11x0 *m = priv(dev_get_drvdata(dev));
272 274
273 writel(m->mccr0 & ~MCCR0_MCE, MCCR0(m)); 275 writel(m->mccr0 & ~MCCR0_MCE, MCCR0(m));
274 276
275 return 0; 277 return 0;
276} 278}
277 279
278static int mcp_sa11x0_resume(struct platform_device *dev) 280static int mcp_sa11x0_resume(struct device *dev)
279{ 281{
280 struct mcp_sa11x0 *m = priv(platform_get_drvdata(dev)); 282 struct mcp_sa11x0 *m = priv(dev_get_drvdata(dev));
281 283
282 writel_relaxed(m->mccr1, MCCR1(m)); 284 writel_relaxed(m->mccr1, MCCR1(m));
283 writel_relaxed(m->mccr0, MCCR0(m)); 285 writel_relaxed(m->mccr0, MCCR0(m));
284 286
285 return 0; 287 return 0;
286} 288}
289#endif
290
291static const struct dev_pm_ops mcp_sa11x0_pm_ops = {
292 SET_SYSTEM_SLEEP_PM_OPS(mcp_sa11x0_suspend, mcp_sa11x0_resume)
293};
287 294
288static struct platform_driver mcp_sa11x0_driver = { 295static struct platform_driver mcp_sa11x0_driver = {
289 .probe = mcp_sa11x0_probe, 296 .probe = mcp_sa11x0_probe,
290 .remove = mcp_sa11x0_remove, 297 .remove = mcp_sa11x0_remove,
291 .suspend = mcp_sa11x0_suspend,
292 .resume = mcp_sa11x0_resume,
293 .driver = { 298 .driver = {
294 .name = DRIVER_NAME, 299 .name = DRIVER_NAME,
295 .owner = THIS_MODULE, 300 .owner = THIS_MODULE,
301 .pm = &mcp_sa11x0_pm_ops,
296 }, 302 },
297}; 303};
298 304