Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp263272imi; Thu, 21 Jul 2022 21:20:18 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tIRBL0F8SQk//MNoeOJLOvQeuPlkvAyAFkzbzd2YJWfW98q+3p3bUanWvTpmy3KdWO8Z8j X-Received: by 2002:a05:6a00:1c54:b0:52b:a70e:8207 with SMTP id s20-20020a056a001c5400b0052ba70e8207mr1774806pfw.48.1658463618594; Thu, 21 Jul 2022 21:20:18 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1658463618; cv=pass; d=google.com; s=arc-20160816; b=FoGoFUzQPeBsw3d2hZGbvP1D8E2ldJfcxi7rZ3neZ42vKMKYacfeDKVssxCbkwgL9L 6aIJb7idBYR6Ni+g9Of5ppWqiEfQi5UtI6yO3rKbguZVw2+fSIqj9Xj5e+lzSp0bOtm2 /955EVy+BUXaHLZanQgzGCIuXkgSgnOgzcG7rbFS5mvigiaxcJ7WS/+cNhPAPr3lTnkU +e8i6XTkYrzzkCVX2zCqKFg4UiFm8P+o70kqaXfQx0fVmLuBsKS1K3WhByFBgo9lNAqo m/m7Vob8aD9KnHb3miSHEdcE3BnOxAtZNXt/l53eZAa9UhnfFokYAQ0V33jyx2ijTz2V liew== 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=kK8A1qhc8RxFrx0hyJytdFxYW1S6bsYH2mPTOT+0jtQ=; b=AJ97bEs6prygP7thliFyNXLXzzRswakQjsFd3GLqXJIUIPWWNtHL5QemT3ZUHEbYLl 4AroZ4iWuiWXd1B12obLsQf/kPVkz5T+HxBwI6zYvarLKudEsUK7zTSdbwO8dmwe/jQm fVZGizyr6Ur3qwFSiC83owm1bWZlC+SOW3FtlO3aBcj9I63dzKdLDzKb5iXmNeo9q6BS ODR+w5vcIzMXdA1oYvOFuQi3kuqtsHXu1a5CjWqwCZ5Bfb6PX7vOLAwMCUTltxzLxJlb LaWMoWe0LXgsOODIPrm+qdnR3SbagavGfF1fJx+B+/ziVtrvbDUSXG9Z5AU+SDrWJmR+ TgnA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b="ScbxJ1//"; 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 z7-20020a1709028f8700b0016d1b271c95si4255397plo.125.2022.07.21.21.20.03; Thu, 21 Jul 2022 21:20:18 -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="ScbxJ1//"; 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 S234260AbiGVEHK (ORCPT + 99 others); Fri, 22 Jul 2022 00:07:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233263AbiGVEGf (ORCPT ); Fri, 22 Jul 2022 00:06:35 -0400 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (mail-co1nam11on2097.outbound.protection.outlook.com [40.107.220.97]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8FBE889A87; Thu, 21 Jul 2022 21:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=D0O+/DRDvEQi50M85QvzHYMgrJ11ItdhxUHQAywTMVW8Zw1s2uMswpxVOw+CnhzL3VgLoU9wEnJ061L4tPj8DX7Zqq6Q3IB5RggQysSHmxPiNlhRC7LOo/hVLKAjd/zTzP6/DxkqWHbNOVIT8UoSI2FTcwfNkERgLk6NN978kxlfWCEabioQno/JP6oLKMJotHRqDn/KgHqHEGDjI/W0wbBqdvYWWXHCbeGB/bk5Dr8HHHPUsmmWRBNe9K9bAKryiYT8qo70YMnhXr4Tny9CVfwJjIlPzvcQP4Qe5Z9Hqi2L/1BG1je8o8elFDumv2QUKaebWdFJv0zDBmxXTuBFfA== 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=kK8A1qhc8RxFrx0hyJytdFxYW1S6bsYH2mPTOT+0jtQ=; b=lZDYdaXFyZnk/tGmMO8zLpQMrKQMCZfR39sbK3XakM8oiYQTke0ug+Sfjbc1ld8Ymi8y4r5Q78pwCDmRXhthdHa0TwqHvvytTemO9e8+bGvGqtcE0MAwhGzrTZSZQqoQ57FGzpYZ9XKSEAitNPw4OFLhYgdSLcGtqiMKsUTN4+/uVOf58YMrCIWkwYXxaTyodn2AwWhOyqRT2LOuVuBR867HmJ0pdDCSae+r7sN2ocefuJKirdPZIeOzMFbc1Q1W2NxmU/0U1MCWmjd/3t61UmaBlfGxkoTj7spB7gku6Bi+7Rwsl2DLFMiMcsauXbhMbr/gMj7+E8lUHj4eJ5BUtg== 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=kK8A1qhc8RxFrx0hyJytdFxYW1S6bsYH2mPTOT+0jtQ=; b=ScbxJ1//sweJdXF/FQOw08rk15xG4WGalrG30CRJWlPQ7vSp6TLGDlKWm/ivWcJkGMqhSU9lyMvfRVGd5r8HN5CKO3fJYTdvSipxQ9YnZ0M/fUgAMls/8BdVd6etGesGESR14jXqNHW+V+rHSAPjFD7NzfMfjze0GTF1wbJVL2M= 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 MN2PR10MB3919.namprd10.prod.outlook.com (2603:10b6:208:1be::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.20; Fri, 22 Jul 2022 04:06:30 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::7451:2903:45de:3912]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::7451:2903:45de:3912%7]) with mapi id 15.20.5438.023; Fri, 22 Jul 2022 04:06:30 +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 v14 mfd 6/9] pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration Date: Thu, 21 Jul 2022 21:06:06 -0700 Message-Id: <20220722040609.91703-7-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220722040609.91703-1-colin.foster@in-advantage.com> References: <20220722040609.91703-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR03CA0044.namprd03.prod.outlook.com (2603:10b6:303:8e::19) 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: b228a45c-243f-4d10-72cb-08da6b978e05 X-MS-TrafficTypeDiagnostic: MN2PR10MB3919:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: Ddl6Yjogfxkg0C8wc/On9U/+/JgGY1rSR0hNsd4q5aZ3D9Kdk1odifKDuCgwDpl665tYQWLpr4Jhzg8MzKdZYKf+0BaSdjlzoZwprUnAcWEoq3ZZE51UDMY7RLrTeFHCEHmhb8DK3Z3WU97OgbcClpx/oitAq2bDl6/RpkeAtUhxeCQRROAqJV4Idw2E/5DS3Kh4Hmyfq4FolbKjg9ASFQvwDEJikNGOlJfHEa+8nBFz1lMl8kLdHGXRb9SlKvpqE3lmTJabTYdr44c36D3ZKkuugjhJk8QkAyBiC0JUQHut7qp01uvfSY4ZIHPmv7aq7EoBMGDcgV7LMRooiVIFMVZZSM8RLRW+ObTtoI2GclUp0/fOhpL7kkYk53FF/5S4csNEVIvDerhOSQMnX3yQXbRCS6aS4HRRidUjDe/+RnhnolOkDcr9URr/Dx5z4ADYTih8hHOJLHu5+t2aVNRadugNR0UPZObZ2FyoAXeFID+Gjp1gJnsVrKcscVYPG1scjl9nJmzrF2UuBdLjnI5tGGXTfZ5oNcYhTWlK4RVkIS8XTtTY038Nuj+E9BSiDezMbJ7XNWiFPn/2Yi7PnFd+6hgaRGz/PcE7V/yCImDXbV+IrBgeomGODArYURw8J8FMY/KGr7/rUexjPdXvOhacp/91trHXuqmnaXbZQIChYoHWGft7deN0z/PBUYfvNPQj09PzEdkcU8cECOz3c8jyItSDecieWo0IJIHxelAcMoPoiLWrUHa9qF3EpJk2St7Mvx6rpTdps4HRJd28aoa1Dt87BizfUkqBH9cQqWgZ/jY= 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)(346002)(376002)(136003)(396003)(39840400004)(36756003)(6506007)(2906002)(44832011)(41300700001)(52116002)(5660300002)(1076003)(66556008)(8676002)(8936002)(4326008)(66476007)(186003)(6486002)(478600001)(6666004)(6512007)(7416002)(83380400001)(26005)(316002)(86362001)(38100700002)(107886003)(2616005)(38350700002)(54906003)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?67j/+GtpdNYSdNjHdBrlnw2SjpQbQd4A/812voHoG3tsq3Seb+LM3fTe3yN+?= =?us-ascii?Q?VIL62FFxLUAhPL6pvcHxBnajUj9OUQNnI55nsZD167++fh1AQU4tTbi4noKP?= =?us-ascii?Q?W8BJl9HI28HWa3KqucqzBJEJV8KOVnrQ6kSN8y4djWwVq1zUpiPJ6H2AtfsN?= =?us-ascii?Q?e40qiSW6iTw2eEXxwLc75jgX0pKmNFEm7ZFqdJxZngMPj6fB4TdYVSYjg1iR?= =?us-ascii?Q?CHl6H0WgU3C3w8DJYqbhyXn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JJjef6cozJaecM/RsSnFnFoyfH4O6SalqT5HXvXVBSVgbmlZCUr38Q?= =?us-ascii?Q?YQn/E1KcVj5Cghd6UerNaedFuatatVElMqQhz8SO8EJkFhErDfna1vEdYGLu?= =?us-ascii?Q?wJANl1s50dNm1Mpit7KXz77iOeDkDaT1gGFfVqToVJDoDUa/beDWpwoTurou?= =?us-ascii?Q?W3do247CfoYcOGiTWBcHx9vmmKXFNBCIelp43aRFHdeN7mtm++1voW5LZGPY?= =?us-ascii?Q?ecxDJIYLn7BpSy2dRFeahRbyrv0+Ao2ahZta+BLXZELhyPc8NHnXZZQNxl35?= =?us-ascii?Q?yEZb/fUW/rPL/FoNZMf69ID5GCRE8NgA6F6WQjo3BhOg7ySO1HbPTiLySBdx?= =?us-ascii?Q?dYdjlr9fCUVsVUb9zPJwCydn2FDMjjYI3k7arFsHi4WaZzeKLSCxpwP5xSyh?= =?us-ascii?Q?iYs6HJr03cj0OzSgXjOIj2S0+ZNGda16cyVe/cbQUpf0UVslhhtZDqnJkreY?= =?us-ascii?Q?cQBGDcZPSPISArDf3cwp6os=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: b228a45c-243f-4d10-72cb-08da6b978e05 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jul 2022 04:06:29.5176 (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: 96eVxerX0Ts6ZqRzjKx8GiNUYZTWoJ1VFy6pnbLireqwX+rcDbLDCK1tNk99h/onK6B3ZaGw1cUaXNTSxnup5gT++f/cGgf0oG58DDCIqno= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MN2PR10MB3919 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 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 Reviewed-by: Vladimir Oltean Acked-by: Linus Walleij --- v14 * Add Reviewed and Acked tags --- drivers/pinctrl/pinctrl-microchip-sgpio.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index e56074b7e659..2b4167a09b3b 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,7 @@ 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_regmap_from_resource(pdev, 0, ®map_config); if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs); -- 2.25.1