From patchwork Wed Aug 3 05:47:25 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12935212 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 22808C19F28 for ; Wed, 3 Aug 2022 05:51:03 +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=yjUdsOJtraQri7LfPWXeBXRLgv65akQhHjVKZYl1gP0=; b=Rvi+c0ToA4Os5t bc5w9OtYvlX2jV7+RzZCeCPjJDuUIIytnNxlueE9isQaMak4mtZ2FYNz0JG1Ja7xHnBq6RIiKJloC nNT2XO513Pd8GZrFpzrA7hhqjO7tKMaqEMzkCTj1HgY1DZjbg5bj33FINi1N2raqW79CNHKrXupVQ GzRxNKnfeOkpxdryhJGJasiWBdOeQnSfG2Y2XUEJMoQ+ISmS8I2Fq5YSurw/FlMRDnVy/589eN0fV hY34u6h7VGHZ0tE1tHm3Q96OerHTnrUHocLpFpkCLgsHPVxBqKs08E9uQzIK/LPtofcyV8RQCOgjM f3Fqz2DetCgZ057cUOAg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJ7GK-002pv7-VI; Wed, 03 Aug 2022 05:49:46 +0000 Received: from mail-dm6nam11on2121.outbound.protection.outlook.com ([40.107.223.121] helo=NAM11-DM6-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1oJ7Eg-002ohk-18 for linux-arm-kernel@lists.infradead.org; Wed, 03 Aug 2022 05:48:03 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=NkVRBa1so/uU4lhXTuPnlKaXq65MQQovr4NSsmAiyFTrJzR2ClVlI2oWw//sMnfiN2zI5v3VwpirVEl19Iw+Fl1UVSc85CL9sFrrp4HjrDk7SdRLsZPDI88+1WYnh93us94XHa1jPLH6VI5RS8xiJRdir8YwG90ec82YZfjhdH3DiTXqYr/SmoiSG/CHhDWZBdcl6mluuk6vSc38nlpXvtTiuOAs50m5rnCVWJf2ZHtLK8lYstz5bXFQpdsxtPH1bJQYpJAnpdvwrtB8jbhFwSs4V9tU766oCG6Zh63RzXvi+5ewjG+adRTu7DQSlcc43Fk0XXlQvc4JfHEwqTe8aA== 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=RB2Ko3JvokEA1QTdWmgqle7W+LlLneKUy/WEwyOhBeg=; b=ehS2sTUG9WcqBhSJpKWV+oMyjF0r/UWVYMFhULTx+aVy3Fw7rnqQQaTGPudv5vdcw1ZKu1uXOLqq00Q5GJ10oPvQ6qmynTqfqtUY3hlg8vNvOp3h/C60ms1WJKlMV/JJ3M4ILRaOR5Ii9Vt8jVsWo7ZGMAYeqS2qHbttNK2MIJxlR7UInvRBu3p2lgvPmuBWoDVWDe7hq+utAmojL7y6DS2ivENhnI+ytO6ssGmCfwqaMkCp+NFEB7OZrnkaM8RPOu/b7FJ6my4tZiTR1h0fG4Q9WahCuohOHEFj+AASgt32WXYyoDhZ4w45BitjJTCN3yoQOLqCKhLgoS50AS4/Dg== 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=RB2Ko3JvokEA1QTdWmgqle7W+LlLneKUy/WEwyOhBeg=; b=jxMMisEYLm/jSzLAMj5Fd5zKl0MKS/eicwseyaExS5+u36/fE4XAz912r3zPCKrK0l4CvHQWsmzX2zkK8Qh/hNm/LYDyBFSBYyOAxQ9aH2L7swFV9AZal/mDYoc2wPD5ioVJliwyoyTbpqu6kNdZIfo1KOXtHhiZ2bauDzp+nHY= 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 MW4PR10MB6438.namprd10.prod.outlook.com (2603:10b6:303:218::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5504.14; Wed, 3 Aug 2022 05:47:52 +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.5482.014; Wed, 3 Aug 2022 05:47:52 +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 v15 mfd 6/9] pinctrl: microchip-sgpio: add ability to be used in a non-mmio configuration Date: Tue, 2 Aug 2022 22:47:25 -0700 Message-Id: <20220803054728.1541104-7-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220803054728.1541104-1-colin.foster@in-advantage.com> References: <20220803054728.1541104-1-colin.foster@in-advantage.com> X-ClientProxiedBy: BYAPR01CA0026.prod.exchangelabs.com (2603:10b6:a02:80::39) 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: 580a5303-405f-46b5-d954-08da7513b4c7 X-MS-TrafficTypeDiagnostic: MW4PR10MB6438:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: XzlRd7kVOxqw9uL+9jQWrwxAryqoeO7RlFhzEUMprSo4iGgaC8fv1tSCW9byUOAYEbP/KtRMSW72aqqxcKX4JzjeGurqwba3/zY5RUcq0CjTz9O2Bcd8XavMY7PC9jWGWJ7fh4FfSZbLwlbMagTsTCfsOoF7JBXQ5Uh2R0b86Sm+xDJs+BklW4+/lBNQFD8+Xe0Gx2p6XSUn7mMp1591PWPkzQNP3WW0wqq0n7SCRkncxQxypKRgjU6PyhIbzqYoihv4R8+wbaI4kBA48ecg8SRlkNGYnqiwdLeMSHfEdERBoweq8UyJIpEkNVhfDyRKtDNPw3IEu8VXaxKTSB+qyQLqSixBwbW7ojkedpneqouyU+rMPRYxbGGVqu76zOWrZGkItC+zJhWpyKsfhc4QeAMulGGHn+mdbIS6BLrHptjk8oTFM8EPRPNW17G1/N8EW0MXaUpiJ4awQ0JhjhehAGG+ZVwrbtX/t5YpFKf5j9YPcCWcoY/8E+JCaoIrZZjCL9giOmrmB4rkr5+xLCZuVI2W4pVu8Kk/rwMcpC1sQ+yj1okYkl+3GPEqheV2Y5hbrluu0MGcNJ9iTDY3mCj9RzpgBQqotzJ+Cad6bk1NzoRta5ZL/D2lr6fi+TgICMn8/KBgJKTE7TPie317TCpOhq7ADMDHj8/M8AfjIDN1lVhX0T7vJFXL5SdJ9p6+0wnpTNv/WPrdKjlOsfx8Gm8ArTiFd9rL/0keac6G/3Kqja9iKDxzB3X4ZOm41p+lk0swixtZOF0Bl5HhkB+IpJH8ntpQLQQPpwY5m5DJusTnrZs= 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)(376002)(366004)(346002)(136003)(39830400003)(396003)(186003)(41300700001)(6666004)(2906002)(6512007)(26005)(52116002)(1076003)(6506007)(107886003)(2616005)(38350700002)(38100700002)(86362001)(83380400001)(5660300002)(36756003)(7416002)(6486002)(478600001)(8676002)(4326008)(66476007)(66556008)(66946007)(8936002)(44832011)(316002)(54906003);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: Mcd1RkYp0D5DBhTt4qDzmJc4tUJ9pf1asYjdUJ2TJnotrUzNA06gw78ghN/tjvaCyfrrOBYhcRc1x91D6SYxXzj/4xw+OxE5jHlsU4j4zU0KGoPdh6BZdnzqIZE5dMh+5vM0K76ctOW8pVs4jieL5p6oqiPMTaJCDCx5xOm/Wbn0p7BO47nfBPcgJ3NL67GedOre0jpMkl/RZ3jCx//PWogLhBJ3jdONbPiC+gTO7jbzF4xeVq95posJElbT28TGt1HcnCpyxmWym7QN3bZuSGYTtdofUTDHcQT1yD1ojCRD5Y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ecGVZluJM/zL0x4y+YDMYA+QbpMdt5FVZHivpJyOhPERdPl/rftdCZZOgTQvCyCDTZJsnAGG50dyZ5dmzNCD7hajiV/L/rhuFNg5S6a/kg9/vODrlR7EcNH9k8rpx1zmjmeHJ8E5/06Ho7Bp8lwoXC808AfjacM7ixNzulvc9BpbQPYThcZu1FnyzAoI9ghuIHXlytUAhzYwe275Pk8+lQwiFXOzVA46LreIXv2zNQ== X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 580a5303-405f-46b5-d954-08da7513b4c7 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2022 05:47:52.6202 (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: Jwy2PVJA+ADCUnnQv004FCojy4jD2uRM25yEcfpp+5gS81ifQtGusg/PLxRYwpBlRIZd4tmKPWwrEb7hy2wH7F1OK65sliqiFPnJHCGdN7k= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MW4PR10MB6438 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220802_224802_111282_7BC786DF X-CRM114-Status: GOOD ( 15.05 ) 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 --- (No changes since v14) 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);