aboutsummaryrefslogtreecommitdiff
path: root/drivers/mfd/ab8500-sysctrl.c
diff options
context:
space:
mode:
authorKennet Wallden <kennet.wallden@stericsson.com>2011-09-27 09:23:56 +0200
committerLee Jones <lee.jones@linaro.org>2013-02-04 08:31:29 +0000
commit1abf063ffd18e6934bb81a776b3d71278eeff4ab (patch)
treeea4c1329d051017e2f0d46537946d2489da5502f /drivers/mfd/ab8500-sysctrl.c
parentd0b32fa1e12a6fafbdf4fb142311a36f5314a6ff (diff)
downloadlinux-1abf063ffd18e6934bb81a776b3d71278eeff4ab.tar.gz
mfd: ab8500-sysctrl: Provide configuration for SysClkReqRfClkBuf registers
Add the possibility to pass configuration settings for SysCl1kReqRfClkBuf to SysClk8ReqRfClkBuf via platform data. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Kennet Wallden <kennet.wallden@stericsson.com> Reviewed-by: Karl-Johan PERNTZ <karl-johan.perntz@stericsson.com> Reviewed-by: Bengt JONSSON <bengt.g.jonsson@stericsson.com>
Diffstat (limited to 'drivers/mfd/ab8500-sysctrl.c')
-rw-r--r--drivers/mfd/ab8500-sysctrl.c24
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c
index 3aaff6043e1..236324e1136 100644
--- a/drivers/mfd/ab8500-sysctrl.c
+++ b/drivers/mfd/ab8500-sysctrl.c
@@ -113,11 +113,35 @@ int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value)
static int ab8500_sysctrl_probe(struct platform_device *pdev)
{
struct ab8500_platform_data *plat;
+ struct ab8500_sysctrl_platform_data *pdata;
sysctrl_dev = &pdev->dev;
plat = dev_get_platdata(pdev->dev.parent);
if (plat->pm_power_off)
pm_power_off = ab8500_power_off;
+
+ pdata = plat->sysctrl;
+
+ if (pdata) {
+ int ret, i, j;
+
+ for (i = AB8500_SYSCLKREQ1RFCLKBUF;
+ i <= AB8500_SYSCLKREQ8RFCLKBUF; i++) {
+ j = i - AB8500_SYSCLKREQ1RFCLKBUF;
+ ret = ab8500_sysctrl_write(i, 0xff,
+ pdata->initial_req_buf_config[j]);
+ dev_dbg(&pdev->dev,
+ "Setting SysClkReq%dRfClkBuf 0x%X\n",
+ j + 1,
+ pdata->initial_req_buf_config[j]);
+ if (ret < 0) {
+ dev_err(&pdev->dev,
+ "unable to set sysClkReq%dRfClkBuf: "
+ "%d\n", j + 1, ret);
+ }
+ }
+ }
+
return 0;
}