diff options
author | Mattias Nilsson <mattias.i.nilsson@stericsson.com> | 2012-01-13 10:20:43 -0500 |
---|---|---|
committer | Samuel Ortiz <sameo@linux.intel.com> | 2012-03-06 12:46:33 -0500 |
commit | 4d64d2e34bc415b05eb77a2732a3164313cf6de3 (patch) | |
tree | f4331b9e59754a52f83cfc79b6ca1547861a1a89 /include | |
parent | 992b133a5d85ced4ff0fbdab22e9196cf571e0c9 (diff) |
mfd: db8500 OPP and sleep handling update
This updates the operating point handling code by:
- Supporting the DDR OPP retention state.
- Supporting another low operating point named
APE_50_PARTLY_25_OPP
- Adding an interface to figure out if the sleep state change
was properly achieved.
Signed-off-by: Shreshtha Kumar Sahu <shreshthakumar.sahu@stericsson.com>
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Signed-off-by: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Samuel Ortiz <sameo@linux.intel.com>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/mfd/db8500-prcmu.h | 25 | ||||
-rw-r--r-- | include/linux/mfd/dbx500-prcmu.h | 15 |
2 files changed, 38 insertions, 2 deletions
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h index c5028f1246fc..841342c55451 100644 --- a/include/linux/mfd/db8500-prcmu.h +++ b/include/linux/mfd/db8500-prcmu.h | |||
@@ -457,6 +457,25 @@ enum hw_acc_dev { | |||
457 | NUM_HW_ACC | 457 | NUM_HW_ACC |
458 | }; | 458 | }; |
459 | 459 | ||
460 | /** | ||
461 | * enum prcmu_power_status - results from set_power_state | ||
462 | * @PRCMU_SLEEP_OK: Sleep went ok | ||
463 | * @PRCMU_DEEP_SLEEP_OK: DeepSleep went ok | ||
464 | * @PRCMU_IDLE_OK: Idle went ok | ||
465 | * @PRCMU_DEEPIDLE_OK: DeepIdle went ok | ||
466 | * @PRCMU_PRCMU2ARMPENDINGIT_ER: Pending interrupt detected | ||
467 | * @PRCMU_ARMPENDINGIT_ER: Pending interrupt detected | ||
468 | * | ||
469 | */ | ||
470 | enum prcmu_power_status { | ||
471 | PRCMU_SLEEP_OK = 0xf3, | ||
472 | PRCMU_DEEP_SLEEP_OK = 0xf6, | ||
473 | PRCMU_IDLE_OK = 0xf0, | ||
474 | PRCMU_DEEPIDLE_OK = 0xe3, | ||
475 | PRCMU_PRCMU2ARMPENDINGIT_ER = 0x91, | ||
476 | PRCMU_ARMPENDINGIT_ER = 0x93, | ||
477 | }; | ||
478 | |||
460 | /* | 479 | /* |
461 | * Definitions for autonomous power management configuration. | 480 | * Definitions for autonomous power management configuration. |
462 | */ | 481 | */ |
@@ -544,6 +563,7 @@ int db8500_prcmu_load_a9wdog(u8 id, u32 val); | |||
544 | 563 | ||
545 | void db8500_prcmu_system_reset(u16 reset_code); | 564 | void db8500_prcmu_system_reset(u16 reset_code); |
546 | int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); | 565 | int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); |
566 | u8 db8500_prcmu_get_power_state_result(void); | ||
547 | void db8500_prcmu_enable_wakeups(u32 wakeups); | 567 | void db8500_prcmu_enable_wakeups(u32 wakeups); |
548 | int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); | 568 | int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); |
549 | int db8500_prcmu_request_clock(u8 clock, bool enable); | 569 | int db8500_prcmu_request_clock(u8 clock, bool enable); |
@@ -699,6 +719,11 @@ static inline int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | |||
699 | return 0; | 719 | return 0; |
700 | } | 720 | } |
701 | 721 | ||
722 | static inline u8 db8500_prcmu_get_power_state_result(void) | ||
723 | { | ||
724 | return 0; | ||
725 | } | ||
726 | |||
702 | static inline void db8500_prcmu_enable_wakeups(u32 wakeups) {} | 727 | static inline void db8500_prcmu_enable_wakeups(u32 wakeups) {} |
703 | 728 | ||
704 | static inline int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state) | 729 | static inline int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state) |
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index 8470c7d7121f..432a2d3fc198 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
@@ -185,12 +185,14 @@ enum prcmu_clock { | |||
185 | * @APE_NO_CHANGE: The APE operating point is unchanged | 185 | * @APE_NO_CHANGE: The APE operating point is unchanged |
186 | * @APE_100_OPP: The new APE operating point is ape100opp | 186 | * @APE_100_OPP: The new APE operating point is ape100opp |
187 | * @APE_50_OPP: 50% | 187 | * @APE_50_OPP: 50% |
188 | * @APE_50_PARTLY_25_OPP: 50%, except some clocks at 25%. | ||
188 | */ | 189 | */ |
189 | enum ape_opp { | 190 | enum ape_opp { |
190 | APE_OPP_INIT = 0x00, | 191 | APE_OPP_INIT = 0x00, |
191 | APE_NO_CHANGE = 0x01, | 192 | APE_NO_CHANGE = 0x01, |
192 | APE_100_OPP = 0x02, | 193 | APE_100_OPP = 0x02, |
193 | APE_50_OPP = 0x03 | 194 | APE_50_OPP = 0x03, |
195 | APE_50_PARTLY_25_OPP = 0xFF, | ||
194 | }; | 196 | }; |
195 | 197 | ||
196 | /** | 198 | /** |
@@ -271,6 +273,14 @@ static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | |||
271 | keep_ap_pll); | 273 | keep_ap_pll); |
272 | } | 274 | } |
273 | 275 | ||
276 | static inline u8 prcmu_get_power_state_result(void) | ||
277 | { | ||
278 | if (cpu_is_u5500()) | ||
279 | return -EINVAL; | ||
280 | else | ||
281 | return db8500_prcmu_get_power_state_result(); | ||
282 | } | ||
283 | |||
274 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) | 284 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) |
275 | { | 285 | { |
276 | if (cpu_is_u5500()) | 286 | if (cpu_is_u5500()) |
@@ -663,9 +673,10 @@ static inline int prcmu_stop_temp_sense(void) | |||
663 | /* PRCMU QoS APE OPP class */ | 673 | /* PRCMU QoS APE OPP class */ |
664 | #define PRCMU_QOS_APE_OPP 1 | 674 | #define PRCMU_QOS_APE_OPP 1 |
665 | #define PRCMU_QOS_DDR_OPP 2 | 675 | #define PRCMU_QOS_DDR_OPP 2 |
676 | #define PRCMU_QOS_ARM_OPP 3 | ||
666 | #define PRCMU_QOS_DEFAULT_VALUE -1 | 677 | #define PRCMU_QOS_DEFAULT_VALUE -1 |
667 | 678 | ||
668 | #ifdef CONFIG_UX500_PRCMU_QOS_POWER | 679 | #ifdef CONFIG_DBX500_PRCMU_QOS_POWER |
669 | 680 | ||
670 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); | 681 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); |
671 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); | 682 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); |