From patchwork Mon Jul 6 22:59:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Alonso X-Patchwork-Id: 6728291 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 0D331C05AC for ; Mon, 6 Jul 2015 23:02:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C8B0A206B2 for ; Mon, 6 Jul 2015 23:02:49 +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 7E61B206B0 for ; Mon, 6 Jul 2015 23:02:48 +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 1ZCFNZ-0008C9-PK; Mon, 06 Jul 2015 23:00:49 +0000 Received: from mail-bl2on0756.outbound.protection.outlook.com ([2a01:111:f400:fc09::756] helo=na01-bl2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1ZCFNL-00087l-NX for linux-arm-kernel@lists.infradead.org; Mon, 06 Jul 2015 23:00:36 +0000 Received: from SN1PR0301MB1646.namprd03.prod.outlook.com (10.162.130.140) by SN1PR0301MB1615.namprd03.prod.outlook.com (10.162.130.25) with Microsoft SMTP Server (TLS) id 15.1.207.19; Mon, 6 Jul 2015 23:00:13 +0000 Received: from BLUPR0301CA0019.namprd03.prod.outlook.com (10.162.113.157) by SN1PR0301MB1646.namprd03.prod.outlook.com (10.162.130.140) with Microsoft SMTP Server (TLS) id 15.1.207.19; Mon, 6 Jul 2015 23:00:12 +0000 Received: from BY2FFO11FD018.protection.gbl (2a01:111:f400:7c0c::117) by BLUPR0301CA0019.outlook.office365.com (2a01:111:e400:5259::29) with Microsoft SMTP Server (TLS) id 15.1.207.19 via Frontend Transport; Mon, 6 Jul 2015 23:00:12 +0000 Authentication-Results: spf=fail (sender IP is 192.88.158.2) smtp.mailfrom=freescale.com; freescale.mail.onmicrosoft.com; dkim=none (message not signed) header.d=none; Received-SPF: Fail (protection.outlook.com: domain of freescale.com does not designate 192.88.158.2 as permitted sender) receiver=protection.outlook.com; client-ip=192.88.158.2; helo=az84smr01.freescale.net; Received: from az84smr01.freescale.net (192.88.158.2) by BY2FFO11FD018.mail.protection.outlook.com (10.1.14.106) with Microsoft SMTP Server (TLS) id 15.1.201.10 via Frontend Transport; Mon, 6 Jul 2015 23:00:11 +0000 Received: from bluefly.am.freescale.net (bluefly.am.freescale.net [10.81.17.130]) by az84smr01.freescale.net (8.14.3/8.14.0) with ESMTP id t66N09g9011008; Mon, 6 Jul 2015 16:00:10 -0700 From: Adrian Alonso To: , , , , Subject: [PATCH 3/4][v2] ARM: imx: pinctrl-imx: imx7d: add support for iomuxc lpsr Date: Mon, 6 Jul 2015 17:59:05 -0500 Message-ID: <1436223546-6333-3-git-send-email-aalonso@freescale.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1436223546-6333-1-git-send-email-aalonso@freescale.com> References: <1436223546-6333-1-git-send-email-aalonso@freescale.com> X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1; BY2FFO11FD018; 1:byk7B8h6QJtyR1G0/yRJHLuNuZqhIANABpUf8+SLv2aSKqF2dAhADTB+ng3HWhMnh1cq+66B0oHMGzEDKNTJP/UihqxjTvFAl3G6dg45rHbmfNX/oFbHqkzXEtfAIjjc2FE1nmXxpxJO4l2JfNiyyzRbLFuQLGiUxBd/Q1e/v1Muue9zz9T0VT6yfOGF5HQA6hafQq5KoxqpJOq5U6JxASFYrBVRlfDck32HAQM/DirLdTAIZ3RXKa0uUa0ME9jSUh8uCWDT94eDyKxQfaPPLSYh5W+4ypW7pRTGzeHvtW6TxWC/gRjFLXD2YAcitzUdp4fSbPcPKPcf5hDSdWulFg== X-Forefront-Antispam-Report: CIP:192.88.158.2; CTRY:US; IPV:NLI; EFV:NLI; SFV:NSPM; SFS:(10019020)(6009001)(2980300002)(339900001)(189002)(199003)(36756003)(62966003)(105606002)(77156002)(189998001)(107886002)(5001960100002)(19580395003)(6806004)(106466001)(48376002)(50226001)(19580405001)(85426001)(2950100001)(5001920100001)(50466002)(229853001)(5001770100001)(92566002)(50986999)(47776003)(46102003)(33646002)(575784001)(104016003)(87936001)(86362001)(2201001)(77096005)(76176999)(2101003)(4001430100001); DIR:OUT; SFP:1102; SCL:1; SRVR:SN1PR0301MB1646; H:az84smr01.freescale.net; FPR:; SPF:Fail; MLV:sfv; MX:1; A:1; LANG:en; MIME-Version: 1.0 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1646; 2:XySEapfaugZt6zpT5uyChLoE2pITKrpffWwI6+1YsltQ/GW5WNe4RVJzuU+aSyWd; 3:PkfMvVD5q+3yrWAdthCeJGSI9XFoVSFtDLNxvru88Z0MIqK3nyPyQaQnY0ApL8U6ominr0m7aDLoXRj66bDJDpejJZvMIYxxGnCVie4FqwGWwsGnEMqPHXaUrFh8dgNq4JKZExxLIkKe7GBN0i2nFubC5JM+UB/jYvCrduHRvUFzwsi6iHJnKIAPJ7rbeVps+0Q3p+IISZfzCMiWjtEHcYzvCS/za2GxovQFQeoDUB0=; 25:cMj8TLvw20yF6sP1iiIL9u8r7WqUSEonTLtw2cPr63d3ZhOoBrlsNkAcuNTKCd4mbXoHThaUOnCDfqM+9kchG/itDoRMy5goYJ8wLyKF2NO+VNHbrGwWuV7rcIc2UqOsepskYS6SJUeb20LeVxs4a2Apbj21b7WZafjFrJagoYdAhIdvueeeBpXxAPttashiVf7TzdF3KFv1/YOiq0xDmtdODUIKDqVx+UMsP3IFpArvuIVf8NJSwFK/OaskWG0f; 20:4p/vpF3g4Wfs8IG247GOhcmDu7E5ChGH4qX2aALida1SUtr4SBrYwt//xuTd3y15dAue0hCL/QZUgnkO21qaBh+KRGKLWiwhGmVJOUfi6n3Pp6IJ0sgUyKEFINDehThybCQjftswhxUKpmKoHnLmpWQaaPXd2r34UO7p2wL0v8eZbSnMBPUxzvvMXEWgt7/HdAclMAnjDq7olMEVco5KFj8rjb6sSHAe5eSILFO3VNmP3vE2dSVor9fSNeqyPE/aoPfhsGTXrgHHqhNlcdGA4MPBJdpKGHjliztTy4nyT21+0lrHhypbFyQ7ThYx+DSQx4QObZ31uioYzc+lGpvN1ciuNZlGB3YquR7pkQvCCEc= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0301MB1646; UriScan:; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0301MB1615; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(601004)(5005006)(3002001); SRVR:SN1PR0301MB1646; BCL:0; PCL:0; RULEID:; SRVR:SN1PR0301MB1646; X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1646; 4:qmWq2GWJHH1URCdcKYFxkqG220rvuQwL88D2y/ZOeE6ICsY5l5fFW/oPjhcTdlE2ZC5t5qKNjcPunAAyV00y9+GV/zz3/y8mRtbBNYxndlQsNIAWl/h+MCc4qkax6WzxUhi8icNlgT1SKydJluQ/Ly2MTYz5j/ay6ReF2yLUvGsGBY4YStdqwTFcc87IiI4/JPpeN3ru/+akikFLvNYAXdC+nXAtA5+XTSglxFFkDUTHFFwBR6s1GflJP8PDOoEccQVbX/CE33T0Ltk3AH7DUFh2v9trRtxBSFIpiPdCJ4o= X-Forefront-PRVS: 06290ECA9D X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR0301MB1646; 23:VWD3/v4G7e1MSMSq86KQ5Kv1DhoJcqgbxqHoBYu?= =?us-ascii?Q?y9YMaoyX/Tz8GIMSrX/wldsiFUJbGisM84EqlCtnoStcH8wpl3wV+dGZx05X?= =?us-ascii?Q?fA/WL0rASI31oKpper1SvAHqa7X1wvibhOblSneRplIiaZXRFarVNHY9cTbn?= =?us-ascii?Q?S/DzlJKR3OZ/ShU5gQ988zNIHASp5iZLRa7lCey4hL4cmyda7qaQKDi0hDqB?= =?us-ascii?Q?zKO3TZZEcCxeSPpVRZ+5kzBeujttsCWYd6C3zkb8Y2EBCNyr6kOcjQ2Co8IS?= =?us-ascii?Q?yjYJ5gwCdOjfzxgKAor6RwkOCgeOSECmX1bdrfHLz6GfTTVFcbacTFhcwGEN?= =?us-ascii?Q?cLLVygOfQKfDnC1SfYWTx9kM+GrXCA45j3pugOOQqhEAC6OmLN/Z492NNNWi?= =?us-ascii?Q?BdWUk8rSgK8QujNEDQXN3XIpR6SSHcxyM484DlvWrbhdwswarTQczDiCNpYn?= =?us-ascii?Q?fNwwo8cmf7UhJ+fb/f9yesvsm71Tzd2F0De+RTv2r/mWgfvFkMNtjwUST91x?= =?us-ascii?Q?+350NkP+lPTfKGF6HdxGEwO5k5wunuCtTrQKzuVqJT5a01Tb9rYr14Rp2Fa2?= =?us-ascii?Q?Y6b+hx1FVvRa4cTy+IVxkXXC0+xuWkCmf82TVmXYoSTYbLWxe+URrIlNlb6A?= =?us-ascii?Q?E9lBdQmINx9wX/C86+H7gv5W5d1rli5+NxEMmxT2hj7is/xkRP8BfIMWExYP?= =?us-ascii?Q?3dWGuE8rP0ovN4vuA5w1+xdirfDd4JMdzi3vMYJyCL9aAhKYT6yitSoTyPzw?= =?us-ascii?Q?3o2xIMeHo1rYxBKPrHOBVtRU3ykr3qipdFFvj8hElC3r1YZzhrF6na75U2gP?= =?us-ascii?Q?P7gHF9xTe10q1xpj/P4k3B/7xkS6VH0WqJWCIb47MEuk9pT+0OGJYfXWnIbY?= =?us-ascii?Q?tmz6oONIGTya/uztUO7/SMsK28quVHyUoB6khLcG6ckpFCeF8KNHapDtadIt?= =?us-ascii?Q?fc/Jw/RYMlGfYOEJQsfLmEJjP3jKHi/jRxU/jUQDwflLUIQ2WRFcImpSveBD?= =?us-ascii?Q?kc5K5TDFT9/VEtqe4lzxmnEnN?= X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1646; 5:qr10xR4TcKmNhCqeh01u1nwD7txBuJKI0uZVr8X2FrQGQSRucrBX4wDDrXKJ4EuhPT430lRHqoHyix7gS0s6CEO8zxCAOEad2BfkkQGJIRvOg4F8BQ0aCB5HTucuTJBNKITck3VbPGSUP2ZnYM1ucg==; 24:SgbFg/PBPJcoX5neIc9ToUt7Ahz5+c9/e4xLEZRgbwhjZmnJPGrtsxkYdncCr25OgUHOY3XZ06+ZsI2uLOsPDWNPin+AUDxjO1QOqeTvtxc=; 20:0rAPoed5SfsLLh7GOm3QzGF+sYhdt4gjVEiKRx661Xarn+TOPjMa+f6RvuVmvOCTpja3GdeqtR4MK+d9EeoX+Q== X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jul 2015 23:00:11.3131 (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.158.2]; Helo=[az84smr01.freescale.net] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR0301MB1646 X-Microsoft-Exchange-Diagnostics: 1; SN1PR0301MB1615; 2:IJLuU7dsBSd9fDO+El4g1g3gT86vNaGXUiEYAcOKMv5UuvkfkWXMRkcuRKFBNXnT; 3:HizpWGn0SJZ1Z+KTJ0rb7djceLwVigQzcL+MubK21mlH2TZWsJR5SVy8KBJhPLtlVwc1eAPUlgYbl2P2BY1kvUObYYyRYFdW8kNQLDPb0YAm7EumN3HU3nvwJWKQdO1JETJwDJ9P41TywPP71agSjNnDPktUdiubtMLfWGY9Eu8F4MQIaiGNEiGwbtOWw2KXonERAqvUZbxIZlPEWFhCP1TvOMAB6Tv/yK8mbbSXPwE=; 25:kst+p1lNix02Y5CNGAi5yhuTEvtaUZn4y2DD6WpXaUdzUaStU145HfNeEKhYuBJd7E21FhzFGZd4fVoh1RAdbhAj2bW/9tEbf3Mf5Yuzr7gMi58iYS6kz6TnIVc/zx8B3qRiPBwAP218YV4LPrIHgbvl/t28acnmkNPGDHs/DcB88NFBGAgnmbu8jmEVMttWAqpJJefpnbA1H8SwuA2bkgBHgLXnmJcAk2tVsLHQXDx4vfiinpIciBwA7Mxj6cxY; 23:LxCcDvw6KQop83m2hU8wfWiml/KEiLN8ooDAer8nTASXsd2GcsnFb+vW/eOJsZNji+pys09oEQP3i/77Eu01IghQTs3YxG3XgZVaMBAJdGaD43qAZMtWS+R4YboPIwZ63HP7Rc7839XJv4t2YutZusAPQ6bqmzuSgiUi4SL94Elbj2CIPvg75iff5qoxcufAFS2+YrH6choG8VMh4LIN3aamdg7VBMITc+8VFzs0d3wUoVdmX+m/QjphAN5PyN2o X-OriginatorOrg: freescale.com X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150706_160036_015957_C64DF781 X-CRM114-Status: GOOD ( 20.59 ) 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.9 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 * Extend pinctrl-imx driver to support iomux lpsr conntroller, * iMX7D has two iomuxc controllers, iomuxc controller similar as previous iMX SoC generation and iomuxc-lpsr which provides low power state rentetion capabilities on gpios that are part of iomuxc-lpsr (GPIO1_IO7..GPIO1_IO0). * Use IOMUXC_LPSR_SUPPORT and iput_val most significant bits to properly configure iomuxc/iomuxc-lpsr settings. * Version 2: - Add suggested comment for input select register shared between iomuxc-lpsr and normal iomuxc controller. - Use IOMUXC_LPSR_MASK to extract pad group id and aling pin_id to 16 bit representation. Signed-off-by: Adrian Alonso --- drivers/pinctrl/freescale/pinctrl-imx.c | 73 ++++++++++++++++++++++----------- drivers/pinctrl/freescale/pinctrl-imx.h | 7 +++- 2 files changed, 56 insertions(+), 24 deletions(-) diff --git a/drivers/pinctrl/freescale/pinctrl-imx.c b/drivers/pinctrl/freescale/pinctrl-imx.c index d7b98ba..8de1790 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.c +++ b/drivers/pinctrl/freescale/pinctrl-imx.c @@ -1,7 +1,7 @@ /* * Core driver for the imx pin controller * - * Copyright (C) 2012 Freescale Semiconductor, Inc. + * Copyright (C) 2012-2015 Freescale Semiconductor, Inc. * Copyright (C) 2012 Linaro Ltd. * * Author: Dong Aisheng @@ -18,6 +18,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,6 @@ struct imx_pinctrl { struct device *dev; struct pinctrl_dev *pctl; - void __iomem *base; const struct imx_pinctrl_soc_info *info; }; @@ -212,12 +212,12 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, if (info->flags & SHARE_MUX_CONF_REG) { u32 reg; - reg = readl(ipctl->base + pin_reg->mux_reg); + reg = readl(pin_reg->base + pin_reg->mux_reg); reg &= ~(0x7 << 20); reg |= (pin->mux_mode << 20); - writel(reg, ipctl->base + pin_reg->mux_reg); + writel(reg, pin_reg->base + pin_reg->mux_reg); } else { - writel(pin->mux_mode, ipctl->base + pin_reg->mux_reg); + writel(pin->mux_mode, pin_reg->base + pin_reg->mux_reg); } dev_dbg(ipctl->dev, "write: offset 0x%x val 0x%x\n", pin_reg->mux_reg, pin->mux_mode); @@ -245,16 +245,22 @@ static int imx_pmx_set(struct pinctrl_dev *pctldev, unsigned selector, * The input_reg[i] here is actually some IOMUXC general * purpose register, not regular select input register. */ - val = readl(ipctl->base + pin->input_reg); + val = readl(pin_reg->base + pin->input_reg); val &= ~mask; val |= select << shift; - writel(val, ipctl->base + pin->input_reg); + writel(val, pin_reg->base + pin->input_reg); } else if (pin->input_reg) { /* * 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 & IOMUXC_LPSR_SUPPORT && + IOMUXC_LPSR_MASK(pin->input_val)) + /* iomuxc-lpsr select input register shared with normal iomuxc */ + writel(pin->input_val, info->base + pin->input_reg); + else + writel(pin->input_val, pin_reg->base + pin->input_reg); + dev_dbg(ipctl->dev, "==>select_input: offset 0x%x val 0x%x\n", pin->input_reg, pin->input_val); @@ -326,10 +332,10 @@ static int imx_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, return -EINVAL; mux_pin: - reg = readl(ipctl->base + pin_reg->mux_reg); + reg = readl(pin_reg->base + pin_reg->mux_reg); reg &= ~(0x7 << 20); reg |= imx_pin->config; - writel(reg, ipctl->base + pin_reg->mux_reg); + writel(reg, pin_reg->base + pin_reg->mux_reg); return 0; } @@ -354,12 +360,12 @@ static int imx_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, return -EINVAL; /* IBE always enabled allows us to read the value "on the wire" */ - reg = readl(ipctl->base + pin_reg->mux_reg); + reg = readl(pin_reg->base + pin_reg->mux_reg); if (input) reg &= ~0x2; else reg |= 0x2; - writel(reg, ipctl->base + pin_reg->mux_reg); + writel(reg, pin_reg->base + pin_reg->mux_reg); return 0; } @@ -386,7 +392,7 @@ static int imx_pinconf_get(struct pinctrl_dev *pctldev, return -EINVAL; } - *config = readl(ipctl->base + pin_reg->conf_reg); + *config = readl(pin_reg->base + pin_reg->conf_reg); if (info->flags & SHARE_MUX_CONF_REG) *config &= 0xffff; @@ -415,12 +421,12 @@ static int imx_pinconf_set(struct pinctrl_dev *pctldev, for (i = 0; i < num_configs; i++) { if (info->flags & SHARE_MUX_CONF_REG) { u32 reg; - reg = readl(ipctl->base + pin_reg->conf_reg); + reg = readl(pin_reg->base + pin_reg->conf_reg); reg &= ~0xffff; reg |= configs[i]; - writel(reg, ipctl->base + pin_reg->conf_reg); + writel(reg, pin_reg->base + pin_reg->conf_reg); } else { - writel(configs[i], ipctl->base + pin_reg->conf_reg); + writel(configs[i], pin_reg->base + pin_reg->conf_reg); } dev_dbg(ipctl->dev, "write: offset 0x%x val 0x%lx\n", pin_reg->conf_reg, configs[i]); @@ -442,7 +448,7 @@ static void imx_pinconf_dbg_show(struct pinctrl_dev *pctldev, return; } - config = readl(ipctl->base + pin_reg->conf_reg); + config = readl(pin_reg->base + pin_reg->conf_reg); seq_printf(s, "0x%lx", config); } @@ -551,14 +557,25 @@ static int imx_pinctrl_parse_groups(struct device_node *np, } pin_id = mux_reg ? mux_reg / 4 : conf_reg / 4; + + pin->input_reg = be32_to_cpu(*list++); + pin->mux_mode = be32_to_cpu(*list++); + pin->input_val = be32_to_cpu(*list++); + + if (info->flags & IOMUXC_LPSR_SUPPORT && + IOMUXC_LPSR_MASK(pin->input_val)) + pin_id = IOMUXC_LPSR_MASK(pin->input_val); + pin_reg = &info->pin_regs[pin_id]; pin->pin = pin_id; grp->pin_ids[i] = pin_id; pin_reg->mux_reg = mux_reg; pin_reg->conf_reg = conf_reg; - pin->input_reg = be32_to_cpu(*list++); - pin->mux_mode = be32_to_cpu(*list++); - pin->input_val = be32_to_cpu(*list++); + pin_reg->base = info->base; + + if (info->flags & IOMUXC_LPSR_SUPPORT && + IOMUXC_LPSR_MASK(pin->input_val)) + pin_reg->base = info->base_lpsr; /* SION bit is in mux register */ config = be32_to_cpu(*list++); @@ -683,6 +700,7 @@ 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 imx_pinctrl *ipctl; struct resource *res; int ret, i; @@ -709,9 +727,18 @@ int imx_pinctrl_probe(struct platform_device *pdev, } res = platform_get_resource(pdev, IORESOURCE_MEM, 0); - ipctl->base = devm_ioremap_resource(&pdev->dev, res); - if (IS_ERR(ipctl->base)) - return PTR_ERR(ipctl->base); + info->base = devm_ioremap_resource(&pdev->dev, res); + if (IS_ERR(info->base)) + return PTR_ERR(info->base); + + if (info->flags & IOMUXC_LPSR_SUPPORT) { + info->base_lpsr = of_iomap(dev_np, 1); + if (IS_ERR(info->base_lpsr)) { + dev_err(&pdev->dev, + "iomuxc-lpsr base address not found\n"); + return PTR_ERR(info->base_lpsr); + } + } imx_pinctrl_desc.name = dev_name(&pdev->dev); imx_pinctrl_desc.pins = info->pins; diff --git a/drivers/pinctrl/freescale/pinctrl-imx.h b/drivers/pinctrl/freescale/pinctrl-imx.h index 49e55d3..5e0f2e0 100644 --- a/drivers/pinctrl/freescale/pinctrl-imx.h +++ b/drivers/pinctrl/freescale/pinctrl-imx.h @@ -1,7 +1,7 @@ /* * IMX pinmux core definitions * - * Copyright (C) 2012 Freescale Semiconductor, Inc. + * Copyright (C) 2012-2015 Freescale Semiconductor, Inc. * Copyright (C) 2012 Linaro Ltd. * * Author: Dong Aisheng @@ -69,6 +69,7 @@ struct imx_pmx_func { struct imx_pin_reg { s16 mux_reg; s16 conf_reg; + void __iomem *base; }; struct imx_pinctrl_soc_info { @@ -81,9 +82,13 @@ struct imx_pinctrl_soc_info { struct imx_pmx_func *functions; unsigned int nfunctions; unsigned int flags; + void __iomem *base; + void __iomem *base_lpsr; }; #define SHARE_MUX_CONF_REG 0x1 +#define IOMUXC_LPSR_SUPPORT 0x2 +#define IOMUXC_LPSR_MASK(id) ((id >> 0x10) & 0xffff) #define NO_MUX 0x0 #define NO_PAD 0x0