From patchwork Wed Sep 30 16:11:06 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7300341 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 A489FBEEA4 for ; Wed, 30 Sep 2015 16:22:26 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C6F8320612 for ; Wed, 30 Sep 2015 16:22:25 +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 D6974205FA for ; Wed, 30 Sep 2015 16:22:24 +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 1ZhK7M-0006zX-9D; Wed, 30 Sep 2015 16:20:32 +0000 Received: from mail-bn1bon0148.outbound.protection.outlook.com ([157.56.111.148] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZhK0s-0004oO-45 for linux-arm-kernel@lists.infradead.org; Wed, 30 Sep 2015 16:14:00 +0000 Received: from BLUPR03CA002.namprd03.prod.outlook.com (10.255.124.19) by BN3PR03MB1368.namprd03.prod.outlook.com (10.163.34.154) with Microsoft SMTP Server (TLS) id 15.1.280.20; Wed, 30 Sep 2015 16:13:26 +0000 Received: from BN1AFFO11FD047.protection.gbl (10.255.124.4) by BLUPR03CA002.outlook.office365.com (10.255.124.19) with Microsoft SMTP Server (TLS) id 15.1.286.20 via Frontend Transport; Wed, 30 Sep 2015 16:13:26 +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 BN1AFFO11FD047.mail.protection.outlook.com (10.58.53.62) 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 t8UGD6CN005572; Wed, 30 Sep 2015 09:13:17 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH v8 4/7] pinctrl: freescale: imx: allow mux_reg offset zero Date: Wed, 30 Sep 2015 11:11:06 -0500 Message-ID: <1443629469-12294-4-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; BN1AFFO11FD047; 1:8kCYENnuIFZBTZtqAajBHQ6I/Xbl0OvNwYeRmrDcf5LxqWeq8/q4ff0fb4l3Wz59MKiGTV7aD72TA3/5NxOFP58RA8NZcVL+fOo1hKsFi8IZhyuk6CpjvuMapSRP7Yvw5NSgZHBrAopc7unROLjwlU9tpxcW5kTa9ROB2axW9dPny7Zojy/5ll0daKqnHpyhdPSQbNQw5kuvSg5gKq4eh/CSkLUwNrTt7wsGKstLcBdbUbPZD38btftR11vrJ957HjCTl0iKU9plwWudEx+F3BKwoH7eFa7/8X5abMarcgmlgkMKw2HwKnEvgMipbLqS5DjPuhoT/aq+6EDyFQK5IlwYHsgtPUJilAI45v1U1NE/cQSfDYtJDfpW/szyCuCrx93S2YLUrS4gSqRIFCd/ZA== 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)(87936001)(106466001)(77156002)(68736005)(2201001)(77096005)(85426001)(86362001)(2950100001)(229853001)(5003940100001)(62966003)(50466002)(46102003)(11100500001)(5007970100001)(64706001)(19580395003)(5001860100001)(50986999)(5001920100001)(4001540100001)(97736004)(5001770100001)(47776003)(5001960100002)(5001830100001)(81156007)(104016004)(19580405001)(50226001)(36756003)(107886002)(92566002)(76176999)(6806005)(33646002)(48376002)(5008740100001)(189998001)(4001430100001)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:BN3PR03MB1368; 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; BN3PR03MB1368; 2:0MAEmT1KKlym1yDt59q5flzSoXaUP22xeVbgTjSX7LMNrIi2kr29/EHBriR4bqLqgvIcqrFaoHekRB3SQvc3C5wBT9pD31CdZiA1wlLJ9DcLNTPakMnWihAxW7rAbAgQAYnwVwx1U4SVjcgtXtPKFUjIhCsKIjE1AWV2LVBfNm4=; 3:Si0zpT0gfj8G8OIFRoGuKynV17jO0Z5tA5uHf1LUI2s+1iUYwYjZlWTigU7t2x1eUNNFu+dFQgIDbgSm3obDVNl5kt+5l12GoiWtvVLS+81GZFXD+ZPAw6/yDLsH+Yjkxjo+qFCXAJfCiw+MvpEfWEFfI2UBjzHUUS3ZoNz0fKP0sqB6+ZK+/JKjfufNs0BT31CgHRjyJY6JOTzImsK2iFL+4lZYcwBmElZ7gDwafks=; 25:heRYhPuTCB6KzbR3esZylAQGFqZ9WWEwKq1y8l0cz7RvjcFSfLSfQw57udS43eohY99pXSOfjd7Fc0FgO7atDhBpkpfGo3Cd0WsgJg66WXRld+ETTV/x0EUIBpetuijkZ5rP9c/8WM8nPQxFSacMrz8lVuPNaT3ejIXHpJorJYqPN0bn8cS/8P0PjQfdEvSHnPo+vQFSA0wMr05mwcDzD+arMFRbdB1TsPk/Vw9xD44kFzrwTM/G24Bx/g4Awmi9RGNztw0ZSIwYkjJG+U2amA== X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN3PR03MB1368; X-Microsoft-Exchange-Diagnostics: 1; BN3PR03MB1368; 20:LRkTsGII3qnGJs75NowiMl5flCoowROQCELftXkdJ9PZwIjqksyRBNTdX3QTnkVSTEYfbHVjWIicpNVSBsdEwwfg2rTAPtb6YwGqT1KqLFVMwEfv/zhHfJzL5Fa7YQzgFzlJHnO/Hq4YaNqKfbIJu+co3ghMfx/unJNeI1bmLptr8yQOtN2lkNQzz8n2VdVYNjg8NXEDVSLCMzw+t4ZReVYrTh4aqVPh3jwJqScdjc9MmRH+ftKPwEd7yRZa3PSyrLCSBdiDoFm2EivbWAVxKzqmkuYx+uJ2QxcZ3YV1k6u6/xkxlgmGqjep4rhZRrmVeu4XjsUQpJt/m+kXEBFKqzb5jATNuunA4qVJmO6lwVU=; 4:cm8NXvXDGC2m+TGbRwWG7u0k7YOQXFEfxtWi8fLD9+Epo8Kd+iabRl7DVqchDOKCLjHmWQCK6FaKf3WmL+eELP/qjv+8zvwhFeFZdLar2iVpRHw/GcJTiq8Sc6pLL4IUhzUs2zgM5ciLf4FomYTLEOiH5+4lWIgdKreCHaapAjM7BZaYfA6qwuNdTxgRFVgDeLZK10g7uj1vT8LWzoCXYfyOi4T/jo8/zkT+meYp+o5yT6eG3VR4HuCf2Vm26lg5XzYm3BjAj8k0Sy2G72wZLoaPAVcD8MM8lUyTS6O1wbfRYAhfLonoPED0qWbKAd71m088JvT6uDfyvxTxODsKKgmp8P9pdhtusALf4c7b/Ks= 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:BN3PR03MB1368; BCL:0; PCL:0; RULEID:; SRVR:BN3PR03MB1368; X-Forefront-PRVS: 071518EF63 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN3PR03MB1368; 23:kSYmcSM/KMZd3/BA18wwIPSGiPqBEcdKscxzXYqTl?= =?us-ascii?Q?CtYWe3B3TdEKcOuE+whRH1oQ8cToEiiKADKM8UGRUHDstPcILvfZLjDAahNc?= =?us-ascii?Q?hVy1VhxO5VlzqYPDqBC6xXNuOjUmyrYG7p0owkBCCq/LpojGbTSPdwasUK0f?= =?us-ascii?Q?PpcrRVYN+uCfK+pTY/jdlYDTH5FHdnBrfwiXMgH4u0kDd+Jr3gzv9oJCu3AR?= =?us-ascii?Q?K+uLLnwiyujNurwsK7FvAMVrWUIyMkFbs6l9yYCMnEugKzaL6TyAmrKIsRSa?= =?us-ascii?Q?RMbeMXfo9xoOcATGcXjLiDmcPTH6yNrCDgqduCmyqwswjBC+Q1oI3pdi/Elg?= =?us-ascii?Q?V/lc45VpepNh7Dlpm3LxOQF21wXJpvvkCS2OnPGqeg8HDOX3UVfLQe6GovSw?= =?us-ascii?Q?oB4JyY1Qnosg2C896hL39Fm9ZJSrcUvVzjlQCcP6je/Taw5J2QKhvKpw2v8N?= =?us-ascii?Q?jMg+BNBl4Rcf81xvdmpz5lZvUAX96JNooa66EfYPd1HcYgqc7KiXsTPaiw+R?= =?us-ascii?Q?8HcdFGcwzd4VgsxSLfkUY0d3XXz7ltVAm1T5gYKPt0L3H/PSMMXqKxhxja5W?= =?us-ascii?Q?OYXLZn9NmWONGokO61xOafhGkugBVQ6QVd/qI36ZmDvauW9y3/NLQ77D3LlN?= =?us-ascii?Q?wGjjUJlykQO0/8zCblvGW0AeF65TePe+zZm4yYvQ1rdouxWKR2ov/y/EBFtz?= =?us-ascii?Q?RbPqoNXGgwXXZ1nzRLpCYu+ZI20jTn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yiCXdwFqVqfTZEJ//kJZAJ0mar0KGGVibm+8bpJteKZq+8JXWZw8XRnwXRQ8KsPBlIMcJVSKCyHA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Sep 2015 16:13:21.1668 (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: BN3PR03MB1368 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150930_091351_050508_DF3B0FE5 X-CRM114-Status: GOOD ( 17.33 ) 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 Allow mux_reg offset zero to be a valid pin_id, on imx7d mux_conf reg offset is zero for iomuxc-lspr controller Signed-off-by: Adrian Alonso --- Changes for V2: Resend Changes for V3: Resend Changes for V4: Simplify pin_id assigment when ZERO_OFFSET_VALID is set Changes for V5: - Drop patch pinctrl: freescale: imx: add ZERO_OFFSET_VALID flag - Allow mux_reg ZERO OFFSET as pin_id Changes for V6: Restore ZERO_OFFSET_VALID flag Changes for V7: Resend Changes for V8: Resend drivers/pinctrl/freescale/pinctrl-imx.c | 5 ++++- drivers/pinctrl/freescale/pinctrl-imx.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index b9c6deb..151d50d 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -542,6 +542,9 @@ static int imx_pinctrl_parse_groups(struct device_node *np, struct imx_pin_reg *pin_reg; struct imx_pin *pin = &grp->pins[i]; + if (!(info->flags & ZERO_OFFSET_VALID) && !mux_reg) + mux_reg = -1; + if (info->flags & SHARE_MUX_CONF_REG) { conf_reg = mux_reg; } else { @@ -550,7 +553,7 @@ static int imx_pinctrl_parse_groups(struct device_node *np, conf_reg = -1; } - pin_id = mux_reg ? mux_reg / 4 : conf_reg / 4; + pin_id = (mux_reg != -1) ? mux_reg / 4 : conf_reg / 4; pin_reg = &info->pin_regs[pin_id]; pin->pin = pin_id; grp->pin_ids[i] = pin_id; diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h index 2a5fe72..2a592f6 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 NO_MUX 0x0 #define NO_PAD 0x0