From patchwork Mon Sep 28 21:56:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7281241 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 867769F36A for ; Mon, 28 Sep 2015 22:05:38 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9B7F52070F for ; Mon, 28 Sep 2015 22:05:37 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 65ADD20723 for ; Mon, 28 Sep 2015 22:05:36 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZggWN-0007e5-B8; Mon, 28 Sep 2015 22:03:43 +0000 Received: from mail-bl2on0112.outbound.protection.outlook.com ([65.55.169.112] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZggRw-0004OW-P9 for linux-arm-kernel@lists.infradead.org; Mon, 28 Sep 2015 21:59:09 +0000 Received: from DM2PR03CA0031.namprd03.prod.outlook.com (10.141.96.30) by DM2PR0301MB1230.namprd03.prod.outlook.com (10.160.219.19) with Microsoft SMTP Server (TLS) id 15.1.280.20; Mon, 28 Sep 2015 21:58:46 +0000 Received: from BL2FFO11FD044.protection.gbl (2a01:111:f400:7c09::161) by DM2PR03CA0031.outlook.office365.com (2a01:111:e400:2428::30) with Microsoft SMTP Server (TLS) id 15.1.280.20 via Frontend Transport; Mon, 28 Sep 2015 21:58:46 +0000 Authentication-Results: spf=fail (sender IP is 192.88.168.50) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; freescale.mail.onmicrosoft.com; dmarc=none action=none header.from=freescale.com; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.168.50 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.168.50; helo=tx30smr01.am.freescale.net; Received: from tx30smr01.am.freescale.net (192.88.168.50) by BL2FFO11FD044.mail.protection.outlook.com (10.173.161.140) with Microsoft SMTP Server (TLS) id 15.1.274.4 via Frontend Transport; Mon, 28 Sep 2015 21:58:45 +0000 Received: from bluefly.am.freescale.net (bluefly.am.freescale.net [10.81.17.130]) by tx30smr01.am.freescale.net (8.14.3/8.14.0) with ESMTP id t8SLwUPx032549; Mon, 28 Sep 2015 14:58:44 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH v7 5/7] pinctrl: freescale: imx: add shared input select reg support Date: Mon, 28 Sep 2015 16:56:39 -0500 Message-ID: <1443477401-17238-5-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443477401-17238-1-git-send-email-aalonso@freescale.com> References: <1443477401-17238-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD044; 1:qKoY/bzOpsXL+DY96wTtKzoRzugHWzKD3CWvNhq9nXBXLBtLu9g9hYXmIlN41VOsxR61enX0fWhga/mDCvbzvHZBQh2vZHCJmJntTqSaq4b4STR7GejPSeE/4VLykdFabXw2xr48lmw/VbvUNdteWOT0jrfdI25tnzU082O6UUyoFAlfb6YjzBAk2ToEbHhG48vSq6UTsr0c9hYsNZTwcWasXcoJvCbkDfyxgfc1GUoAFwW54Li2vv80nq+JLPbhndskoGupHz6gfL0tmTODodZV6BMkeVE1Ryt9yJHL4qXh1xarJ3HRoqlhUSxh91yR3o9anPWYHsRSxxcf/Xzl+DzlRorkr9jtphYZmyxtjD/jaXmoW3yHQCptFgTqdhGihwzVJKHaBa8sEkXx+DQnTw== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(199003)(189002)(106466001)(107886002)(229853001)(46102003)(77156002)(76176999)(50986999)(189998001)(50226001)(5001920100001)(36756003)(2950100001)(62966003)(85426001)(33646002)(5001960100002)(86362001)(47776003)(48376002)(5003940100001)(19580395003)(87936001)(19580405001)(105606002)(5001770100001)(5001830100001)(104016004)(97736004)(11100500001)(4001540100001)(5001860100001)(6806005)(81156007)(5007970100001)(77096005)(50466002)(92566002)(68736005)(64706001)(2201001)(4001430100001)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB1230; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; A:1; MX:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1230; 2:TNysbuS2T5QckMv3SdN/CuI8ASFP2IAjJvM8npo9JHZdLQ/ZJrFxY1SRXguRNKrP4PoMCPFLlFXanyivb7nkueSgXUYWoFTdCPmk3bVmadKUZobbO6sZiV/ZsImvH2FxSGxvUbt/rrr+uKsjPyQXYrkK6WyW6JxhOzBngIt88dw=; 3:Q0nwFnFP5V2y9Tjen5ygAAoVr0eo5VU71E3ECL0O51N2MXPqVU4SKsIb4Bu8V2FdBMA2Iu3hYrMTdZSmKcMmPVDhkH1l0sTwTJi7M94UIAY9IhoZw2HM2Z/2ReWWMyWHseiXC+AGJWN+nQvtDS/1g3FdUNkUOyeRgSIwCIjRNc/vXAemLqoxYMIdOFHZtK0TRbceAvyza5yitlxd9W9iqEjgFCRT2NPNRrOYjNY+XCw=; 25:FnMa12C4i8eWvZT2j6ZlwmOn5ChxHJoKVuVgQhbbRkvaVpb29GR4mcq0aA0tqkLLUhyCDtjJ8vSG2wcMne91X9qM4i76sfLIKRUigm/5M2WHyJMbxVoGSa7fstYRpEcimYG5XZmjFmAA3zX1XzLT//1GTybgFWj42mMGELuzuEurTUCs5rVa+bW/8puU1T5g0Ls4uo0W6YI5Spl4yJnHzHOTanRqJIvhnEX2P7F630F1Y7/mfUVnms18AwJkQxMVjItdXULgFSolq4Xbi+WYFw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1230; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1230; 20:+HmD2To/pKPIW/10NOeD/GKL2ErUZgDFESFGZD7XwEAEppQcv64ee+5AwkaxTfe3VZC6dazvo7sWksRvwsN0/IexC4Cz9nKvDuChN8Me0UeyCx8TY/qYtrYbyjHZuVHayyaK2eBSm+dHBrPGFS+hEhoyklqw/ndOwedBp7kti4p58hL2/8YXq8ZAlMUg7eCBAtjeTmnQIRzqgqodEqyQGiCPoZdLq/dHbX0FyrsVJWzN1UbfjbFvkmxQudGx+oSbl/pVI0oU1eepmXMnGghhokoR3Qr6ZCgJzRDewTitknjMizE/YZYx0atxZjgkcQ1id5x8BUy7kGUSKiDXs0m1Aq9z5Q2UFNMAI1UdtyzzwlM=; 4:HB/QHw4Q6ba2VH5pc1muiCCHuiEPuO2kzLpWaISvGgPo69mTg4h43HXxieeNcX4tj4+Mybj567gIPrDzMVtG0frkpYIvxMqlU0iEnYMn5rf6QgvwhSiYXJNVCJTZAu3pY9dBZSYwunogCYuCyVzf1S+BRyHPEjikVB2gNBEroOur3d4xmbk0Q07Jcx8NGNtnsM1XetN1mTHxZ/kR4mNPocjwWcTtk7hDZ8ECHAkDkjv4UToGWAA+xrORnJ9NQUZeJDK6EQvZwWViqD+7j1r6gf6z6gL2YaM1KxuGLf99ERCNQN5M5kGI4CpsYfoCR7tSS5F4REXQJxYg+ZvJaAsl/WR8GQ5ipTT80gfIAQEdXXI= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(520078)(8121501046)(3002001); SRVR:DM2PR0301MB1230; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB1230; X-Forefront-PRVS: 0713BC207F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB1230; 23:+By/DYL8WFAtnQUC//Ec0TmDVqVyn13a1iZOn7U?= =?us-ascii?Q?Z6xQaLaPomf5dvsSKXYJZkA6jhQWwwnc9/fBUm0LXbQuxy2maEefI5UWnqvQ?= =?us-ascii?Q?7dQ7SJ9Rm36kMj5lrpEgEYk4m/ZI0mkfNfz3obRozd0XgIrADbDFG9JC7VBr?= =?us-ascii?Q?klQKCdjvVBl00sXPwnFzHfnPc8vQg4FSTJPTGOPstCps0u1hDMJxEI2RR4kr?= =?us-ascii?Q?irIUvWbCnhpViTeh0/Wd68rJknpVionR8zgNhKZjCf0lOg/xgU4mJXJBZ0NT?= =?us-ascii?Q?TplkwymB6gmVCCfTUSoS9TAdG2zvA64r7/DMJQAWC71P0nW4AVEeip9a/Fet?= =?us-ascii?Q?/EKopNgkDwYSekH61AAh8entXayIpRWay61M/la1FAxJ03S9t+jDUD1ZQl0z?= =?us-ascii?Q?3IxvoFDCdPpQ5FzhQ2nYA5HdG64+Ew19F2Qlx+bxJc/b9e/A4snpy5MpHIpz?= =?us-ascii?Q?uhtE6nwQLMhh7zORahiVqhv1QxdqSKMzGlVquUhD5JjxA8gnjLHku8Rypvfg?= =?us-ascii?Q?8PEhdEpSxgsedA5teYDdz6z3475yEb2/k7Mz9tzBY+iPZ8KM1cFBQvHV5KOW?= =?us-ascii?Q?ynyd+tXwQsxXmN/tk+EWea7RDE4gqXzOtq6UgJyb5aIOJoLUMxcwdpjjGyLL?= =?us-ascii?Q?AsDCN+u2p9oVwKeZmOk7WLuJJR2wjkWq7L5Dp8M1P+ZoXqdi34iK2L+2iY89?= =?us-ascii?Q?3RWP6QrR9tqtKjLWRvAvflYsfzrIWzXW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wVaQbx/L0X31Aw11E4gOy/YiLZ2JrT4F/sXdUYirQJ7H8F3LkzUdifU4GQ== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Sep 2015 21:58:45.5785 (UTC) X-MS-Exchange-CrossTenant-Id: 710a03f5-10f6-4d38-9ff4-a80b81da590d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=710a03f5-10f6-4d38-9ff4-a80b81da590d; Ip=[192.88.168.50]; Helo=[tx30smr01.am.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR0301MB1230 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150928_145909_151524_30F70D72 X-CRM114-Status: GOOD ( 22.12 ) X-Spam-Score: -1.9 (-) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, Frank.Li@freescale.com, nitin.garg@freescale.com, Anson.Huang@freescale.com, linux-gpio@vger.kernel.org, robh+dt@kernel.org, kernel@pengutronix.de, yibin.gong@freescale.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAD_ENC_HEADER,BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP - Add shared input select register support - imx7d has two iomux controllers iomuxc and iomuxc-lpsr which share select_input register for daisy chain settings Signed-off-by: Adrian Alonso --- Changes for V2: Resend Changes for V3: - Use of_parse_phandle instead of of_get_child_by_name to get input select base register address Changes for V4: Resend Changes for V5: - Remove SHARE_INPUT_SELECT_REG flag - Use fsl,input-sel to check if shared input select register support is used Changes for V6: Resend Changes for V7: Resend drivers/pinctrl/freescale/pinctrl-imx.c | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 151d50d..a5bb939 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -39,6 +40,7 @@ struct imx_pinctrl { struct device *dev; struct pinctrl_dev *pctl; void __iomem *base; + void __iomem *input_sel_base; const struct imx_pinctrl_soc_info *info; }; @@ -254,7 +256,12 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, * Regular select input register can never be at offset * 0, and we only print register value for regular case. */ - writel(pin->input_val, ipctl->base + pin->input_reg); + if (ipctl->input_sel_base) + writel(pin->input_val, ipctl->input_sel_base + + pin->input_reg); + else + writel(pin->input_val, ipctl->base + + pin->input_reg); dev_dbg(ipctl->dev, "==>select_input: offset 0x%x val 0x%x\n", pin->input_reg, pin->input_val); @@ -685,6 +692,8 @@ static int imx_pinctrl_probe_dt(struct platform_device *pdev, int imx_pinctrl_probe(struct platform_device *pdev, struct imx_pinctrl_soc_info *info) { + struct device_node *dev_np = pdev->dev.of_node; + struct device_node *np; struct imx_pinctrl *ipctl; struct resource *res; int ret, i; @@ -715,6 +724,23 @@ int imx_pinctrl_probe(struct platform_device *pdev, if (IS_ERR(ipctl->base)) return PTR_ERR(ipctl->base); + if (of_property_read_bool(dev_np, "fsl,input-sel")) { + np = of_parse_phandle(dev_np, "fsl,input-sel", 0); + if (np) { + ipctl->input_sel_base = of_iomap(np, 0); + if (IS_ERR(ipctl->input_sel_base)) { + of_node_put(np); + dev_err(&pdev->dev, + "iomuxc input select base address not found\n"); + return PTR_ERR(ipctl->input_sel_base); + } + } else { + dev_err(&pdev->dev, "iomuxc fsl,input-sel property not found\n"); + return -EINVAL; + } + of_node_put(np); + } + imx_pinctrl_desc.name = dev_name(&pdev->dev); imx_pinctrl_desc.pins = info->pins; imx_pinctrl_desc.npins = info->npins;