From patchwork Fri Sep 25 21:06:00 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7268021 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 E75E39F32B for ; Fri, 25 Sep 2015 21:10:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 058C12095F for ; Fri, 25 Sep 2015 21:10:26 +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 222A92087A for ; Fri, 25 Sep 2015 21:10:25 +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 1ZfaEU-0001DK-1f; Fri, 25 Sep 2015 21:08:42 +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 1ZfaE9-00015Z-LR for linux-arm-kernel@lists.infradead.org; Fri, 25 Sep 2015 21:08:23 +0000 Received: from BN3PR0301CA0056.namprd03.prod.outlook.com (10.160.152.152) by DM2PR0301MB1231.namprd03.prod.outlook.com (10.160.219.20) with Microsoft SMTP Server (TLS) id 15.1.268.17; Fri, 25 Sep 2015 21:07:58 +0000 Received: from BY2FFO11FD006.protection.gbl (2a01:111:f400:7c0c::154) by BN3PR0301CA0056.outlook.office365.com (2a01:111:e400:401e::24) with Microsoft SMTP Server (TLS) id 15.1.280.20 via Frontend Transport; Fri, 25 Sep 2015 21:07:58 +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 BY2FFO11FD006.mail.protection.outlook.com (10.1.14.127) with Microsoft SMTP Server (TLS) id 15.1.274.4 via Frontend Transport; Fri, 25 Sep 2015 21:07:57 +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 t8PL7njf028753; Fri, 25 Sep 2015 14:07:56 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH v6 4/6] pinctrl: freescale: imx: add shared input select reg support Date: Fri, 25 Sep 2015 16:06:00 -0500 Message-ID: <1443215162-13716-4-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443215162-13716-1-git-send-email-aalonso@freescale.com> References: <1443215162-13716-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD006; 1:DjNNAZ9m/oIto9LLXbgTy5C0rMkA25ow1WP/sC/pVajm/7illr3/kwavZOxkBdw77AdpvzgaaPdFeqCJgrC8MUOItW78SARBPPjpqA2FeySLzVeF/0QC+wCIv71T0Tou14OBeXGqoftureM3GWzYN+TfoHH8aDCIE3Y0U9KK74Ub3dvro+ZT5i/W72kI/T2grKGjR5Qe8ynoesAqys2jOqfYGibtY+0nH5jyuNbrrfNh18ONRj7CvqYvIIWsTOcv0i/tqsfysxDkNJf5fIzUjayDLawe0lAgY+1QpLUQlSTTjoExf51a9oUOAnQ6WdwVv7wBmwSIg/Rq4Y8rhFckVQrL69mbbpELYaUpG+AAOTXXG7tL46rYnZR4eWemXANnDw0ABjf4KiDLVY24C0MtVw== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(189002)(199003)(85426001)(87936001)(46102003)(76176999)(48376002)(6806005)(33646002)(2201001)(50226001)(2950100001)(5001770100001)(5007970100001)(104016004)(92566002)(105606002)(189998001)(50466002)(36756003)(5003940100001)(5001920100001)(19580395003)(68736005)(5001960100002)(229853001)(106466001)(11100500001)(19580405001)(77096005)(77156002)(50986999)(86362001)(97736004)(5001830100001)(5001860100001)(47776003)(64706001)(107886002)(81156007)(4001540100001)(62966003)(2101003)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB1231; H:tx30smr01.am.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1231; 2:SMCKovDRCh7+V9MDT5b5/9a+EGeNt4cGvm4Q+VRmpWz+gcUMVvp8RsZyARkgWiOPdDGTnu2Rbm/eRpiQ0WgkPzEAmKaCCyIl25tMaZEKDFlbV6IqF82/SFOWclP+Y3i8lrox+4agMIdut+k6rvsc2HDHaPYnOn7w2fOqd5hcU7w=; 3:0/0ANtihxVN0rJcHt3ROrcloTj+DrAeuA5RD5kUvYFvGFSP7UyMAk3ztBaEsSpaTx8I8SiM4SJHTqHpL4B9LAg65SrXqNrLyOPj14C92A5sMfnkERFXF8aY5vs5Aw2suLF6uhyfPeV/L3TwIBn9Ed/SmekgWY/SBBBRGgTfmSKTilZ/lbWoD3wWqTSpCYiDWlB0571RKEKvlPRxQcYM6EGEkw/1obdQFiTGakFDROr0=; 25:h9vMblCtMlDZT5igXR5i9BWpKrwYM9PQorvbLGQaI/fMQsourRPR/vxZ3bQKwTJML/J7oJqSoLeRDVxN2WletJ3Wy4syOd44slCWI7S1rX48QkCOKFv0UQF2/DsW4gkWjp+36Qmmp5OMhko2xMpo6uz4z5raAEIzZ0rSQsAbWuzjNrSzylYmraIveiFQ/bomu7o4m/B5zS+hbhTZojlpWlX+hXUi8s/anSYq+bAEQwHUcOhMwxUiqYepYFoAP4Pa+Kpw/J7DjYRhQ78miXTTmw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1231; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1231; 20:YP+thu2Uh4Njb00tiNw2I0Yy7Vl1i+6ghoYz56YIKIIBrG2JGYFxFMnyXuRWaFmGHIZmmNmEgCmaDoKzyVXVEMTjczeMSsXZCGXCruIrWBndES4bERoVE2Zv+g8QVMTrRnO4MqHrh4Fx928vL+QS9nJcHkwa+ePmXOgOELUKk3OKLE8TaZxJ5h8/yGj5EqLRKns2XE8DT41JEIh8ZBehBvDndYKzMih1rCsR8bsCe/JsDe9ABSMCrcX76QToGR3jrN4qkYilJDQZP2/7RD/dlG67+otiP4h7Pt12Z7gRPN2ZAtiFac/jE4kzx9RL5X5atT40cl/dYFhCExP07c6lUP6UihdgD1kTX4GF9G/BEI4=; 4:afG/MuibzSA1ZGOLPn7WECOMssHJzq9Z7auRKnkIXRCGov9WikQr/9hOIwK8bBPEcbs07d4s303YfXaSKk8vEXxbKf+zviz0N+flxrlkPM72h20l9ZAu+Ppqedqkg8SySYh13GYsUS/+emXGXokA9uFp1y1YhxFyYOywU1DaPTY5zRHjFKa09/rASKlb1rPjO83r90OihNkhIav2OY6YXJAkHlNsZpuCxcxnc4oJnZLtmCPbEs/v8gCtNbyyeCfHPgpwclETg2OXwpz+/NkOKGdHWBzcpWsyqQfmx9GfTfSea5huhTVK2s6eBGTUJlKTTI4R2lHnLIgccV6PrmCdwf9PyrkOWzMeSCWc09keZBc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(8121501046)(5005006)(520078)(3002001); SRVR:DM2PR0301MB1231; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB1231; X-Forefront-PRVS: 07106EF9B9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB1231; 23:7z9ny5co8QqHOnZhia1JmA7EANwJaqWXPY+XCPv?= =?us-ascii?Q?wMJmSxet1Pe4wF7N5O5pB3Oy558OneZJKgJ9qu2WIeKKcruldrGwkLEaQ81g?= =?us-ascii?Q?LEjZDDINDOB7hCNvzDM12fGaZd5L6riit7diiSxyFSfh8eC5p5TyeU8dsWqi?= =?us-ascii?Q?fGcnAof9+jySVjdfJMV5ydMJz4cfmHuTjcSXMH0w5CXlV8rBnoJcviIxI/w7?= =?us-ascii?Q?DOU6sPml8MV6q+5pMhTGiM1McNZzdZ7B1Ri2KOL37hvBqlRiIHhYsDcEqZ4Q?= =?us-ascii?Q?odoXmPZh3xvz33ynFQOQrCCn4XgF7EL9BhLr0K9g6nxuy+NN0l+IquMk/gvK?= =?us-ascii?Q?mlnPgPiFLoPYx9Tvkv9jGwGdAxgw/5l8x0oanhocAt/zI3jwON7FDa/LPdIe?= =?us-ascii?Q?ftUuP4zaYFqVoblu3aKYK/pz6jG90h2hP4ctNu6u3jzUOZv6YTH4HiYkIVgE?= =?us-ascii?Q?gqrfz1ImCVwGwTOP1RzP9aPW5OlyzSTFAFj7gtFBKcZA8zAPgBFseuK3iVWH?= =?us-ascii?Q?QyYB1W9FipF0DA4L9JsdlMI6akb0UUjIrE8J5Sp6uTVapfLqdKHdfIqx8K3J?= =?us-ascii?Q?uXpiulP+GEWLWKkiku+mYXl1KlvLUYEaHLyGaWdYUprRjPP1NseidfTSUBpB?= =?us-ascii?Q?TU0WVCSA9Csi7QzZ3DsTgOF2xG+PRCoaVOJApZOxLSN8BmdiAfwT9/fnGfeE?= =?us-ascii?Q?MK4G2PEneO5a2Q0ZSR3Or3njI+Oax9S2UR3JzVVDB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mqO7uRPZbAU9XtnLs04ySuECJ3epG0zaIBBjWn5zi/i0FRyZqS2HdYmB6Fw== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2015 21:07:57.6286 (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: DM2PR0301MB1231 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150925_140822_014252_4CD6251F X-CRM114-Status: GOOD ( 21.42 ) 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, 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 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;