aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorRafael J. Wysocki <rjw@sisk.pl>2012-07-11 15:22:47 -0400
committerWolfram Sang <w.sang@pengutronix.de>2012-07-12 06:04:32 -0400
commitf277d27cc40f77719d45d9f5abf3ae4e9bdb172f (patch)
treef616f4a21bef56a1d4d78e38facf0ad767f22ad9 /drivers
parent02d8bf8dc6b09cb810599c64d47da3bdf4f85882 (diff)
i2c-at91: Use struct dev_pm_ops for power management
Make the AT91 Two-Wire Interface driver define its PM callbacks through a struct dev_pm_ops object rather than by using legacy PM hooks in struct platform_driver. Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl> Signed-off-by: Wolfram Sang <w.sang@pengutronix.de>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/i2c/busses/i2c-at91.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/i2c/busses/i2c-at91.c b/drivers/i2c/busses/i2c-at91.c
index 1679deef9c8..e24484beef0 100644
--- a/drivers/i2c/busses/i2c-at91.c
+++ b/drivers/i2c/busses/i2c-at91.c
@@ -279,30 +279,31 @@ static int __devexit at91_i2c_remove(struct platform_device *pdev)
279 279
280/* NOTE: could save a few mA by keeping clock off outside of at91_xfer... */ 280/* NOTE: could save a few mA by keeping clock off outside of at91_xfer... */
281 281
282static int at91_i2c_suspend(struct platform_device *pdev, pm_message_t mesg) 282static int at91_i2c_suspend(struct device *dev)
283{ 283{
284 clk_disable(twi_clk); 284 clk_disable(twi_clk);
285 return 0; 285 return 0;
286} 286}
287 287
288static int at91_i2c_resume(struct platform_device *pdev) 288static int at91_i2c_resume(struct device *dev)
289{ 289{
290 return clk_enable(twi_clk); 290 return clk_enable(twi_clk);
291} 291}
292 292
293static SIMPLE_DEV_PM_OPS(at91_i2c_pm, at91_i2c_suspend, at91_i2c_resume);
294#define AT91_I2C_PM (&at91_i2c_pm)
295
293#else 296#else
294#define at91_i2c_suspend NULL 297#define AT91_I2C_PM NULL
295#define at91_i2c_resume NULL
296#endif 298#endif
297 299
298static struct platform_driver at91_i2c_driver = { 300static struct platform_driver at91_i2c_driver = {
299 .probe = at91_i2c_probe, 301 .probe = at91_i2c_probe,
300 .remove = __devexit_p(at91_i2c_remove), 302 .remove = __devexit_p(at91_i2c_remove),
301 .suspend = at91_i2c_suspend,
302 .resume = at91_i2c_resume,
303 .driver = { 303 .driver = {
304 .name = "at91_i2c", 304 .name = "at91_i2c",
305 .owner = THIS_MODULE, 305 .owner = THIS_MODULE,
306 .pm = AT91_I2C_PM,
306 }, 307 },
307}; 308};
308 309