Skip to content

Commit c553552

Browse files
vitkyrkaLee Jones
authored andcommitted
mfd: ab8500-sysctrl: AB8505 doesn't have SYSCLKREQ5..8
So we're removing support for it. Signed-off-by: Rabin Vincent <rabin.vincent@stericsson.com> Signed-off-by: Lee Jones <lee.jones@linaro.org> Tested-by: Marcus COOPER <marcus.xm.cooper@stericsson.com> Acked-by: Samuel Ortiz <sameo@linux.intel.com>
1 parent 492390c commit c553552

1 file changed

Lines changed: 22 additions & 15 deletions

File tree

‎drivers/mfd/ab8500-sysctrl.c‎

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -182,9 +182,9 @@ EXPORT_SYMBOL(ab8500_sysctrl_write);
182182

183183
static int ab8500_sysctrl_probe(struct platform_device *pdev)
184184
{
185+
struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent);
185186
struct ab8500_platform_data *plat;
186187
struct ab8500_sysctrl_platform_data *pdata;
187-
int ret, i, j;
188188

189189
plat = dev_get_platdata(pdev->dev.parent);
190190

@@ -196,20 +196,27 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev)
196196

197197
pdata = plat->sysctrl;
198198

199-
200-
for (i = AB8500_SYSCLKREQ1RFCLKBUF;
201-
i <= AB8500_SYSCLKREQ8RFCLKBUF; i++) {
202-
j = i - AB8500_SYSCLKREQ1RFCLKBUF;
203-
ret = ab8500_sysctrl_write(i, 0xff,
204-
pdata->initial_req_buf_config[j]);
205-
dev_dbg(&pdev->dev,
206-
"Setting SysClkReq%dRfClkBuf 0x%X\n",
207-
j + 1,
208-
pdata->initial_req_buf_config[j]);
209-
if (ret < 0) {
210-
dev_err(&pdev->dev,
211-
"unable to set sysClkReq%dRfClkBuf: "
212-
"%d\n", j + 1, ret);
199+
if (pdata) {
200+
int last, ret, i, j;
201+
202+
if (is_ab8505(ab8500))
203+
last = AB8500_SYSCLKREQ4RFCLKBUF;
204+
else
205+
last = AB8500_SYSCLKREQ8RFCLKBUF;
206+
207+
for (i = AB8500_SYSCLKREQ1RFCLKBUF; i <= last; i++) {
208+
j = i - AB8500_SYSCLKREQ1RFCLKBUF;
209+
ret = ab8500_sysctrl_write(i, 0xff,
210+
pdata->initial_req_buf_config[j]);
211+
dev_dbg(&pdev->dev,
212+
"Setting SysClkReq%dRfClkBuf 0x%X\n",
213+
j + 1,
214+
pdata->initial_req_buf_config[j]);
215+
if (ret < 0) {
216+
dev_err(&pdev->dev,
217+
"unable to set sysClkReq%dRfClkBuf: "
218+
"%d\n", j + 1, ret);
219+
}
213220
}
214221
}
215222

0 commit comments

Comments
 (0)