Received: by 2002:ac0:e350:0:0:0:0:0 with SMTP id g16csp181183imn; Tue, 2 Aug 2022 22:58:19 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tWNrr8VxS0yMW7nljsp0Yyg3ETa6amPA/VxcCO9O0Padkvl1thsVwuX5cxa5oaM5vomYxG X-Received: by 2002:aa7:da92:0:b0:43c:c5af:d5c9 with SMTP id q18-20020aa7da92000000b0043cc5afd5c9mr24220236eds.10.1659506299262; Tue, 02 Aug 2022 22:58:19 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1659506299; cv=pass; d=google.com; s=arc-20160816; b=K1brlwxMKNA0tPa3+O0jYnmfz6hNAVn2wvSosjimO3S45ShWYRmqYTg1d9F5WlaSlt W76Y4O7C17Gt10OYneP1g5Zx2CoNInn7T36Oholli48R92IyLMiW4vveDShmZKzQpId7 zmkJlgr+K7nzUCRf3zsRK2eKsfiS4XDOqesRgEoQFsfapGQPg27jv7wYKu0k4YMoJ/Ay fscmibLWhEJY9uYdRLYjvX0vFe6tiSSpu8vaF14Xs0oU9dp8Emi24/hJBL3VbZWkA0eC WVcfafp60VrWDsK0YxGe0Q3elDVmekIx+wpBd8pkWm3jaWZ2FdhsN5gAQ9Lh5KoV9kEY nktA== 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=xQJjcp8DKF6pLkVeT7POjvJZIlNckNnBJ3zmE7qNBYA=; b=UoFCcuaxrmDnaYnwMBNGcRvhRF5UpauCR4CxJb3e3AeGU4hzSRrUtEhN4J0WTb2ANw PUtwQ4Kz3OCp8ZnPnjJ8Ft/hvSGQcF/BkFmtA6L1NtO5qFzoBSm7VWXBpu5o0wUjMBd2 t+20mcfhb1/svj+olQpFo7kHiTtjZTnSNqF8xOvmR5PCuSLaMuZMXpKb7BhSHcIJbu+h BYMcgFbPHwFl/Q9UfJzptMcXKuYaNhpqKQjrrb9ILAg2zBoS+VVl/zot8chK+WRKWdlE +8mQFg/i5yrSV45NF+DpY2pWPF6zIU+ewiKbBDEhR6jKeyFbE7u+lsYbZsPFCCMQo5bR m2oQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=NLDWwSQS; 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 wt4-20020a170906ee8400b0072a38f3f0e8si15360628ejb.215.2022.08.02.22.57.53; Tue, 02 Aug 2022 22:58:19 -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=NLDWwSQS; 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 S236840AbiHCFsO (ORCPT + 99 others); Wed, 3 Aug 2022 01:48:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233757AbiHCFrw (ORCPT ); Wed, 3 Aug 2022 01:47:52 -0400 Received: from NAM12-MW2-obe.outbound.protection.outlook.com (mail-mw2nam12on2121.outbound.protection.outlook.com [40.107.244.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id BE4053C8FB; Tue, 2 Aug 2022 22:47:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Xz5glsx7Jz9CdvFcl+Rc9xu4kgDXcfhWQSVk5p0i2e+Y+faSgq717Gro2pnpjjbMQGBcPEVleEaBhxZW0wvBpCtKVNxhaWtRxDVP8zaU+8uGbgpG8OsAcwCidBcA7reMKUJpMXD87twWAJgk+i+8ZcJrEWPjzZ1Lew6BPF9z33IRhvrgbbK2F7JNy1q8D6DjAex95kJpiBAovn0H1etogW8RowBmtULvxgu7hsX5xbPZPyXBpC9JurRe4XQNajZg4PnoSsPROoW4kM3uFPM4Ii13cgUK++MFMQKCUoQSgmZtpkrpAUyDJ+HLvx7g89xqcqS7eaolr82/Xl6v0zLXZw== 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=xQJjcp8DKF6pLkVeT7POjvJZIlNckNnBJ3zmE7qNBYA=; b=g1AV3OB7pXh/ammpFu+lNOSDJjSSPMVQLeuxfDI0UG8caMlXxnQorGpp0LfgYwnwmMQbgSQHsO+cDNzf3B6fL+FKFL+3ZYrnOzJLKmREhA1wie/3OeYtrt7nEmla0qeYcp+Z7dYEsApzr+MqQxSns63T86GQM3vbEO66ayE/UPSaFin7NzEUlxvhYHYe8rbii0sCThHI0A1thWgFw0C/Cs5yaLv8FFO368B59EY+VOyia2Ow4lwNQqqUix5CFWQbvPID8utLzG6JsW/AGTEUB/8lf8qJhg5XaTxYQEiXy3BoKn1EJAMcQBJQPygoVLM/eubfr9oS2kJKLPjIpH47xA== 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=xQJjcp8DKF6pLkVeT7POjvJZIlNckNnBJ3zmE7qNBYA=; b=NLDWwSQSaBdNxV7wL2YCoLEtKbrxwch7G/l8kUzN20941gvfcuI1xBG0oCkL0tAd9y+wKkaJFpGh0RbgYlGAOAzS1PZfJ+3pYUuLOGNcogcv0APK7T8oQsEffqBWpzDWUUaHY1aC4gGWu2jDcqg7iBWpyHUH5p+sEPQLAddLQVM= 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 MW4PR10MB6438.namprd10.prod.outlook.com (2603:10b6:303:218::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Wed, 3 Aug 2022 05:47:49 +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.5482.014; Wed, 3 Aug 2022 05:47:49 +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 Subject: [PATCH v15 mfd 4/9] pinctrl: ocelot: add ability to be used in a non-mmio configuration Date: Tue, 2 Aug 2022 22:47:23 -0700 Message-Id: <20220803054728.1541104-5-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220803054728.1541104-1-colin.foster@in-advantage.com> References: <20220803054728.1541104-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: BYAPR01CA0026.prod.exchangelabs.com (2603:10b6:a02:80::39) 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: a520dbad-15f4-428d-4772-08da7513b2e6 X-MS-TrafficTypeDiagnostic: MW4PR10MB6438:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: ofMeyDomJHUWqxkhiSg5FxSdLJ/nsHF+2rQvHwKRGR+Ck3DLI2No6FCAkObK7gGeiwZ1hFQ1b8z+L+jTuZhWcg6MiwSHZX/bDMgVjzar5nXCSbl+7WLBqriRVPoOS9J2Bb5vvE58/v3hPDwFruqXrwO4R73GvWLW/YGJF3O/Wf/xuFvBvj0Q0zfLVQ4YhxQVvS/spIW6g4BtRqAW856sC8u1vrfwWNEhseibjBg1ihmmxVah+IghUiFO2OLbycPYL67V1P5dfXt5bIUIcioE9xsjGLdkXIkSe9V/atLOo5rUMnyvYh5QryHHahOdym+zqBaB3smbtBZqyMjn14aCIQtxH4u4UdpLBPvbvplwwN/oXmbypAeLhOOeKztQPpnUS/ZYcHjlpaz5dwQDMHaFInzJKBKV4KXkRpavwnlJoo+fdMm4eQqeNfTGBu+Bq6T+Tpw1RCC9BCRRL2l/c6KasJGgF73Yzxo5rXNvXC6XuZ2tXU7dRRBHtZwBxyZ1yy2bg/btcrFhYpkH1XRTsgNebrDeFSBfs5DXCkFoTm1BKz0gYqnBPiOmfBoDyr/RC7RrCHMoC0me8UrK1PFibsyUl0w0anegrxYQqjam6utl2b0LQZbgwy7fyC3BrS3/OW21yCzpLLi3RpBrmbGoe+RlyUQ+QXyQLOmpfm07PLdLxSiZL+NF8DaoENmz/C8QGENAk8HFVPW63jB0TMfRVGGZku20Po+ZOIvul+ULCZKvKBRsqbTexeK6wQbdut41dYpDQo3WEFZcVNdPOCV3CblxMrFf6ErwnF+cAriTth569IQ= 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)(376002)(366004)(346002)(136003)(39830400003)(396003)(186003)(41300700001)(6666004)(2906002)(6512007)(26005)(52116002)(1076003)(6506007)(107886003)(2616005)(38350700002)(38100700002)(86362001)(83380400001)(5660300002)(36756003)(7416002)(6486002)(478600001)(8676002)(4326008)(66476007)(66556008)(66946007)(8936002)(44832011)(316002)(54906003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?j4en16UqVG2wJOncM8uIMuy9blM9uSthyQwuJQA9m8vXIzo7U7xOU/pwWSv7?= =?us-ascii?Q?7JYG7JAP4Mlmr87pMBC6wcJmldwrEvUflJgJvE+pJJzDDYUed/IiQyKAvYHj?= =?us-ascii?Q?JPn/QG7KTrV+PznLzHBMlshddkzfmujpgC5CTRxFXlU39RKqmhy2G0lSETK6?= =?us-ascii?Q?Pq9AZ97OjdSiasHjGRvWs3hzNouQThHDxM1SHN/6RCVU0AP7693qI6yXFDxO?= =?us-ascii?Q?y6foXongVc2qR79k22fUNc7q60W9rjXggRvL3Y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k8TFnU1Mcupo5+oSU1dMp05TduwGh/pBLouEVf4H7CQSqoDZ+PLkr?= =?us-ascii?Q?qcgcvntnzBpOliGtOmjkqArxdPriIbPXMpZf1yps5n9KMap2Plf5nKxRlUh2?= =?us-ascii?Q?W3MuysH+KgLm0OBBjKOaXUiV9zrvmOgKur257kgQb50CH8iiLSmPPf7XYG/t?= =?us-ascii?Q?mqVYD+TykxyYpNPnIYteGG6UKN8IsdD/rlhKUA6Kod7kZFAiYjqMguBcjs3+?= =?us-ascii?Q?zrTxNavNY51Ce8rib7o8KJIMfr+/aTX1o8zg7X2W2/vCG4I3Atp8oqWhCGk5?= =?us-ascii?Q?2ZSLcR1q7BRCjEo5zeD15y/NZJQ3SH0dxHFvzf1QKYkP+2nBNqdxu05GGWUO?= =?us-ascii?Q?ZBt647Z5KVcuhw2IrlFDiYJTzJcyTmo3TQqSWP40B2+GVZw3WaaTBghpjkAJ?= =?us-ascii?Q?T9vTBhKwapx+UJccDZ7bwKqNSnBVF8etTMU+p+Ja593keBetrLG3R8Rom69m?= =?us-ascii?Q?KQ=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: a520dbad-15f4-428d-4772-08da7513b2e6 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2022 05:47:49.4173 (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: +I41sEpjaPD7BKP8S0zgZV8ibqNuM5TMh+eKdBrJ7kNQTbPXs7KPJ+E2ghxQ9/OySXn1erMj8N0rhX20zp7Td3T3BljGlopYG+iaFDm43WE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB6438 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 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 Acked-by: Linus Walleij --- (No changes since v14) 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 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