diff options
author | Rabin Vincent <rabin.vincent@stericsson.com> | 2011-09-06 16:06:55 +0530 |
---|---|---|
committer | Philippe Langlais <philippe.langlais@stericsson.com> | 2012-05-22 10:59:09 +0200 |
commit | a9078aa68e5b6a339158911f34386ccb49e246dd (patch) | |
tree | 098db3e538ffb6fd5419a32bb6a9dc3adb04b0c9 | |
parent | 78cafbd258fb6154631d25531afff143d84d2af1 (diff) |
u5500: prcmu: implement DDR OPP handling
ST-Ericsson ID: 348762
ST-Ericsson FOSS-OUT ID: Trivial
ST-Ericsson Linux next: NA
Change-Id: I26770ee6151f91c70eebba1c1c460e7cdedd43e1
Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com>
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/30502
Reviewed-by: QATOOLS
Reviewed-by: QABUILD
Reviewed-by: Vijaya Kumar K-1 <vijay.kilari@stericsson.com>
Reviewed-by: Mattias NILSSON <mattias.i.nilsson@stericsson.com>
Reviewed-by: QATEST
Reviewed-on: http://gerrit.lud.stericsson.com/gerrit/32601
Tested-by: Venkata Biswanath DEVARASETTY <venkata.biswanath@stericsson.com>
-rw-r--r-- | drivers/mfd/db5500-prcmu-regs.h | 1 | ||||
-rw-r--r-- | drivers/mfd/db5500-prcmu.c | 18 | ||||
-rw-r--r-- | include/linux/mfd/db5500-prcmu.h | 12 | ||||
-rw-r--r-- | include/linux/mfd/dbx500-prcmu.h | 4 |
4 files changed, 33 insertions, 2 deletions
diff --git a/drivers/mfd/db5500-prcmu-regs.h b/drivers/mfd/db5500-prcmu-regs.h index 12e8d10ca46..e8aa2901478 100644 --- a/drivers/mfd/db5500-prcmu-regs.h +++ b/drivers/mfd/db5500-prcmu-regs.h @@ -116,6 +116,7 @@ #define PRCM_MMIP_LS_CLAMP_SET 0x420 #define PRCM_MMIP_LS_CLAMP_CLR 0x424 +#define PRCM_DDR_SUBSYS_APE_MINBW 0x438 /* Miscellaneous unit registers */ #define PRCM_DSI_SW_RESET 0x324 diff --git a/drivers/mfd/db5500-prcmu.c b/drivers/mfd/db5500-prcmu.c index dc19b13416b..81c65c07a6e 100644 --- a/drivers/mfd/db5500-prcmu.c +++ b/drivers/mfd/db5500-prcmu.c @@ -1228,6 +1228,24 @@ int db5500_prcmu_get_ape_opp(void) } } +int db5500_prcmu_get_ddr_opp(void) +{ + return readb(_PRCMU_BASE + PRCM_DDR_SUBSYS_APE_MINBW); +} + +int db5500_prcmu_set_ddr_opp(u8 opp) +{ + if (cpu_is_u5500v1()) + return -EINVAL; + + if (opp != DDR_100_OPP && opp != DDR_50_OPP) + return -EINVAL; + + writeb(opp, _PRCMU_BASE + PRCM_DDR_SUBSYS_APE_MINBW); + + return 0; +} + /** * db5500_prcmu_get_arm_opp - get the current ARM OPP * diff --git a/include/linux/mfd/db5500-prcmu.h b/include/linux/mfd/db5500-prcmu.h index 2edcf0699ad..b70811dc563 100644 --- a/include/linux/mfd/db5500-prcmu.h +++ b/include/linux/mfd/db5500-prcmu.h @@ -32,6 +32,8 @@ int db5500_prcmu_set_arm_opp(u8 opp); int db5500_prcmu_get_arm_opp(void); int db5500_prcmu_set_ape_opp(u8 opp); int db5500_prcmu_get_ape_opp(void); +int db5500_prcmu_set_ddr_opp(u8 opp); +int db5500_prcmu_get_ddr_opp(void); static inline unsigned long prcmu_clock_rate(u8 clock) { @@ -154,6 +156,16 @@ static inline int db5500_prcmu_get_ape_opp(void) return 0; } +static inline int db5500_prcmu_set_ddr_opp(u8 opp) +{ + return 0; +} + +static inline int db5500_prcmu_get_ddr_opp(void) +{ + return 0; +} + #endif /* CONFIG_MFD_DB5500_PRCMU */ #endif /* __MFD_DB5500_PRCMU_H */ diff --git a/include/linux/mfd/dbx500-prcmu.h b/include/linux/mfd/dbx500-prcmu.h index a93edeac43f..9b79563c4bf 100644 --- a/include/linux/mfd/dbx500-prcmu.h +++ b/include/linux/mfd/dbx500-prcmu.h @@ -387,14 +387,14 @@ int prcmu_set_clock_rate(u8 clock, unsigned long rate); static inline int prcmu_set_ddr_opp(u8 opp) { if (cpu_is_u5500()) - return -EINVAL; + return db5500_prcmu_set_ddr_opp(opp); else return db8500_prcmu_set_ddr_opp(opp); } static inline int prcmu_get_ddr_opp(void) { if (cpu_is_u5500()) - return -EINVAL; + return db5500_prcmu_get_ddr_opp(); else return db8500_prcmu_get_ddr_opp(); } |