From patchwork Tue Aug 18 15:48:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7032001 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id CFD64C05AC for ; Tue, 18 Aug 2015 15:53:24 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E44A5204EC for ; Tue, 18 Aug 2015 15:53:23 +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 EF69C204D6 for ; Tue, 18 Aug 2015 15:53:22 +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 1ZRjAV-0003Js-7G; Tue, 18 Aug 2015 15:51:19 +0000 Received: from mail-by2on0144.outbound.protection.outlook.com ([207.46.100.144] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZRjAG-00038E-5E for linux-arm-kernel@lists.infradead.org; Tue, 18 Aug 2015 15:51:04 +0000 Received: from CO2PR03CA0026.namprd03.prod.outlook.com (10.141.194.153) by CY1PR0301MB1226.namprd03.prod.outlook.com (10.161.212.148) with Microsoft SMTP Server (TLS) id 15.1.231.21; Tue, 18 Aug 2015 15:50:40 +0000 Received: from BY2FFO11OLC003.protection.gbl (2a01:111:f400:7c0c::106) by CO2PR03CA0026.outlook.office365.com (2a01:111:e400:1414::25) with Microsoft SMTP Server (TLS) id 15.1.243.17 via Frontend Transport; Tue, 18 Aug 2015 15:50:40 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11OLC003.mail.protection.outlook.com (10.1.15.183) with Microsoft SMTP Server (TLS) id 15.1.243.9 via Frontend Transport; Tue, 18 Aug 2015 15:50:40 +0000 Received: from bluefly.am.freescale.net (bluefly.am.freescale.net [10.81.17.130]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t7IFoNEK021180; Tue, 18 Aug 2015 08:50:39 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH 5/8] pinctrl: freescale: imx: add shared input select reg support Date: Tue, 18 Aug 2015 10:48:56 -0500 Message-ID: <1439912939-17535-5-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1439912939-17535-1-git-send-email-aalonso@freescale.com> References: <1439912939-17535-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11OLC003; 1:cw7jXe4iqSzp+uOzy0/M9Afhkke3+4yLpRHpq/femB0brGNpPF0wFvG4vVrjQ2vS/0vm/6DTvW4vVsSOqMXkTRYM4auTAY77KjAX+m3SyTSoDEdHhSgIq5pydRcX9N0kBW+WRZEQoj8SzuVeQXWVGDjOn6Adb7tM1gGkTRe7wLjgTKLQrACxZsMRoFAGINmgXxqSK9i67t29BsjYGf0kS0dvLZafZpkLToM2YxnZR0t1t5HjczezkEbr4ruWezkBx50Ydxbtz+Ak2P92qCmTghw70m4Jnu/h+RSxJBJJDCcxogwyQ7inA76rC4O7t4ZSdMjZv7BeOqV+tgp+ClmIoD07wI6dMDC1d3+MFlNMa5Dyz1XLB1nxjrt52tUIk+MhnLwKsfit2dldKPk8GjMc/A== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(3050300001)(189002)(199003)(6806004)(5003940100001)(62966003)(189998001)(50466002)(92566002)(77096005)(5001860100001)(5001770100001)(19580405001)(5001960100002)(19580395003)(2950100001)(97736004)(48376002)(229853001)(68736005)(4001540100001)(5001830100001)(77156002)(107886002)(106466001)(46102003)(50986999)(33646002)(76176999)(81156007)(105606002)(36756003)(64706001)(50226001)(69596002)(104016003)(87936001)(86362001)(2201001)(85426001)(575784001)(47776003)(4001430100001)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1226; H:az84smr01.freescale.net; FPR:; SPF:Fail; PTR:InfoDomainNonexistent; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1226; 2:5F4p96RK2+4Dhq9oFuQJIE/UEkjKXj1SukZe3VvBjvwev3dyuqOoitN/2S9jlpQ65CwS/e4QMGpXIlr9q1l8vnHQdq1uLISQffZRTX3V1rT8wbRVDN/T3u6//Qce3IYOy52JA9ykY/Y5/GwBkRB/ZypcBp2GdBsR9RMemLroEHc=; 3:j3/F3OFF4xwakErJLRirZUC7v2redvvU/g+DgiyIJyJh3B2F8fl0rjtbJPisdS08C6rEndaN87k8P71Bx3G3qk2BgTih+flOqoNid+Z+4mlcGdDtWcFToYYY1Sw1TCIKu2idxn/FKxO6unrudNatBx3mH3zUDEv4b1+MU0O+rWZYUvd3hjr80drx4dARyGAE3PXnDmZi510vKTK8mWI20nHwzMVWDCgaHW/PCvGQRiw=; 25:5Tw2bL58jOQYDwB2Pad3WVBx61NiR08VIyQr83Jjom6HIUrz2gRjpcy0YUBNnV5/boAHxwmqqpAbX/qKoqHMwF+D4Vn5wcQmmejmxrWYPM8iaHD+rIxJWu3eTRG/oFnAqNTPjDdx4Ldx9VWl5HEEI52ImRs66c6OKcLLe83+8wBlN95A8xCxrZfjZW4h67SzcWpJ27zeXOm3MHeCUNhZS/7w28yyzW/Umw03spFh7zsDewAoXW6/vurbhvKi4hMZ8TLJLv+LMQF9EtlfJw4iwg== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1226; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1226; 20:Zrbol7AM5HMxJExPFwim4XpTocHx4TgiVJ4XEiRq+vGFDPBoPTYKxsTFVSljOIJqKY9a/90vY6ZroeQXrrICIOne5l38D22beIqYsytIC+auKiHIExxpW+top/Eg8tHPsUaNu9ol6sA9TrzAgNM1LdMbc2iBxXOx4Xf3XK9MefnOZSDXOMnPVf9ScSN7UkaKLeJSEf+RhWTTURUyweoSH2Lre7vCxwsqkQ70MHbklrLmzNzcpmwcOo542ZpAoH4h49jSN+dN/meLHyLbKPrU4dsgwZiVzzU1k1YLuGxTyb38SjZrOs0wIWJRutg+rbWht9GBwFod7HvKpDy5DKmGSSezlwFsaZ80WKqbeAOofLQ=; 4:UrAaFrURh97QHBBuu8qwvmF9IbeP9QmDui4HUkjVWdSSJgxFsz5hP+Mn26qGvsNhFyvFEANScINuoMmVPToZnrzLxt+if9tutWONkrmAcOJTIN4MK1M9Y+i5NuK7H8ov5nTAi0Xj4EVqCwEDGQ6t9JaHyZ8DJ47cirml2TU6liwD5by0ODvlgYWiYEnNW/vw4Vd+Yc3G8+eEd+xzFgUIoGbqKv4ZKFFRT50nOLYmLpAgQY9I4mLZNw5yOOu+bY57cnHfnIo961ujOLha5y8DqSvcITGqZIdh0pzxwyhmF5zxgulPaKTgK2uGYIOhxdrR X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(8121501046)(5005006)(3002001); SRVR:CY1PR0301MB1226; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1226; X-Forefront-PRVS: 067270ECAF X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1226; 23:68ZKX/18+eLIqr4QA54k0ZUBxBrqy0+NEACb+0I?= =?us-ascii?Q?C8gkwvs6NDeQ2kcxx5s8wQZabH2neaB3HTE40odF0+iLdk/8tHVAdvHy9HMV?= =?us-ascii?Q?D45awgn/un+Ah+OfpN/kBopNnuU1sy7U3zUJCXXtZFDmzSL2d8768Rm5eCzp?= =?us-ascii?Q?V0dCxGJ4F/7CL3ql6YvotZ2J83fpg9u3blL76MwaQGAGHU6xbi2Acr4X4TfB?= =?us-ascii?Q?KeeL4XppNTQT+vmBH+qJBQBdxIgPkmm4BDny1NsTNcSnPUT2LWmoPYTdMvej?= =?us-ascii?Q?gl+qd+lBOevOqgojuPQVHRP5C/yfzM/JIU3NP7R7nT2nWjktfeTOq2D91q4J?= =?us-ascii?Q?l44Dw9S6xEhBWPGfo/m0E5jsLpWguDypSWn934ELaucBUgVS+zPfbuWVBjW5?= =?us-ascii?Q?Gn/LkZ904VYvvaUMwH34vjSZJRN2M0T0yV8U/ErpxvyZd5hf3Tp2/ZHtKgdl?= =?us-ascii?Q?5mQkpSRhu//7+1OwfzByCokNdCIpnR/36qfeuO8P7XARWep+P0b0gJsgLiwS?= =?us-ascii?Q?W73r6nVxBOrpE7wR7AGdZBoYbG8nKCwAetTAw0wra4maULhBoOiSkvuy25Px?= =?us-ascii?Q?Dg6TQHFNytW1qt0lIln/tL36B44jPvNMQo9SeV40sQbA/hVUm4sK+2rl2FPM?= =?us-ascii?Q?jsv1hKbmgcq13EanGYA/SfZc1uoA6r/WYa8Ut0lFzMETcj1UnkYG+NwK8OWf?= =?us-ascii?Q?vvwYTRfUFmRw4SsyMDpoTxPdr6lb47DaavUo7+0MSwUCTzo8E3BMRoC0jDCO?= =?us-ascii?Q?kHpOOu7WeOM2cv435SDPOInWeWO8edVDVa3XGcHSxu6gHtrxKpWNvgtNtfRI?= =?us-ascii?Q?1jBVwMaEwlmdjWlMZeoS2VorZitN3FOdTpDtnxvx3TBCkeQ9UMxhhDw8H+jQ?= =?us-ascii?Q?YfhG/ewcRgXVaSjU2XiCHB4VsK8uTaoClF7hAKn++uoO9BoykSi6EH/Cn2FO?= =?us-ascii?Q?5lVtqX863QYwYfauCSfLwXCtq3J7kh7moJIbAiFWJdThlKfcwNt/nNZZQdid?= =?us-ascii?Q?sbsmba8AQw8TNxVhDLXUkdRo6Q1DmHKNJG/1VivQ5ZnPuHTDpbm6PN/wOXeo?= =?us-ascii?Q?R03UP84sAguo2bztKV83LeL/fMyi7zti0lIYncs8dW7G0cei3DK9wKTbMors?= =?us-ascii?Q?KteGn9yRoybxpzfuLwjCaOIFsLP/YSYfhV+05lzEbctsHG6LibOTnmtHlDA2?= =?us-ascii?Q?9uxaSksrjE67X1zPh969fapFGPJWVr6u0J3mREQYhmv6sLJ26X4kxOkwuFQP?= =?us-ascii?Q?Rqwx7l4Ru/kNHJcIag99mXVvX5QpfA3Ul9shkG+hK?= X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1226; 5:smHMZFYT2A2ef2+rnK1Tdu+lAzvwDcKUj7FUXBHFJsBbR6ASEUuA2h9Kzj05MiIr2T+loUyZv1awgAJ56+RuoVKpL6h4QFDOBLX8O6de8pDHxdt9qvHbVFFkfVwaA+RvIbVJ6jEktcHMoZFmJLY3Ew==; 24:AgxLWHKlJnfpQ9cxORrMl1feweuW9gt6oautbJIHHQKMha/J844feHXRU3avlD0l/Dg6u8N3deJ8kigEA5IvWLo78wiK3cveI+JxA4UuWio=; 20:zSUeuCU0k/rlzwPaLB9LN2PbEYcoy/kDp1ZzFmRSDgPEacEYbqgAMGS/SmTdQNjiPUzGVfLzoPro2U1uP5L5aA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Aug 2015 15:50:40.2443 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR0301MB1226 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150818_085104_302423_80A9ECAC X-CRM114-Status: GOOD ( 17.16 ) 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, 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.6 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 --- drivers/pinctrl/freescale/pinctrl-imx.c | 28 +++++++++++++++++++++++++++- drivers/pinctrl/freescale/pinctrl-imx.h | 1 + 2 files changed, 28 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index 0440b0b..1009b52 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 (info->flags & SHARE_INPUT_SELECT_REG) + 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); @@ -691,6 +698,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; @@ -716,6 +725,23 @@ int imx_pinctrl_probe(struct platform_device *pdev, if (IS_ERR(ipctl->base)) return PTR_ERR(ipctl->base); + if (info->flags & SHARE_INPUT_SELECT_REG) { + np = of_get_child_by_name(dev_np->parent, "iomuxc"); + 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 base address not found\n"); + return PTR_ERR(ipctl->input_sel_base); + } + } else { + dev_err(&pdev->dev, "iomuxc device node not foud\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; diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h index d22b8f6..85c701b 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.h +++ b/drivers/pinctrl/freescale/pinctrl-imx.h @@ -85,6 +85,7 @@ struct imx_pinctrl_soc_info { #define SHARE_MUX_CONF_REG 0x1 #define ZERO_OFFSET_VALID 0x2 +#define SHARE_INPUT_SELECT_REG 0x4 #define NO_MUX 0x0 #define NO_PAD 0x0