From patchwork Fri Jun 10 17:56:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12877872 X-Patchwork-Delegate: kuba@kernel.org 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 439FAC43334 for ; Fri, 10 Jun 2022 17:57:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1347362AbiFJR5W (ORCPT ); Fri, 10 Jun 2022 13:57:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44556 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350243AbiFJR5R (ORCPT ); Fri, 10 Jun 2022 13:57:17 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2121.outbound.protection.outlook.com [40.107.223.121]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E999E9399C; Fri, 10 Jun 2022 10:57:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=YoGWJqU8fcO3WbZbtVWc9Qdn8PLZNM6+NYJWoV+FnEGQTm2OFFrGcBKHPze4PEtEtz6hBRVSQttG/Aj9phq8W4fXIl3M8u/v7joEYbZF9/TUaorpjuBdBAoLYXXuc6IIxguNSIb1HMupPVajuFaWR54y6nDUFt7lTho0MdQT9i0XiPf3husVbEUgMscAPyMOb+fnoMFQMMvfiC0vu0dbMriwLvGPU85tHDHEOsb3VQWHyvS/Mjbm49KCZclwIWnDYwG9fePaiWayhXSH5F+wL6EDry0RaHcOku2WBMeZAUFL6vkK33Gc+uH+nep6fh8Q5N8KiHQCGZ/WM41z8Zj4BQ== 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=p6B4X2S6ByfrNayHTGMhOyw2kSy23jsOuPxVkk6Em5g=; b=aGA3PMZEH5Obnj1FUEnx/N6nkoIcPkZqg++2CuAjg8RtJDPUh96iVqbYtjOo7L6SQ8qGsBzfZrI+xaLW3fop8dPPtiqKsMKRhvO1rjqfh/e6nx380Zey4W4sBvKJ5TEEjKLLNbjUbLQpS+njn69VS4P5FZlQRXGuSmSbJx6MDZ/FWfjXsvO6oWql0F+NdHIh58CuTreKT/I67gzrRjtAkZH3wprT3hIAxYBxZ1IPcSxmnKGbVqT5v1G8xbp9tgGxuZd6ZYiS/wUVamTcRjWVWVnaAGgB5d6VNP2uSd5VWQX3MjVoMDskvuABuTVxNQ5JIcJ85q6Xz2bJZz7oyAZ7HA== 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=p6B4X2S6ByfrNayHTGMhOyw2kSy23jsOuPxVkk6Em5g=; b=UIuScHOstBdZ9PqoV0WdqXWLE0g3JapJqp89GJgAyXpXidRvCiW7oAagL6+NaDa7rmKGj7AX+VJPhWOL4k+IOMLqmx6BMoAONZe61/8WLS3IvBTiZ5+w0CZhXujgiDJAK0XqmAeVPwpmDbU1iJ47qOEs+XL/1TjJnNq5si1yxxc= 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 DM6PR10MB3356.namprd10.prod.outlook.com (2603:10b6:5:1a9::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5314.15; Fri, 10 Jun 2022 17:57:08 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::b8c0:76a2:4c89:d10f]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::b8c0:76a2:4c89:d10f%7]) with mapi id 15.20.5332.014; Fri, 10 Jun 2022 17:57:08 +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 v9 net-next 4/7] pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration Date: Fri, 10 Jun 2022 10:56:52 -0700 Message-Id: <20220610175655.776153-5-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610175655.776153-1-colin.foster@in-advantage.com> References: <20220610175655.776153-1-colin.foster@in-advantage.com> X-ClientProxiedBy: MWHPR19CA0070.namprd19.prod.outlook.com (2603:10b6:300:94::32) 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: 33cd7c9f-960e-471c-5336-08da4b0aa2f6 X-MS-TrafficTypeDiagnostic: DM6PR10MB3356:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: MJw36KAeSgqSXE9yXxY9Wc/vT9jc1zKWpmfNVaJUghr17pFfNI1JTXWr4ZpqSNiDx7qzEpnVrrH5Y4h9mrNeutLmw6qNONSZwCxMBzESz6OLvOG45Ktno6JEoHwCXXuTYz92CMJZWsBDyShuLxFtuPn50fOQkhqPbf2YOVWgxVS2sYEKWpezUP8YVJnTESubPZTlRHjBspySsm8WrsuMn2qRb7EeM/xjuIK5ZHmcJ9YSCVaYi/oLVmiDbWr6I9wGDCOr7tfTklQ+wQtZBCbNKEXIWVx+KsAZ2yl8vbQz3EYrnkBPBJbrVY0yigBouqNHYOPWedyN0hjIKgvI4NlJ0sC5b0Z2Zkntbz1X1RfYIxyLusLGQpxN+eVEfPs+pz3p6w+n/Bns+woL6uJPq3j6a8eEvFyrOWXJ97ENE75gVEnpuE15ad8uFOLH5VHH+iFoCOP+o76jF6Nn6+oKVVgCkRcwkupG4QMsxP3T2mjL/Hqbtvknk9bysx7FwxZE/DKa8zkc2no1HpUSYLNsTQCCyZh2F5vATFj4QeFlmx4B89lnZIfFlVS/viUVkAJDPVJv6LP0zM3ecuKU/uKUbyhcN6vxpsDrKL0raHIZk5p0eAye2xugwcY7j8s0CZje1HXk6Va/9lNszvvwrQ0INuPUvA4FYdEBseK7BOIwonozzElybJxc5CTqPIsjvQFtiKn2YGR+fntErY9a0t4vYXyjQg== 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:(13230001)(346002)(366004)(396003)(136003)(39830400003)(1076003)(54906003)(316002)(4326008)(52116002)(8676002)(2616005)(86362001)(508600001)(6512007)(26005)(6506007)(6666004)(41300700001)(6486002)(186003)(83380400001)(2906002)(38350700002)(44832011)(8936002)(36756003)(38100700002)(66556008)(66946007)(66476007)(7416002)(5660300002);DIR:OUT;SFP:1102; X-MS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sxhm9VmiF+9HLDOe1ZVDNX/mn1btQ4ufewNyDXG0rW5EUU81aexweh3D8rqGqcjMEo38VujhSYptz5iGAGF+WBfYoE/e65YrK3CD4oMASubKAjSlVtoyI+/1clLSgPqeiRaatVWczFJv+ccppTD1eiwo/EIaiHecIRCKDOkTQlQr6X6kEAzvgWr4zKix/Y49ysoOOHw7jbdxPF7Sen0q7uHC7tsmwZLHY3fheoHWt/eP7sCssaFYKhMwvZTNJJEI3o9UpVE++3l6XjdE7JJKhcQ+Lq08ukLFPvaoL6W0qO1bw+KVcJRBdwZIlQpEB9H2sq3Kyf/vI3HTDELKsC5awZ2di0yjBGtBe/zdY8SHsXOahYpQ4wejBOgQv4nKQwmzD3HIP5zIrR4YxFm/S9rGSvuLawRBP9o6WVukoYxZkQR5jR/cYJVG1KeKK1+Vr7UiHtOA7YXDglnAUmBpfmbBgOdU/+ciss8l65zrbm+Oan283oVtUiDiWCIF9wxPhqLn0ZF7VTfask7OT1NYlVdCAjzLYr9vdjfRhUeY+Cu6GaEpgGF/79bmkeVMGpxgp6ju/YF/jwhvelOZ/yKUBcGoLwolvTBODe0/+VvMJ9GyLRe8XYRzU2hRhVdHRsVaHkKhmgtmgB+kuo3somRgcncaJl8ue3dhwL8AkNWs8sMO42J5sHz3yB/6Gv+gUzX6DS0rgukLGf4yQ/uvAKFPpfywTowAX8LaJeFKOFWctoptW3hO6uiTDs9Krx0q0ggkWe9nz6eUw2rcy2VC X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 33cd7c9f-960e-471c-5336-08da4b0aa2f6 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 17:57:08.4967 (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: 7yAc734C0BsIgdymLflxeJkCSHV2Q+mGNYpZYJ24fHIpIN/wwf9ukqqPaj8ODKbFK932l9YgG5jeIGft0OaHp63VwRYpt2WLSMcJErXItKk= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR10MB3356 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org X-Patchwork-Delegate: kuba@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 | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/drivers/pinctrl/pinctrl-microchip-sgpio.c b/drivers/pinctrl/pinctrl-microchip-sgpio.c index 6f55bf7d5e05..25fe57a0c26e 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); + ocelot_platform_init_regmap_from_resource(pdev, 0, &priv->regs, NULL, + ®map_config); if (IS_ERR(priv->regs)) return PTR_ERR(priv->regs);