summaryrefslogtreecommitdiff
path: root/drivers/mfd
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@stericsson.com>2011-09-06 16:06:55 +0530
committerPhilippe Langlais <philippe.langlais@stericsson.com>2012-05-22 10:59:09 +0200
commita9078aa68e5b6a339158911f34386ccb49e246dd (patch)
tree098db3e538ffb6fd5419a32bb6a9dc3adb04b0c9 /drivers/mfd
parent78cafbd258fb6154631d25531afff143d84d2af1 (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>
Diffstat (limited to 'drivers/mfd')
-rw-r--r--drivers/mfd/db5500-prcmu-regs.h1
-rw-r--r--drivers/mfd/db5500-prcmu.c18
2 files changed, 19 insertions, 0 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
*