From patchwork Tue Jun 28 08:17:04 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12897900 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 7A234C43334 for ; Tue, 28 Jun 2022 08:19:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=ruD3C3yF3xlCNTs64vg9x4RYO4F+N1n08ycJNY3Rl6g=; b=ac2zKbu6gTKkT6 O7trcF4Jzgn5WWo841dYcKK/uw6m4hedlRS+XSYOWHSszw6YRTi/9c4/ionR23mPSnJJYT45kJ1HO BO9KST58Ep8g9/pk/rgOZNQBUXo+lSG27Cq3bLi2M2MmWipxCaLzxZRHQL4O5hjf8iO/8fQWuYyjn +v6Cp54H95uYUvK227xP7ycBG+uO8ti6b7OO3xD/71IM2lWkmrbmdOoMZOdI9gcncafK5Upx18VcB 507qn5gj0hNrSRCnyJ84CsHFp5prPRblC2BXYwdBQNLRXW/7PYhWa5BwF2HYHMXznd78wtrKG6g2o A0MDNbrxZHHoid9jqbrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1o66Qd-005C6j-LY; Tue, 28 Jun 2022 08:18:35 +0000 Received: from mail-sn1anam02on2114.outbound.protection.outlook.com ([40.107.96.114] helo=NAM02-SN1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1o66Ph-005BeO-6Q for linux-arm-kernel@lists.infradead.org; Tue, 28 Jun 2022 08:17:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=X1s44+BipLKdrqut1FOUESR8S0v269HR7qn0m2JfMCejN43qvpTnjUp2Pg9m2gcOYpxpu3T0MZ0SEyhRqsDanZwW7BmDGiJA/CwBpXiz2THubBq7xqx3Jxp1QCRd1iv+6bypK7F0XwyQcsvJ4XJ79FHFPDutkqTVwZ6XwB28JrlDP4oqIjuIdSEJVBDYVTeawuXs60hvOmqH8AxhHKadPZjqTCdd8Ncd7jVCWRAjQ15CRD9sYxrb6gGSM0Uzb+35t1YponmkMFkqPi6d/HyoM32Kw+Yzxw8FJxxg0fF4rflCx3rwr2jLsyKA34QhsMzQmfCD8ca5XRT9ALQRkeyvVA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=Vj88WRfFsVodv5LPCLp1LsJWC/szl038VLhyrxtp6Aw=; b=eN3TfcMg8ecB9nYE+OhbZBjDTX9uw5kGJWxBw326jLhghP2c3qFai/d/n3ngSI73m1DGqGvAKiP9PMX/ywx1a0BD+22iFXBzWPBH6wbTg6BF/fKcRKFcHLgircUnv0N4Oto/M11zYyqo3kRl+6DclLG5uUEFC6GP7r4G1q7+GM7USl8Tuhb93YkyMGhGdILsPMMO/JX3lmsWPiULlgNVSqmHMrOdNBgyTtjXZJVXfya4Jox7L7D2zcLMhDYcMc9pf3QFtPcT3K0H/panTaPnSV+8vNv3tJDnyOf1WfKlhulp2Qhe55j4kgYtJZtPTUw31Nnv37YU+0MGGOdnXtKb+A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=in-advantage.com; dmarc=pass action=none header.from=in-advantage.com; dkim=pass header.d=in-advantage.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=inadvantage.onmicrosoft.com; s=selector2-inadvantage-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Vj88WRfFsVodv5LPCLp1LsJWC/szl038VLhyrxtp6Aw=; b=OYkKd/WoqEbzWXb70q5j68xdxMgTtujeEZaER9IfiCcHLfIDBYT5CF3QXo7QRO9i5LEn6zafODzjl+SNm2PoY6TfEjsbKpgAaqAytisZGyS3xJwa/Mn4p2Pn36+nx4vTfSXqWi5/NnEhqD+Ww7fDzM1PanHfUpVnS2aWPNobu3A= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=in-advantage.com; Received: from MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) by SJ0PR10MB5891.namprd10.prod.outlook.com (2603:10b6:a03:425::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5373.17; Tue, 28 Jun 2022 08:17:28 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::712f:6916:3431:e74e]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::712f:6916:3431:e74e%6]) with mapi id 15.20.5373.018; Tue, 28 Jun 2022 08:17:28 +0000 From: Colin Foster To: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org Cc: Vladimir Oltean , Lee Jones , Rob Herring , Krzysztof Kozlowski , Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Lars Povlsen , Steen Hegelund , UNGLinuxDriver@microchip.com, Linus Walleij , Wolfram Sang , Terry Bowman , Andy Shevchenko Subject: [PATCH v11 net-next 4/9] pinctrl: ocelot: add ability to be used in a non-mmio configuration Date: Tue, 28 Jun 2022 01:17:04 -0700 Message-Id: <20220628081709.829811-5-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220628081709.829811-1-colin.foster@in-advantage.com> References: <20220628081709.829811-1-colin.foster@in-advantage.com> X-ClientProxiedBy: MW4PR04CA0259.namprd04.prod.outlook.com (2603:10b6:303:88::24) To MWHPR1001MB2351.namprd10.prod.outlook.com (2603:10b6:301:35::37) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: d04a2e34-2d5d-44b2-89c1-08da58dea3a1 X-MS-TrafficTypeDiagnostic: SJ0PR10MB5891:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: N0Z+mMToR2oZeYXQ9gEGThd6u5Y6+KS3XN74Vjq3SRi++7MdJ2LVI28Oa32QrTHv0f8L+DBTwDea7Z0i18K+vy32V2YDSKQbE5Z9EPIjcpW1uDQv5/JHaIV83broowQNQ8filwUiWob7T6mwPt1w+M6CCfWRxHhAS9jCu+Adk4kzAw3SLlD2N8ZhSDsASaCWLMDu6QEhsxAAKIkLPl9OQzUBop8zu7x5og6dzGr4YeRwPpDOOXrIpUJKIv405gDRn05cHZhU0duJBcesOPgLvP8VVI3yyzmc4xhQO9D59cfzc20IfFG7yrG5Lgx3cQkGy7IpDlRbWznXdmCjdSAx+H278DJRVB7C1WbfrVaVtwsPfMWaY+X3hQBSWRbiSSbzCIFJa4Stax0Tkey33Y0Wzt0SJ+jKU9iNXMPuKtOgB98YkR+e4hBa9Qsxp33wOyCHa3YaJ27NzU9HTW9MLPHNlkzRAWbQ9JFbMI3bmfbQVJbpr+Y39fygNE006X2jffR0EyMh5Kd1FTtFD9+G0eDkiLzthnvlBSFXoKuRPotBbNuUXCrt8fvka9x8ajH+yEsKBbujs3kHvCJ4P69X5qVlg2NZy5toybHkehalmGxWfZfOGfmxe+/AXuMTo7eYwOEp7M3IIP1dmetoxAewp4Hhmh37ayDgvM26Pp0K+DnQ9hHKOZrrDfpFmDZkdbz8JhBgnVqu3ZmH7pC89YpFB1N+TK96FGovPxzVFbelO1MeovkVVO0aBhgxkj6dGPYsn58d0yXTMBr+ULPLm/U6lht047cPe+G2/ockYfY8EQpW9+4= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2351.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(346002)(366004)(396003)(39840400004)(376002)(136003)(36756003)(38100700002)(6512007)(6666004)(41300700001)(38350700002)(44832011)(478600001)(8676002)(4326008)(2616005)(66946007)(66556008)(66476007)(6506007)(2906002)(54906003)(86362001)(1076003)(6486002)(8936002)(186003)(5660300002)(7416002)(316002)(83380400001)(26005)(52116002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: 6TiD9pnTU9Fiv4BVVdWXElLgfcWzUl1v/S1FktuBwtstw7NOtqxtCPZJA6fEnGjZc7lnfICJYPazM04k54kY18p9nfWXdmVOXWMJgdaLhONkXkWS9CXg7skq2evzmXYZQRmCtN61/kX5sjot4cljSt2/QN5/cpDYn7Gaq6jHfFlfZMDqVJoaYL0ChRIAWWVkxLBODgIkGz4Qa6Qg8hpAQuIuB58Wiigapc7ow3k1LHr0cnd7IbZECPDLWGvbSVhA9OMiisAZHsqQg767QdLgm/rpR2AkpS4i5S7df1V6XH58FIuH31CrpC8Bmj/TLfcVSn1M1l6LRAsbk4yBwEifxMldmAw36Rmmroo3yAfRLQE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p19P99tuoVfApnnpDyD7RQLpjzSdQ4uU1VKOFrnUF9MJc/8F6IbyL/qVm5F9wmn4Xfb3yM4LF4QgDsKUZ2rdS4EPz05mdEHHzexLkr2BzTdCflsv+2StmXYKkTSTAhEZgGO8CEx+hupXRlt9VdIe4mp2d1Z1F5J9+0lwN+OIHZMLyrEUrlc/84NJOGMV1sYjQYIFg== X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: d04a2e34-2d5d-44b2-89c1-08da58dea3a1 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 28 Jun 2022 08:17:27.9634 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 48e842ca-fbd8-4633-a79d-0c955a7d3aae X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: A7s22QZou7VCfLBADuw1q3q39H9vlc06Fs939O4ocSy5aBtfF5E1KrJ/sIw8jptm3MpA4v7CXbzopS9jFVRst39C5QmnHNvfC/QpuQiUZx4= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5891 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220628_011737_372236_C51C1AAC X-CRM114-Status: GOOD ( 14.55 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org There are a few Ocelot chips that contain pinctrl logic, but can be controlled externally. Specifically the VSC7511, 7512, 7513 and 7514. In the externally controlled configurations these registers are not memory-mapped. Add support for these non-memory-mapped configurations. Signed-off-by: Colin Foster --- drivers/pinctrl/pinctrl-ocelot.c | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index 5554c3014448..655bada7cc4b 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -1918,7 +1919,6 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) struct ocelot_pinctrl *info; struct reset_control *reset; struct regmap *pincfg; - void __iomem *base; int ret; struct regmap_config regmap_config = { .reg_bits = 32, @@ -1938,16 +1938,12 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) "Failed to get reset\n"); reset_control_reset(reset); - base = devm_ioremap_resource(dev, - platform_get_resource(pdev, IORESOURCE_MEM, 0)); - if (IS_ERR(base)) - return PTR_ERR(base); - info->stride = 1 + (info->desc->npins - 1) / 32; regmap_config.max_register = OCELOT_GPIO_SD_MAP * info->stride + 15 * 4; - info->map = devm_regmap_init_mmio(dev, base, ®map_config); + info->map = ocelot_platform_init_regmap_from_resource(pdev, 0, + ®map_config); if (IS_ERR(info->map)) { dev_err(dev, "Failed to create regmap\n"); return PTR_ERR(info->map); @@ -1989,3 +1985,4 @@ builtin_platform_driver(ocelot_pinctrl_driver); MODULE_DESCRIPTION("Ocelot Chip Pinctrl Driver"); MODULE_LICENSE("Dual MIT/GPL"); +MODULE_IMPORT_NS(MFD_OCELOT);