From patchwork Fri Jun 10 20:23:26 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Colin Foster X-Patchwork-Id: 12878090 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 ACB26C43334 for ; Fri, 10 Jun 2022 20:25:56 +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=6rtq5y2J0Xg9h+f6VOJuUWZ6n8WagFUn9LgxQvXjjic=; b=p2Y8g0Oc/W9foZ mfV16j5YFVjhe3ghZnkmXMYBULLS642mDs4DGBqAgDXd0kfC0Tekj5b1zpl85ZDTcMIh9Ex92Gxmp 2anjpJacfImeuG3Ltazl42/AV54eBWQ4SS3BzNiaxPCjuCJeXyNFknzjjODY+nDSZKSZXXwWVyF9j mITyr1dd6eRTeAO9tPOQhR6IXwS9R8YyhADie8LALRTMAt5KJMwGMo/yN7cG/a/a7V3x5GgKFoehL CX+79IVjzgeuNz8BTf6WLr9fBfbqRp4Cv/IbpvzSXIq6c9K+ghfAiv56CJkIJU+Y/khtWAcBAX4uc eZsBT3nGAD62ca7XPgYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzlBQ-009iY1-ES; Fri, 10 Jun 2022 20:24:40 +0000 Received: from mail-mw2nam10on2072f.outbound.protection.outlook.com ([2a01:111:f400:7e89::72f] helo=NAM10-MW2-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nzlAi-009iBJ-Jw for linux-arm-kernel@lists.infradead.org; Fri, 10 Jun 2022 20:23:57 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=cb05GgOWAEk9aYvEXqtzYoBM+8Pgt8SlNF0JatVG/XPW2PBVroy6TMz4FyrvxTd8ZonxJquM/e/11QqPbuV4z5jcpNJgBDkRdXuB/PHwStCxVamYfLtTmpb2Y8s9AsxxOzDqLjnsSDIiY/hNXuG1LH6xtq7bGHz/2gKhasJtMMBNvVHChLgpVJpjrqsqp8grkxFA8yeB/37LRDYLiFs4Ri8ele1vdLLYmA/nWK3s+Nu/dmZIU+jz7LeeYOUMXXoquwAq5jNhEocB5MZXZLZmOy1y/OXmy/Xa4FLGmzIHcyzKmtx3KSFPAMqmZ8zQmxURR+MeU282Di3N+RrNUpEklg== 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=iAdLj5PQta2TPxzuQkdcF5w3vYdR8cuUjFKNyQFjmPE=; b=LCxKkfJQt/eYWGW/JnhJxMWtC1lN4rPCam5xYo6U2SMpFSR+b7ptdd5FLDnSrIxAF9nySU31fySVUSuJqZCGGF3U3ZPE+8kL85CZblWocpZnOac9IJ3kZRogZciCemdq2jobWpg0uJ9X/QsevRfHp777o9Hzb+7xj31G3tP3n4eZaqQNOIdaLroprFwwGW1t0+GHfABQBjyrJoxKWeqpNAXv8x0G9CYETjsD/v94hrh+//hBxpITHICEFzzKwbZePQNt1XbF2+vOkA0wZbHkRnDg6j9ALpY4cMhKozq/WO/Bti9gZaVGzbpIBfs4aVrFK51QzIAgduhqO4sHhZq70g== 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=iAdLj5PQta2TPxzuQkdcF5w3vYdR8cuUjFKNyQFjmPE=; b=MT80FS7hTF5V27D67KfSSctTzJYupbHb8O5QLPJXOeNpF8LzBY9R9m2Wxqr/8DQ8qbqRGhQaD3e6z2uVbGW6HrhRdG1J/T6NPfzTr0F4VlwCND9ZOrtKwArEJbg7aWi8k14qLbAFoUJm5BoaT3Rg5voy/OEMRf9OAw8u12kBxFQ= 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 MWHPR10MB1629.namprd10.prod.outlook.com (2603:10b6:301:9::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5332.13; Fri, 10 Jun 2022 20:23:48 +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 20:23:48 +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 v10 net-next 3/7] pinctrl: ocelot: add ability to be used in a non-mmio configuration Date: Fri, 10 Jun 2022 13:23:26 -0700 Message-Id: <20220610202330.799510-4-colin.foster@in-advantage.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20220610202330.799510-1-colin.foster@in-advantage.com> References: <20220610202330.799510-1-colin.foster@in-advantage.com> X-ClientProxiedBy: MW4PR04CA0246.namprd04.prod.outlook.com (2603:10b6:303:88::11) 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: 32082673-f455-42c0-9c0e-08da4b1f1fdf X-MS-TrafficTypeDiagnostic: MWHPR10MB1629: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: avW/4DYqJrIZ6mgMBnxfPwo4qywPoWvkEo6maYYJyeiIWF3XQ7Bfwdg8FtM/zYeDDvQhb4ganjnOUB1EuN9e+Ju2ftob7/6KyJlq6NpMGbvDnMJtX7waLrL4AuCKXBQvkz9iKv9JI4vYw+80ddD8mycc4VihyyXRlx5iYy6PFl5ajoDJwMPy6AtP9uIQ56EhU/M1PuOtoIqvBYDCSs5T947b/q61R9pdBaWm8B+K4NSF72CUDRTXnAPGjHnnlQ+WAoqc4dULcWTI+CgSfjCzdBOtto2oBeCBV9sP3whIK2BExlwJdwqrEabP3WpmD9Q8N8ylyETvlKCJfweGaCpSCez5BshjKUTBdegic4b7QZOkQ+w5z3aYVGZpAPBHHp1KSyzYzhf4NC7LRPwpVdb/AT4vxg9pG1c40Wp7gZr6dNZb7sx858dYNMV9KzduCIWXLPVSiqlRo8vcxtvEhWrR5frg2OcOBhnagbhxm21WLU4/gLns8Ktfo3I4n40CaTRv4ky8A0aCGxpZ9XIT1zwrFN0/dZ+YJC8kfbuC1Eb/oyRgIYOoxzmX1q0da2sHpu2P4fwSn41Ou1OAUVb0RdVSe7xOly3fgOSK/VIj+OfUiZO1TauukDo/i3uyVbZloSTZqzI94guvp8Oj57Oj/XjrZJE58O59FFgFsmj9YagGcakoRFCI8Js62lbWVPqR+UkDFa9L1VMVGC7pk8FR9JXKzQ== 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)(136003)(39830400003)(396003)(366004)(346002)(316002)(83380400001)(2616005)(2906002)(1076003)(6486002)(54906003)(8936002)(36756003)(6666004)(52116002)(6512007)(6506007)(26005)(186003)(41300700001)(86362001)(44832011)(66556008)(66476007)(38100700002)(38350700002)(5660300002)(4326008)(7416002)(8676002)(508600001)(66946007);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: xe+czl5JeI7HaHTBkxKh0Wnab8ojXrHGiqAwEIAjkXfG/QrMfc5/tM7Bbnih5k4WYk1H70/C+w/ZQafdgEOS8JaTpVBA3E98KRJxGl4nkm6OnPMXXolmQHTv4gQilY7H1h5qNUx3E806PcVUoOJZs7Hwiz+dMpl0u11d6r9H8QYpQ8oaZHQg1YjUhIrfLWA4jav5YSZn1AgrXN3ic/kAHf1/nN2qH4CeH7siN6ce/plvn/V8rD3k5FcrRZ/zVSONTzrb7rLkJMKzLeoUQOZnhW4ABDzLhgq+nvUPNCAwwV7h1tE8qsdhgW0Z3R6TeaSm9Ky0htOH3uwwW2goBNOLxvCF8AClChj+akuNJu9kYtd3uaytAotOUty112CHrrntqGgjefRZ2PUBuVDK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0wgxTHEQiRKnbU4SWY+l8PiLK1RRJgwobMeOOGvYA2MZWBryc+SGgmlPeOKDcNSY95HQpO79vSWUP5kON/gJtBvxntKELQv3e6sJuciXKaWYJDv3tVrgocEIJVaQ7UBRUYUJAuDttWlHScWXqDl2Z0U9wfzJP8JXuQYayfUVMwNaYimm9XULH8kpURv9GLQnqiX9nmk9ROL5z3wUwacoRXuokLbTC0nf4aECBXFtG46h4argFzLGOqhnxC59dbVwhZj1q3M3Af+Qhe0u96B2c2sJb/oHTVQbclhwIeYEu5cjJnO0u8c5VMq X-OriginatorOrg: in-advantage.com X-MS-Exchange-CrossTenant-Network-Message-Id: 32082673-f455-42c0-9c0e-08da4b1f1fdf X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2351.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2022 20:23:47.9351 (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: ESkJWWZK4S1/lkg8HZAzlzc0/Z575XBNz61K0ezuqqqqomdRzFSjARQ4JqzIXxmA9B2ESr0nQNlreU1JEQWeaJRzBVokTFX71HhZZ83u7LM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR10MB1629 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220610_132356_668429_22860BCC X-CRM114-Status: GOOD ( 14.83 ) 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 contain pinctrl 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-ocelot.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/drivers/pinctrl/pinctrl-ocelot.c b/drivers/pinctrl/pinctrl-ocelot.c index 5f4a8c5c6650..7ac12102120f 100644 --- a/drivers/pinctrl/pinctrl-ocelot.c +++ b/drivers/pinctrl/pinctrl-ocelot.c @@ -10,6 +10,7 @@ #include #include #include +#include #include #include #include @@ -1917,7 +1918,6 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) struct ocelot_pinctrl *info; struct reset_control *reset; struct regmap *pincfg; - void __iomem *base; int ret; struct regmap_config regmap_config = { .reg_bits = 32, @@ -1937,16 +1937,12 @@ static int ocelot_pinctrl_probe(struct platform_device *pdev) "Failed to get reset\n"); reset_control_reset(reset); - base = devm_ioremap_resource(dev, - platform_get_resource(pdev, IORESOURCE_MEM, 0)); - if (IS_ERR(base)) - return PTR_ERR(base); - info->stride = 1 + (info->desc->npins - 1) / 32; regmap_config.max_register = OCELOT_GPIO_SD_MAP * info->stride + 15 * 4; - info->map = devm_regmap_init_mmio(dev, base, ®map_config); + ocelot_platform_init_regmap_from_resource(pdev, 0, &info->map, NULL, + ®map_config); if (IS_ERR(info->map)) { dev_err(dev, "Failed to create regmap\n"); return PTR_ERR(info->map);