From patchwork Thu Sep 10 19:21:46 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7155651 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 99E51BEEC1 for ; Thu, 10 Sep 2015 19:26:52 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 9F54D2085A for ; Thu, 10 Sep 2015 19:26:51 +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 AEB4E206F4 for ; Thu, 10 Sep 2015 19:26:50 +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 1Za7SU-000281-Ij; Thu, 10 Sep 2015 19:24:34 +0000 Received: from mail-bn1bon0137.outbound.protection.outlook.com ([157.56.111.137] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Za7SE-0001uC-1h for linux-arm-kernel@lists.infradead.org; Thu, 10 Sep 2015 19:24:19 +0000 Received: from DM2PR03CA0007.namprd03.prod.outlook.com (10.141.96.17) by CY1PR0301MB1227.namprd03.prod.outlook.com (10.161.212.149) with Microsoft SMTP Server (TLS) id 15.1.262.15; Thu, 10 Sep 2015 19:24:02 +0000 Received: from BN1AFFO11FD034.protection.gbl (2a01:111:f400:7c10::122) by DM2PR03CA0007.outlook.office365.com (2a01:111:e400:2428::17) with Microsoft SMTP Server (TLS) id 15.1.268.17 via Frontend Transport; Thu, 10 Sep 2015 19:24:01 +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 BN1AFFO11FD034.mail.protection.outlook.com (10.58.52.158) with Microsoft SMTP Server (TLS) id 15.1.262.18 via Frontend Transport; Thu, 10 Sep 2015 19:24:01 +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 t8AJNfTV019448; Thu, 10 Sep 2015 12:24:00 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH v3 6/8] pinctrl: freescale: imx: add shared input select reg support Date: Thu, 10 Sep 2015 14:21:46 -0500 Message-ID: <1441912908-21946-6-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441912908-21946-1-git-send-email-aalonso@freescale.com> References: <1441912908-21946-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1AFFO11FD034; 1:jBEu18bmhqciLjkYczYXAjFRcxDNkLJ0U7jqCgjWRys2xIwhvpjzALAnVM9ZFXbVXKq1dOs5X58nD8MMLDG/ArYHjfaVlaRBun80R9V61S+Zu670AZKMKhgNBTaLDdX8bkYTbL0iW93xMjeKrutSRv4TUMUHr4odZISHcnoKvJkbCWP0arGM9YwPI0WvDPf8ddMPX+cXfl3739oG+QGk6EwHGs6j+nskWRcueDzbKFn6lihgnsU/nMqvnyKQxCNUOrsI+56qD+ViHvwMeKk0B2nYHb3SYh3ZWCZqYsnOloNY+O1nyfAVIxcNN1ZhXOuYcop/3AJaCBP61Lb2sXsQrSj/0EG1vBjvlxWVyTlVTNSW/zotrfJ+YhwMZC/aPsIsTHIe5C57UkpMEDo8X0s3Tg== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1110001)(1109001)(339900001)(199003)(189002)(64706001)(2201001)(47776003)(5001830100001)(104016003)(5001860100001)(6806004)(229853001)(97736004)(107886002)(81156007)(5001770100001)(19580405001)(19580395003)(5001960100002)(50986999)(36756003)(77096005)(33646002)(68736005)(105606002)(87936001)(50466002)(189998001)(86362001)(62966003)(4001540100001)(77156002)(106466001)(2950100001)(76176999)(92566002)(11100500001)(46102003)(50226001)(85426001)(5003940100001)(5007970100001)(48376002)(4001430100001)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:CY1PR0301MB1227; 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; CY1PR0301MB1227; 2:4dRkV3QcYdZtlU5v9xeKN8CKFPFXVosE/VkzeMjn6Y7RXi3tmk9syX+eLdij4NKWKkKwFPrXGr4G2CFBlZfdMOaH9rKgiQiybtnQLuTa8/mQl8UgWNeSJTpdb6U2+KaSRN4Y/S0azqz8PZqPKbieqhNGvWzcwnNAWOHXSYAP7WY=; 3:WutnrhltJJLhHZbmrzla1OckOAkGFgzaTs36E6v/9SV77O86VFciN2+05o6E5zUrLfpzISa9y5cR4eHRb9kgPJhi/ipGo5TqE58LH05Bx2YJjlJHk1ku+5fTGT/g+hyXL/LKc8CH0/38tt4BowfG6ga5KqGgYqdgtzcW4wQBv50wKBm4lXrnvUSeh9KczhaUOl1T2cmAufgbhPofz6c3TLed6UnNBDubNGZ7Yd3f8pY=; 25:XPHQIbQd3Bx4YWiD5rQrRX79kIG4cOUi91fVluYc02YuWXy1hKuqSXUwrPsnrslkQRd5qf1Av6gSz5ZlXixUrEhA0tvbWpH0kHb1/Aeh8IsqHvjmMF71hwRZqlOrrR/c20V56U/vQsMYd3IhplAsgetJwuSNuSKYPZuVkYZzg9OJjYtuJYfTxBFv/FGWmwndZUAVTwJnGO7ZYYSPIJeXe89QLED1BoE5fQZP/qKFqQJPv4DxWCWIH6hk89on1B/wotHPfQq6vCRjkjAf/j497w== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:CY1PR0301MB1227; X-Microsoft-Exchange-Diagnostics: 1; CY1PR0301MB1227; 20:OlNq4CZHie4xTu3q2scjPgXecUHxG6KCTp1oWxneJze0pY8ZEk318odk0xxaTLSAr2CjB8vRppGk3NXH4LEw7qp5meA9xmbEmAoD80rtZ4AJTHzGu/VIbNWY/9Qy8FUWemAvTNYZvoP/xpz/sZOMYivP+i/R6YpouVShZYq+ruhxak4Rwl+t8c8Rnmhw3ja5ewzN3qkuW/frBE0j0okmM0QNqNcBY9CO0ceBfM2F3m/oEI0C1kyTtZu2Yj80wv+p1CdWY2VdiE3vt/YD4evd4NDOAqDSPkc+9ldilyNVEkwyll3SItpK7I35Xng8kE96fwZoRONF7MI4HzmlLMYN2SKAipTuZ+sga9qW+NkOjCc=; 4:sXcWBef2bBqCMVLiA+cDhXDieK6XELWeK0ikTh6KkgJB8BZ4lJYkjVnZ0iscHhrtpV0gRl3JuxoYdt+jLm1ZpVGrPQm23NPe3VkFl1VbmTuZgZy809SnESciUA2C6RMbvERunPbRu0K3bVIt3rR8HHTpMz9uNMf2RKVSIOsfJiQOxLHCpp+Y86isw3f5VlsTGKNx/G73EzADW0ztMBRn+CA4/QSquodjCuNLqvSc7P8AKMmv3mUjF4sc8a/oBIJbRvNLakDMI0oOUuOJuBAtGL//BrGdo0Zz0DcODopl9+MSCHpsStY7yiLcVj7No8ef 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:CY1PR0301MB1227; BCL:0; PCL:0; RULEID:; SRVR:CY1PR0301MB1227; X-Forefront-PRVS: 06952FC175 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; CY1PR0301MB1227; 23:LyCOn3Zw5IP5RIlJrSXXkJ1njayGcmz586eM0W7?= =?us-ascii?Q?y/HFdQ3phxFsdwwq8Aya7ioZaLlTQRM59VdWe21gIaGQ3nhLjoUgu4g9gHiJ?= =?us-ascii?Q?CNna96AKmUL/kPT4uqT1A879wM/gb7Hki3LwHwUREPf6TPZ2X7GIQndp72UU?= =?us-ascii?Q?l0V8S3S1BhiFuGZRGcLJwD9AJf253jb8eBXr3+GuIs+ERNFjvDwbAldR+STo?= =?us-ascii?Q?kc+wCQD5CaSnyx2KmHc0rakaaqCicQAdJVC7VmQuIiBdon6S0fY63R2kQLcp?= =?us-ascii?Q?hNHbzAYiLRRNQAykmqpPlrnu/rKm271PbFG1BKLQ+cvH6+UdpSMeDtZQKU+r?= =?us-ascii?Q?ojIJTV864KPb/giZuvrzatUvkqmsQMl/I53QP8Uup/o8sbq6XCZ7/iTHAvAw?= =?us-ascii?Q?DTWfrdEBVpjsSUEFEWPHhxtGXAgKfJVvTIbMo9pQuJ88vt2OFFq+wLchOUr+?= =?us-ascii?Q?usAWi0M1UJryi6BJgY4+V4pbzhs1Y1bXMLQX0JVBZrMs7l3tpjoedxYopZ8x?= =?us-ascii?Q?TB3qboFSBsDc99LKuoy4x+Qzr1f3ZEXupJdR7svvZAktnFLdiMWUcUpZM1Mk?= =?us-ascii?Q?6SkizsCAA+ywZnoM38asUHpQBXPC2U0YxqwfVP54GQfEk9Se/o7zrd1w2rMH?= =?us-ascii?Q?r/LBP3kTN0+Ut57kdKHW5MF0hjUYeGnuyqae6YB+gYeYvVimskvl9Oa6EJai?= =?us-ascii?Q?gMsmDfYha1JpqP6Z1kpykeLZF8u7+CMiPPNhfO1pNcsn56HWWmZ0B7cUEYOO?= =?us-ascii?Q?htT97V+r8a6ubq+GQlfC7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X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Sep 2015 19:24:01.3156 (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: CY1PR0301MB1227 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150910_122418_277050_717C5F06 X-CRM114-Status: GOOD ( 21.06 ) 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 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 5edbca5..b39c1a0 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); @@ -690,6 +697,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; @@ -715,6 +724,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_parse_phandle(dev_np, "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 input-sel device node 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; diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h index 2a592f6..3805476 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.h +++ b/drivers/pinctrl/freescale/pinctrl-imx.h @@ -86,6 +86,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