aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/rtc
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2009-04-05 14:15:54 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2009-04-05 14:15:54 -0400
commit45e36c1666aa6c8b0c538abcf984b336184d8c3f (patch)
treec1f1771d6b02ec210238081450b4a063847b3383 /drivers/rtc
parent87fc94d54b639d8c39fc4a11db0e142f84096e13 (diff)
parent68b42d1b548be1840aff7122fdebeb804daf0fa3 (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/lethal/sh-2.6: (23 commits) sh: sh7785lcr: Map whole PCI address space. sh: Fix up DSP context save/restore. sh: Fix up number of on-chip DMA channels on SH7091. sh: update defconfigs. sh: Kill off broken direct-mapped cache mode. sh: Wire up ARCH_HAS_DEFAULT_IDLE for cpuidle. sh: Add a command line option for disabling I/O trapping. sh: Select ARCH_HIBERNATION_POSSIBLE. sh: migor: Fix up CEU use flags. input: migor_ts: add wakeup support rtc: rtc-sh: use set_irq_wake() input: sh_keysc: use enable/disable_irq_wake() sh: intc: set_irq_wake() support sh: intc: install enable, disable and shutdown callbacks clocksource: sh_cmt: use remove_irq() and remove clockevent workaround sh: ap325 and Migo-R use new sh_mobile_ceu_info flags sh: Fix up -Wformat-security whining. sh: ap325rxa: Add ov772x support, again. sh: Sanitize asm/mmu.h for assembly use. sh: Tidy up sh7786 pinmux table. ...
Diffstat (limited to 'drivers/rtc')
-rw-r--r--drivers/rtc/rtc-sh.c36
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/rtc/rtc-sh.c b/drivers/rtc/rtc-sh.c
index 4898f7fe8518..9b1ff12bf947 100644
--- a/drivers/rtc/rtc-sh.c
+++ b/drivers/rtc/rtc-sh.c
@@ -795,10 +795,46 @@ static int __devexit sh_rtc_remove(struct platform_device *pdev)
795 795
796 return 0; 796 return 0;
797} 797}
798
799static void sh_rtc_set_irq_wake(struct device *dev, int enabled)
800{
801 struct platform_device *pdev = to_platform_device(dev);
802 struct sh_rtc *rtc = platform_get_drvdata(pdev);
803
804 set_irq_wake(rtc->periodic_irq, enabled);
805 if (rtc->carry_irq > 0) {
806 set_irq_wake(rtc->carry_irq, enabled);
807 set_irq_wake(rtc->alarm_irq, enabled);
808 }
809
810}
811
812static int sh_rtc_suspend(struct device *dev)
813{
814 if (device_may_wakeup(dev))
815 sh_rtc_set_irq_wake(dev, 1);
816
817 return 0;
818}
819
820static int sh_rtc_resume(struct device *dev)
821{
822 if (device_may_wakeup(dev))
823 sh_rtc_set_irq_wake(dev, 0);
824
825 return 0;
826}
827
828static struct dev_pm_ops sh_rtc_dev_pm_ops = {
829 .suspend = sh_rtc_suspend,
830 .resume = sh_rtc_resume,
831};
832
798static struct platform_driver sh_rtc_platform_driver = { 833static struct platform_driver sh_rtc_platform_driver = {
799 .driver = { 834 .driver = {
800 .name = DRV_NAME, 835 .name = DRV_NAME,
801 .owner = THIS_MODULE, 836 .owner = THIS_MODULE,
837 .pm = &sh_rtc_dev_pm_ops,
802 }, 838 },
803 .probe = sh_rtc_probe, 839 .probe = sh_rtc_probe,
804 .remove = __devexit_p(sh_rtc_remove), 840 .remove = __devexit_p(sh_rtc_remove),