aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/sh
diff options
context:
space:
mode:
authorFrancesco VIRLINZI <francesco.virlinzi@st.com>2009-04-06 03:17:04 -0400
committerPaul Mundt <lethal@linux-sh.org>2009-04-06 11:55:19 -0400
commit7fd87b3f1a6955da0a21b4fd99f8939701055172 (patch)
tree8461dd19d75747499ee9cbebad2bbaafa42a0478 /drivers/sh
parent0221c81b1b8eb0cbb6b30a0ced52ead32d2b4e4c (diff)
sh: intc: Added resume from hibernation support to the intc
It's required for all modules loaded in the previous runtime session because not initilized duing the kernel start-up. Signed-off-by: Francesco Virlinzi <francesco.virlinzi@st.com> Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/sh')
-rw-r--r--drivers/sh/intc.c35
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 {
44struct intc_desc_int { 44struct 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
819static int intc_resume(struct sys_device *dev)
820{
821 return intc_suspend(dev, PMSG_ON);
822}
823
798static struct sysdev_class intc_sysdev_class = { 824static 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 */