diff options
| author | Mattias Nilsson <mattias.i.nilsson@stericsson.com> | 2011-08-12 04:28:10 -0400 |
|---|---|---|
| committer | Samuel Ortiz <sameo@linux.intel.com> | 2011-10-24 08:09:18 -0400 |
| commit | 73180f85f4ffbb66843f8248811b2ade29b22df2 (patch) | |
| tree | 26b48bd3369e2f38d741bae92ceef25e8da35948 /include/linux/mfd | |
| parent | fea799e3d3ab84ac675de7e48a13a79fb76b6e63 (diff) | |
mfd: Move to the new db500 PRCMU API
Now that we have a shared API between the DB8500 and DB5500
PRCMU's, switch to using this neutral API instead. We delete the
parts of db8500-prcmu.h that is now PRCMU-neutral, and calls will
be diverted to respective driver. Common registers are in
dbx500-prcmu-regs.h and common accessors and defines in
<linux/mfd/dbx500-prcmu.h> This way we get a a lot more
abstraction and code reuse.
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/linux/mfd')
| -rw-r--r-- | include/linux/mfd/db5500-prcmu.h | 102 | ||||
| -rw-r--r-- | include/linux/mfd/db8500-prcmu.h | 368 | ||||
| -rw-r--r-- | include/linux/mfd/dbx500-prcmu.h | 8 |
3 files changed, 174 insertions, 304 deletions
diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h index f0977986402c..9890687f582d 100644 --- a/include/linux/mfd/db5500-prcmu.h +++ b/include/linux/mfd/db5500-prcmu.h | |||
| @@ -5,21 +5,35 @@ | |||
| 5 | * | 5 | * |
| 6 | * U5500 PRCMU API. | 6 | * U5500 PRCMU API. |
| 7 | */ | 7 | */ |
| 8 | #ifndef __MACH_PRCMU_U5500_H | 8 | #ifndef __MFD_DB5500_PRCMU_H |
| 9 | #define __MACH_PRCMU_U5500_H | 9 | #define __MFD_DB5500_PRCMU_H |
| 10 | 10 | ||
| 11 | #ifdef CONFIG_UX500_SOC_DB5500 | 11 | #ifdef CONFIG_MFD_DB5500_PRCMU |
| 12 | 12 | ||
| 13 | void db5500_prcmu_early_init(void); | 13 | void db5500_prcmu_early_init(void); |
| 14 | 14 | int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state); | |
| 15 | int db5500_prcmu_set_display_clocks(void); | ||
| 16 | int db5500_prcmu_disable_dsipll(void); | ||
| 17 | int db5500_prcmu_enable_dsipll(void); | ||
| 15 | int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); | 18 | int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size); |
| 16 | int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | 19 | int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); |
| 20 | void db5500_prcmu_enable_wakeups(u32 wakeups); | ||
| 21 | int db5500_prcmu_request_clock(u8 clock, bool enable); | ||
| 22 | void db5500_prcmu_config_abb_event_readout(u32 abb_events); | ||
| 23 | void db5500_prcmu_get_abb_event_buffer(void __iomem **buf); | ||
| 24 | int prcmu_resetout(u8 resoutn, u8 state); | ||
| 25 | int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
| 26 | bool keep_ap_pll); | ||
| 27 | int db5500_prcmu_config_esram0_deep_sleep(u8 state); | ||
| 28 | void db5500_prcmu_system_reset(u16 reset_code); | ||
| 29 | u16 db5500_prcmu_get_reset_code(void); | ||
| 30 | bool db5500_prcmu_is_ac_wake_requested(void); | ||
| 31 | int db5500_prcmu_set_arm_opp(u8 opp); | ||
| 32 | int db5500_prcmu_get_arm_opp(void); | ||
| 17 | 33 | ||
| 18 | #else /* !CONFIG_UX500_SOC_DB5500 */ | 34 | #else /* !CONFIG_UX500_SOC_DB5500 */ |
| 19 | 35 | ||
| 20 | static inline void db5500_prcmu_early_init(void) | 36 | static inline void db5500_prcmu_early_init(void) {} |
| 21 | { | ||
| 22 | } | ||
| 23 | 37 | ||
| 24 | static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) | 38 | static inline int db5500_prcmu_abb_read(u8 slave, u8 reg, u8 *value, u8 size) |
| 25 | { | 39 | { |
| @@ -31,15 +45,75 @@ static inline int db5500_prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size) | |||
| 31 | return -ENOSYS; | 45 | return -ENOSYS; |
| 32 | } | 46 | } |
| 33 | 47 | ||
| 34 | #endif /* CONFIG_UX500_SOC_DB5500 */ | 48 | static inline int db5500_prcmu_request_clock(u8 clock, bool enable) |
| 49 | { | ||
| 50 | return 0; | ||
| 51 | } | ||
| 52 | |||
| 53 | static inline int db5500_prcmu_set_display_clocks(void) | ||
| 54 | { | ||
| 55 | return 0; | ||
| 56 | } | ||
| 57 | |||
| 58 | static inline int db5500_prcmu_disable_dsipll(void) | ||
| 59 | { | ||
| 60 | return 0; | ||
| 61 | } | ||
| 62 | |||
| 63 | static inline int db5500_prcmu_enable_dsipll(void) | ||
| 64 | { | ||
| 65 | return 0; | ||
| 66 | } | ||
| 35 | 67 | ||
| 36 | static inline int db5500_prcmu_config_abb_event_readout(u32 abb_events) | 68 | static inline int db5500_prcmu_config_esram0_deep_sleep(u8 state) |
| 37 | { | 69 | { |
| 38 | #ifdef CONFIG_MACH_U5500_SIMULATOR | ||
| 39 | return 0; | 70 | return 0; |
| 40 | #else | ||
| 41 | return -1; | ||
| 42 | #endif | ||
| 43 | } | 71 | } |
| 44 | 72 | ||
| 45 | #endif /* __MACH_PRCMU_U5500_H */ | 73 | static inline void db5500_prcmu_enable_wakeups(u32 wakeups) {} |
| 74 | |||
| 75 | static inline int prcmu_resetout(u8 resoutn, u8 state) | ||
| 76 | { | ||
| 77 | return 0; | ||
| 78 | } | ||
| 79 | |||
| 80 | static inline int db5500_prcmu_set_epod(u16 epod_id, u8 epod_state) | ||
| 81 | { | ||
| 82 | return 0; | ||
| 83 | } | ||
| 84 | |||
| 85 | static inline void db5500_prcmu_get_abb_event_buffer(void __iomem **buf) {} | ||
| 86 | static inline void db5500_prcmu_config_abb_event_readout(u32 abb_events) {} | ||
| 87 | |||
| 88 | static inline int db5500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
| 89 | bool keep_ap_pll) | ||
| 90 | { | ||
| 91 | return 0; | ||
| 92 | } | ||
| 93 | |||
| 94 | static inline void db5500_prcmu_system_reset(u16 reset_code) {} | ||
| 95 | |||
| 96 | static inline u16 db5500_prcmu_get_reset_code(void) | ||
| 97 | { | ||
| 98 | return 0; | ||
| 99 | } | ||
| 100 | |||
| 101 | static inline bool db5500_prcmu_is_ac_wake_requested(void) | ||
| 102 | { | ||
| 103 | return 0; | ||
| 104 | } | ||
| 105 | |||
| 106 | static inline int db5500_prcmu_set_arm_opp(u8 opp) | ||
| 107 | { | ||
| 108 | return 0; | ||
| 109 | } | ||
| 110 | |||
| 111 | static inline int db5500_prcmu_get_arm_opp(void) | ||
| 112 | { | ||
| 113 | return 0; | ||
| 114 | } | ||
| 115 | |||
| 116 | |||
| 117 | #endif /* CONFIG_MFD_DB5500_PRCMU */ | ||
| 118 | |||
| 119 | #endif /* __MFD_DB5500_PRCMU_H */ | ||
diff --git a/include/linux/mfd/db8500-prcmu.h b/include/linux/mfd/db8500-prcmu.h index 917dbcab701c..60d27f7bfc1f 100644 --- a/include/linux/mfd/db8500-prcmu.h +++ b/include/linux/mfd/db8500-prcmu.h | |||
| @@ -11,7 +11,6 @@ | |||
| 11 | #define __MFD_DB8500_PRCMU_H | 11 | #define __MFD_DB8500_PRCMU_H |
| 12 | 12 | ||
| 13 | #include <linux/interrupt.h> | 13 | #include <linux/interrupt.h> |
| 14 | #include <linux/notifier.h> | ||
| 15 | 14 | ||
| 16 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ | 15 | /* This portion previously known as <mach/prcmu-fw-defs_v1.h> */ |
| 17 | 16 | ||
| @@ -133,7 +132,7 @@ enum ap_pwrst { | |||
| 133 | * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle | 132 | * @APEXECUTE_TO_APIDLE: Power state transition from ApExecute to ApIdle |
| 134 | */ | 133 | */ |
| 135 | enum ap_pwrst_trans { | 134 | enum ap_pwrst_trans { |
| 136 | NO_TRANSITION = 0x00, | 135 | PRCMU_AP_NO_CHANGE = 0x00, |
| 137 | APEXECUTE_TO_APSLEEP = 0x01, | 136 | APEXECUTE_TO_APSLEEP = 0x01, |
| 138 | APIDLE_TO_APSLEEP = 0x02, /* To be removed */ | 137 | APIDLE_TO_APSLEEP = 0x02, /* To be removed */ |
| 139 | PRCMU_AP_SLEEP = 0x01, | 138 | PRCMU_AP_SLEEP = 0x01, |
| @@ -146,54 +145,6 @@ enum ap_pwrst_trans { | |||
| 146 | }; | 145 | }; |
| 147 | 146 | ||
| 148 | /** | 147 | /** |
| 149 | * enum ddr_pwrst - DDR power states definition | ||
| 150 | * @DDR_PWR_STATE_UNCHANGED: SDRAM and DDR controller state is unchanged | ||
| 151 | * @DDR_PWR_STATE_ON: | ||
| 152 | * @DDR_PWR_STATE_OFFLOWLAT: | ||
| 153 | * @DDR_PWR_STATE_OFFHIGHLAT: | ||
| 154 | */ | ||
| 155 | enum ddr_pwrst { | ||
| 156 | DDR_PWR_STATE_UNCHANGED = 0x00, | ||
| 157 | DDR_PWR_STATE_ON = 0x01, | ||
| 158 | DDR_PWR_STATE_OFFLOWLAT = 0x02, | ||
| 159 | DDR_PWR_STATE_OFFHIGHLAT = 0x03 | ||
| 160 | }; | ||
| 161 | |||
| 162 | /** | ||
| 163 | * enum arm_opp - ARM OPP states definition | ||
| 164 | * @ARM_OPP_INIT: | ||
| 165 | * @ARM_NO_CHANGE: The ARM operating point is unchanged | ||
| 166 | * @ARM_100_OPP: The new ARM operating point is arm100opp | ||
| 167 | * @ARM_50_OPP: The new ARM operating point is arm50opp | ||
| 168 | * @ARM_MAX_OPP: Operating point is "max" (more than 100) | ||
| 169 | * @ARM_MAX_FREQ100OPP: Set max opp if available, else 100 | ||
| 170 | * @ARM_EXTCLK: The new ARM operating point is armExtClk | ||
| 171 | */ | ||
| 172 | enum arm_opp { | ||
| 173 | ARM_OPP_INIT = 0x00, | ||
| 174 | ARM_NO_CHANGE = 0x01, | ||
| 175 | ARM_100_OPP = 0x02, | ||
| 176 | ARM_50_OPP = 0x03, | ||
| 177 | ARM_MAX_OPP = 0x04, | ||
| 178 | ARM_MAX_FREQ100OPP = 0x05, | ||
| 179 | ARM_EXTCLK = 0x07 | ||
| 180 | }; | ||
| 181 | |||
| 182 | /** | ||
| 183 | * enum ape_opp - APE OPP states definition | ||
| 184 | * @APE_OPP_INIT: | ||
| 185 | * @APE_NO_CHANGE: The APE operating point is unchanged | ||
| 186 | * @APE_100_OPP: The new APE operating point is ape100opp | ||
| 187 | * @APE_50_OPP: 50% | ||
| 188 | */ | ||
| 189 | enum ape_opp { | ||
| 190 | APE_OPP_INIT = 0x00, | ||
| 191 | APE_NO_CHANGE = 0x01, | ||
| 192 | APE_100_OPP = 0x02, | ||
| 193 | APE_50_OPP = 0x03 | ||
| 194 | }; | ||
| 195 | |||
| 196 | /** | ||
| 197 | * enum hw_acc_state - State definition for hardware accelerator | 148 | * enum hw_acc_state - State definition for hardware accelerator |
| 198 | * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged | 149 | * @HW_NO_CHANGE: The hardware accelerator state must remain unchanged |
| 199 | * @HW_OFF: The hardware accelerator must be switched off | 150 | * @HW_OFF: The hardware accelerator must be switched off |
| @@ -469,26 +420,6 @@ enum auto_enable { | |||
| 469 | 420 | ||
| 470 | /* End of file previously known as prcmu-fw-defs_v1.h */ | 421 | /* End of file previously known as prcmu-fw-defs_v1.h */ |
| 471 | 422 | ||
| 472 | /* PRCMU Wakeup defines */ | ||
| 473 | enum prcmu_wakeup_index { | ||
| 474 | PRCMU_WAKEUP_INDEX_RTC, | ||
| 475 | PRCMU_WAKEUP_INDEX_RTT0, | ||
| 476 | PRCMU_WAKEUP_INDEX_RTT1, | ||
| 477 | PRCMU_WAKEUP_INDEX_HSI0, | ||
| 478 | PRCMU_WAKEUP_INDEX_HSI1, | ||
| 479 | PRCMU_WAKEUP_INDEX_USB, | ||
| 480 | PRCMU_WAKEUP_INDEX_ABB, | ||
| 481 | PRCMU_WAKEUP_INDEX_ABB_FIFO, | ||
| 482 | PRCMU_WAKEUP_INDEX_ARM, | ||
| 483 | NUM_PRCMU_WAKEUP_INDICES | ||
| 484 | }; | ||
| 485 | #define PRCMU_WAKEUP(_name) (BIT(PRCMU_WAKEUP_INDEX_##_name)) | ||
| 486 | |||
| 487 | /* PRCMU QoS APE OPP class */ | ||
| 488 | #define PRCMU_QOS_APE_OPP 1 | ||
| 489 | #define PRCMU_QOS_DDR_OPP 2 | ||
| 490 | #define PRCMU_QOS_DEFAULT_VALUE -1 | ||
| 491 | |||
| 492 | /** | 423 | /** |
| 493 | * enum hw_acc_dev - enum for hw accelerators | 424 | * enum hw_acc_dev - enum for hw accelerators |
| 494 | * @HW_ACC_SVAMMDSP: for SVAMMDSP | 425 | * @HW_ACC_SVAMMDSP: for SVAMMDSP |
| @@ -527,64 +458,6 @@ enum hw_acc_dev { | |||
| 527 | }; | 458 | }; |
| 528 | 459 | ||
| 529 | /* | 460 | /* |
| 530 | * Ids for all EPODs (power domains) | ||
| 531 | * - EPOD_ID_SVAMMDSP: power domain for SVA MMDSP | ||
| 532 | * - EPOD_ID_SVAPIPE: power domain for SVA pipe | ||
| 533 | * - EPOD_ID_SIAMMDSP: power domain for SIA MMDSP | ||
| 534 | * - EPOD_ID_SIAPIPE: power domain for SIA pipe | ||
| 535 | * - EPOD_ID_SGA: power domain for SGA | ||
| 536 | * - EPOD_ID_B2R2_MCDE: power domain for B2R2 and MCDE | ||
| 537 | * - EPOD_ID_ESRAM12: power domain for ESRAM 1 and 2 | ||
| 538 | * - EPOD_ID_ESRAM34: power domain for ESRAM 3 and 4 | ||
| 539 | * - NUM_EPOD_ID: number of power domains | ||
| 540 | */ | ||
| 541 | #define EPOD_ID_SVAMMDSP 0 | ||
| 542 | #define EPOD_ID_SVAPIPE 1 | ||
| 543 | #define EPOD_ID_SIAMMDSP 2 | ||
| 544 | #define EPOD_ID_SIAPIPE 3 | ||
| 545 | #define EPOD_ID_SGA 4 | ||
| 546 | #define EPOD_ID_B2R2_MCDE 5 | ||
| 547 | #define EPOD_ID_ESRAM12 6 | ||
| 548 | #define EPOD_ID_ESRAM34 7 | ||
| 549 | #define NUM_EPOD_ID 8 | ||
| 550 | |||
| 551 | /* | ||
| 552 | * state definition for EPOD (power domain) | ||
| 553 | * - EPOD_STATE_NO_CHANGE: The EPOD should remain unchanged | ||
| 554 | * - EPOD_STATE_OFF: The EPOD is switched off | ||
| 555 | * - EPOD_STATE_RAMRET: The EPOD is switched off with its internal RAM in | ||
| 556 | * retention | ||
| 557 | * - EPOD_STATE_ON_CLK_OFF: The EPOD is switched on, clock is still off | ||
| 558 | * - EPOD_STATE_ON: Same as above, but with clock enabled | ||
| 559 | */ | ||
| 560 | #define EPOD_STATE_NO_CHANGE 0x00 | ||
| 561 | #define EPOD_STATE_OFF 0x01 | ||
| 562 | #define EPOD_STATE_RAMRET 0x02 | ||
| 563 | #define EPOD_STATE_ON_CLK_OFF 0x03 | ||
| 564 | #define EPOD_STATE_ON 0x04 | ||
| 565 | |||
| 566 | /* | ||
| 567 | * CLKOUT sources | ||
| 568 | */ | ||
| 569 | #define PRCMU_CLKSRC_CLK38M 0x00 | ||
| 570 | #define PRCMU_CLKSRC_ACLK 0x01 | ||
| 571 | #define PRCMU_CLKSRC_SYSCLK 0x02 | ||
| 572 | #define PRCMU_CLKSRC_LCDCLK 0x03 | ||
| 573 | #define PRCMU_CLKSRC_SDMMCCLK 0x04 | ||
| 574 | #define PRCMU_CLKSRC_TVCLK 0x05 | ||
| 575 | #define PRCMU_CLKSRC_TIMCLK 0x06 | ||
| 576 | #define PRCMU_CLKSRC_CLK009 0x07 | ||
| 577 | /* These are only valid for CLKOUT1: */ | ||
| 578 | #define PRCMU_CLKSRC_SIAMMDSPCLK 0x40 | ||
| 579 | #define PRCMU_CLKSRC_I2CCLK 0x41 | ||
| 580 | #define PRCMU_CLKSRC_MSP02CLK 0x42 | ||
| 581 | #define PRCMU_CLKSRC_ARMPLL_OBSCLK 0x43 | ||
| 582 | #define PRCMU_CLKSRC_HSIRXCLK 0x44 | ||
| 583 | #define PRCMU_CLKSRC_HSITXCLK 0x45 | ||
| 584 | #define PRCMU_CLKSRC_ARMCLKFIX 0x46 | ||
| 585 | #define PRCMU_CLKSRC_HDMICLK 0x47 | ||
| 586 | |||
| 587 | /* | ||
| 588 | * Definitions for autonomous power management configuration. | 461 | * Definitions for autonomous power management configuration. |
| 589 | */ | 462 | */ |
| 590 | 463 | ||
| @@ -620,88 +493,12 @@ struct prcmu_auto_pm_config { | |||
| 620 | u8 sva_policy; | 493 | u8 sva_policy; |
| 621 | }; | 494 | }; |
| 622 | 495 | ||
| 623 | /** | ||
| 624 | * enum ddr_opp - DDR OPP states definition | ||
| 625 | * @DDR_100_OPP: The new DDR operating point is ddr100opp | ||
| 626 | * @DDR_50_OPP: The new DDR operating point is ddr50opp | ||
| 627 | * @DDR_25_OPP: The new DDR operating point is ddr25opp | ||
| 628 | */ | ||
| 629 | enum ddr_opp { | ||
| 630 | DDR_100_OPP = 0x00, | ||
| 631 | DDR_50_OPP = 0x01, | ||
| 632 | DDR_25_OPP = 0x02, | ||
| 633 | }; | ||
| 634 | |||
| 635 | /* | ||
| 636 | * Clock identifiers. | ||
| 637 | */ | ||
| 638 | enum prcmu_clock { | ||
| 639 | PRCMU_SGACLK, | ||
| 640 | PRCMU_UARTCLK, | ||
| 641 | PRCMU_MSP02CLK, | ||
| 642 | PRCMU_MSP1CLK, | ||
| 643 | PRCMU_I2CCLK, | ||
| 644 | PRCMU_SDMMCCLK, | ||
| 645 | PRCMU_SLIMCLK, | ||
| 646 | PRCMU_PER1CLK, | ||
| 647 | PRCMU_PER2CLK, | ||
| 648 | PRCMU_PER3CLK, | ||
| 649 | PRCMU_PER5CLK, | ||
| 650 | PRCMU_PER6CLK, | ||
| 651 | PRCMU_PER7CLK, | ||
| 652 | PRCMU_LCDCLK, | ||
| 653 | PRCMU_BMLCLK, | ||
| 654 | PRCMU_HSITXCLK, | ||
| 655 | PRCMU_HSIRXCLK, | ||
| 656 | PRCMU_HDMICLK, | ||
| 657 | PRCMU_APEATCLK, | ||
| 658 | PRCMU_APETRACECLK, | ||
| 659 | PRCMU_MCDECLK, | ||
| 660 | PRCMU_IPI2CCLK, | ||
| 661 | PRCMU_DSIALTCLK, | ||
| 662 | PRCMU_DMACLK, | ||
| 663 | PRCMU_B2R2CLK, | ||
| 664 | PRCMU_TVCLK, | ||
| 665 | PRCMU_SSPCLK, | ||
| 666 | PRCMU_RNGCLK, | ||
| 667 | PRCMU_UICCCLK, | ||
| 668 | PRCMU_NUM_REG_CLOCKS, | ||
| 669 | PRCMU_SYSCLK = PRCMU_NUM_REG_CLOCKS, | ||
| 670 | PRCMU_TIMCLK, | ||
| 671 | }; | ||
| 672 | |||
| 673 | /* | ||
| 674 | * Definitions for controlling ESRAM0 in deep sleep. | ||
| 675 | */ | ||
| 676 | #define ESRAM0_DEEP_SLEEP_STATE_OFF 1 | ||
| 677 | #define ESRAM0_DEEP_SLEEP_STATE_RET 2 | ||
| 678 | |||
| 679 | #ifdef CONFIG_MFD_DB8500_PRCMU | ||
| 680 | void __init prcmu_early_init(void); | ||
| 681 | int prcmu_set_display_clocks(void); | ||
| 682 | int prcmu_disable_dsipll(void); | ||
| 683 | int prcmu_enable_dsipll(void); | ||
| 684 | #else | ||
| 685 | static inline void __init prcmu_early_init(void) {} | ||
| 686 | #endif | ||
| 687 | |||
| 688 | #ifdef CONFIG_MFD_DB8500_PRCMU | 496 | #ifdef CONFIG_MFD_DB8500_PRCMU |
| 689 | 497 | ||
| 498 | void db8500_prcmu_early_init(void); | ||
| 690 | int prcmu_set_rc_a2p(enum romcode_write); | 499 | int prcmu_set_rc_a2p(enum romcode_write); |
| 691 | enum romcode_read prcmu_get_rc_p2a(void); | 500 | enum romcode_read prcmu_get_rc_p2a(void); |
| 692 | enum ap_pwrst prcmu_get_xp70_current_state(void); | 501 | enum ap_pwrst prcmu_get_xp70_current_state(void); |
| 693 | int prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); | ||
| 694 | |||
| 695 | void prcmu_enable_wakeups(u32 wakeups); | ||
| 696 | static inline void prcmu_disable_wakeups(void) | ||
| 697 | { | ||
| 698 | prcmu_enable_wakeups(0); | ||
| 699 | } | ||
| 700 | |||
| 701 | void prcmu_config_abb_event_readout(u32 abb_events); | ||
| 702 | void prcmu_get_abb_event_buffer(void __iomem **buf); | ||
| 703 | int prcmu_set_arm_opp(u8 opp); | ||
| 704 | int prcmu_get_arm_opp(void); | ||
| 705 | bool prcmu_has_arm_maxopp(void); | 502 | bool prcmu_has_arm_maxopp(void); |
| 706 | bool prcmu_is_u8400(void); | 503 | bool prcmu_is_u8400(void); |
| 707 | int prcmu_set_ape_opp(u8 opp); | 504 | int prcmu_set_ape_opp(u8 opp); |
| @@ -710,19 +507,14 @@ int prcmu_request_ape_opp_100_voltage(bool enable); | |||
| 710 | int prcmu_release_usb_wakeup_state(void); | 507 | int prcmu_release_usb_wakeup_state(void); |
| 711 | int prcmu_set_ddr_opp(u8 opp); | 508 | int prcmu_set_ddr_opp(u8 opp); |
| 712 | int prcmu_get_ddr_opp(void); | 509 | int prcmu_get_ddr_opp(void); |
| 713 | unsigned long prcmu_qos_get_cpufreq_opp_delay(void); | ||
| 714 | void prcmu_qos_set_cpufreq_opp_delay(unsigned long); | ||
| 715 | /* NOTE! Use regulator framework instead */ | 510 | /* NOTE! Use regulator framework instead */ |
| 716 | int prcmu_set_hwacc(u16 hw_acc_dev, u8 state); | 511 | int prcmu_set_hwacc(u16 hw_acc_dev, u8 state); |
| 717 | int prcmu_set_epod(u16 epod_id, u8 epod_state); | ||
| 718 | void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, | 512 | void prcmu_configure_auto_pm(struct prcmu_auto_pm_config *sleep, |
| 719 | struct prcmu_auto_pm_config *idle); | 513 | struct prcmu_auto_pm_config *idle); |
| 720 | bool prcmu_is_auto_pm_enabled(void); | 514 | bool prcmu_is_auto_pm_enabled(void); |
| 721 | 515 | ||
| 722 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); | 516 | int prcmu_config_clkout(u8 clkout, u8 source, u8 div); |
| 723 | int prcmu_request_clock(u8 clock, bool enable); | ||
| 724 | int prcmu_set_clock_divider(u8 clock, u8 divider); | 517 | int prcmu_set_clock_divider(u8 clock, u8 divider); |
| 725 | int prcmu_config_esram0_deep_sleep(u8 state); | ||
| 726 | int prcmu_config_hotdog(u8 threshold); | 518 | int prcmu_config_hotdog(u8 threshold); |
| 727 | int prcmu_config_hotmon(u8 low, u8 high); | 519 | int prcmu_config_hotmon(u8 low, u8 high); |
| 728 | int prcmu_start_temp_sense(u16 cycles32k); | 520 | int prcmu_start_temp_sense(u16 cycles32k); |
| @@ -732,14 +524,36 @@ int prcmu_abb_write(u8 slave, u8 reg, u8 *value, u8 size); | |||
| 732 | 524 | ||
| 733 | void prcmu_ac_wake_req(void); | 525 | void prcmu_ac_wake_req(void); |
| 734 | void prcmu_ac_sleep_req(void); | 526 | void prcmu_ac_sleep_req(void); |
| 735 | void prcmu_system_reset(u16 reset_code); | ||
| 736 | void prcmu_modem_reset(void); | 527 | void prcmu_modem_reset(void); |
| 737 | bool prcmu_is_ac_wake_requested(void); | ||
| 738 | void prcmu_enable_spi2(void); | 528 | void prcmu_enable_spi2(void); |
| 739 | void prcmu_disable_spi2(void); | 529 | void prcmu_disable_spi2(void); |
| 740 | 530 | ||
| 531 | int prcmu_config_a9wdog(u8 num, bool sleep_auto_off); | ||
| 532 | int prcmu_enable_a9wdog(u8 id); | ||
| 533 | int prcmu_disable_a9wdog(u8 id); | ||
| 534 | int prcmu_kick_a9wdog(u8 id); | ||
| 535 | int prcmu_load_a9wdog(u8 id, u32 val); | ||
| 536 | |||
| 537 | void db8500_prcmu_system_reset(u16 reset_code); | ||
| 538 | int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, bool keep_ap_pll); | ||
| 539 | void db8500_prcmu_enable_wakeups(u32 wakeups); | ||
| 540 | int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state); | ||
| 541 | int db8500_prcmu_request_clock(u8 clock, bool enable); | ||
| 542 | int db8500_prcmu_set_display_clocks(void); | ||
| 543 | int db8500_prcmu_disable_dsipll(void); | ||
| 544 | int db8500_prcmu_enable_dsipll(void); | ||
| 545 | void db8500_prcmu_config_abb_event_readout(u32 abb_events); | ||
| 546 | void db8500_prcmu_get_abb_event_buffer(void __iomem **buf); | ||
| 547 | int db8500_prcmu_config_esram0_deep_sleep(u8 state); | ||
| 548 | u16 db8500_prcmu_get_reset_code(void); | ||
| 549 | bool db8500_prcmu_is_ac_wake_requested(void); | ||
| 550 | int db8500_prcmu_set_arm_opp(u8 opp); | ||
| 551 | int db8500_prcmu_get_arm_opp(void); | ||
| 552 | |||
| 741 | #else /* !CONFIG_MFD_DB8500_PRCMU */ | 553 | #else /* !CONFIG_MFD_DB8500_PRCMU */ |
| 742 | 554 | ||
| 555 | static inline void db8500_prcmu_early_init(void) {} | ||
| 556 | |||
| 743 | static inline int prcmu_set_rc_a2p(enum romcode_write code) | 557 | static inline int prcmu_set_rc_a2p(enum romcode_write code) |
| 744 | { | 558 | { |
| 745 | return 0; | 559 | return 0; |
| @@ -755,34 +569,12 @@ static inline enum ap_pwrst prcmu_get_xp70_current_state(void) | |||
| 755 | return AP_EXECUTE; | 569 | return AP_EXECUTE; |
| 756 | } | 570 | } |
| 757 | 571 | ||
| 758 | static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | 572 | static inline bool prcmu_has_arm_maxopp(void) |
| 759 | bool keep_ap_pll) | ||
| 760 | { | ||
| 761 | return 0; | ||
| 762 | } | ||
| 763 | |||
| 764 | static inline void prcmu_enable_wakeups(u32 wakeups) {} | ||
| 765 | |||
| 766 | static inline void prcmu_disable_wakeups(void) {} | ||
| 767 | |||
| 768 | static inline void prcmu_config_abb_event_readout(u32 abb_events) {} | ||
| 769 | |||
| 770 | static inline int prcmu_set_arm_opp(u8 opp) | ||
| 771 | { | ||
| 772 | return 0; | ||
| 773 | } | ||
| 774 | |||
| 775 | static inline int prcmu_get_arm_opp(void) | ||
| 776 | { | ||
| 777 | return ARM_100_OPP; | ||
| 778 | } | ||
| 779 | |||
| 780 | static bool prcmu_has_arm_maxopp(void) | ||
| 781 | { | 573 | { |
| 782 | return false; | 574 | return false; |
| 783 | } | 575 | } |
| 784 | 576 | ||
| 785 | static bool prcmu_is_u8400(void) | 577 | static inline bool prcmu_is_u8400(void) |
| 786 | { | 578 | { |
| 787 | return false; | 579 | return false; |
| 788 | } | 580 | } |
| @@ -817,13 +609,6 @@ static inline int prcmu_get_ddr_opp(void) | |||
| 817 | return DDR_100_OPP; | 609 | return DDR_100_OPP; |
| 818 | } | 610 | } |
| 819 | 611 | ||
| 820 | static inline unsigned long prcmu_qos_get_cpufreq_opp_delay(void) | ||
| 821 | { | ||
| 822 | return 0; | ||
| 823 | } | ||
| 824 | |||
| 825 | static inline void prcmu_qos_set_cpufreq_opp_delay(unsigned long n) {} | ||
| 826 | |||
| 827 | static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state) | 612 | static inline int prcmu_set_hwacc(u16 hw_acc_dev, u8 state) |
| 828 | { | 613 | { |
| 829 | return 0; | 614 | return 0; |
| @@ -844,21 +629,11 @@ static inline int prcmu_config_clkout(u8 clkout, u8 source, u8 div) | |||
| 844 | return 0; | 629 | return 0; |
| 845 | } | 630 | } |
| 846 | 631 | ||
| 847 | static inline int prcmu_request_clock(u8 clock, bool enable) | ||
| 848 | { | ||
| 849 | return 0; | ||
| 850 | } | ||
| 851 | |||
| 852 | static inline int prcmu_set_clock_divider(u8 clock, u8 divider) | 632 | static inline int prcmu_set_clock_divider(u8 clock, u8 divider) |
| 853 | { | 633 | { |
| 854 | return 0; | 634 | return 0; |
| 855 | } | 635 | } |
| 856 | 636 | ||
| 857 | int prcmu_config_esram0_deep_sleep(u8 state) | ||
| 858 | { | ||
| 859 | return 0; | ||
| 860 | } | ||
| 861 | |||
| 862 | static inline int prcmu_config_hotdog(u8 threshold) | 637 | static inline int prcmu_config_hotdog(u8 threshold) |
| 863 | { | 638 | { |
| 864 | return 0; | 639 | return 0; |
| @@ -893,86 +668,107 @@ static inline void prcmu_ac_wake_req(void) {} | |||
| 893 | 668 | ||
| 894 | static inline void prcmu_ac_sleep_req(void) {} | 669 | static inline void prcmu_ac_sleep_req(void) {} |
| 895 | 670 | ||
| 896 | static inline void prcmu_system_reset(u16 reset_code) {} | ||
| 897 | |||
| 898 | static inline void prcmu_modem_reset(void) {} | 671 | static inline void prcmu_modem_reset(void) {} |
| 899 | 672 | ||
| 900 | static inline bool prcmu_is_ac_wake_requested(void) | 673 | static inline int prcmu_enable_spi2(void) |
| 901 | { | 674 | { |
| 902 | return false; | 675 | return 0; |
| 903 | } | 676 | } |
| 904 | 677 | ||
| 905 | #ifndef CONFIG_UX500_SOC_DB5500 | 678 | static inline int prcmu_disable_spi2(void) |
| 906 | static inline int prcmu_set_display_clocks(void) | ||
| 907 | { | 679 | { |
| 908 | return 0; | 680 | return 0; |
| 909 | } | 681 | } |
| 910 | 682 | ||
| 911 | static inline int prcmu_disable_dsipll(void) | 683 | static inline void db8500_prcmu_system_reset(u16 reset_code) {} |
| 684 | |||
| 685 | static inline int db8500_prcmu_set_power_state(u8 state, bool keep_ulp_clk, | ||
| 686 | bool keep_ap_pll) | ||
| 912 | { | 687 | { |
| 913 | return 0; | 688 | return 0; |
| 914 | } | 689 | } |
| 915 | 690 | ||
| 916 | static inline int prcmu_enable_dsipll(void) | 691 | static inline void db8500_prcmu_enable_wakeups(u32 wakeups) {} |
| 692 | |||
| 693 | static inline int db8500_prcmu_set_epod(u16 epod_id, u8 epod_state) | ||
| 917 | { | 694 | { |
| 918 | return 0; | 695 | return 0; |
| 919 | } | 696 | } |
| 920 | #endif | ||
| 921 | 697 | ||
| 922 | static inline int prcmu_enable_spi2(void) | 698 | static inline int db8500_prcmu_request_clock(u8 clock, bool enable) |
| 923 | { | 699 | { |
| 924 | return 0; | 700 | return 0; |
| 925 | } | 701 | } |
| 926 | 702 | ||
| 927 | static inline int prcmu_disable_spi2(void) | 703 | static inline int db8500_prcmu_set_display_clocks(void) |
| 928 | { | 704 | { |
| 929 | return 0; | 705 | return 0; |
| 930 | } | 706 | } |
| 931 | 707 | ||
| 932 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ | 708 | static inline int db8500_prcmu_disable_dsipll(void) |
| 709 | { | ||
| 710 | return 0; | ||
| 711 | } | ||
| 712 | |||
| 713 | static inline int db8500_prcmu_enable_dsipll(void) | ||
| 714 | { | ||
| 715 | return 0; | ||
| 716 | } | ||
| 717 | |||
| 718 | static inline int db8500_prcmu_config_esram0_deep_sleep(u8 state) | ||
| 719 | { | ||
| 720 | return 0; | ||
| 721 | } | ||
| 722 | |||
| 723 | static inline void db8500_prcmu_config_abb_event_readout(u32 abb_events) {} | ||
| 933 | 724 | ||
| 934 | #ifdef CONFIG_UX500_PRCMU_QOS_POWER | 725 | static inline void db8500_prcmu_get_abb_event_buffer(void __iomem **buf) {} |
| 935 | int prcmu_qos_requirement(int pm_qos_class); | 726 | |
| 936 | int prcmu_qos_add_requirement(int pm_qos_class, char *name, s32 value); | 727 | static inline u16 db8500_prcmu_get_reset_code(void) |
| 937 | int prcmu_qos_update_requirement(int pm_qos_class, char *name, s32 new_value); | ||
| 938 | void prcmu_qos_remove_requirement(int pm_qos_class, char *name); | ||
| 939 | int prcmu_qos_add_notifier(int prcmu_qos_class, | ||
| 940 | struct notifier_block *notifier); | ||
| 941 | int prcmu_qos_remove_notifier(int prcmu_qos_class, | ||
| 942 | struct notifier_block *notifier); | ||
| 943 | #else | ||
| 944 | static inline int prcmu_qos_requirement(int prcmu_qos_class) | ||
| 945 | { | 728 | { |
| 946 | return 0; | 729 | return 0; |
| 947 | } | 730 | } |
| 948 | 731 | ||
| 949 | static inline int prcmu_qos_add_requirement(int prcmu_qos_class, | 732 | static inline int prcmu_config_a9wdog(u8 num, bool sleep_auto_off) |
| 950 | char *name, s32 value) | ||
| 951 | { | 733 | { |
| 952 | return 0; | 734 | return 0; |
| 953 | } | 735 | } |
| 954 | 736 | ||
| 955 | static inline int prcmu_qos_update_requirement(int prcmu_qos_class, | 737 | static inline int prcmu_enable_a9wdog(u8 id) |
| 956 | char *name, s32 new_value) | ||
| 957 | { | 738 | { |
| 958 | return 0; | 739 | return 0; |
| 959 | } | 740 | } |
| 960 | 741 | ||
| 961 | static inline void prcmu_qos_remove_requirement(int prcmu_qos_class, char *name) | 742 | static inline int prcmu_disable_a9wdog(u8 id) |
| 962 | { | 743 | { |
| 744 | return 0; | ||
| 963 | } | 745 | } |
| 964 | 746 | ||
| 965 | static inline int prcmu_qos_add_notifier(int prcmu_qos_class, | 747 | static inline int prcmu_kick_a9wdog(u8 id) |
| 966 | struct notifier_block *notifier) | ||
| 967 | { | 748 | { |
| 968 | return 0; | 749 | return 0; |
| 969 | } | 750 | } |
| 970 | static inline int prcmu_qos_remove_notifier(int prcmu_qos_class, | 751 | |
| 971 | struct notifier_block *notifier) | 752 | static inline int prcmu_load_a9wdog(u8 id, u32 val) |
| 972 | { | 753 | { |
| 973 | return 0; | 754 | return 0; |
| 974 | } | 755 | } |
| 975 | 756 | ||
| 976 | #endif | 757 | static inline bool db8500_prcmu_is_ac_wake_requested(void) |
| 758 | { | ||
| 759 | return 0; | ||
| 760 | } | ||
| 761 | |||
| 762 | static inline int db8500_prcmu_set_arm_opp(u8 opp) | ||
| 763 | { | ||
| 764 | return 0; | ||
| 765 | } | ||
| 766 | |||
| 767 | static inline int db8500_prcmu_get_arm_opp(void) | ||
| 768 | { | ||
| 769 | return 0; | ||
| 770 | } | ||
| 771 | |||
| 772 | #endif /* !CONFIG_MFD_DB8500_PRCMU */ | ||
| 977 | 773 | ||
| 978 | #endif /* __MFD_DB8500_PRCMU_H */ | 774 | #endif /* __MFD_DB8500_PRCMU_H */ |
diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index 6c7584d69d8f..bac942f959c1 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h | |||
| @@ -240,7 +240,7 @@ static inline int prcmu_set_power_state(u8 state, bool keep_ulp_clk, | |||
| 240 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) | 240 | static inline int prcmu_set_epod(u16 epod_id, u8 epod_state) |
| 241 | { | 241 | { |
| 242 | if (machine_is_u5500()) | 242 | if (machine_is_u5500()) |
| 243 | return db5500_prcmu_set_epod(epod_id, epod_state); | 243 | return -EINVAL; |
| 244 | else | 244 | else |
| 245 | return db8500_prcmu_set_epod(epod_id, epod_state); | 245 | return db8500_prcmu_set_epod(epod_id, epod_state); |
| 246 | } | 246 | } |
| @@ -295,7 +295,7 @@ int prcmu_get_ddr_opp(void); | |||
| 295 | static inline int prcmu_set_arm_opp(u8 opp) | 295 | static inline int prcmu_set_arm_opp(u8 opp) |
| 296 | { | 296 | { |
| 297 | if (machine_is_u5500()) | 297 | if (machine_is_u5500()) |
| 298 | return db5500_prcmu_set_arm_opp(opp); | 298 | return -EINVAL; |
| 299 | else | 299 | else |
| 300 | return db8500_prcmu_set_arm_opp(opp); | 300 | return db8500_prcmu_set_arm_opp(opp); |
| 301 | } | 301 | } |
| @@ -303,7 +303,7 @@ static inline int prcmu_set_arm_opp(u8 opp) | |||
| 303 | static inline int prcmu_get_arm_opp(void) | 303 | static inline int prcmu_get_arm_opp(void) |
| 304 | { | 304 | { |
| 305 | if (machine_is_u5500()) | 305 | if (machine_is_u5500()) |
| 306 | return db5500_prcmu_get_arm_opp(); | 306 | return -EINVAL; |
| 307 | else | 307 | else |
| 308 | return db8500_prcmu_get_arm_opp(); | 308 | return db8500_prcmu_get_arm_opp(); |
| 309 | } | 309 | } |
| @@ -362,7 +362,7 @@ static inline int prcmu_enable_dsipll(void) | |||
| 362 | static inline int prcmu_config_esram0_deep_sleep(u8 state) | 362 | static inline int prcmu_config_esram0_deep_sleep(u8 state) |
| 363 | { | 363 | { |
| 364 | if (machine_is_u5500()) | 364 | if (machine_is_u5500()) |
| 365 | return db5500_prcmu_config_esram0_deep_sleep(state); | 365 | return -EINVAL; |
| 366 | else | 366 | else |
| 367 | return db8500_prcmu_config_esram0_deep_sleep(state); | 367 | return db8500_prcmu_config_esram0_deep_sleep(state); |
| 368 | } | 368 | } |
