From patchwork Mon Aug 15 00:55:50 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12942999 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 9D0EAC25B06 for ; Mon, 15 Aug 2022 00:58:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=5oRg+gJPzZ/LD+aayUcN32D51vBnGqQarn+Y7LV4XV8=; b=uiXgL8BQDd70kt KX92Y3wQvx3dTTzjKUqV7RhVGmaA6iSLHPlye7/HNvgy7Oj5GbBcpk7pYOiUp6S4tDYMX6V7G4chf DH5fJ4mfpE9V24bwXylLpjRCuY5awXquWnPAnKfpu3MPsHR6Uw5bjaCXBn03kidUVW6td6QbtEEtg /fJd4Ca8jX9oQcunYlqTVj80k5q22QXtLn4egqAk/hNg623O2qC4QH6fgNvqGeU3MldhdL5PRkjSm kPOdYgkjSaV13lWqHGbQUkuj7x9EYGvMvoSjYkiRBBYnyzZ/IJr8Mr5IxRORpWlU0VS4V7oqmQBWd VWXLOM9NywCRDI0Pqbrg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNOQK-00AAkD-4z; Mon, 15 Aug 2022 00:57:46 +0000 Received: from mail-mw2nam04on2132.outbound.protection.outlook.com ([40.107.101.132] helo=NAM04-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oNOOy-00AA2P-H0 for linux-arm-kernel@lists.infradead.org; Mon, 15 Aug 2022 00:56:22 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=U1bAF4ZrVbFH8gSK2r4A+ZV7jkypW/J84BqLCyvwYEn8RI+flFA5jSak1mDofPsgVtTVOPuMD6w70J/NgreQYTlgQjVfRYqnn8z5gFDtj2XuU71eVnd3TCUW+y0Jwgs1vY/KhxMcvQU6I1gAJvROXHjPjO8IulgCfr/d/qHNgV19tLrSOl3MNtppYGa64+JYT7yYH5gev92A10wQkvC7XclRzfAPvcq+IsLML4Tnu6uT+70C0ssVgmxxSnIj7jMyXpqYDGdl4sz1Yq1bqGs8Hlx8P0tpWm2+gPGdIXowl3BiwmDyhUbExfPfRx8gsiYhkdSNFPuaU6n5ILZWYYr6nQ== 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=VeRckxEZO54EkM75hMOVmLtgg5AW5O+vUBQluRmm+bU=; b=QZpmvG7Gu5P7AfIGItaaLE0zXMNquvIO7DqNAZ0WP9o4pVRuilKpdhlrr9Uo7g7dy6Erw64ritCPrmDNMlUvX7yIKxCqGiyKEYFm0JIr/C1wj3s2aJd6bEszbystu6fsFtT3sELzwsSWyC20pWI/aoxFf4VfF8Mjh1W8M/IwPyQoMJVGKT61uIjfImbjTEAC/jhLCcaj8Q6+wIfZ/NWwt0w6EdjEcwo9ksPfydkw4cN7/XnRW9UV/fN9mePmW0jvZ1TQ3i+8jebe8XK7DiE3ZSI1e3jyYOz/Gy6qOdVoKPti2CTYhbvFw7S7o4K18B8kobM6w/p3HkI7j8QhX5bKww== 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=VeRckxEZO54EkM75hMOVmLtgg5AW5O+vUBQluRmm+bU=; b=aqpyGBmWPt8QXJxXZ4OMK40tFnF+GDC9DtcDzkl5PIMIocoM/a+dldB3yQ7ylauzotIfGH8WvMfA5ZeZVsGMDEtC14ZVsZyHocpCZw+SR79TWEtL1K+Af7/RDcHo7D84DH3gOnK099FkzzReqWC1OiEqZkGwL3tx0p6mWKYeg3A= 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:13 +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:13 +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 5/8] pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration Date: Sun, 14 Aug 2022 17:55:50 -0700 Message-Id: <20220815005553.1450359-6-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> 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: 3a4f1b3a-1b0d-4d7c-71c7-08da7e58f36d 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: S74AKBcejZBvK1InBKTCo3H1rB8tSoZne17ZbxabYV2mZoD1iO1Kzqn0OKUioOH5ruq4j6hgtrdL6XS+9uNVzGRRxmWE5bFAsrDlSp4lO1dFgKz1iWmkkCBS7nt3Vfe0t54jE9h26rg18MwhlhfDD1M3SwDG5n/ykpt5ECACb27P68Teip8hE04LAZBhjfJzahegYuM091yxuFaTw20OyxnjkOdLE6m5chg4WGpG2jiHsziUvgAqOEc8pHoaSe/xRAEN6o+vD1x6Zi8rtt2b3+EPl3Cb6o8Lm6gqqK0yydyIrlnROuYnfCX13vGCoUS4W8rPFKqpUhAp8lWbBGLDRT+2fJEsbYxjyU58T0FCJ4rYY6HCSC9M/w5fjotyByLMoLMkQbNo8QobD0SmSSiJ5eTwbGS866UxfW5IDk9CN7StigfL5RnhRet4qYobArSrDEod7ZXJiw73tB5sVmDwBI5Bd3FbzdoDyiVX/UUQjrDDd/qEiSi6oiPLuf/JdMOn9IVdN+cyhwJ1zPi6tHxcZ57f2p2fxiE5yJVGXs1GZOe2cXY/NhiBeN/fFH0H0E4fAm1E6OMpBOegZNzYDrpqmkNVUuOcUzO/TR+qYxUkB35aXDZmOxDk0CeTiMhH+XCWgzcqMG/g5vQOCBp2VLuom2C94D9Gg60nQAWpqnzlmlbYJ2pxBKWULL1Ck2NxROiRiuxbIbiMffP8PBmAYz/3A6XY3xtZT3X9koL/cK5JaV7BzBIb+pLsiuY1edhaIbaEfAFu3Az3Guo+MC86R4tKTcpehg7BZdRmWmnNnu+Yijc= 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: DYQ7MBHF/+j8HqvCUfy+W+5sX0tHy5IwolNY8p6YwVL0y+aq6VkES0BDAZ3UUaILYMIV9K8LJsoLQPGzUzLkPlFW9OJ4R1qxAF7wM5wwfBWMVJ/cgnwQ2IRq8k/G/0KL5gXfllq2hmV+7P3uOYj67www8eoe2nnA4EqCj7y+4SA7GA3OMCF6oqCckLpMGsLGgDnahv45stUshaXrMnD9bRVgKetmojd8GBM3GNO5b/1In2SACiO85LC5SjVL/ROPiB5oeEIEPwx2B1qiSNW/37G5iXltDTp8KHx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wd77QEGthyCwmYV6x82F8awxwxLUWLG1Bh+RZhL+nxXK4VoxbZHFByPd/3ShCKMl5G2EhgaL6u/tL2uCgGUXyfK+aX7pgAA6YUKjOgWOCf6oTZ1wXgfPr0azJK1PCfaw0z4YCJVv/TTb7WNH6ngqLa4um5tC4oXgLIw+YWuaO6ENYOd6xQIfGzZuHMJLcMQpYQhsIDeWqRJ367Y8ftxGFEgm876OdySThnKJH/OTvGDORRA== X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 3a4f1b3a-1b0d-4d7c-71c7-08da7e58f36d 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:13.4947 (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: ikigP4setFmEi9fqscGQNGUc5LXk8+XRPX5NibrDMtWOUaFw8InAymNZx/uE10BFDcytlixDw6eZo05NFE29/16cjnOmwjqli/cn/AYUVLo= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CH2PR10MB3862 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220814_175620_698690_FC37AB8E X-CRM114-Status: GOOD ( 14.31 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.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 Reviewed-by: Andy Shevchenko --- v16 * Add Andy Reviewed-by tag v15 * No changes 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);