Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp3740181iog; Tue, 28 Jun 2022 01:32:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1sPuh+Bd4EXo0TzswMqaqCCE+8GCwVJk6o+jqhBUZjIxYD6SREjMtJKlET4vpoRlkRxsicF X-Received: by 2002:a17:90a:3e07:b0:1ed:492d:2792 with SMTP id j7-20020a17090a3e0700b001ed492d2792mr18140403pjc.57.1656405120992; Tue, 28 Jun 2022 01:32:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1656405120; cv=pass; d=google.com; s=arc-20160816; b=jzP6IaJyGAhrxNWt9OdQjEB9AzVrEkEcWP7QUslC4A3SuiEkJOL2fsx0GwDoFlSZfC UtTwlDM4t9EtHkUdi3/yIfWEpu2ZMETuxJ8gQti5MQsJoFg/1PQUsdmFz/2To7Nh371k fiwmkiijFnCMlmBakOJdLzZ4ViBIXpmtAKVIgd/HGOSfN05Tjyh3L17LF5EebD84RiSK WxP75ydBWGd+2W/scOx1PxskmAv25QFdYIzSBtJNHdAHEnKqnvJKPoQKUVcEpI0TrwKK gFVhdGmq1mlumcxFZxPd0CqII4iWttwHK/s+slFN5n8sBiYQ4OLhZnkVJpRgApYfu7EW FVuA== 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=Hz8l3dmutRiH5cPvPX48O7gaWF1rOkq/6lmdFFpPong=; b=zDOxaJ/w6u3+NAzOB42/zwbFpU9ZaflxHwyrv0FYqhbOFP1NfAn11i2+K90F1TnVxz ubt9T1+iWW9R81pLQkYO3leVCF9OF2UwrZ6tWuk7uoE6xg4MypKfndkHUMP3X41Hddha EAsCPU1K26eRNHCj1KT7sXq6sNZJHs/vxCGdpO3XP9kaNxF5vtSreVwNQ0y4jtVcQ6N4 qbCGH8jwdXMsIQYKyanISi6A/+iBD6f2H0Pwzuab6GNAsbUPc9rBVYeM2SVxbUw53LDu hg1hr6gjvVXsQeckLfI+Avw/Vwh5pyv0TUgu9TO+FtqEirxVszJ9KJCYBGuQOlIxTA1c eudQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=aL9Aho+U; 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 z18-20020a170902d55200b00161f01e76easi16259649plf.249.2022.06.28.01.31.48; Tue, 28 Jun 2022 01:32:00 -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=aL9Aho+U; 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 S1343523AbiF1IUW (ORCPT + 99 others); Tue, 28 Jun 2022 04:20:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43654 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244023AbiF1IS7 (ORCPT ); Tue, 28 Jun 2022 04:18:59 -0400 Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2136.outbound.protection.outlook.com [40.107.212.136]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 78E5E2DA96; Tue, 28 Jun 2022 01:17:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=I+9r7svwppcMyaZDcOLPj/af/sORu80bJSiHWGmtPQIoqR6zChJXbuJYFOHEz7ve617KTw/oEd6zyivrHA2VKk2eKS6rrzGRhKaBm2QvPPrQ3m6ChbqhTwdOPXRKOn3K88C9XLcSmRO9eM0oqEH7A45GlfedwvMsCUBm80i3yWmIODblzyP/J1V2bJP6KXazFSNcln17Xx3OS3C0KgJQ41o2S3uJ1mbgYdmjkV0plhSnGjG7n/Pby5JUZhCIqRKWMOZ09B5SCeJAT9UPH+yxxKZ4sjIPbYBKtxVm/vrtcGHoHmYCylel48TxUfjBARKjGha1UeqlokOJSnhVfohNMg== 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=Hz8l3dmutRiH5cPvPX48O7gaWF1rOkq/6lmdFFpPong=; b=LvLchjVQrAy1nBP9iilQdgB7MKeLQnIBee+iOfYxYDmkguYycqtAPzTqIxCmN3BgwyQYidVvW17mQN1fi8afTK+pYVVPemce89VCQUNe794d3eJbOjMirvVlNHM1Nmc8y35A3xLtcpijK/iiCsMjpth3Mvbpwm0rj/2/SBEVs/MnraB7QbChrHWUJY2O9VqchPnsH2bh9aveXsV7DtPJLZMiO6YR3wgh/pD7EXg4uO1DMDho69YhEj16od6kD79tiekD/mMdXPyFfLcM86DG00V5tqlxAykpkOVJCKf0oN80HHr+zNPh7NtNzcS+ZZqbEsLuin8QySQsD3cgAnznUg== 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=Hz8l3dmutRiH5cPvPX48O7gaWF1rOkq/6lmdFFpPong=; b=aL9Aho+UPk/hczC6ucNDryasFUm5G0AN3GiFy0yB92/5Z8K/jz39mNb4trY19MN57CX3EwswlbgbFlmqLOBurj+TPAE1oLDZqHpOIs9Ksi7M7igwlSh94W6dRKqTND52J8f0INlgRGabFPtpRGk+CaieiLCohKBL9R3RlFQX7cc= 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:29 +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:29 +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 6/9] pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration Date: Tue, 28 Jun 2022 01:17:06 -0700 Message-Id: <20220628081709.829811-7-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> Content-Transfer-Encoding: 8bit Content-Type: text/plain 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: c8217e62-8a55-4d6d-0726-08da58dea465 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: 6hOjN06Q8eGcSBps/Uk6Uky6CWZ0r5idDFiogJ7wKuucgC8ive2m3eiuiBJ80DZ3YJzU/U9Zpbq2PyH7ldB3rNPPGy9tqesc0Byk7yK3Xow5fcxhMRURw5bnAtffJyu30JBXiiuwqX92D5Do7KTeXGezM97jTODcCAqrvzIW4UrvNARu1d1mMuwOV9riHuSv2UcX5XmzmykoAoyHs6zQV4tm0A1+rvS7ZnLC9BAgRfrtsSj8/yp2ENQU3+9eTR5YNbMh7KWwO+yfwXWfV9wsqeWauuF+ulh9Xe0z352nLYN6ipTEViJGjnIrqfjEoAwLh+afiROTSwHdsht1NalBXZVS6rXYd6i49Qah8RPSbh4X/A3FqIQCnjhZXuwFA22+gLjt4cZSeOnmKYgrZDUbxXIz/GU7W/PAW/c0OByUGz1oJpb/tOX1GMGHXH/yaaazCW8hxpgnAjiHeibQax5L5vdpnJU1Pmd1cP63+4sIQhCvDHv+ktKeFFoaL6ACqgXGa4KRcz3STHap3YExLNdmY7qwpM7WKEC7MHFq3zcsakOmu08XHZfOarDLqVlSx2WPq6HxJO0hCJ5N0L3R5zz06YBymWjxmLmuaVQlARxE+dCqtJvY2+ZpyfJv9WYmoRoCN6XvOYfB+FtKEMUndbfQ0Jjv8xJz4RMPq60CT0go9a/D4QH1BGWxqZ0jcyYOpeIpTjP79XIl0MmqpZZjZ067Rst3IzTo+IJjQquRD0ULw6kH3zSQQZ0I8Q8b3G9CpYQ7DgA08ndNEkL3qX9tvCihG4YL0kLJ10DS0BAlttojT3I= 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: =?us-ascii?Q?YWPC9TAijY7IJjxCgunvFV/qko5w38UfdPk+Pz+yWdXYMWLybxJcrmza1iHT?= =?us-ascii?Q?hOtYQn9nSvaBxG5MFu6CXowaJ5LhVA+3oE4gOAU3I6nAjml6X8W0eDZigQjE?= =?us-ascii?Q?yBv31x8/RJPELDIgS7UD3RJuMSIkRl5NCouQaWwivb2dxNp7MfxUly6MtrlX?= =?us-ascii?Q?GGFOoMPR2DPKcgMBMnSxcGxrNFi2rkT5/ZHUUYBLF9Czgar0grWsUpMbZw4d?= =?us-ascii?Q?BRhF6CUq8a3K2a6W/zRmmOpuUJob8yQ7eHFdrEJLzISwCTXZADQSj/0FbtPC?= =?us-ascii?Q?j4/w6WSUtho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-ascii?Q?gpDn75xXeqmscHzagukREXXcq+wGFfdQ98f3ivJ1we7IwG4hXiaCllhQUOVt?= =?us-ascii?Q?0dN3AHox/on8bTIwIb+9L3e4uDn68CBFuBtQ2d25C2mLR26hTZgYF4sxFGN/?= =?us-ascii?Q?2Gax7M94HSWz9Hllqkt+M4eBRgFKEOppSz6hvRNGTZ6ZoAZu+Vt8RhlDT2iL?= =?us-ascii?Q?Nfh1VZKZU+A+v1mNRvWOnwRsReBMeSdGpyf7Y7CLJSdIiWdogkEjkgoIiP3i?= =?us-ascii?Q?W50SJSQFPotc5OhXov3nwBFZuT49M3DEIQdD+wTCT7TP4Z6c+ruHr28+TjKZ?= =?us-ascii?Q?GZg5jzo9UT963oyoWchNUN7pUXITurzJZKcIRolbKT1UQfC6a4kHvV45u3RX?= =?us-ascii?Q?5tL2PitiqlS6NHXXj0PpJKBd1cIw3poXar4DWzhVAdNFfWerrR0h01zJM0J/?= =?us-ascii?Q?7Q=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: c8217e62-8a55-4d6d-0726-08da58dea465 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:29.2289 (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: 4DWB10UyAEavLbVlBZh3A7MUHID1TybGlfalNkuNYrZFgDN9pnI6AjN5ZIXawQl4M1s7E94Sm+Mg0y5xlC0CVA/1K5rzAiuhi0krWieL/vM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR10MB5891 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 can contain SGPIO 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-microchip-sgpio.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index 47b479c1fb7c..c924605f9d03 100644 --- a/drivers/pinctrl/pinctrl-microchip-sgpio.c +++ b/drivers/pinctrl/pinctrl-microchip-sgpio.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -904,7 +905,6 @@ static int microchip_sgpio_probe(struct platform_device *pdev) struct reset_control *reset; struct sgpio_priv *priv; struct clk *clk; - u32 __iomem *regs; u32 val; struct regmap_config regmap_config = { .reg_bits = 32, @@ -937,11 +937,8 @@ static int microchip_sgpio_probe(struct platform_device *pdev) return -EINVAL; } - regs = devm_platform_ioremap_resource(pdev, 0); - if (IS_ERR(regs)) - return PTR_ERR(regs); - - priv->regs = devm_regmap_init_mmio(dev, regs, ®map_config); + priv->regs = ocelot_platform_init_regmap_from_resource(pdev, 0, + ®map_config); if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs); @@ -1013,3 +1010,4 @@ builtin_platform_driver(microchip_sgpio_pinctrl_driver); MODULE_DESCRIPTION("Microchip SGPIO Pinctrl Driver"); MODULE_LICENSE("GPL"); +MODULE_IMPORT_NS(MFD_OCELOT); -- 2.25.1