From patchwork Fri Sep 18 16:29: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: 7219311 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 03A3ABEEC1 for ; Fri, 18 Sep 2015 16:49:02 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 1BFC8208CC for ; Fri, 18 Sep 2015 16:49:01 +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 1C1A4208BC for ; Fri, 18 Sep 2015 16:49:00 +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 1Zcyob-0000nO-Li; Fri, 18 Sep 2015 16:47:13 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Zcynd-0007xm-Dw for linux-arm-kernel@bombadil.infradead.org; Fri, 18 Sep 2015 16:46:13 +0000 Received: from mail-bn1on0116.outbound.protection.outlook.com ([157.56.110.116] helo=na01-bn1-obe.outbound.protection.outlook.com) by merlin.infradead.org with esmtps (Exim 4.85 #2 (Red Hat Linux)) id 1ZcyaL-0001bV-DG for linux-arm-kernel@lists.infradead.org; Fri, 18 Sep 2015 16:32:30 +0000 Received: from BLUPR0301CA0028.namprd03.prod.outlook.com (10.162.113.166) by BY2PR0301MB1638.namprd03.prod.outlook.com (10.163.28.140) with Microsoft SMTP Server (TLS) id 15.1.268.17; Fri, 18 Sep 2015 16:32:06 +0000 Received: from BL2FFO11FD014.protection.gbl (2a01:111:f400:7c09::158) by BLUPR0301CA0028.outlook.office365.com (2a01:111:e400:5259::38) with Microsoft SMTP Server (TLS) id 15.1.274.16 via Frontend Transport; Fri, 18 Sep 2015 16:32:06 +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 BL2FFO11FD014.mail.protection.outlook.com (10.173.160.222) with Microsoft SMTP Server (TLS) id 15.1.274.4 via Frontend Transport; Fri, 18 Sep 2015 16:32:05 +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 t8IGVgDd032121; Fri, 18 Sep 2015 09:32:05 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH v4 6/8] pinctrl: freescale: imx: add shared input select reg support Date: Fri, 18 Sep 2015 11:29:56 -0500 Message-ID: <1442593798-11501-6-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1442593798-11501-1-git-send-email-aalonso@freescale.com> References: <1442593798-11501-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BL2FFO11FD014; 1:YPolj9GftPG8PaWfrMAUx2Zu6KpGiM5nQS18s/TTgOisYeCpjqXU3S82tywn6X7B98j8xxm8T+Pl7M012MFhozKZX4vmxKBYXfsIx8YaZaX73+HOYWRgZifhhOnUGN3vgblUI+ahjYuu/o+VdHii7CkbaYW2y2b7jPXaAWnRGMg0FSHaIVDWklNig9ci2UrDDnKWyHYWOYHBcZ4mxt4mzX6NYeTcCeNQla1jX/3QNJ9zV6x8mMX1p6+SHAvJ7f6zPiHVuzoIXMhxm9Z3A8HXFRgPy+tQ54dQ1u624wJRkK3UO96IUCDFDXBKJ1ABM1/Pa9hq9U26KVX4nnKDxMZqtzHIuu20iw7W3UXuZy8ATIo4y206u7Uh6PEDCUq7EH+KzSlmCrpVJqrtI6xy6BUfLg== 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)(2201001)(64706001)(189998001)(92566002)(46102003)(5003940100001)(5001960100002)(2950100001)(76176999)(81156007)(85426001)(77156002)(5001860100001)(107886002)(4001540100001)(50986999)(87936001)(50226001)(5007970100001)(104016003)(5001770100001)(11100500001)(106466001)(47776003)(105606002)(68736005)(62966003)(33646002)(77096005)(86362001)(19580395003)(50466002)(36756003)(19580405001)(229853001)(6806004)(48376002)(97736004)(5001830100001)(4001430100001)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:BY2PR0301MB1638; 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; BY2PR0301MB1638; 2:wGbhbqCzoF2TcBDobRVrEX5z9eOZVBo55oXhz8UoZkvZr+R2cEaou739IFIZEZESSw4fyZ0l08TUUHM+zCwM2zp+ykVi6s3wIuGG0353BsfAOq+kmQBJPbONVlZDr/J8ow7mmHeAhbcK8eBXTgTrrnFBfq9VDj0OVX59oJrZ9Qg=; 3:nr+ULF2dEtrfXUfFS5SrP3VpyJzzkgkmfZdVPOsY8uJ5m5M/aHJAL/mRVSOjAqfT7634AfOag2t7uqK5n355HILMZHEuNR6Jt1+D5vVf3ClRpMOX6eXEZY4osNhC544xTzHH20hbVpamAZuMoks19xqJNJkHS4pal1KIvz2W0Sh+tFucjFcTDF6a///seU6GMh7x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+Zx7GuPcjCA4KYo/k7ZQZ37wO+Y+QaHiBfd6alqvVkZGyPSyq6nKRXvxU0e4so1xj794Ucg+sL563ir1tVb1 X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(520075)(8121501046)(520078)(520058)(3002001); SRVR:BY2PR0301MB1638; BCL:0; PCL:0; RULEID:; SRVR:BY2PR0301MB1638; X-Forefront-PRVS: 0703B549E4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BY2PR0301MB1638; 23:rGJ7UifeqPFFzN8J2cqueiwInlKvVccZjM3d3Xt?= =?us-ascii?Q?DC8XgIYZXNtrvwO32VkOjYLN9bIwCD0HMzuoNl1qJ2yn3R9E6o53HDO7ZiwR?= =?us-ascii?Q?fR6YkfH8wUhrRWn/HYqy+Qlykjqp/X2T9a6DtlieCVWkfvhg7cWP12pshj/g?= =?us-ascii?Q?ADvdqfP7d6eHmGKD4RemM1QpCekrB/UTLk2rnPFAufYSqFpLH5Ln7ulFi+bI?= =?us-ascii?Q?TXRDXkrHs0UxhTz+F9dmnOJvqLsq97oNjoHtFAf94uxC004fzMy08k81FKge?= =?us-ascii?Q?5FUzZrD22bCG6gkiHIQb0shf1VXEZ/zroY4YvtM9UzkgCiMPxeYNfgwJn9zD?= =?us-ascii?Q?Jnh22Cne2u/Oc6BdqQ7zjJMVBZ3n529/HZBILWUfQurBHZs7QMpNq9UBusKN?= =?us-ascii?Q?8bQyghfcRPcd3nbo+TT5pnFmyCrdidaaSrcNVfWOYYbpmr+OwA9gg/pBjqyU?= =?us-ascii?Q?ZhVHSHvI1IoayQocOCiaDwxYPWuJRYD6BKd3fj+u1uMXX13KJyHlEBcmIpbs?= =?us-ascii?Q?2bCcCK/d91WcZALmh+Kr0efdocgrsVQEDGlx22VLSshArXKIjrkpYoXiVCqH?= =?us-ascii?Q?+OYRTeM215RRydpqEuvDnD0qTMqcRw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un1WOeu6eFhOGz+Hx/Pw/mIu8vi+HyLllHk4KotIFxUlQOfuhsPEdPIHGSF9R3Dq4HcWGD39AKYLyc6wosjHEs57jM2SFrhwO+qrLkQ8E=; 20:Kx502+23xxDqJ6wMLGD29eWHolRB5LQiZ0GOJiR+0tn0c684TEOh4N/yHDM4w4T35zPGNNNBdMtMc09nI8eGXg== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Sep 2015 16:32:05.9674 (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: BY2PR0301MB1638 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150918_123229_642291_2DB67047 X-CRM114-Status: GOOD ( 22.81 ) 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 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 866d864..619915f 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); @@ -687,6 +694,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; @@ -712,6 +721,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