aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin/mach-common/ints-priority.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/blackfin/mach-common/ints-priority.c')
-rw-r--r--arch/blackfin/mach-common/ints-priority.c72
1 files changed, 54 insertions, 18 deletions
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index 9c7d65aee275..1aac5ebaace4 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -396,24 +396,6 @@ void handle_sec_fault(unsigned int irq, struct irq_desc *desc)
396 raw_spin_unlock(&desc->lock); 396 raw_spin_unlock(&desc->lock);
397} 397}
398 398
399static int sec_suspend(void)
400{
401 return 0;
402}
403
404static void sec_resume(void)
405{
406 bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_RESET);
407 udelay(100);
408 bfin_write_SEC_GCTL(SEC_GCTL_EN);
409 bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_EN | SEC_CCTL_NMI_EN);
410}
411
412static struct syscore_ops sec_pm_syscore_ops = {
413 .suspend = sec_suspend,
414 .resume = sec_resume,
415};
416
417#endif 399#endif
418 400
419#ifdef CONFIG_SMP 401#ifdef CONFIG_SMP
@@ -1093,6 +1075,9 @@ static int bfin_gpio_irq_type(struct irq_data *d, unsigned int type)
1093} 1075}
1094 1076
1095#ifdef CONFIG_PM 1077#ifdef CONFIG_PM
1078static struct bfin_pm_pint_save save_pint_reg[NR_PINT_SYS_IRQS];
1079static u32 save_pint_sec_ctl[NR_PINT_SYS_IRQS];
1080
1096static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state) 1081static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state)
1097{ 1082{
1098 u32 pint_irq; 1083 u32 pint_irq;
@@ -1128,6 +1113,57 @@ static int bfin_gpio_set_wake(struct irq_data *d, unsigned int state)
1128 1113
1129 return 0; 1114 return 0;
1130} 1115}
1116
1117void bfin_pint_suspend(void)
1118{
1119 u32 bank;
1120
1121 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) {
1122 save_pint_reg[bank].mask_set = pint[bank]->mask_set;
1123 save_pint_reg[bank].assign = pint[bank]->assign;
1124 save_pint_reg[bank].edge_set = pint[bank]->edge_set;
1125 save_pint_reg[bank].invert_set = pint[bank]->invert_set;
1126 }
1127}
1128
1129void bfin_pint_resume(void)
1130{
1131 u32 bank;
1132
1133 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++) {
1134 pint[bank]->mask_set = save_pint_reg[bank].mask_set;
1135 pint[bank]->assign = save_pint_reg[bank].assign;
1136 pint[bank]->edge_set = save_pint_reg[bank].edge_set;
1137 pint[bank]->invert_set = save_pint_reg[bank].invert_set;
1138 }
1139}
1140
1141static int sec_suspend(void)
1142{
1143 u32 bank;
1144
1145 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++)
1146 save_pint_sec_ctl[bank] = bfin_read_SEC_SCTL(bank + SIC_SYSIRQ(IRQ_PINT0));
1147 return 0;
1148}
1149
1150static void sec_resume(void)
1151{
1152 u32 bank;
1153
1154 bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_RESET);
1155 udelay(100);
1156 bfin_write_SEC_GCTL(SEC_GCTL_EN);
1157 bfin_write_SEC_SCI(0, SEC_CCTL, SEC_CCTL_EN | SEC_CCTL_NMI_EN);
1158
1159 for (bank = 0; bank < NR_PINT_SYS_IRQS; bank++)
1160 bfin_write_SEC_SCTL(bank + SIC_SYSIRQ(IRQ_PINT0), save_pint_sec_ctl[bank]);
1161}
1162
1163static struct syscore_ops sec_pm_syscore_ops = {
1164 .suspend = sec_suspend,
1165 .resume = sec_resume,
1166};
1131#else 1167#else
1132# define bfin_gpio_set_wake NULL 1168# define bfin_gpio_set_wake NULL
1133#endif 1169#endif