From patchwork Fri Feb 15 12:56:57 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14911 Return-Path: X-Original-To: patchwork@peony.canonical.com Delivered-To: patchwork@peony.canonical.com Received: from fiordland.canonical.com (fiordland.canonical.com [91.189.94.145]) by peony.canonical.com (Postfix) with ESMTP id 947B823E01 for ; Fri, 15 Feb 2013 12:58:17 +0000 (UTC) Received: from mail-vb0-f48.google.com (mail-vb0-f48.google.com [209.85.212.48]) by fiordland.canonical.com (Postfix) with ESMTP id 5EE51A18762 for ; Fri, 15 Feb 2013 12:58:17 +0000 (UTC) Received: by mail-vb0-f48.google.com with SMTP id fc21so2092661vbb.21 for ; Fri, 15 Feb 2013 04:58:16 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=x-received:x-forwarded-to:x-forwarded-for:delivered-to:x-received :received-spf:x-received:from:to:cc:subject:date:message-id:x-mailer :in-reply-to:references:x-gm-message-state; bh=DG4JQSbEMqEDcv3JICrJtl8ogBkQ8Ni8FaSYlrB1wDY=; b=j5xWO0V852FUJYAenvR/KSaeBDfuRc8mvMp0O1xizkcXSfkJ06vbkDMJkd+KIggAjG oQwiGPbvRmy9U2dTCPVSTj21UYCk/6IApQGGPfutEkDDWN6x7VSzRlAiWPpl89FSFqrj 9EGDAUwnLBpyCFQHy8FF6/jhHe0nOHIHVav1njWQfWNBoP4N08kxBFy/RlOoIz0CMklf lj9N+bdfGSmJaFTPwsI2sDadzwXxzQ+jl1F1tbjXcgoXAZa7bHDUUntAFQxeisIvXfwT Wx9gU4hMR8nt2dRzWTUjA5ApN0X2wblnTI6Ip8mJ/5rYdNFzXEnPixu/H86dChn8o6QX ukQw== X-Received: by 10.52.98.5 with SMTP id ee5mr2514875vdb.102.1360933096901; Fri, 15 Feb 2013 04:58:16 -0800 (PST) X-Forwarded-To: linaro-patchwork@canonical.com X-Forwarded-For: patch@linaro.org linaro-patchwork@canonical.com Delivered-To: patches@linaro.org Received: by 10.221.4.5 with SMTP id oa5csp11424vcb; Fri, 15 Feb 2013 04:58:16 -0800 (PST) X-Received: by 10.194.158.100 with SMTP id wt4mr4005517wjb.37.1360933092696; Fri, 15 Feb 2013 04:58:12 -0800 (PST) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx.google.com with ESMTPS id b5si1054607wiy.46.2013.02.15.04.58.12 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:58:12 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.172; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.172 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) smtp.mail=lee.jones@linaro.org Received: by mail-wi0-f172.google.com with SMTP id ez12so1105039wid.17 for ; Fri, 15 Feb 2013 04:58:12 -0800 (PST) X-Received: by 10.180.14.233 with SMTP id s9mr3917339wic.25.1360933092159; Fri, 15 Feb 2013 04:58:12 -0800 (PST) Received: from localhost.localdomain (cpc34-aztw25-2-0-cust250.18-1.cable.virginmedia.com. [86.16.136.251]) by mx.google.com with ESMTPS id j4sm2852410wiz.10.2013.02.15.04.58.10 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 15 Feb 2013 04:58:11 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, sameo@linux.intel.com Cc: arnd@arndb.de, linus.walleij@stericsson.com, Rabin Vincent , Lee Jones Subject: [PATCH 26/35] mfd: ab8500-sysctrl: AB8505 doesn't have SYSCLKREQ5..8 Date: Fri, 15 Feb 2013 12:56:57 +0000 Message-Id: <1360933026-30325-27-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> References: <1360933026-30325-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQnlcLzZpBM2LprZqrWW1sRchyaLvKqtI2NdO5nRSYTjBzcOAZ7aJS9S3scRKvSSkG8TJyPw From: Rabin Vincent So we're removing support for it. Signed-off-by: Rabin Vincent Signed-off-by: Lee Jones Tested-by: Marcus COOPER --- drivers/mfd/ab8500-sysctrl.c | 37 ++++++++++++++++++++++--------------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c index f43c42b..272479c 100644 --- a/drivers/mfd/ab8500-sysctrl.c +++ b/drivers/mfd/ab8500-sysctrl.c @@ -182,9 +182,9 @@ EXPORT_SYMBOL(ab8500_sysctrl_write); static int ab8500_sysctrl_probe(struct platform_device *pdev) { + struct ab8500 *ab8500 = dev_get_drvdata(pdev->dev.parent); struct ab8500_platform_data *plat; struct ab8500_sysctrl_platform_data *pdata; - int ret, i, j; plat = dev_get_platdata(pdev->dev.parent); @@ -196,20 +196,27 @@ static int ab8500_sysctrl_probe(struct platform_device *pdev) pdata = plat->sysctrl; - - 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); + if (pdata) { + int last, ret, i, j; + + if (is_ab8505(ab8500)) + last = AB8500_SYSCLKREQ4RFCLKBUF; + else + last = AB8500_SYSCLKREQ8RFCLKBUF; + + for (i = AB8500_SYSCLKREQ1RFCLKBUF; i <= last; 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); + } } }