diff options
author | Marc Pignat <marc.pignat@hevs.ch> | 2008-10-16 01:02:56 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-16 14:21:39 -0400 |
commit | 986e36a5b817de01733d46aa623406106d661cec (patch) | |
tree | cab630f3d89ce9bfacb35804b18366e90a5666d9 /drivers | |
parent | 5d5b4d74f9ae85bbd558a708678b6927f962e75d (diff) |
rtc: DS1374 wakeup support
Wakeup support implementation.
Signed-off-by: Marc Pignat <marc.pignat@hevs.ch>
Cc: David Brownell <david-b@pacbell.net>
Cc: Alessandro Zummo <a.zummo@towertech.it>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/rtc/rtc-ds1374.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-ds1374.c b/drivers/rtc/rtc-ds1374.c index a150418fba76..a5b0fc09f0c6 100644 --- a/drivers/rtc/rtc-ds1374.c +++ b/drivers/rtc/rtc-ds1374.c | |||
@@ -429,12 +429,33 @@ static int __devexit ds1374_remove(struct i2c_client *client) | |||
429 | return 0; | 429 | return 0; |
430 | } | 430 | } |
431 | 431 | ||
432 | #ifdef CONFIG_PM | ||
433 | static int ds1374_suspend(struct i2c_client *client, pm_message_t state) | ||
434 | { | ||
435 | if (client->irq >= 0 && device_may_wakeup(&client->dev)) | ||
436 | enable_irq_wake(client->irq); | ||
437 | return 0; | ||
438 | } | ||
439 | |||
440 | static int ds1374_resume(struct i2c_client *client) | ||
441 | { | ||
442 | if (client->irq >= 0 && device_may_wakeup(&client->dev)) | ||
443 | disable_irq_wake(client->irq); | ||
444 | return 0; | ||
445 | } | ||
446 | #else | ||
447 | #define ds1374_suspend NULL | ||
448 | #define ds1374_resume NULL | ||
449 | #endif | ||
450 | |||
432 | static struct i2c_driver ds1374_driver = { | 451 | static struct i2c_driver ds1374_driver = { |
433 | .driver = { | 452 | .driver = { |
434 | .name = "rtc-ds1374", | 453 | .name = "rtc-ds1374", |
435 | .owner = THIS_MODULE, | 454 | .owner = THIS_MODULE, |
436 | }, | 455 | }, |
437 | .probe = ds1374_probe, | 456 | .probe = ds1374_probe, |
457 | .suspend = ds1374_suspend, | ||
458 | .resume = ds1374_resume, | ||
438 | .remove = __devexit_p(ds1374_remove), | 459 | .remove = __devexit_p(ds1374_remove), |
439 | .id_table = ds1374_id, | 460 | .id_table = ds1374_id, |
440 | }; | 461 | }; |