Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp1691083imw; Tue, 5 Jul 2022 13:51:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1shHAsWz3KC6sDdLIU3KqTkLwjfKaCYdhjYJ65T9ZSASSQko6tNDCNpfDvrBgFYNpEtJO+k X-Received: by 2002:a17:90b:4a0c:b0:1ec:d90c:601d with SMTP id kk12-20020a17090b4a0c00b001ecd90c601dmr44440360pjb.154.1657054272771; Tue, 05 Jul 2022 13:51:12 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1657054272; cv=pass; d=google.com; s=arc-20160816; b=enHtISIEZkCIn1iYZS9+DKejw2N0uJ/T8Wm/XOV86XFDSUMFYbNKQcGor3lGhOxfF4 FfQyzyQjt0nIqNSz2jgys9FizpTWOOzmeWbELdGJi5n2+Iw8UFiLa3IyZFMM3NviWZld NV9nbP0T4TjC/Qazt5eMsGj8+OYlhEPHcCZeALDBvqgkPipbhWEpH34RqLNguQEeypnc UrIFFWPIcTWeUGEiKi4JIvFHpSl9ZT8Izxy/dpWnIsyhnxYAl+4BL3JVVMCgxm1j4xmm kxRojsUf+x1RQWsrBEG8ql3h6yYszkJysnBbES2DKiHe8CQ8O3IMIIgEc1L0jzS7O7i4 1+ag== 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=ll+F7wpfknxrO1MrYqXnjoKX+16S1j9J2FtyIEIKjus=; b=WjkkAdL2ZKCJjpCzvGveZP5n+ud2AnyS1CASghmZUyloukEg6fJHR1dXKzG5fohmhL 7RNmnyWSQ6kJk1E0W8pUOt4LNypzESTxlRU0H8SvdCtLF3SPWLMLuzuRXGk/RhpGEPpN sq/K6axpnCKcME5l4DFh2TS6nbC2ZnUI0aEg7Tauy9+N99oj56bL6/ayTGmOy8RFKsR1 T+pAiErj8JLvEbaU3vu6mUcHtdoxadsMe9GQMcDOQOKyZlqYXC7S1wKr+a8I9z+2iyQ3 z4b7HzkYeXQWKN4e7lm/Xpuslf3FGnUTAMwdGosi/166tTf7SE97E3tEbzmwf2Qgq6V5 v+tw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=0j5sfrjM; 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 j10-20020a636e0a000000b0040c757c212dsi20484369pgc.450.2022.07.05.13.50.59; Tue, 05 Jul 2022 13:51:12 -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=0j5sfrjM; 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 S232122AbiGEUs7 (ORCPT + 99 others); Tue, 5 Jul 2022 16:48:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53972 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231901AbiGEUsS (ORCPT ); Tue, 5 Jul 2022 16:48:18 -0400 Received: from NAM10-BN7-obe.outbound.protection.outlook.com (mail-bn7nam10on2113.outbound.protection.outlook.com [40.107.92.113]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 154991209E; Tue, 5 Jul 2022 13:48:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Ja+viL62m7Zf7U/wguxGlIRIUPhC2Q22JeSQsh+Fj3mFBCqOgkBEsjb5bnEfBeNY2BG4BV7r//Gc/1wLTlTt2qxJWi5d8ttPaW+3DyY1e3+C9wA4E39sgtku6ZP8GaQ6tCPTxZC6wK8kYgpBT4MxO1MkOfytHDEZm9aYuxPZDkFwfKweuYa9K2G4OTiEFCRBFpJ1LG+p3El0swqVTxNz03OAOmruO8sX7WCyhzmK2SD4TqnO5n62Bcoo23u13SPeThMW1vCFnFkO3VZCMEGtlcZJBCGZJJq0NWDMSXlPDGh40I23zUcbZKhW1Q9jZnNL8cNdUGCBmMck5js+fnEL6g== 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=ll+F7wpfknxrO1MrYqXnjoKX+16S1j9J2FtyIEIKjus=; b=amWWduXAkPXqCFgv3pCA1nShGaXlvVZmGmEPIJ5mgBZsnF2ipZzi9fUXTaQjPTIwOqJJwUV2yhIz+vNVrp95ABwR18sIn1Uh2+031vqHfbJmOJiLLpWFfxDKr0fJxNBgpHJ68bYKLnW6FW7l7v52sVzVRkHFGEskX6b83X46GBcvHko4J6Tod5YIsaV5aRzPzTYDpBLC+OR+s7YnwwHLJp5DY3Ht84Uhnj8MRWbtpWbqOwnm5CVK9iqNwpIEp/81V3VCAyrBRgIkiG4ByxYFAWw8OPrM2ZrcQIQjmm5YlSHzgo/2qZEWLei7kNFRLqXyZwC4ggWb+50drq8Hk0a3ZQ== 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=ll+F7wpfknxrO1MrYqXnjoKX+16S1j9J2FtyIEIKjus=; b=0j5sfrjMPlOBHwPZr2IgjSPL2JkoZxvq6UTDLZRYWWw0gufx60AZZtFc20dX7JJUg2FOjAWWfNs5afsByoSO5vdtQ3NSEcXigoa5f5Ex4rqDEcZzPSk8IR9Szg+0DQCoWtS3g7+wA/37+pcOJgnScUwzQPOOCp2JdwLZiVPJwNI= 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 BL0PR10MB2898.namprd10.prod.outlook.com (2603:10b6:208:75::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5395.15; Tue, 5 Jul 2022 20:48:12 +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.5395.020; Tue, 5 Jul 2022 20:48:12 +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 , katie.morris@in-advantage.com Subject: [PATCH v13 net-next 4/9] pinctrl: ocelot: add ability to be used in a non-mmio configuration Date: Tue, 5 Jul 2022 13:47:38 -0700 Message-Id: <20220705204743.3224692-5-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220705204743.3224692-1-colin.foster@in-advantage.com> References: <20220705204743.3224692-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW2PR2101CA0001.namprd21.prod.outlook.com (2603:10b6:302:1::14) 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: 962b4700-d744-4b3e-36d3-08da5ec7ad40 X-MS-TrafficTypeDiagnostic: BL0PR10MB2898:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: TNxJ4GHnZlIgi7XQTBUB2pvBNDtnpEQBPmTDOYpBthI1v0SQZbk6ywiU15E7tXt4jbRgARprfaFCBqYzvP9bFVQOZRFJngV6bmk3ppkNI00Nx0pQgy5NjSjoxx0qFkmPJwP7iunXB1+QDpognOx7u1fitZhDQWIzHXsCsh+dPXY1yDI5Ueo3sSSo3cHn7ucl/+JNWg1nTPSxvZlxrS5XWhqtlOYHZOjIkSbk+kO72Z579ApoK49Fj6IIyQdnsHtcjEQn/9a2HTbiZmpN3P0n1SoNvfNgNucUsZf+mkg6UNLf3XmswaTuQUv/Qq6TVsP8jS6unI+bd/eLlNg0S7IRTVxYlL+6hX2PWRvt07Qu92+AhFM3SaduO0OQxNMbdQGwCupYplClRNQaBY2Qf54HM/rQZDra73exY7BRDK/TQ1w4u/ndq7R7DE2PckjplyBvNXa3JhHusac+YFxnu2T4NtkpM5aAmPeVxPkzqU9SMmS6QzK3TMq6lioVkPNKYZhpM2YVzGQceS9IexEzntdXEMTATrrLwJTjM406ytwaF2p0kP/qrd3k+2cVkV52mWcL3L1mpOuBGN0Rra+gPhkT2zS85MDlH3nRKAvgw+dFyEoAWTYl18Kd4SIgkZHiPdRBtGYd0K1YcR9ZwtqhGC9p1SyYiCjUWZql7WYzy2p+BEqQIJoYiYZ7SE/iLc7NJmzRJ7057AzDlU96RtofflpOSjApZpxWW/JrmUAz0iLjlQGDJ9hkF1y5kY/zdUS0j7SLfKofjeqfYVA4Lb4T1xnLltdn2BYbvWmvsPx5Sx5e9v8I1/lsMZch9PEXx4bG1esv 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)(39830400003)(376002)(346002)(136003)(396003)(366004)(478600001)(38350700002)(66556008)(66476007)(8676002)(66946007)(4326008)(316002)(38100700002)(186003)(107886003)(2616005)(1076003)(6486002)(41300700001)(26005)(6506007)(6666004)(52116002)(6512007)(54906003)(83380400001)(5660300002)(86362001)(2906002)(44832011)(7416002)(36756003)(8936002);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?hiNwDCglAn6VsBfidwirRNWisf9XkAfxJD2RVpfFmhs7zPsan1s3SSdceddX?= =?us-ascii?Q?THlHzx8+tkfU7vzhVU2N1pS9D4lSNfRzv4Pc/ByrAK5XFBf3uD1VCrWjaiOo?= =?us-ascii?Q?qSY2sNzldQtCOBTy/oRUja1V2KVMC4qbFlBHmSkchJICTQhgYEt9XWiq041f?= =?us-ascii?Q?qzCu5pa0xSMFYSjqSP+qPej1/JJdYSq4mdR41GkSGceDghR99U8iCCO3+fHt?= =?us-ascii?Q?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IVcWXWSb7V?= =?us-ascii?Q?ft+BCuZQvua8MIL093vivUyycKuWVh8AU+xWBmfVhBjaXgljLNuVvHYe7HJa?= =?us-ascii?Q?czoWOJn+Mtu7rvoL55l9t2sixmJFhaWqvZYmSMxYdtQf7gD30+oldK87ktMf?= =?us-ascii?Q?hwcSGn7+EaM2C0HWBR2Sni+NcZG2m/GCClbPVHPGqHN9VT/hCdfD3t5tYzbO?= =?us-ascii?Q?/eCOhfZeoBRJ7P+VIJcT4ntUrLbXu+U+OSOi3GNnyCembdtS9IwI8RhPBm/f?= =?us-ascii?Q?G18z+WhinLGd3WmjbMKzQwSDhELlC4TA0IRJ/hSgWNcZDjD7dS5Ao23gUXHx?= =?us-ascii?Q?EuxnZ+g15UksCHw5wkJWVb7W4BV7EvV3B9VerUAIbcGBFBC7oC1qfBGKEsIY?= =?us-ascii?Q?ihYET1G/haU2pHzb/NC0yTNvPbsMmaROSxYgnzWfj4A4Opqxx79xTrTtLYsb?= =?us-ascii?Q?a9nC5CU4XhWZo1rDaWzrrHF+ZK5XmagH0JUnZT3MrxrShU3kQOmkypkXAyxO?= =?us-ascii?Q?Pg=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 962b4700-d744-4b3e-36d3-08da5ec7ad40 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Jul 2022 20:48:12.6390 (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: AadtdEpgQzH9EyhiRrjv9RZ4NXfzhLniwoF3gppVn7wOWwMLVH6qKtl50kFN5DwBucMgF2XpHvQ3atsVBZSGUP9OneHaRWx9xSzzedrekhs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BL0PR10MB2898 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 --- 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 d18047d2306d..80a3bba520cb 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,20 +1938,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