diff options
-rw-r--r-- | drivers/sh/intc.c | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/drivers/sh/intc.c b/drivers/sh/intc.c index 7fb9b5c4669a..12d13d99b6f0 100644 --- a/drivers/sh/intc.c +++ b/drivers/sh/intc.c | |||
@@ -44,6 +44,7 @@ struct intc_handle_int { | |||
44 | struct intc_desc_int { | 44 | struct intc_desc_int { |
45 | struct list_head list; | 45 | struct list_head list; |
46 | struct sys_device sysdev; | 46 | struct sys_device sysdev; |
47 | pm_message_t state; | ||
47 | unsigned long *reg; | 48 | unsigned long *reg; |
48 | #ifdef CONFIG_SMP | 49 | #ifdef CONFIG_SMP |
49 | unsigned long *smp; | 50 | unsigned long *smp; |
@@ -786,18 +787,44 @@ static int intc_suspend(struct sys_device *dev, pm_message_t state) | |||
786 | /* get intc controller associated with this sysdev */ | 787 | /* get intc controller associated with this sysdev */ |
787 | d = container_of(dev, struct intc_desc_int, sysdev); | 788 | d = container_of(dev, struct intc_desc_int, sysdev); |
788 | 789 | ||
789 | /* enable wakeup irqs belonging to this intc controller */ | 790 | switch (state.event) { |
790 | for_each_irq_desc(irq, desc) { | 791 | case PM_EVENT_ON: |
791 | if ((desc->status & IRQ_WAKEUP) && (desc->chip == &d->chip)) | 792 | if (d->state.event != PM_EVENT_FREEZE) |
792 | intc_enable(irq); | 793 | break; |
794 | for_each_irq_desc(irq, desc) { | ||
795 | if (desc->chip != &d->chip) | ||
796 | continue; | ||
797 | if (desc->status & IRQ_DISABLED) | ||
798 | intc_disable(irq); | ||
799 | else | ||
800 | intc_enable(irq); | ||
801 | } | ||
802 | break; | ||
803 | case PM_EVENT_FREEZE: | ||
804 | /* nothing has to be done */ | ||
805 | break; | ||
806 | case PM_EVENT_SUSPEND: | ||
807 | /* enable wakeup irqs belonging to this intc controller */ | ||
808 | for_each_irq_desc(irq, desc) { | ||
809 | if ((desc->status & IRQ_WAKEUP) && (desc->chip == &d->chip)) | ||
810 | intc_enable(irq); | ||
811 | } | ||
812 | break; | ||
793 | } | 813 | } |
814 | d->state = state; | ||
794 | 815 | ||
795 | return 0; | 816 | return 0; |
796 | } | 817 | } |
797 | 818 | ||
819 | static int intc_resume(struct sys_device *dev) | ||
820 | { | ||
821 | return intc_suspend(dev, PMSG_ON); | ||
822 | } | ||
823 | |||
798 | static struct sysdev_class intc_sysdev_class = { | 824 | static struct sysdev_class intc_sysdev_class = { |
799 | .name = "intc", | 825 | .name = "intc", |
800 | .suspend = intc_suspend, | 826 | .suspend = intc_suspend, |
827 | .resume = intc_resume, | ||
801 | }; | 828 | }; |
802 | 829 | ||
803 | /* register this intc as sysdev to allow suspend/resume */ | 830 | /* register this intc as sysdev to allow suspend/resume */ |