Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1992809rwb; Sun, 14 Aug 2022 18:19:57 -0700 (PDT) X-Google-Smtp-Source: AA6agR5oxfj6vInchJ1uMP9JvcFxl4YUmRoaitOy77W54s1O2A21wJRd2uIvjILMc6IB5K60nwoc X-Received: by 2002:a17:906:9b15:b0:730:d10f:a932 with SMTP id eo21-20020a1709069b1500b00730d10fa932mr8964574ejc.304.1660526397119; Sun, 14 Aug 2022 18:19:57 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1660526397; cv=pass; d=google.com; s=arc-20160816; b=B5YNltPUVy3726WXh+RzY2Io0hm6qydONj3+D0NRKc0BtqIVyYt1OftpdeT4iomGus /DaU91EDDqQqWTiikrVjEK9LjcSX/OlJsGbO1QHeQRs3GbndurK7LKBPrrq9yMAhuA9f ePRJrR0cE+PadqPSSI+hHh2OMJnoCB9KIAvhEe3C9A01cGEMkjnVCHUYxrGudDj8B+FD PyRXlD1dj8hKgCljIiEYUFKyQs+AgBQSiqSKR7lO/2xhnx0P5tU1ORE3BGlf7T9nB0/T pXi5e+1pf+PN7m9NCqsJXOswGfMCL69HMvafXYeG43eCq7f9KpBXUmTU3E2rFl3wVz1w o5LQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=X5YiTOizMEq699Jb164Rl8ZUbsPRl90dx3bmh4H/GhM=; b=k4iuw0Es9BeZQTCvt5XeXPflQdBlXGd+t6UMlHDx+oGMZUrkOF7iq9I18CN2TUvkvR IAycW3BT/oV5A+dgA/GgffwsVGO/cgVgSMQHJam+DhYX3Vvd1zDBj60jJhso7PU7XCE4 gTEOemYRsOg1QWEdq2pw2LnbZ3G7oMEAlL/EHBq33uwsFYJpOB2kWbLTUMJkyH2Mv81y /zA0IrAROiJHt2p97NNWGoysoM65IesxirLDq7KCKWXg2uE+f9JLbYoeiOKPPhdtyJJz SQJs6EhmGNmtZ+2q+2dheqUOlHRGAdAgGGTLQSdgzxLHl1qqzSpfDdCAD6iVpPBdqfd9 O/+Q== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b="I/UelCSc"; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id e17-20020a056402191100b0043d85ca3de4si8255900edz.435.2022.08.14.18.19.30; Sun, 14 Aug 2022 18:19:57 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b="I/UelCSc"; arc=pass (i=1 spf=pass spfdomain=in-advantage.com dkim=pass dkdomain=in-advantage.com dmarc=pass fromdomain=in-advantage.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=in-advantage.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230199AbiHOA4q (ORCPT + 99 others); Sun, 14 Aug 2022 20:56:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51572 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230200AbiHOA4g (ORCPT ); Sun, 14 Aug 2022 20:56:36 -0400 Received: from NAM04-BN8-obe.outbound.protection.outlook.com (mail-bn8nam04on2126.outbound.protection.outlook.com [40.107.100.126]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1FF43B856; Sun, 14 Aug 2022 17:56:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=AXz78wNYgTSok5mw1l5QdfNuqXkUspgd0c7Rxi2lLKnLHlFiglupLnsbW9jfsamoL7JaMwoRgvTzLQGZRBzRG9Y1fOmpTNrcVcUhxK1CsnvBt7SZ4qzMIkmcLbOjuyDGMXxfYGfPbfpafwsBHfL/6WTmUakl4wV43awkSgEZovixvAbfD0fGnI/Ql3y3i3jpNdrAb+8kqRNqGM0uAJWrw3ftwTDIod4wEtPHjvyo0P0BlKjuVD331zKS95lNhjXnXGH7kaBvlMoHNi3zljEAGjMcLLt+Rk4A6hjNijEnc3UMpd+fpQKhSde1F7S6xkTlnHGVSWrYQ+SZ4sd/bNZPPA== 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=X5YiTOizMEq699Jb164Rl8ZUbsPRl90dx3bmh4H/GhM=; b=eqSIVgQGEX+bFXG1xpIwGn/9qFuvMzDM0q9N/7iiCa++cFcVSlZrRrpRJH7ewVyfyvZn84mhtGLA1K9vrQrQXPsr6oXomf0/+skLlqsyguN6MHDvQAB/GBtyyvv1ocN+x8vg+BkH08NJouLNWQtjM/rOEip6yV8Iu287Lz43qa2RhdXsf1S4tSrmUoJXFy1f8jpV4W2/i12iWpKp3nNqH3NS61GhSIf5/EktebxMfKD6EohdGigPCc22IlNrpqG8LVN9Zt8ElqvVW+P91vDA06g26b8HgFQwM8cjy9j7hD8aIP9ox0w3HWNEV5rH9d8gIOJRjHMOdrdEfbqJZDUCkQ== 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=X5YiTOizMEq699Jb164Rl8ZUbsPRl90dx3bmh4H/GhM=; b=I/UelCScXdKPqZSQcNwCNJF6qh8j82ifg7rHzh6iIsP0SSefmHcOJ6eucOQKix2eeDhf5XAk37vYJGVsR+bqI5BJN0nSr70FL+oAMJZblk8rFveF+pCVHhkD0+dbFsjSk35de9jy+5pgeUwl0ZYVhxuJOiTDsIrN3yfDbeBt5so= 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 CH2PR10MB3862.namprd10.prod.outlook.com (2603:10b6:610:8::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5525.11; Mon, 15 Aug 2022 00:56:10 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::b869:6c52:7a8d:ddee]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::b869:6c52:7a8d:ddee%4]) with mapi id 15.20.5504.027; Mon, 15 Aug 2022 00:56:10 +0000 From: Colin Foster To: linux-arm-kernel@lists.infradead.org, linux-gpio@vger.kernel.org, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org Cc: Terry Bowman , Vladimir Oltean , Wolfram Sang , Andy Shevchenko , UNGLinuxDriver@microchip.com, Steen Hegelund , Lars Povlsen , Linus Walleij , Paolo Abeni , Jakub Kicinski , Eric Dumazet , "David S. Miller" , Russell King , Heiner Kallweit , Andrew Lunn , Krzysztof Kozlowski , Rob Herring , Lee Jones , katie.morris@in-advantage.com, Jonathan Cameron , Dan Williams Subject: [PATCH v16 mfd 3/8] pinctrl: ocelot: add ability to be used in a non-mmio configuration Date: Sun, 14 Aug 2022 17:55:48 -0700 Message-Id: <20220815005553.1450359-4-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220815005553.1450359-1-colin.foster@in-advantage.com> References: <20220815005553.1450359-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR08CA0034.namprd08.prod.outlook.com (2603:10b6:a03:100::47) 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: fae45f93-82d9-45f2-937c-08da7e58f15e X-MS-TrafficTypeDiagnostic: CH2PR10MB3862:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: rLumUiK6yyCWeSsIgZL+8L4Zot+3M9B+sBbFgGJ5CQ/+CrkU+QKotfNXV43jQvDg+BlwDchcn+dW+zORJKyK+LNs7s/bYsT9tCCnqb45WIibFzvVfBjMzvSLJAa3K4hZlKt1ANwfeqVK3OG8ym7cXKGe9XEmpE5n4zkh7egm8IJ/aoWVsEqlZ7bwAkmBpvML440wfxnCJp2BAJU36QhzcRUvkqBi0C4xMRZUrVpRCJ8vZFyd9QsUjAW1EYfJxnjjD6tvr3vP5jRWV62259vWKRGE1yf9yMHLyqKp4PSP/9UPH7fFWfbgckeYZx+YUczkO4oJ7In6AgZRK7iSU4nM5eIqHhvJtr7F9/xoAxHCtpk6/bXSMfkXOkJG/t/s0boNwkbMTrRnrGbslaUkjehr25OUiM6nSWrtwq0zmXDmS2dPYSH6nkxTE3oFPxE6rpeYIedrZ3eP/wR7u5YJCCBGvGihL6Yj/7TisdgEuKTFzy3rehXTZoKSWu4t0CE87gaelnV3V94ibGOMafVhykpI2lw1TCkcIcn+m/Jf34mqc5BXR7Cr+8firgmsfNRfMTgjd7NgkWlMtBhrNPbEKyOMbOaARte0ziqXCBZ7nFSSV7so51OyUaKdfx3ifZRnj2rzEO3laxmTanvnJxDYL8lOhzuSF44sdSsqqFUMCHbyF+d21EMgf6eSqyRIkarp5/yniMllJGgUH3ryTETFWvyXp3Xdr8TccW2oRwuFcdg22Ggcn/5604nfAQ5ijmTfvZoSY1R7w/xzWclBteNsOJec7uZwFIS7VF++yRPgRPPztTU= 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)(366004)(39830400003)(396003)(136003)(346002)(376002)(1076003)(54906003)(41300700001)(52116002)(2616005)(6666004)(86362001)(186003)(6506007)(26005)(36756003)(6512007)(316002)(83380400001)(4326008)(66946007)(66556008)(66476007)(2906002)(478600001)(6486002)(5660300002)(44832011)(8676002)(7416002)(8936002)(38100700002)(38350700002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?NvFJ86bZyvzLEreErLjuyH/UsBN4BD+TR2Y+hAXXhz6LaFGyh1PdHVkTM/yV?= =?us-ascii?Q?rq6dFlcaEqnf9J+1Lw+k1IW99y6nMnyLHrYnc8sAm8EJyzkiEWUsz+pQcdoF?= =?us-ascii?Q?0AiTWYA2+fvMa0l+4Xz18C4MFS7R6u+I0ljpSfS1ODj5Woiw3QG5viZmsmBZ?= =?us-ascii?Q?m/6VXgsRmf/S6QlQqcHO3gp45hdN9JLllUWk22iVnL7wl2vUmlMsss65d50g?= =?us-ascii?Q?Y4SVJC9AOL9x0WbTSSrOSZt3k6P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Q?0+fZZmi3KuvLIiNxTv/kBy6WaS45FR+0C3DhHDY+a1Ur8gyHmou+VHJGz78X?= =?us-ascii?Q?keJ6As6DjeRHZN8ZNrcjfY+/6eaQsYVMOO46CYh0TlEMFvxvcj27ImzoNQxR?= =?us-ascii?Q?eukL/QeNj0LWKmtNpR92zvOkhb/KrJH4PuHzFmoEHuGL6ObLonoqzoFsc/0j?= =?us-ascii?Q?C3kc8YgvyWfD5K/qK4Ko711fJG7HWIf7hL7eypwn/iEJHJDzYvYUlj6pDOJt?= =?us-ascii?Q?0CtCQ5ccuxg2nGoBN7Zp69Y8+Ms4GT/bd9HvvNSjE+Qln44aeekWKXNkVHay?= =?us-ascii?Q?Mx3ez/ug7ral2dBxyJrFzSDGJO45qK84braixcMSUPJ7pyS4r8vu5aaHSBUa?= =?us-ascii?Q?wtn7ytpVkY/Ch2J+PHjgNtBbZG5vhi6i4Tc4d3e/yZ2aI6/6glrR0PFTmIQl?= =?us-ascii?Q?mOfojRurCqFSYuQRGXiP751BHknTmhNfMRPUDR6bUOVjgiliK2rlPRPzcpsH?= =?us-ascii?Q?qA=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: fae45f93-82d9-45f2-937c-08da7e58f15e X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Aug 2022 00:56:10.0106 (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: W8E+Xakqg5aoXqTbeIXh+7mOJCuhnde8++MUKMMV7XeqaOKYFNCZcpDECwT/w+vZcIjUcnApqh/kwXG0N2hD2o+UHFooaW6cENuud/MSYjg= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB3862 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.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 Reviewed-by: Vladimir Oltean Reviewed-by: Andy Shevchenko Acked-by: Linus Walleij --- v16 * Add Andy Reviewed-by tag v15 * No changes v14 * Add Reviewed and Acked tags --- drivers/pinctrl/pinctrl-ocelot.c | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index c5fd154990c8..340ca2373429 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -1975,7 +1976,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, @@ -2004,20 +2004,14 @@ 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); - if (IS_ERR(info->map)) { - dev_err(dev, "Failed to create regmap\n"); - return PTR_ERR(info->map); - } + info->map = ocelot_regmap_from_resource(pdev, 0, ®map_config); + if (IS_ERR(info->map)) + return dev_err_probe(dev, PTR_ERR(info->map), + "Failed to create regmap\n"); dev_set_drvdata(dev, info->map); info->dev = dev; -- 2.25.1