diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/i2c/chips/tsl2550.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/i2c/chips/tsl2550.c b/drivers/i2c/chips/tsl2550.c index 3de4b19ba08f..a10fd2791a69 100644 --- a/drivers/i2c/chips/tsl2550.c +++ b/drivers/i2c/chips/tsl2550.c | |||
@@ -432,11 +432,32 @@ static int __devexit tsl2550_remove(struct i2c_client *client) | |||
432 | return 0; | 432 | return 0; |
433 | } | 433 | } |
434 | 434 | ||
435 | #ifdef CONFIG_PM | ||
436 | |||
437 | static int tsl2550_suspend(struct i2c_client *client, pm_message_t mesg) | ||
438 | { | ||
439 | return tsl2550_set_power_state(client, 0); | ||
440 | } | ||
441 | |||
442 | static int tsl2550_resume(struct i2c_client *client) | ||
443 | { | ||
444 | return tsl2550_set_power_state(client, 1); | ||
445 | } | ||
446 | |||
447 | #else | ||
448 | |||
449 | #define tsl2550_suspend NULL | ||
450 | #define tsl2550_resume NULL | ||
451 | |||
452 | #endif /* CONFIG_PM */ | ||
453 | |||
435 | static struct i2c_driver tsl2550_driver = { | 454 | static struct i2c_driver tsl2550_driver = { |
436 | .driver = { | 455 | .driver = { |
437 | .name = TSL2550_DRV_NAME, | 456 | .name = TSL2550_DRV_NAME, |
438 | .owner = THIS_MODULE, | 457 | .owner = THIS_MODULE, |
439 | }, | 458 | }, |
459 | .suspend = tsl2550_suspend, | ||
460 | .resume = tsl2550_resume, | ||
440 | .probe = tsl2550_probe, | 461 | .probe = tsl2550_probe, |
441 | .remove = __devexit_p(tsl2550_remove), | 462 | .remove = __devexit_p(tsl2550_remove), |
442 | }; | 463 | }; |