From patchwork Tue Jan 15 12:55:46 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lee Jones X-Patchwork-Id: 14055 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 0893223E2E for ; Tue, 15 Jan 2013 12:56:38 +0000 (UTC) Received: from mail-vb0-f52.google.com (mail-vb0-f52.google.com [209.85.212.52]) by fiordland.canonical.com (Postfix) with ESMTP id A3ADCA1934A for ; Tue, 15 Jan 2013 12:56:37 +0000 (UTC) Received: by mail-vb0-f52.google.com with SMTP id ez10so53134vbb.25 for ; Tue, 15 Jan 2013 04:56:37 -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=5KTSqXqNUgAZ5dAgg78pEwzJVhf+4w9QKRx2t7rV/9k=; b=ULB4dv7x+MKhCOAJpC1u5n7uN7B87aSeaXUX20fdxSjbdzWsrzCyBuboWlUVyxKpCW CBFT6S4dIqS7CPloRTyNc+d1AOlMgTVC7AFa0Pybfl2djbq5oUz2X/ffAHIay+9HI2/q 3pSsi98UwHIdBAulsliBGxPPjjhFfmRs7exwlNb8PRszaPyTe9T7fpprrRkfiO+IZiWw XWVQgg5PjdIPqbv+zR7LXxW7WVpJYxbwWPlWkPthYMOPLtTucE4dTc1OkMB0b0RILV/W oDrht9ORM7M64ntJ9u0I9jIH6DQYJcXc1Sf2pwfaEfRrgUUXE/YKt/+UQP2BbnjsQ/7o 8tpg== X-Received: by 10.52.18.207 with SMTP id y15mr91189062vdd.8.1358254597142; Tue, 15 Jan 2013 04:56:37 -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.58.145.101 with SMTP id st5csp110594veb; Tue, 15 Jan 2013 04:56:36 -0800 (PST) X-Received: by 10.180.86.39 with SMTP id m7mr3573896wiz.1.1358254596201; Tue, 15 Jan 2013 04:56:36 -0800 (PST) Received: from mail-wi0-f174.google.com (mail-wi0-f174.google.com [209.85.212.174]) by mx.google.com with ESMTPS id m13si3356962wie.32.2013.01.15.04.56.35 (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 04:56:36 -0800 (PST) Received-SPF: neutral (google.com: 209.85.212.174 is neither permitted nor denied by best guess record for domain of lee.jones@linaro.org) client-ip=209.85.212.174; Authentication-Results: mx.google.com; spf=neutral (google.com: 209.85.212.174 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-f174.google.com with SMTP id hq4so2270125wib.13 for ; Tue, 15 Jan 2013 04:56:35 -0800 (PST) X-Received: by 10.180.97.68 with SMTP id dy4mr3568208wib.7.1358254595786; Tue, 15 Jan 2013 04:56:35 -0800 (PST) Received: from localhost.localdomain (cpc1-aztw13-0-0-cust473.18-1.cable.virginmedia.com. [77.102.241.218]) by mx.google.com with ESMTPS id eo10sm3672833wib.9.2013.01.15.04.56.34 (version=TLSv1.1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 15 Jan 2013 04:56:35 -0800 (PST) From: Lee Jones To: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: arnd@arndb.de, linus.walleij@stericsson.com, sameo@linux.intel.com, Kennet Wallden , Lee Jones Subject: [PATCH 06/26] mfd: ab8500-sysctrl: Provide configuration for SysClkReqRfClkBuf registers Date: Tue, 15 Jan 2013 12:55:46 +0000 Message-Id: <1358254566-12419-7-git-send-email-lee.jones@linaro.org> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358254566-12419-1-git-send-email-lee.jones@linaro.org> References: <1358254566-12419-1-git-send-email-lee.jones@linaro.org> X-Gm-Message-State: ALoCoQn+3F9r9UGMNY1qOjZystn6XKTD2kf258VswOU96ZCjxQx8QBtZ3/PJuzf6Op7k1xZCsrAy From: Kennet Wallden Add the possibility to pass configuration settings for SysCl1kReqRfClkBuf to SysClk8ReqRfClkBuf via platform data. Signed-off-by: Lee Jones Signed-off-by: Kennet Wallden Reviewed-by: Karl-Johan PERNTZ Reviewed-by: Bengt JONSSON --- drivers/mfd/ab8500-sysctrl.c | 25 +++++++++++++++++++++++++ include/linux/mfd/abx500/ab8500-sysctrl.h | 5 +++++ include/linux/mfd/abx500/ab8500.h | 2 ++ 3 files changed, 32 insertions(+) diff --git a/drivers/mfd/ab8500-sysctrl.c b/drivers/mfd/ab8500-sysctrl.c index cf58f69..19a024e 100644 --- a/drivers/mfd/ab8500-sysctrl.c +++ b/drivers/mfd/ab8500-sysctrl.c @@ -113,11 +113,36 @@ int ab8500_sysctrl_write(u16 reg, u8 mask, u8 value) static int __devinit 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; + int i; + int 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; } diff --git a/include/linux/mfd/abx500/ab8500-sysctrl.h b/include/linux/mfd/abx500/ab8500-sysctrl.h index 10eb509..ebf12e7 100644 --- a/include/linux/mfd/abx500/ab8500-sysctrl.h +++ b/include/linux/mfd/abx500/ab8500-sysctrl.h @@ -37,6 +37,11 @@ static inline int ab8500_sysctrl_clear(u16 reg, u8 bits) return ab8500_sysctrl_write(reg, bits, 0); } +/* Configuration data for SysClkReq1RfClkBuf - SysClkReq8RfClkBuf */ +struct ab8500_sysctrl_platform_data { + u8 initial_req_buf_config[8]; +}; + /* Registers */ #define AB8500_TURNONSTATUS 0x100 #define AB8500_RESETSTATUS 0x101 diff --git a/include/linux/mfd/abx500/ab8500.h b/include/linux/mfd/abx500/ab8500.h index 96840c4..3f4e6d1 100644 --- a/include/linux/mfd/abx500/ab8500.h +++ b/include/linux/mfd/abx500/ab8500.h @@ -270,6 +270,7 @@ struct regulator_reg_init; struct regulator_init_data; struct ab8500_gpio_platform_data; struct ab8500_codec_platform_data; +struct ab8500_sysctrl_platform_data; /** * struct ab8500_platform_data - AB8500 platform data @@ -291,6 +292,7 @@ struct ab8500_platform_data { struct regulator_init_data *regulator; struct ab8500_gpio_platform_data *gpio; struct ab8500_codec_platform_data *codec; + struct ab8500_sysctrl_platform_data *sysctrl; }; extern int __devinit ab8500_init(struct ab8500 *ab8500,