aboutsummaryrefslogtreecommitdiffstats
path: root/arch/blackfin
diff options
context:
space:
mode:
authorMichael Hennerich <michael.hennerich@analog.com>2008-08-05 05:38:41 -0400
committerBryan Wu <cooloney@kernel.org>2008-08-05 05:38:41 -0400
commit4a88d0ce494034fbb8dd0076d80e71b38abf5748 (patch)
treec9c560f0314e3d494ae1b9020921128fa1e3e9f5 /arch/blackfin
parent5400c5aa2de41501be7529831c9df36c729bf371 (diff)
Blackfin arch: Functional power management support
Merge VR Regulator Hibernate wakeups into set_irq_wake for internal interrupts. Signed-off-by: Michael Hennerich <michael.hennerich@analog.com> Signed-off-by: Bryan Wu <cooloney@kernel.org>
Diffstat (limited to 'arch/blackfin')
-rw-r--r--arch/blackfin/Kconfig36
-rw-r--r--arch/blackfin/mach-common/ints-priority.c46
-rw-r--r--arch/blackfin/mach-common/pm.c18
3 files changed, 44 insertions, 56 deletions
diff --git a/arch/blackfin/Kconfig b/arch/blackfin/Kconfig
index 5a097c46bc46..cc2add7e39e7 100644
--- a/arch/blackfin/Kconfig
+++ b/arch/blackfin/Kconfig
@@ -933,13 +933,6 @@ endchoice
933comment "Possible Suspend Mem / Hibernate Wake-Up Sources" 933comment "Possible Suspend Mem / Hibernate Wake-Up Sources"
934 depends on PM 934 depends on PM
935 935
936config PM_BFIN_WAKE_RTC
937 bool "Allow Wake-Up from RESET and on-chip RTC"
938 depends on PM
939 default n
940 help
941 Enable RTC Wake-Up (Voltage Regulator Power-Up)
942
943config PM_BFIN_WAKE_PH6 936config PM_BFIN_WAKE_PH6
944 bool "Allow Wake-Up from on-chip PHY or PH6 GP" 937 bool "Allow Wake-Up from on-chip PHY or PH6 GP"
945 depends on PM && (BF52x || BF534 || BF536 || BF537) 938 depends on PM && (BF52x || BF534 || BF536 || BF537)
@@ -947,41 +940,12 @@ config PM_BFIN_WAKE_PH6
947 help 940 help
948 Enable PHY and PH6 GP Wake-Up (Voltage Regulator Power-Up) 941 Enable PHY and PH6 GP Wake-Up (Voltage Regulator Power-Up)
949 942
950config PM_BFIN_WAKE_CAN
951 bool "Allow Wake-Up from on-chip CAN0/1"
952 depends on PM && (BF54x || BF534 || BF536 || BF537)
953 default n
954 help
955 Enable CAN0/1 Wake-Up (Voltage Regulator Power-Up)
956
957config PM_BFIN_WAKE_GP 943config PM_BFIN_WAKE_GP
958 bool "Allow Wake-Up from GPIOs" 944 bool "Allow Wake-Up from GPIOs"
959 depends on PM && BF54x 945 depends on PM && BF54x
960 default n 946 default n
961 help 947 help
962 Enable General-Purpose Wake-Up (Voltage Regulator Power-Up) 948 Enable General-Purpose Wake-Up (Voltage Regulator Power-Up)
963
964config PM_BFIN_WAKE_USB
965 bool "Allow Wake-Up from on-chip USB"
966 depends on PM && (BF54x || BF52x)
967 default n
968 help
969 Enable USB Wake-Up (Voltage Regulator Power-Up)
970
971config PM_BFIN_WAKE_KEYPAD
972 bool "Allow Wake-Up from on-chip Keypad"
973 depends on PM && BF54x
974 default n
975 help
976 Enable Keypad Wake-Up (Voltage Regulator Power-Up)
977
978config PM_BFIN_WAKE_ROTARY
979 bool "Allow Wake-Up from on-chip Rotary"
980 depends on PM && BF54x
981 default n
982 help
983 Enable Rotary Wake-Up (Voltage Regulator Power-Up)
984
985endmenu 949endmenu
986 950
987menu "CPU Frequency scaling" 951menu "CPU Frequency scaling"
diff --git a/arch/blackfin/mach-common/ints-priority.c b/arch/blackfin/mach-common/ints-priority.c
index 64d746114e4b..e713b9db867d 100644
--- a/arch/blackfin/mach-common/ints-priority.c
+++ b/arch/blackfin/mach-common/ints-priority.c
@@ -71,6 +71,7 @@ atomic_t num_spurious;
71 71
72#ifdef CONFIG_PM 72#ifdef CONFIG_PM
73unsigned long bfin_sic_iwr[3]; /* Up to 3 SIC_IWRx registers */ 73unsigned long bfin_sic_iwr[3]; /* Up to 3 SIC_IWRx registers */
74unsigned vr_wakeup;
74#endif 75#endif
75 76
76struct ivgx { 77struct ivgx {
@@ -184,17 +185,56 @@ static void bfin_internal_unmask_irq(unsigned int irq)
184#ifdef CONFIG_PM 185#ifdef CONFIG_PM
185int bfin_internal_set_wake(unsigned int irq, unsigned int state) 186int bfin_internal_set_wake(unsigned int irq, unsigned int state)
186{ 187{
187 unsigned bank, bit; 188 unsigned bank, bit, wakeup = 0;
188 unsigned long flags; 189 unsigned long flags;
189 bank = SIC_SYSIRQ(irq) / 32; 190 bank = SIC_SYSIRQ(irq) / 32;
190 bit = SIC_SYSIRQ(irq) % 32; 191 bit = SIC_SYSIRQ(irq) % 32;
191 192
193 switch (irq) {
194#ifdef IRQ_RTC
195 case IRQ_RTC:
196 wakeup |= WAKE;
197 break;
198#endif
199#ifdef IRQ_CAN0_RX
200 case IRQ_CAN0_RX:
201 wakeup |= CANWE;
202 break;
203#endif
204#ifdef IRQ_CAN1_RX
205 case IRQ_CAN1_RX:
206 wakeup |= CANWE;
207 break;
208#endif
209#ifdef IRQ_USB_INT0
210 case IRQ_USB_INT0:
211 wakeup |= USBWE;
212 break;
213#endif
214#ifdef IRQ_KEY
215 case IRQ_KEY:
216 wakeup |= KPADWE;
217 break;
218#endif
219#ifdef IRQ_CNT
220 case IRQ_CNT:
221 wakeup |= ROTWE;
222 break;
223#endif
224 default:
225 break;
226 }
227
192 local_irq_save(flags); 228 local_irq_save(flags);
193 229
194 if (state) 230 if (state) {
195 bfin_sic_iwr[bank] |= (1 << bit); 231 bfin_sic_iwr[bank] |= (1 << bit);
196 else 232 vr_wakeup |= wakeup;
233
234 } else {
197 bfin_sic_iwr[bank] &= ~(1 << bit); 235 bfin_sic_iwr[bank] &= ~(1 << bit);
236 vr_wakeup &= ~wakeup;
237 }
198 238
199 local_irq_restore(flags); 239 local_irq_restore(flags);
200 240
diff --git a/arch/blackfin/mach-common/pm.c b/arch/blackfin/mach-common/pm.c
index 4fe6a2366b13..143134b852ea 100644
--- a/arch/blackfin/mach-common/pm.c
+++ b/arch/blackfin/mach-common/pm.c
@@ -229,28 +229,12 @@ int bfin_pm_suspend_mem_enter(void)
229 wakeup = bfin_read_VR_CTL() & ~FREQ; 229 wakeup = bfin_read_VR_CTL() & ~FREQ;
230 wakeup |= SCKELOW; 230 wakeup |= SCKELOW;
231 231
232 /* FIXME: merge this somehow with set_irq_wake */
233#ifdef CONFIG_PM_BFIN_WAKE_RTC
234 wakeup |= WAKE;
235#endif
236#ifdef CONFIG_PM_BFIN_WAKE_PH6 232#ifdef CONFIG_PM_BFIN_WAKE_PH6
237 wakeup |= PHYWE; 233 wakeup |= PHYWE;
238#endif 234#endif
239#ifdef CONFIG_PM_BFIN_WAKE_CAN
240 wakeup |= CANWE;
241#endif
242#ifdef CONFIG_PM_BFIN_WAKE_GP 235#ifdef CONFIG_PM_BFIN_WAKE_GP
243 wakeup |= GPWE; 236 wakeup |= GPWE;
244#endif 237#endif
245#ifdef CONFIG_PM_BFIN_WAKE_USB
246 wakeup |= USBWE;
247#endif
248#ifdef CONFIG_PM_BFIN_WAKE_KEYPAD
249 wakeup |= KPADWE;
250#endif
251#ifdef CONFIG_PM_BFIN_WAKE_ROTARY
252 wakeup |= ROTWE;
253#endif
254 238
255 local_irq_save(flags); 239 local_irq_save(flags);
256 240
@@ -268,7 +252,7 @@ int bfin_pm_suspend_mem_enter(void)
268 icache_disable(); 252 icache_disable();
269 bf53x_suspend_l1_mem(memptr); 253 bf53x_suspend_l1_mem(memptr);
270 254
271 do_hibernate(wakeup); /* Goodbye */ 255 do_hibernate(wakeup | vr_wakeup); /* Goodbye */
272 256
273 bf53x_resume_l1_mem(memptr); 257 bf53x_resume_l1_mem(memptr);
274 258