diff options
-rw-r--r-- | drivers/mfd/db8500-prcmu.c | 12 | ||||
-rw-r--r-- | drivers/mfd/dbx500-prcmu-regs.h | 2 | ||||
-rw-r--r-- | include/linux/mfd/db8500-prcmu.h | 1 | ||||
-rw-r--r-- | include/linux/mfd/dbx500-prcmu.h | 8 |
4 files changed, 23 insertions, 0 deletions
diff --git a/drivers/mfd/db8500-prcmu.c b/drivers/mfd/db8500-prcmu.c index 4e27db841fab..a1b3464cdba3 100644 --- a/drivers/mfd/db8500-prcmu.c +++ b/drivers/mfd/db8500-prcmu.c | |||
@@ -904,6 +904,18 @@ bool db8500_prcmu_pending_irq(void) | |||
904 | } | 904 | } |
905 | 905 | ||
906 | /* | 906 | /* |
907 | * This function checks if the specified cpu is in in WFI. It's usage | ||
908 | * makes sense only if the gic is decoupled with the db8500_prcmu_gic_decouple | ||
909 | * function. Of course passing smp_processor_id() to this function will | ||
910 | * always return false... | ||
911 | */ | ||
912 | bool db8500_prcmu_is_cpu_in_wfi(int cpu) | ||
913 | { | ||
914 | return readl(PRCM_ARM_WFI_STANDBY) & cpu ? PRCM_ARM_WFI_STANDBY_WFI1 : | ||
915 | PRCM_ARM_WFI_STANDBY_WFI0; | ||
916 | } | ||
917 | |||
918 | /* | ||
907 | * This function copies the gic SPI settings to the prcmu in order to | 919 | * This function copies the gic SPI settings to the prcmu in order to |
908 | * monitor them and abort/finish the retention/off sequence or state. | 920 | * monitor them and abort/finish the retention/off sequence or state. |
909 | */ | 921 | */ |
diff --git a/drivers/mfd/dbx500-prcmu-regs.h b/drivers/mfd/dbx500-prcmu-regs.h index b9ab4ce62654..3a0bf91d7780 100644 --- a/drivers/mfd/dbx500-prcmu-regs.h +++ b/drivers/mfd/dbx500-prcmu-regs.h | |||
@@ -79,6 +79,8 @@ | |||
79 | 79 | ||
80 | /* ARM WFI Standby signal register */ | 80 | /* ARM WFI Standby signal register */ |
81 | #define PRCM_ARM_WFI_STANDBY (_PRCMU_BASE + 0x130) | 81 | #define PRCM_ARM_WFI_STANDBY (_PRCMU_BASE + 0x130) |
82 | #define PRCM_ARM_WFI_STANDBY_WFI0 0x08 | ||
83 | #define PRCM_ARM_WFI_STANDBY_WFI1 0x10 | ||
82 | #define PRCM_IOCR (_PRCMU_BASE + 0x310) | 84 | #define PRCM_IOCR (_PRCMU_BASE + 0x310) |
83 | #define PRCM_IOCR_IOFORCE 0x1 | 85 | #define PRCM_IOCR_IOFORCE 0x1 |
84 | 86 | ||
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h index 926bdb3adc0f..048a534fde38 100644 --- a/include/linux/mfd/db8500-prcmu.h +++ b/include/linux/mfd/db8500-prcmu.h | |||
@@ -585,6 +585,7 @@ int db8500_prcmu_gic_recouple(void); | |||
585 | int db8500_prcmu_copy_gic_settings(void); | 585 | int db8500_prcmu_copy_gic_settings(void); |
586 | bool db8500_prcmu_gic_pending_irq(void); | 586 | bool db8500_prcmu_gic_pending_irq(void); |
587 | bool db8500_prcmu_pending_irq(void); | 587 | bool db8500_prcmu_pending_irq(void); |
588 | bool db8500_prcmu_is_cpu_in_wfi(int cpu); | ||
588 | void db8500_prcmu_enable_wakeups(u32 wakeups); | 589 | void db8500_prcmu_enable_wakeups(u32 wakeups); |
589 | int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); | 590 | int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); |
590 | int db8500_prcmu_request_clock(u8 clock, bool enable); | 591 | int db8500_prcmu_request_clock(u8 clock, bool enable); |
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index 5c72c07e20e4..eaa99a021785 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
@@ -305,6 +305,14 @@ static inline bool prcmu_gic_pending_irq(void) | |||
305 | return db8500_prcmu_gic_pending_irq(); | 305 | return db8500_prcmu_gic_pending_irq(); |
306 | } | 306 | } |
307 | 307 | ||
308 | static inline bool prcmu_is_cpu_in_wfi(int cpu) | ||
309 | { | ||
310 | if (cpu_is_u5500()) | ||
311 | return -EINVAL; | ||
312 | else | ||
313 | return db8500_prcmu_is_cpu_in_wfi(cpu); | ||
314 | } | ||
315 | |||
308 | static inline int prcmu_copy_gic_settings(void) | 316 | static inline int prcmu_copy_gic_settings(void) |
309 | { | 317 | { |
310 | if (cpu_is_u5500()) | 318 | if (cpu_is_u5500()) |