From patchwork Wed Sep 30 16:11:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7300371 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 CE2199F536 for ; Wed, 30 Sep 2015 16:22:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1A0F1205FA for ; Wed, 30 Sep 2015 16:22:55 +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 276C120612 for ; Wed, 30 Sep 2015 16:22:54 +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 1ZhK7k-0007Tn-Df; Wed, 30 Sep 2015 16:20:56 +0000 Received: from mail-bl2on0101.outbound.protection.outlook.com ([65.55.169.101] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZhK0t-0004q2-Le for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2015 16:14:06 +0000 Received: from BLUPR03CA011.namprd03.prod.outlook.com (10.255.124.28) by BY1PR03MB1369.namprd03.prod.outlook.com (10.162.109.27) with Microsoft SMTP Server (TLS) id 15.1.280.20; Wed, 30 Sep 2015 16:13:28 +0000 Received: from BY2FFO11FD051.protection.gbl (10.255.124.4) by BLUPR03CA011.outlook.office365.com (10.255.124.28) with Microsoft SMTP Server (TLS) id 15.1.280.20 via Frontend Transport; Wed, 30 Sep 2015 16:13:27 +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 BY2FFO11FD051.mail.protection.outlook.com (10.1.15.188) with Microsoft SMTP Server (TLS) id 15.1.274.4 via Frontend Transport; Wed, 30 Sep 2015 16:13:21 +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 t8UGD6CO005572; Wed, 30 Sep 2015 09:13:20 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH v8 5/7] pinctrl: freescale: imx: add shared input select reg support Date: Wed, 30 Sep 2015 11:11:07 -0500 Message-ID: <1443629469-12294-5-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443629469-12294-1-git-send-email-aalonso@freescale.com> References: <1443629469-12294-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD051; 1:K92vl5qA596iQj/mBkiEIh2z6t5L1NZ+6vetHxRZMHQaA5156jigejeaYHXQ5gAwsK8E7k7Whg3N/6N9WqJp9CKBnqeL4lyUipv7ztv1sIxD+2aWgBl0TeeyuCxqz5HDe8VWKUYKrZ9RC7kwCz5TlIy5hosh3BzZcDdHCrxZmk3ttJk617vr7uvBnSzGmjkzp4x5YoWmUV2o9fPuAVxa7x0uiyjoV0uznCvrdaETsdbevKV4BaK5Z2UOnpy0Tip0wCfUoenlOdipgL8G+ph8P72AUSWoaVkImr5OHVgNpJD7qnoVqi0SqR/sZcLwy03CUW6wbxc/cxR+yG8JGfZbzoTybAWCAe1znGsZcXb1XUol3nWsUwCrjIL4NW+aQXX6hcyNjOD+qcDcGYqN6vRgsw== 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)(107886002)(62966003)(229853001)(68736005)(46102003)(189998001)(5001960100002)(77096005)(106466001)(5003940100001)(36756003)(77156002)(5008740100001)(19580395003)(2201001)(48376002)(87936001)(50226001)(97736004)(6806005)(105606002)(85426001)(19580405001)(86362001)(81156007)(5001920100001)(76176999)(33646002)(50466002)(4001540100001)(92566002)(5001860100001)(47776003)(64706001)(5001770100001)(5007970100001)(50986999)(104016004)(5001830100001)(2950100001)(4001430100001)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:BY1PR03MB1369; 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; BY1PR03MB1369; 2:VJ7DoN5JxXq/qBoU7PpYmdZgL4crg7H3eJ4fPV5NWVFuOrgLFnc6yNLsvH8nmOirj9qNLn8a/5c5kBxZnDZEuoNeCLUmn3XgJIJdhNqGUD2lmRJM6l+1pISp2SNQdbWpIsSp9bBSipIWhAgsYyjDcifYr8bfoXWNjbRe349nQxU=; 3:HmZybzaJmle5EDZ4S0di1bE5ZLJ1Kq9F/qxbFxvuFVpRX5o7lOh2WJ4MNMuYZHlsohHvcDDjoSxm3vTn17VXIURsIvUoR+gGbqhevA1CD3OJPLVeJfjCIk1a3srZ0SonAfvIcQW4RHEzMcnWyi4vEVb1pgZDhG0keITPxvXSvndzH2FvpWyl39e1Cs08I0epq4+pQrC8Icb2xgKHzzNS6tHcu3+5Z0aMDacK0NPVxbs=; 25:KJ7GbnTsmo3iJFlivXF2YtQ+iGdYwR/GSGDBqmDuP8eb/N9+SaQjS3PjfJbmgFnQkBkLBXgl2k6f68e60n9xOXgBj5coj50n2/qHJgkMu0HpRJRdYtAthvK7Ie6pq7pB294MJ0UGvb33dtB5GI7MqkZ4PQToAF0ONYk6RSt6qSmVtYtDZm3sNxv1oUAaO+IZWvOm3RQrUEVeQ9c3dwO1yfSEY9K9O9d3dlZV80Ljn94CA2tCrZWV4828XJEUyaeS5EIwT6PgHB5UmsgoJ/Jphw== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BY1PR03MB1369; X-Microsoft-Exchange-Diagnostics: 1; BY1PR03MB1369; 20:2LS9Xx4sWseiSH30ZMpiLqkN6NYNRyRiBnHl4kT/64AADb0aoQtdnsBnsslRysAm68+0WzmIYqWKEbdIfdpU6TBAOkrmUrzg+gv7Zsi6M9RDJHZzu5Qvg5DxbJJ9U40pewcu790FA6ZbOvcxPdDA5fA7DG/t3H7FCNMfIt9OFSmxQDpWIRb4PzfWFA1Ptla4Yn/mMgqnQk2DJgLRHvDISny7OM/G9MQ9Tx+PMtywqXDw32swHbHzImafBuaCZZCN0Px7DZhdCtDLnZd8o6xvvSql1G8KI2rhGbOxb4FmtUjUqGCyikyAMTTlf/PRqVSO2EETI9vLDQ4qtgGpfaU2hKZfiqQVmdqmSMr4fxAxAzA=; 4:F4hRxXgaxxr+NVfqvi9Z4Me0vNr8N+WIsO4ytnMyQrUcfBuS/bQERnalwZK4Y3yBhKCWK+Mx4+738ZYEVJ5PWIdz9XwkOy/tWn3ex44iffwFb6lzudo17QBXhwBzt0UTD9PzZ0ZzRysIOzwUWPutZj/jL6+cTFyboMvcauoKXjTJsjP2bYabyom5cyxoq32Y3I76NecksmKHWyEORfS54/FObS+8mB0ZWL4keLwy5zh0w+6yubB3/7owDFlKH/UA6whfn8zr9kf6/nUg8UlRShVZUdkN/FqLtKd8PsXyu7171CAuUKkOcMRV2Rp9etcV01fDz83S9dym1TnqJN/7JRZDv8jbFnXI9tjzh6FuP8g= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(2401047)(5005006)(8121501046)(520078)(3002001); SRVR:BY1PR03MB1369; BCL:0; PCL:0; RULEID:; SRVR:BY1PR03MB1369; X-Forefront-PRVS: 071518EF63 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY1PR03MB1369; 23:vOjl5sUQ1K9bkgj/RrU/+SRJ74z3taofSsRS/NFMw?= =?us-ascii?Q?cKPyoFWTFLsVei+Z8Mw5WHI6JwS4fCZCVRe9Lq8XgunaOjqx07BLvb73Emsg?= =?us-ascii?Q?5zTsup6OO6yD1bjwq+SZAYZtuyswE3FUcN5tbOW5MxZo1RRG8j9uHSoTwIZt?= =?us-ascii?Q?xkWFDsGsXNFI4e2jnD93yWppw7E3JQbEnIMpKOupv5Cy6LNyWs9SI4srdVJV?= =?us-ascii?Q?qh5VXHV/tugSVvbbKad4fKrlcwI/yBRxiH8a2erHRxa1nvLHGj1e/LcN+LQH?= =?us-ascii?Q?71io+NuYecVb0+9IK1ejTTSkMHvqCVE4CMaSNMWk4EAKH8B0VwHBGsONltM5?= =?us-ascii?Q?jYhVGnxPKXYDdWvZSWooWgiVSUZDrzP2XY+SacJYFZCy4hFMKGCfLXD7zw/L?= =?us-ascii?Q?6Q+QPotcjZTdEpoMghGaj95gevzJ1WK4QwcNW7aCtCcnnlYnGPZEltvVj4bf?= =?us-ascii?Q?BEVSBiG0lQ8B4CnyzPBt65mTtp5s4DijzVNF91IKSfKr5RQvS93aUlC6sYBY?= =?us-ascii?Q?dD+dZI6M8HC2QgCHTW68J0gaqDctTFbCDoEffd8uCuoDJBezLwcd+giQglcp?= =?us-ascii?Q?PT2WXzzQHCb1jzyMXD4M3cKepC1v/z3pWZ6syhQoZcUyhIapFfL7ZDkHokmx?= =?us-ascii?Q?fhdml6O/pnsU7taVDx/WiDr5s/QXBM3ww89rFippnpkY14Fi3SVWDrFtWiX3?= =?us-ascii?Q?wuuL/+KWoD8xcOWhczLEv53AlEgE4enOOOAZsI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YO3mAUqrJw2eBfdSdiA5bNFWYIsVAisM39/WpaW8DopGNp3FvJWuEU43uO5A== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2015 16:13:21.3920 (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: BY1PR03MB1369 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150930_091352_659773_BDDE067E X-CRM114-Status: GOOD ( 21.85 ) 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: Aisheng.Dong@freescale.com, 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 Changes for V8: 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;