summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Aaberg <jonas.aberg@stericsson.com>2011-12-05 07:52:01 +0100
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 10:59:22 +0200
commit61b93ed2b7bb6cfd673d197b01e522dfb0645726 (patch)
treeb35c28dce59189262d4cf255473c605ec9ff1ae9
parent3c6b47432f8a1d916f421e9cc38da05d415be471 (diff)
mfd: dbx500-prcmu: Add get power state status
Add function that returns how a execution of a power state went. Useful for cpuidle and suspend debugging. ST-Ericsson Linux next: - ST-Ericsson ID: 370799 ST-Ericsson FOSS-OUT ID: Trivial Change-Id: Iaaf44c5b3f0df94e37655f1932e35ed6111f474b Signed-off-by: Jonas Aaberg <jonas.aberg@stericsson.com> Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/40920
-rw-r--r--drivers/mfd/db5500-prcmu.c5
-rw-r--r--include/linux/mfd/db5500-prcmu.h6
-rw-r--r--include/linux/mfd/db8500-prcmu.h78
-rw-r--r--include/linux/mfd/dbx500-prcmu.h2
4 files changed, 12 insertions, 79 deletions
diff --git a/drivers/mfd/db5500-prcmu.c b/drivers/mfd/db5500-prcmu.c
index e909b52a29f..009b46565fe 100644
--- a/drivers/mfd/db5500-prcmu.c
+++ b/drivers/mfd/db5500-prcmu.c
@@ -1025,6 +1025,11 @@ unlock_return:
return r;
}
+u8 db5500_prcmu_get_power_state_result(void)
+{
+ return readb(PRCM_REQ_MB0_AP_POWER_STATE);
+}
+
void db5500_prcmu_enable_wakeups(u32 wakeups)
{
unsigned long flags;
diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h
index ad5c24bac4d..cf97d25a913 100644
--- a/include/linux/mfd/db5500-prcmu.h
+++ b/include/linux/mfd/db5500-prcmu.h
@@ -24,6 +24,7 @@ void db5500_prcmu_get_abb_event_buffer(void __iomem **buf);
int prcmu_resetout(u8 resoutn, u8 state);
int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk,
bool keep_ap_pll);
+u8 db5500_prcmu_get_power_state_result(void);
int db5500_prcmu_config_esram0_deep_sleep(u8 state);
void db5500_prcmu_system_reset(u16 reset_code);
u16 db5500_prcmu_get_reset_code(void);
@@ -139,6 +140,11 @@ static inline int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk,
return 0;
}
+static inline u8 db5500_prcmu_get_power_state_result(void)
+{
+ return 0;
+}
+
static inline void db5500_prcmu_system_reset(u16 reset_code) {}
static inline u16 db5500_prcmu_get_reset_code(void)
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h
index b3a43b1263f..f1a52a022f9 100644
--- a/include/linux/mfd/db8500-prcmu.h
+++ b/include/linux/mfd/db8500-prcmu.h
@@ -181,84 +181,6 @@ enum hw_acc_state {
};
/**
- * enum mbox_2_arm_stat - Status messages definition for mbox_arm
- * @BOOT_TO_EXECUTEOK: The apBoot to apExecute state transition has been
- * completed
- * @DEEPSLEEPOK: The apExecute to apDeepSleep state transition has been
- * completed
- * @SLEEPOK: The apExecute to apSleep state transition has been completed
- * @IDLEOK: The apExecute to apIdle state transition has been completed
- * @SOFTRESETOK: The A9 watchdog/ SoftReset state has been completed
- * @SOFTRESETGO : The A9 watchdog/SoftReset state is on going
- * @BOOT_TO_EXECUTE: The apBoot to apExecute state transition is on going
- * @EXECUTE_TO_DEEPSLEEP: The apExecute to apDeepSleep state transition is on
- * going
- * @DEEPSLEEP_TO_EXECUTE: The apDeepSleep to apExecute state transition is on
- * going
- * @DEEPSLEEP_TO_EXECUTEOK: The apDeepSleep to apExecute state transition has
- * been completed
- * @EXECUTE_TO_SLEEP: The apExecute to apSleep state transition is on going
- * @SLEEP_TO_EXECUTE: The apSleep to apExecute state transition is on going
- * @SLEEP_TO_EXECUTEOK: The apSleep to apExecute state transition has been
- * completed
- * @EXECUTE_TO_IDLE: The apExecute to apIdle state transition is on going
- * @IDLE_TO_EXECUTE: The apIdle to apExecute state transition is on going
- * @IDLE_TO_EXECUTEOK: The apIdle to apExecute state transition has been
- * completed
- * @INIT_STATUS: Status init
- */
-enum ap_pwrsttr_status {
- BOOT_TO_EXECUTEOK = 0xFF,
- DEEPSLEEPOK = 0xFE,
- SLEEPOK = 0xFD,
- IDLEOK = 0xFC,
- SOFTRESETOK = 0xFB,
- SOFTRESETGO = 0xFA,
- BOOT_TO_EXECUTE = 0xF9,
- EXECUTE_TO_DEEPSLEEP = 0xF8,
- DEEPSLEEP_TO_EXECUTE = 0xF7,
- DEEPSLEEP_TO_EXECUTEOK = 0xF6,
- EXECUTE_TO_SLEEP = 0xF5,
- SLEEP_TO_EXECUTE = 0xF4,
- SLEEP_TO_EXECUTEOK = 0xF3,
- EXECUTE_TO_IDLE = 0xF2,
- IDLE_TO_EXECUTE = 0xF1,
- IDLE_TO_EXECUTEOK = 0xF0,
- RDYTODS_RETURNTOEXE = 0xEF,
- NORDYTODS_RETURNTOEXE = 0xEE,
- EXETOSLEEP_RETURNTOEXE = 0xED,
- EXETOIDLE_RETURNTOEXE = 0xEC,
- INIT_STATUS = 0xEB,
-
- /*error messages */
- INITERROR = 0x00,
- PLLARMLOCKP_ER = 0x01,
- PLLDDRLOCKP_ER = 0x02,
- PLLSOCLOCKP_ER = 0x03,
- PLLSOCK1LOCKP_ER = 0x04,
- ARMWFI_ER = 0x05,
- SYSCLKOK_ER = 0x06,
- I2C_NACK_DATA_ER = 0x07,
- BOOT_ER = 0x08,
- I2C_STATUS_ALWAYS_1 = 0x0A,
- I2C_NACK_REG_ADDR_ER = 0x0B,
- I2C_NACK_DATA0123_ER = 0x1B,
- I2C_NACK_ADDR_ER = 0x1F,
- CURAPPWRSTISNOT_BOOT = 0x20,
- CURAPPWRSTISNOT_EXECUTE = 0x21,
- CURAPPWRSTISNOT_SLEEPMODE = 0x22,
- CURAPPWRSTISNOT_CORRECTFORIT10 = 0x23,
- FIFO4500WUISNOT_WUPEVENT = 0x24,
- PLL32KLOCKP_ER = 0x29,
- DDRDEEPSLEEPOK_ER = 0x2A,
- ROMCODEREADY_ER = 0x50,
- WUPBEFOREDS = 0x51,
- DDRCONFIG_ER = 0x52,
- WUPBEFORESLEEP = 0x53,
- WUPBEFOREIDLE = 0x54
-}; /* earlier called as mbox_2_arm_stat */
-
-/**
* enum dvfs_stat - DVFS status messages definition
* @DVFS_GO: A state transition DVFS is on going
* @DVFS_ARM100OPPOK: The state transition DVFS has been completed for 100OPP
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h
index 5e686f5658b..45a0ae0cc39 100644
--- a/include/linux/mfd/dbx500-prcmu.h
+++ b/include/linux/mfd/dbx500-prcmu.h
@@ -276,7 +276,7 @@ static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk,
static inline u8 prcmu_get_power_state_result(void)
{
if (cpu_is_u5500())
- return -EINVAL;
+ return db5500_prcmu_get_power_state_result();
else
return db8500_prcmu_get_power_state_result();
}