From patchwork Fri Sep 25 21:05:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7268031 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 9169EBEEC1 for ; Fri, 25 Sep 2015 21:10:29 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id BAED42087A for ; Fri, 25 Sep 2015 21:10:28 +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 79DFE2096A for ; Fri, 25 Sep 2015 21:10:26 +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 1ZfaEL-0001B3-Ly; Fri, 25 Sep 2015 21:08:33 +0000 Received: from mail-bn1bon0141.outbound.protection.outlook.com ([157.56.111.141] helo=na01-bn1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZfaE9-000157-7V for linux-arm-kernel@lists.infradead.org; Fri, 25 Sep 2015 21:08:22 +0000 Received: from DM2PR0301MB1229.namprd03.prod.outlook.com (10.160.219.18) by DM2PR0301MB0653.namprd03.prod.outlook.com (10.160.96.15) with Microsoft SMTP Server (TLS) id 15.1.280.20; Fri, 25 Sep 2015 21:07:58 +0000 Received: from CO2PR03CA0039.namprd03.prod.outlook.com (10.141.194.166) by DM2PR0301MB1229.namprd03.prod.outlook.com (10.160.219.18) with Microsoft SMTP Server (TLS) id 15.1.268.17; Fri, 25 Sep 2015 21:07:56 +0000 Received: from BN1BFFO11FD034.protection.gbl (2a01:111:f400:7c10::1:123) by CO2PR03CA0039.outlook.office365.com (2a01:111:e400:1414::38) with Microsoft SMTP Server (TLS) id 15.1.286.15 via Frontend Transport; Fri, 25 Sep 2015 21:07:56 +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 BN1BFFO11FD034.mail.protection.outlook.com (10.58.144.97) with Microsoft SMTP Server (TLS) id 15.1.274.4 via Frontend Transport; Fri, 25 Sep 2015 21:07:55 +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 t8PL7nje028753; Fri, 25 Sep 2015 14:07:55 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH v6 3/6] pinctrl: freescale: imx: allow mux_reg offset zero Date: Fri, 25 Sep 2015 16:05:59 -0500 Message-ID: <1443215162-13716-3-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1443215162-13716-1-git-send-email-aalonso@freescale.com> References: <1443215162-13716-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD034; 1:pSKcekWR0OSP8BUf8mdVLRMQqfZoO06Q5p1L94YdWqWxAw+Cdq4Ws4mfF90ug9OcIaIkKtGmMw9G9YqgtFGmaKoUbp3KqWWckJ0Vm5LnQETNDWOcz2/T4EB/NO76mQRhqGJAXcCO3YamyC5Hmw9Ma5t4qLcdQPOOPSe3P+f/eJrmrU3ZSs3aF11jWqhhhJvxJfWu7o6cwHIOP2D8mIPeCsJXDDyle8u5GQaKMZhoplqqFMGV9CfYL+TVdcl8s9Ir9kRR6F3bxsfVNa/Y1N68pIMDiYZyPF3L7a4Ifj8lIP/bIlFvSuO62uHwd4mma4sUTXJq+LAuZlZtpxQmwWj3baeMpZKaOngJOsp9a2RTKgD9ZTJ6lKVwHDX4gkVGSienHOZPDo0lOKt4tFap2hZtzg== X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(1109001)(1110001)(339900001)(189002)(199003)(106466001)(2950100001)(77156002)(107886002)(47776003)(81156007)(104016004)(6806005)(4001540100001)(64706001)(5001770100001)(5001830100001)(189998001)(97736004)(36756003)(5001860100001)(5001960100002)(50226001)(62966003)(50986999)(105606002)(92566002)(5007970100001)(2201001)(68736005)(19580395003)(229853001)(19580405001)(46102003)(33646002)(76176999)(77096005)(87936001)(5003940100001)(50466002)(86362001)(48376002)(11100500001)(85426001)(2101003)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB1229; 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; DM2PR0301MB1229; 2:seXrHgqnbGBm2PYOnBsvC9zagoGGjI3n26zuQHvX8dry7Uij0hIdeB4RGnnvuLmw4d94RqtZpdNOFr+wWGSn71FejeLRmnA/ntuXlE4IRgFxtC5MURUviQORh+NxSzU5GR24MbCHBTMew5cCgxuAy16I1tG6Qm+tviUb4/Ee8fA=; 3:k9pZVpv9QL9Wxhk23xQhoeftvfAuvT2BTjtcXS3xpCprvJZYbRsg5A6vdk91218XTLaVRGQXdBi1DAI5P0LX1f8nNa6cegT2qh+kSUvCQdi2gciRydVvkuHrZk3iJj+TSXDTi01uW5NUC3OrroEsshVUl4bMPdDemkpP8Sd8bATMUoWyCG3xrr3/hF8C48SeI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/3SdBp1TmrjkVrQdM6LwjcRued3NtED5J4AvYrJfvtlO2hjblP+JDAEmneKxSBwMWeM= 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:DM2PR0301MB1229; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB1229; X-Forefront-PRVS: 07106EF9B9 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB1229; 23:aynkg+aBFM2hQGn3B0ocQzCh0Ns81M1y7JDPWlH?= =?us-ascii?Q?jDhkaNdurf+NA/RGXwtokyj9EZnCXjvE1eFtUVDk28Hq5nxC7MRcqH6N7LXZ?= =?us-ascii?Q?6eGCjGVmBxqTOMBiH4qyydzbewJBMMmfpR+3NWVTP9DTGypoI5tblMuaMtHj?= =?us-ascii?Q?b3FkDJGI5I164vy7ub5e67cxKd41DmKg10BcU3z+XicSAxps9SDaoEdCo0KN?= =?us-ascii?Q?Vy7ROrOm/xNFOnZtFaLinvKhoNyK/hAl4Vlp2PHYDNF67RnarFxxL7FzKcI8?= =?us-ascii?Q?6LTrHfFgINhMV+pBOuaid0qeKx+KZmVRXiApvXbcVdBaNuMArGBsP0vdekIM?= =?us-ascii?Q?FCsjSzZztP9Nxuvuz9s6FZPD47snVjRTdw4YkKO/1F7Td1XiheIIno3FQllf?= =?us-ascii?Q?+QrbZ4AIHW9w2cK8uw4U1Y3l6ngUBM+kLmuKd+8c3HD0gr1aNiTmu27heguS?= =?us-ascii?Q?4BmGxCTcLzNC+MKRubLGu/AePhXxNwDyL4MKafX6PywfxHgeV4nvwbDzDEyc?= =?us-ascii?Q?pXfHAnQRUPNUhCjB3tmukSHHNVY0/EIORK2emIgxv3MO7UjwECeEqjyRG6eN?= =?us-ascii?Q?8EJLZ4jt7tK35s/mTengUyJO0qJ25HqpHBkkmCxTVLTn/zG4N5rTp7QjbI22?= =?us-ascii?Q?ugzL+4rok11Xkgl5DL6WUAoyp7qqWoc4QHSKuwPk7cs01oFnoTkKG0Z2F9ti?= =?us-ascii?Q?X9cysBg2MV6U8RR5cmZUxGofweUXwNqcRgrQk8T08tScT2TknR58x4xKr+ug?= =?us-ascii?Q?YPlYJUCynoQPZ6MtDqlxglaxgecBnvNVh1A4nqCufLeR4TAcfriByTcKSGkK?= =?us-ascii?Q?cQas5NxVeWOsQv26aVTw1iAg9oLXfgSyfheNmqUc1p8/M9c6r78wlwiPCQsP?= =?us-ascii?Q?0sJssWY4buKUMo337Q0dY8qAdntFE+agvq6y1GUcm7kAhRVQWoAH3qehwqKJ?= =?us-ascii?Q?H0+65md5QjwqbX7n006HCzy7ZKGDdL19aA+0yY4Duw/5bNaIiiKsXKGE9ukG?= =?us-ascii?Q?/tTbr+pU+JIzSvTF1oZnbVLQ3K4TVKQX4sG5gftsbDknx8Z2/uAZEz+kbz1I?= =?us-ascii?Q?OW7Mc7Tfd8ulPG8+dHSNNQoq9Lbm1g+3LTw1pypNxcCNPlKbUD9VUFb5Q//9?= =?us-ascii?Q?XDxbDpRjSc5PFPtYrT2IBj/61eInQ717ro07mVKk23Ayd73iflQFAzFo4qT7?= =?us-ascii?Q?NDZFW4AN6gjbxqKjFnR1swd3U6SEREY2KHnXC6bROa0J4RtH+FmAg+dAMXIo?= =?us-ascii?Q?v8hQnRCrI42IPPPxIQ3hWa/BSJg10QIpTN43nmphKfkcFxGMUuxbC0UletUo?= =?us-ascii?Q?lhQ=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1229; 5:olKvGbx3qAdHjyIOQLJ9xj4oDY0mCCTU03yWhRTaByC86SY4ULLhK9iDBBcTzimYAWFEBFBXTZJTXUCfuG/zlyyqOU/0Bv49OG88TTVkD2bqotbp1U5858ACKG5kX+7sPS0TNJIHsbcGBCrEMAazCQ==; 24:xjL+3eeaCyZNZYXyNAnQTxfy+CpYzD+BzfsdVoUjIubgJynTIJW1fdB7omEADcW1/iSjPEwv7bdGDaHDWT7kJJRD97HeSpdlSoyveBiBg+Q=; 20:EHWkSIJydgecEtXUFn1eaqBlI0pFqOxC7GW1zemI++ulNAh2TjRABYvtHWckLIQ0BUiBzXXtmPwvFL5ILcAFRw== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 25 Sep 2015 21:07:55.6256 (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: DM2PR0301MB1229 X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB0653; 2:1bIqROMnjeQRHbwdU/Tcv6dObktlDHKDn3kl6dqwxosdJz/mLqHFfPJur3Gmi6ZeJ5xdg2/sjCxWOLgaqe6ix0UhE7Aj8JNHdqD+H84SKzKUZ4zDG6janlgLcpRxko07CvoMqNNClwN7IKpNeT9laBBxZR4SiCLT0ZsojcoUegA=; 23:R/wL2OW/VNfJqFeHaFhcqH+IYSyyXxXg1kIfNznWd+X3c6lZk84UOzhLIDoIIs40f6GSPPAVZWjHY9gEndUFTIhsFNg/X94JQgyA6OScd6XpIl9vOdikUK8RlHwtc83U1srxNejuekd4gVcPwjuyNpnSX7qYXjyqY9r/3Kb9AlfpqMlr8CnV2HeD+RpokNq3 X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150925_140821_537312_2109A4C0 X-CRM114-Status: GOOD ( 16.73 ) 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, 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 Acked-by: Shawn Guo --- 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 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