Received: by 2002:a05:6358:bb9e:b0:b9:5105:a5b4 with SMTP id df30csp3309468rwb; Mon, 5 Sep 2022 09:26:16 -0700 (PDT) X-Google-Smtp-Source: AA6agR7a6FCgV5qUPZHe4HvnNf3Tj77PnsacMVPSxFaAqSgMYVxF26VVG2Tq4+7s6MHKi4CX8mwS X-Received: by 2002:a17:902:e808:b0:176:9839:8dd8 with SMTP id u8-20020a170902e80800b0017698398dd8mr10127296plg.171.1662395176277; Mon, 05 Sep 2022 09:26:16 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1662395176; cv=pass; d=google.com; s=arc-20160816; b=bbPeG9z4jab16VpyLR8YUqRxVDqdcpldKc4CKp53bmcRq9BrDH+eoIm+VDvbwbOqbt ifN+w+xVYMaKgAUOs9C4VlyaC6UqFENNzZednv8TSA6Qm5FZ8b/yrf4BR2msYmkPnX7s efpAnFCsrmaOJkqE/I8uU0Ac2eIIDSQZD+HzmWMPAF2Ho1/hyHl6CVakHt0Hg3q/gNPj n2k2bAxSpcH5fsxiBW8OR1UEHaP9nHiANYHj3+qUZEC+J+axKVnmqXbjQzgBclU4FV8u 1L2c3GXadm0VufhmcA4HH0P3/Q17/dXr0wkPew5YtOcv6AKZC/oDiFM4tgPEbqNrRnuq 96PA== 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=VeRckxEZO54EkM75hMOVmLtgg5AW5O+vUBQluRmm+bU=; b=TDkjUPMgvZ4bRAi7Ys6dDKpPYMnIwoZqnhbT4C0aNgIQw913JFqKfPkpweL5tqtxyY 8M3mTtoJSXmKSbygobtQtZQPHepuoxlBCjDm3oIaGegbw2tu7IbbYktFnthXbXRqIRaj C2gkfQDUFvkvY1KNoMhcnVqUhVUJNbXevWr664ak4z+dmS1E4ghP0BRie9Xr9XE+4xrZ Eksm0EOnWy4IQcBKvrX6BIBbQMRqOfBEW9mWRK3eLG4Y62BSj3882y2YT6vlET9yRdhL 14wapeSOcBbamcPHjQTbJ1tMF/FdsEEIxpU4cYX0LNrX0qZA92KbLA/bv7HPc2bKnuKv zoCA== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@inadvantage.onmicrosoft.com header.s=selector2-inadvantage-onmicrosoft-com header.b=dE1tEgwk; 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 ls2-20020a17090b350200b002007cc304f3si2350978pjb.60.2022.09.05.09.26.04; Mon, 05 Sep 2022 09:26:16 -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=dE1tEgwk; 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 S238024AbiIEQWj (ORCPT + 99 others); Mon, 5 Sep 2022 12:22:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52886 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231964AbiIEQV7 (ORCPT ); Mon, 5 Sep 2022 12:21:59 -0400 Received: from NAM04-DM6-obe.outbound.protection.outlook.com (mail-dm6nam04on2116.outbound.protection.outlook.com [40.107.102.116]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB9005AC7E; Mon, 5 Sep 2022 09:21:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=HoerRC1G/kRSYbntfQimrt/Fy7DhzMRRKDY5qZA84GLhpXJo1jIgPkC2d5t7PpAhGzo4m5f4Ba4VXNSN3u2lD8PPnJvxWLfgGAp4lGWntULusH2+OI6i6Zbgj2lCQIfCQOwIZPBjTsrRT7fuOdcoSPaEwUjXN6VUtM0R2tnqF4uWzfE9gJspsc4gUY8HZVa3l1IekUemLzJ0Yd6lPc0TeeykCqY4flp5h0V9Za2YCu5l/XNTCOq6kjOLMYfkpKsYpi9Q83kZ6pbm1VkQmwaaYy6CZLxxmiXjUtca4sfmCqyuNXgnETQsaU0eDqLox6ZjjiRqYjKsKiFzMZpahX8b+Q== 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=L0NDtdWqSvavwDciXMqD1BaCStM+cMTs7gOEswM0yvP0r+L5ouGcK8J/p1hdLR7QgXurctGPsG+8WPSB4cYOKTZyXo3IsfmBgAA2NL/ZRqYFYiUASMWvpQGo6AmF6X4tZgDyu58taCh4HimJZqD1GhQi1aFVYfsoDIA3vKYPWienOLgA6IdhuXtfawZIozmY1UDgn+UrdVEyzdrUpy0SMyHNd6+/efjb6lGsksY6EeUecnqelCsYL0RfH7ITw+w2+mnvs0bwfpGnyLdvFBtfrYzvXvcGknUG0h5MZXUszJ0W5CTRcvXrwNHQ/2wceO7bTm4Bq5B6DaO+sfzEDRQ19g== 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=dE1tEgwk0dQLfEhLyOFSdjPlXOwQpZ0gjztQ7xrpjPEZXWHOGyoAH03aMZKBrbdDAAMMSCaltBT57WzMpIISa5VKV4awMSwEUm+3KTavZnZaqOXdyM0Sa6yit/ujn7SRHZNvd48KeMq8tWvvrCrk1NrSbvl9H0J6O+o2S7D76x4= 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 PH0PR10MB5848.namprd10.prod.outlook.com (2603:10b6:510:149::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5588.14; Mon, 5 Sep 2022 16:21:54 +0000 Received: from MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::38ee:4bfb:c7b8:72e1]) by MWHPR1001MB2351.namprd10.prod.outlook.com ([fe80::38ee:4bfb:c7b8:72e1%7]) with mapi id 15.20.5588.012; Mon, 5 Sep 2022 16:21:53 +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 , Greg Kroah-Hartman , Andy Shevchenko , Dan Williams , Jonathan Cameron , 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: [RESEND PATCH v16 mfd 5/8] pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration Date: Mon, 5 Sep 2022 09:21:29 -0700 Message-Id: <20220905162132.2943088-6-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220905162132.2943088-1-colin.foster@in-advantage.com> References: <20220905162132.2943088-1-colin.foster@in-advantage.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: MW4PR04CA0263.namprd04.prod.outlook.com (2603:10b6:303:88::28) 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: e4fccb98-e301-425b-9fee-08da8f5abecc X-MS-TrafficTypeDiagnostic: PH0PR10MB5848:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: tLwqw3QX5/ON/Hk2Hvw+buRuKpEtz8JitKr9dAJV7h3+RevJ7k/UahOOoYaAag0cQFUrvz2GRvw6vXfmka4g0U8MbMLNjdi/nPnD/IdL211zhTR2huEmaJR0i2hruzmRFxvdUOsuP25wVX2b3v4Mg12VSSATVvsczzMErKtT1lWxjgK48xHUE186RHfVlyzCLqtuGGtE/na7gpFo+LW07p2PFcTZfMr7F3NCIn0R7gF9d4GfGiyqljFrn/kdPdJ2GtXmmhZQNt7hNlAweSJM/ENrm+etLjTAiELbwM5ouVZ2YCTn7XYhXQk22/PbbEGwjDMH6cmIuHVmK0BEotrx/DbLreVXF2flWoV71yVhQr+bhB6SBYXKsTWGOkAJ5c272TUN1buo+3xAYBfG4BZ+S0CrTNhjkBGQhKw7Ty3hoTZEfJ9yh3sYrhGJPzVoFBMiswUygLZOxZiIPhq0u8JKP4DqHNhnPG8jR3atrVEZzUtaXzVPK0fB5u3AhHYXy+7Ya+tNda2MQraFm/PVTaedRbd7uU0e3qNLMCo5SeivBhl9g2Z456oXdfeCU4sLoGqAhSwDebnGXR7N115FuiNNnWIRM10vCICCo6NqRZa7Yl7eKB6l3d0MF2REcDOUq+diotdzg2JM+gRi1HMlAH8S9mO5nlAmYMgP+bGA1t7Wl8x2TfmwspzqtPGjO9PKWh9YrqrKhJQARcp07eFN04yKvZo0Gu4oToxCk55FiRi6uS7Bd5Q3tYaojk5gSbYwelEi 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)(396003)(346002)(376002)(39830400003)(136003)(366004)(66946007)(5660300002)(8936002)(66556008)(54906003)(6486002)(41300700001)(6666004)(107886003)(52116002)(186003)(2906002)(1076003)(7416002)(2616005)(44832011)(6512007)(36756003)(6506007)(316002)(83380400001)(26005)(38350700002)(38100700002)(4326008)(86362001)(66476007)(8676002)(478600001);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?i0kiCfMX6e3R/myWK/D6+nxYjtbifKiXWq5Pv6oBPZRuqUC00iIJInolA1aV?= =?us-ascii?Q?VR/quxfqTme/sRhLLR44LgRtG046Rbb5iNhs5wrIh82nNvZwq+MvHlLoIrgc?= =?us-ascii?Q?9GZ8KoNjXYz/piaqUiZJsfm0wVk/XS41S7AH7hOAisVNOMH94R1DpklUeYNR?= =?us-ascii?Q?LUYt9ntF7J4poZnHp9gMJS9apZcxOWa6m3jrJZM+UnFcFdZIy3WPJfftPZoi?= =?us-ascii?Q?d8UwfPAPAT4IljMFeYLrYD/xl00By/59xNK9+A0WVBjqd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cpuzcwW9JvRl3JwxH1iv4j0G2+Nqq6RCoTmx0m0Z0mzvgLury?= =?us-ascii?Q?AhxryxUTc+PwAzd2BAILigIBMGTc50PaVXkq7uosmviIJ2J0b2XRrdDvfFIc?= =?us-ascii?Q?leOrDiduYINVReS/WLXmkF7I7eSSazKlzlwbhBdVptm+Lq7BZczHg5KJ4PjI?= =?us-ascii?Q?6Zszpp4zokWQWlKCaJrOfIRq0vRo+05GpRRSsoiXXnFCN29g0F2xrVsxZdp0?= =?us-ascii?Q?AS/aeOftx6cImGBNyRAC4gtT5fxvDSLYZIkuQF2ue+YWw1VaqQwTiHUP+IbI?= =?us-ascii?Q?rSjHdWTO5uvAhuG9prgOk7T5LyKz/cihSbs8SjPyvZ+jLelXZM6NkK1pQGDe?= =?us-ascii?Q?mdHTKqF0JGJbtah+daQOhiikzrnxKBqpBjGVW8/B1AcctUYRPd11dTHNFlLt?= =?us-ascii?Q?q0CJ27GF5/lo59uX31gcgswxZLnMIPR+GZQdoKbdHwz+OI8dr45rMO9vtkBF?= =?us-ascii?Q?bw=3D=3D?= X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: e4fccb98-e301-425b-9fee-08da8f5abecc X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Sep 2022 16:21:53.8662 (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: o/vxkNHRafvmxTcrhql6SMRlWMTbVuNXDd28pbzsLkXJrQLZLHPpUv4BVIpJpeZcRtstuCS5ewkrKbukKVjkav4IoCWrMrAEXaUMxN61Rv8= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH0PR10MB5848 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 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); -- 2.25.1