From patchwork Tue Sep 1 22:49:11 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 7107521 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 7D9989F36E for ; Tue, 1 Sep 2015 22:53:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 945E72026D for ; Tue, 1 Sep 2015 22:53:58 +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 AD573205BB for ; Tue, 1 Sep 2015 22:53:57 +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 1ZWuPC-0003Ot-8j; Tue, 01 Sep 2015 22:51:54 +0000 Received: from mail-by2on0127.outbound.protection.outlook.com ([207.46.100.127] helo=na01-by2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZWuOt-00036r-Kd for linux-arm-kernel@lists.infradead.org; Tue, 01 Sep 2015 22:51:36 +0000 Received: from CO2PR03CA0042.namprd03.prod.outlook.com (10.141.194.169) by DM2PR0301MB1231.namprd03.prod.outlook.com (10.160.219.20) with Microsoft SMTP Server (TLS) id 15.1.256.15; Tue, 1 Sep 2015 22:51:12 +0000 Received: from BN1BFFO11FD033.protection.gbl (2a01:111:f400:7c10::1:121) by CO2PR03CA0042.outlook.office365.com (2a01:111:e400:1414::41) with Microsoft SMTP Server (TLS) id 15.1.262.13 via Frontend Transport; Tue, 1 Sep 2015 22:51:11 +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 BN1BFFO11FD033.mail.protection.outlook.com (10.58.144.96) with Microsoft SMTP Server (TLS) id 15.1.256.10 via Frontend Transport; Tue, 1 Sep 2015 22:51:10 +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 t81MolNI028361; Tue, 1 Sep 2015 15:51:10 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH v2 6/8] pinctrl: freescale: imx: add shared input select reg support Date: Tue, 1 Sep 2015 17:49:11 -0500 Message-ID: <1441147753-13239-6-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1441147753-13239-1-git-send-email-aalonso@freescale.com> References: <1441147753-13239-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BN1BFFO11FD033; 1:da/Ne0GcdYD5F8+QM4xAH1KPLNpJ5oVrAaL39H0g4pyvJyyi01ayYzkUjPqyeOiFHITxfRQeEvtx+F3Je+rJ+Mj3GukIWjtCkUOLnXU3gNTKXCLd/uoxELCvk0mhuDd4MrtGiQjPFLpVpa5dtysLz12zl1BvRNUu/2FJyTSeXlNBH0Ie49k+tN+1vnC+ybNrxzIq9zq+Ps5wdpdWrzCb0IScn1ga1wIUg5nC9ovH2trs8syZ73AcYesaVv8DOJj7IK0qe5K8+ci6MqBF8+j7kEP895p97IJbCSaqAktrRv+tQC3zcQbki6ylBIJRmw9V4e1/S3JbjK/439Bp52CO1GseURrgrUii7vkWj1gsdkz0c6OUYqlTWbRC4/xuMINWgi8YWAw+ovWSYpupi3AGg5JX1A0n2SlQWK3EgcF0k/0PfMLHuOL+6b6UE8a5dsMO X-Forefront-Antispam-Report: CIP:192.88.168.50; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(3050300001)(339900001)(189002)(199003)(50466002)(62966003)(2950100001)(86362001)(5001830100001)(50986999)(5001770100001)(68736005)(50226001)(81156007)(36756003)(19580395003)(77096005)(5001860100001)(19580405001)(6806004)(5007970100001)(5001960100002)(87936001)(46102003)(104016003)(5003940100001)(2201001)(4001540100001)(76176999)(105606002)(106466001)(47776003)(85426001)(107886002)(92566002)(77156002)(48376002)(33646002)(229853001)(64706001)(97736004)(189998001)(4001430100001)(2101003); DIR:OUT; SFP:1102; SCL:1; SRVR:DM2PR0301MB1231; 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; DM2PR0301MB1231; 2:9sR7JEfnzCucgqLXSDza5LIw6wiz1VnLSthlFJDu5JE1IX5V6iCo5zz+IKKqtU8Z331m2ldenj08HpvOSnYQk680yB7IFi0mysdpgm2dpTnJ9eqlHx90Hatb/kB3DKwpQgxSTRduVPFfqWjegvX/4tug4vsV0wfxzQHsN23LEpU=; 3:rbaiQpni9kR0IKQPX0uAqiTgzjer7DPZRx6TPjJCq3KCPpnwDGBg61JlKr8730R96KvkXkAUG5FTI3clKQPbH4HWh1Ba+KPbDrSefJYk3Z7E95UmpvTjfpJKr9BE2AuKdRpwtFdIXNFPBaxaWvoBlgWclfxM6jNCNreZYPnreQ0irpYv6DP8AFKZfFyLprpnCSelSbMkV6VUag9HROluH1b2eM/4cAATJxL89Mo/nQw=; 25:jkhQoCF1u4ycm3rqQsAXiu/SRK338brpiQZMOXyIsfswG9zUQDWkVapcLz8EgzsrrsgtCIrwMCv/nKAx4RCzYWD+KskbiltFY+PYBc+zzp//IeTMw1bvuaco2ru29al0/z8K5ChThUCridbF1qKuh0++BO/N2wuGFjabyKzpkzUI4vN03stk0/H6tRJUCyXVXvFvt4txjf0wiS51/UiAcYItgb7dN/1DB26YnwvSPXi3kVFdXM97/pboQeKQGXhZ X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DM2PR0301MB1231; X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1231; 20:E7rWd63QUIksr+4JwkbWwVRVcKfnr/xhaBD2QPUrQMop9xlgClFlVu2AihZKnVsUYyzQWNJYZfcNyP7tVj4+oLeQZLNm1j9AnW2FHUK2HJLrx2h9U+Ox2qvIqGKUxStIOXwRIaXQ3LzFs8lOmK6UvjbbgVlBA1WIZoQmCXov1cmtzAEuTB+KvEUbC9z3E6AGFWfbtreXlLLaDDjkYHleh8ibklgTVZPY5Wm7fe2GhIC9k2mhTEQly29NBbk62E6LJNuMm86+w5ZKgLHaq2nKNQvfmVmr4konYCBY3W++DTdSlnhQDpgvnq0B2tT58s+twCqJoqQ2SZpW3civJH2IR+Q1ujPWFIRLlvPg0LKHvI8=; 4:Pfy93oF5+3dgHaES/JSktpU3GFLspyFWkSVvgcWcc7C9wIQk7tcLg2jBsUdLj9kHTxwEjbjEPN2TX4BoCKUwd7GtSN58uWDwnIhXz062rXLbJcAGna1jXQKj00AV4p0WYeSyyvEi+CiVYjZjAkKlcyc74BM10zKxk/0KzWK/RBDNOmyZ9b60rDiRejDgAvYhfTneqOv3gAz4dBG2L2I11BPu200kdIXUfswqZGRuPg9vd/qIEaL3jKu0ntHwW5NyXLY82sPvG8Vyf/cXGLBG35cmehOzNXiNO2bUTkms+mVtIlIae2BcZsoD+35a0Nc3 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:DM2PR0301MB1231; BCL:0; PCL:0; RULEID:; SRVR:DM2PR0301MB1231; X-Forefront-PRVS: 06860EDC7B X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; DM2PR0301MB1231; 23:2ATduIJqTsXXLvgZQ8f4p2TzlSZHtzB9WxemKS0?= =?us-ascii?Q?n1kLL+6wxXf9+nDO+1LR7WntmOISwx7APSwKidWGIzweLbcEpTi6kRUE8Krs?= =?us-ascii?Q?8boa/wLwb/Q/Wi4/FDCRAtY7NCwajf0UgwqL7XcR35sjIH5CoiN1B1pFs8Yx?= =?us-ascii?Q?jRkau5dQOFOD0pAHdrHk2O80/mR2VsHz7tPhKRae1mjiSxRXlOAcRQDZa5on?= =?us-ascii?Q?/JPqCqODgW9l608FAprR8ktLgCbOxvzk2eWh63YJyiS8OWvIMoyALEIMvXUF?= =?us-ascii?Q?8d5USporITyKO0ECNJddODGASbF6tcnMRLcmBCd4pQDkxdLHDeVLKrNub5n/?= =?us-ascii?Q?MjcRZhLdg4Yl1/oZlsHccjbv51f2Br/YLbWj1INv+tCHG2qXFfGeOe8bsZXh?= =?us-ascii?Q?6tRueuOHiUNMcSONBUjhL4PX++TmoCS9+7rVAbnB+LlR9b9aVBMAm0JtCi65?= =?us-ascii?Q?vNMV6pHhELnJUi4jlO1/+taoAkgYCEj99c0DzAFOMaxUnOE+GQQ6sA019YfD?= =?us-ascii?Q?87VXUo5R4E3CJXCgq+MmOCq/peV+MzP0WPcBhcjyDFZhbWmBIji2nSsz1CAu?= =?us-ascii?Q?hV09cNRGT+9WS80d3jzozgc6J6bD0sDGUsHu065fR2cGR3ci4eUVZWx9XJeR?= =?us-ascii?Q?JqCfWifsHMpxvfbY5x9P9c5imvOcbAQte9k8ialWLaKlQ5yHXV9E6gUOaG7j?= =?us-ascii?Q?s69ia7jxC4AmxXc7B3wY9e/j/p/ZV42AjlmJDuf3Vwxn3/uFYJfy/0QNYZFa?= =?us-ascii?Q?ncJjKHwuGK0moDMqjIwQD+hvJS4jVhOM/YGWXkX15mGFUMFjfDcdYWC6Xqcl?= =?us-ascii?Q?taV6h1Kz9YJLFd8SWAZ1rROMcVGivKMsVgV7XhoT3xlMOwZRLm450BvPk92c?= =?us-ascii?Q?++A6aUiZcgcVtSWnoFNPqnFvYwHi8xSUvSrtfcspPLYyNP8LUp8EozF/hy4D?= =?us-ascii?Q?dkguPBb/7/c4TBv+nq8RwOYfyS/wDhEvilyCFEYOPv+1bGPJLVf3GJWjbSwz?= =?us-ascii?Q?AaOmIYbMBTWA9+iWx72bOr1o0anzqkdtIW2RGy0a4ikXiewlBjuKOPAGZ3ff?= =?us-ascii?Q?f85zAzslkQoR5AOw5UwhHx9meQQgBjtxwfYInr1gZMOJ1Glzjx3MxD4TjhdT?= =?us-ascii?Q?8vUEAQMvaywH26nA7H4tdCOW7xchOyVHdzfwTrLdtzhpL4UPj0Wqi1Ko1ZZM?= =?us-ascii?Q?hiyXBZ41Xm5Iwc6hn4DNpNH7SITf+MzH4q5EHDeF0VVbhawDr3Zy0a0iMXVX?= =?us-ascii?Q?aBx7e0i+srKqSDLm0fhI=3D?= X-Microsoft-Exchange-Diagnostics: 1; DM2PR0301MB1231; 5:x5gbDmbZhajbNHDGI5ycsolq/8XgTLNaH5qiTlwTu1p9P4CxS3YOEDjlNkUaNwCxjl2Nn+fKTr5SiP/ponRB0WUDBlOXY2Ao7oq6G74UxviTXtdHcmo3e6YVuCyxKfG0PGUIGdBLL5opJLZuUztDmw==; 24:VeshjoIqKMKr8OrhIOzAG6a0bgIMDuyAaP55QurzRg8/CSqy7U73+Rs3evDsLVMt2WXjo58mVSuifJSncELLnXRzWSMJa34lq7eUs0XoQL4=; 20:/bm1mQ8CAjPbQy+vveTCFdXLkFkoiasur9T7iLeVmhnDgySMHBhquNXsLXCPbgvFmVfIelxnk9ksdx15YvhuIA== X-OriginatorOrg: freescale.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 01 Sep 2015 22:51:10.8253 (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: DM2PR0301MB1231 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150901_155135_744003_CDD1506C X-CRM114-Status: GOOD ( 20.97 ) 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, 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 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 9f019be..597319d 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_get_child_by_name(dev_np->parent, "iomuxc"); + 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 base address not found\n"); + return PTR_ERR(ipctl->input_sel_base); + } + } else { + dev_err(&pdev->dev, "iomuxc device node not foud\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 67c07c2..d11a827 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