From patchwork Wed Nov 13 10:10:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 13873414 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 348F5D41C27 for ; Wed, 13 Nov 2024 10:17:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type: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=2JMsIrNOcncD1mnEjvXrGMCWkZcNE+wVT8B+C65EkpU=; b=wzRh2xiHX/L1Tb5YV0FQbnaIGK efnMpotE0AL6Thkz9z5k/zYbaLyAfFsFpaJcNPDIBez4YS+T91xfTsICs4vWT7jp/LexT0nV/kbSR R/Lmd4tFPtgIA4x4DDMZ1uSD4TKrIZhGvZ8lAdHScq1LXEsLEseMEtMXtWmo8/bPQyNoaLgYdIA97 C8NNH+EG/rYRAeomuot70a8DA/sGPGmlr+JovpLb3yNbnukUZRtEDsahh/monhw6pCAx0+rO6pm75 HZVpTA/S9MldetUFfeh677i1XmWudCq5QochsXCfHBeL8F431gmg9UOcGOnZK1xRYLtQ//1a2VklM evmzn2gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tBAQo-00000006PQv-29Qn; Wed, 13 Nov 2024 10:17:02 +0000 Received: from mail-vi1eur05on20621.outbound.protection.outlook.com ([2a01:111:f403:2613::621] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tBAMZ-00000006Oah-2OGj for linux-arm-kernel@lists.infradead.org; Wed, 13 Nov 2024 10:12:41 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=gSTHBWv12uvx2jtK377mVuhBSpBontOdL6GZiDYjXOk5Ggr2AddJrugK3ujOYgp/mX7gGvHyG3yQY9U+Z2EoTNQunijm+Xm+fR+A7SO6RBgkCHDSeot00MQgLUReI6MoRbKuJegbq2P5Xkj+yR+OWHIkCbHR/ElmTcgJB4EVgOFobjUaJhQGbwCOxeftmBhZ1HnaGEJHtumaSG+Ku692vD9qhTqpVi8MtoygHA+K5TMGbEkyzV+CggpCB6iPbjBLfwAOKBxF6FyoS2l9kM8TtoNyDR2cLj04Axs/mc8KED5r5SGM79Yv/lc/CypWG9TlabP1PWrlKU6Jy3MeNxvcSw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=2JMsIrNOcncD1mnEjvXrGMCWkZcNE+wVT8B+C65EkpU=; b=p/u6ONMpUxVTqOlPD3XIA0ga7bGeHdpcCFu+pgFplyDPTckkJccpCFg9E8Cd59jiObitml5ABb6v3pln34Sg3vTh7na59XcfZglqJ2gzn9yNWRjKcharGX+DH/81kOcjJPfH0b8hUVbBYgMICsbm4us2fRCTycMnhdL5/dc4wNRL94+epfoyxvRGJ2miE5YIFdGBOx1pipsOyBx23basDJ0oyGtLv3oLwXP4THsb9Nwk274sLzgMdQEDeTYI7uXUVxgksEIFfR5pAjB2qwGmvTqtiuQN7YtN6GAlcg+J020HHF5m+bMEOItuTYzVnbblal8qEuGxuBVPjD45bzgkxA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2JMsIrNOcncD1mnEjvXrGMCWkZcNE+wVT8B+C65EkpU=; b=OHXGO76f1ots/rmt2qUrocFxFhqD/Uou703B5EPbFYc1H1g/z7biUqu1ZTEBAfiSVXDo/XKcfPGAGAWftNIpE8ZTBWUy6f6jWJuQyTn+Lt5crVzEu1a2nGcyhex9StVK7g9nBSWWqdThvdmQLXFIbQ+XVsvKlehIvtPeQTxyLdBwFu2RfZ0t+FdegCav1EVNfU+jgIrRAjWDhSyYo+lcVQkEErLj67yp+875nI0dx1ZyoGm9t8SmOejA4NVMTzPAO+Gq09gKY//GQ3F9Hgzzf/rp8EgHBDyISSqUeEVmudwoQ9522nBfK+1TPhKkGSL0oIvCfbPbEd9gnxsDnKg0UQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by PA2PR04MB10129.eurprd04.prod.outlook.com (2603:10a6:102:3ff::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Wed, 13 Nov 2024 10:12:34 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%4]) with mapi id 15.20.8158.013; Wed, 13 Nov 2024 10:12:34 +0000 From: Andrei Stefanescu To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Larisa Grigore , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lee Jones , Shawn Guo , Sascha Hauer , Fabio Estevam , Dong Aisheng , Jacky Bai Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP S32 Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Pengutronix Kernel Team , imx@lists.linux.dev, Andrei Stefanescu Subject: [PATCH v6 1/7] dt-bindings: mfd: add support for the NXP SIUL2 module Date: Wed, 13 Nov 2024 12:10:53 +0200 Message-ID: <20241113101124.1279648-2-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> References: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AM8P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::10) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8487:EE_|PA2PR04MB10129:EE_ X-MS-Office365-Filtering-Correlation-Id: d88f97dc-57ef-432d-2b5e-08dd03cbb0d9 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|52116014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?2TnWXpon+A+7gPmiNvVBgk1zUj54vZO?= =?utf-8?q?ytY/uQKymYxkklG0/IhSY2a2f2t0P/pfUO4T86z7S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K7a+Fa97xpIzelry+IqvxdRDLyQ?= =?utf-8?q?PnK8qsBi6Wkt7VJOEeyOPOAnJt6GfjnEZed+fny9yQKqq1r8IyxwmyxCIDiTtLrOs?= =?utf-8?q?BTKlkndRNQZaAy8In7glG18SSe+1gtpIRPgbGV8erFLoySCFtIKlxwDMpZT7B0x28?= =?utf-8?q?ZVpQSSk0SjrtaKhVYpiWLT8NZus4/8zvFzvuiIAQzzrnWwu7SdtHi+AGz1DSKdZmq?= =?utf-8?q?Ws1rLU6ae2Pf6CMTwLcHNqo2UZiq/kDB2Yehd96OkEVVSGzAEpnFKd8AELno/wwRg?= =?utf-8?q?YrQLFcQWrJvyKfoaVBaKuXepBxEG7B2oMkrYAYJjZ6smLTdztaxgOm7+M2XIcRvST?= =?utf-8?q?46HhJoBWdVAV/2i3t+NybMhRLs8dVPAGTNw=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8487.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(52116014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?zNfrcCq5YH1INUx/s1ekhE5/x921?= =?utf-8?q?2v3W9usORkLFv7uZj/7dwTwRef+WogT/zkKWeo3sl7EYLiqz3rxmNTlu9xi1kWrhy?= =?utf-8?q?+QMVODa6zCRVSh78UjTR37HtZoiCOzCi5lwx/YGWEhnt3kooS6WjZrhoIvfCncD2q?= =?utf-8?q?L8OcuASaMyfxTimUM5QBHZDckwNOWnsaNqdzMn1cHMEaNQfXUQg2QcfP66oKMXfXn?= =?utf-8?q?yRE4AI4GkyW2JGxVxeb8nefjMgr4/5DDw5TxfJq5nsAKAslK1HxVO6XewHHE8O0Oq?= =?utf-8?q?umtsitvnbXy2RIpZaOw0fRw+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Q9yileEb2?= =?utf-8?q?g3MxPc7QgajyXU0jZM3aXeTsZ2OnKjwITYR6lXc7VjZRfyfP4BoZfKh24t8oLeNcP?= =?utf-8?q?m9PFVYy8o+/1mxuQsDod3Fp6lVMVdJtg6YF08OloetolGZzqN1pFUu6Do/b4R1LMn?= =?utf-8?q?VSEYxH1VVs+NR6MPCcinSFX0K/jxze1O41a71ZK3XNTg0vGe9SM8Id9Kw83ntGkiV?= =?utf-8?q?RgzqHCu75ophhYi0lkmyUx521pDPJiTjd64xI5Hb1G/bYKbxOKkmEr9kfPosW3ax5?= =?utf-8?q?lCo/3Xy/i6ZaR7UTnXcexIeu72wj1KxYiy58fT6K8vPUGI+5ytlLuyRgsB+7pajGV?= =?utf-8?q?JnS6Gv6rM6xee3qUwuOeEBfnn86+1oMp2g=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: d88f97dc-57ef-432d-2b5e-08dd03cbb0d9 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 10:12:34.0488 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: jfbJhVdVpySr2Bb8JPaJpnpLiHT6ihksQpO8ziY5yAZb8OW/JsEtKN7hCbicmJ5/XYYna7tSEdVhVePEnFhLggid1mx/HJLzVZIywNWWeWs= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10129 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241113_021239_646737_CBC80825 X-CRM114-Status: GOOD ( 17.26 ) 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 Add the dt-bindings for the NXP SIUL2 module which is a multi function device. It can export information about the SoC, configure the pinmux&pinconf for pins and it is also a GPIO controller with interrupt capability. Signed-off-by: Andrei Stefanescu --- .../bindings/mfd/nxp,s32g2-siul2.yaml | 165 ++++++++++++++++++ 1 file changed, 165 insertions(+) create mode 100644 Documentation/devicetree/bindings/mfd/nxp,s32g2-siul2.yaml diff --git a/Documentation/devicetree/bindings/mfd/nxp,s32g2-siul2.yaml b/Documentation/devicetree/bindings/mfd/nxp,s32g2-siul2.yaml new file mode 100644 index 000000000000..a8edbea75bb6 --- /dev/null +++ b/Documentation/devicetree/bindings/mfd/nxp,s32g2-siul2.yaml @@ -0,0 +1,165 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +# Copyright 2024 NXP +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/mfd/nxp,s32g2-siul2.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: NXP S32 System Integration Unit Lite2 (SIUL2) + +maintainers: + - Andrei Stefanescu + +description: | + SIUL2 is a hardware block which implements pinmuxing, + pinconf, GPIOs (some with interrupt capability) and + registers which contain information about the SoC. + There are generally two SIUL2 modules whose functionality + is grouped together. For example interrupt configuration + registers are part of SIUL2_1 even though interrupts are + also available for SIUL2_0 pins. + + The following register types are exported by SIUL2: + - MIDR (MCU ID Register) - information related to the SoC + - interrupt configuration registers + - MSCR (Multiplexed Signal Configuration Register) - pinmuxing and pinconf + - IMCR (Input Multiplexed Signal Configuration Register)- pinmuxing + - PGPDO (Parallel GPIO Pad Data Out Register) - GPIO output value + - PGPDI (Parallel GPIO Pad Data In Register) - GPIO input value + + Most registers are 32bit wide with the exception of PGPDO/PGPDI which are + 16bit wide. + +properties: + compatible: + enum: + - nxp,s32g2-siul2 + - nxp,s32g3-siul2 + + reg: + maxItems: 2 + + reg-names: + items: + - const: siul20 + - const: siul21 + + gpio-controller: true + + "#gpio-cells": + const: 2 + + gpio-ranges: + maxItems: 2 + + gpio-reserved-ranges: + maxItems: 2 + + interrupts: + maxItems: 1 + + interrupt-controller: true + + "#interrupt-cells": + const: 2 + + nvmem-layout: + $ref: /schemas/nvmem/layouts/nvmem-layout.yaml# + description: + This container may reference an NVMEM layout parser. + +patternProperties: + "-hog(-[0-9]+)?$": + required: + - gpio-hog + + "-pins$": + type: object + additionalProperties: false + + patternProperties: + "-grp[0-9]$": + type: object + allOf: + - $ref: /schemas/pinctrl/pinmux-node.yaml# + - $ref: /schemas/pinctrl/pincfg-node.yaml# + description: + Pinctrl node's client devices specify pin muxes using subnodes, + which in turn use the standard properties below. + + properties: + bias-disable: true + bias-high-impedance: true + bias-pull-up: true + bias-pull-down: true + drive-open-drain: true + input-enable: true + output-enable: true + + pinmux: + description: | + An integer array for representing pinmux configurations of + a device. Each integer consists of a PIN_ID and a 4-bit + selected signal source(SSS) as IOMUX setting, which is + calculated as: pinmux = (PIN_ID << 4 | SSS) + + slew-rate: + description: Supported slew rate based on Fmax values (MHz) + enum: [83, 133, 150, 166, 208] + required: + - pinmux + + additionalProperties: false + +required: + - compatible + - reg + - reg-names + - gpio-controller + - "#gpio-cells" + - gpio-ranges + - gpio-reserved-ranges + - interrupts + - interrupt-controller + - "#interrupt-cells" + +additionalProperties: false + +examples: + - | + #include + #include + + siul2@4009c000 { + compatible = "nxp,s32g2-siul2"; + reg = <0x4009c000 0x179c>, + <0x44010000 0x17b0>; + reg-names = "siul20", "siul21"; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&siul2 0 0 102>, <&siul2 112 112 79>; + gpio-reserved-ranges = <102 10>, <123 21>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; + + jtag_pins: jtag-pins { + jtag-grp0 { + pinmux = <0x0>; + input-enable; + bias-pull-up; + slew-rate = <166>; + }; + }; + + nvmem-layout { + compatible = "fixed-layout"; + #address-cells = <1>; + #size-cells = <1>; + + soc-major@0 { + reg = <0 0x4>; + }; + }; + }; +... From patchwork Wed Nov 13 10:10:54 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 13873415 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 21339D41C2E for ; Wed, 13 Nov 2024 10:19:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type: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=nHX5hYTYU5Vx0dDy8P8XmUqnrwWHmblGMTu8xZWtmV4=; b=s3wvNJ2Qkf4XukT2kUbv7SxhSy sfC0shJnDdADvV9zIWPFjs4qwCgux9YXO2mHbh5yEhs97HZKE3rlO5XeuTEvq9hdmwV2f3UlLgrfr +yx+dhEuW0S4TXOV4vQCbb0Mp4RzsfQSZnYRK+0sWPXlPdnxFVOsfeGzcLwQ2YIagSNUQ5JlXXLC5 V38thjg1X+3bUI8mRP/Y/GKdaVOaAY8PGaFx9BqrVUhbHEkoTJSSC8qV2SwmX8ojXMMIkZ3XAPmsN qlHCTqufy1MGdh6u6xmKbdrHdAV0BxrEfRULd6lMWGlve2nZKYtNeKG7PO7YQKNbGqIwdKMpcZSzK W/JWUZrQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tBASa-00000006PsF-1VE3; Wed, 13 Nov 2024 10:18:52 +0000 Received: from mail-vi1eur05on20621.outbound.protection.outlook.com ([2a01:111:f403:2613::621] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tBAMb-00000006Oah-2bbB for linux-arm-kernel@lists.infradead.org; Wed, 13 Nov 2024 10:12:43 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LawweWnjj4x++eNajQ1zzpJKUU6XAorJKXjXu2V6FPyFVpW7dNLvatyQYWwvGoBOcBUp/1QOXmOg8zo7RPJ2nD6/mrMfdg7cDKYKbZllIaNnWUHjuesW+LAGCMNf3X/YZoi0PGydq34NAqL6xNqkNblZO7/MnNrT7FGIaUBw2J1M7BJs0HUxn7DNP6XgZAXZ9wNogkAuWIoWKuyxMbFZ8HgaYFIlkMWj+roqB1mH5TlxETrAk3AjKJGoI8cHYjlFXLfLM+MRAEgHYVchVwFwhB5JanylKlm7tBqsQPx3Vbfhw/0Ij/++LLtHx9QB3cCT0XUryeYxPVBcb7GCbNnnoA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=nHX5hYTYU5Vx0dDy8P8XmUqnrwWHmblGMTu8xZWtmV4=; b=RgxE214KgHUw2XXL6Z2MNArxtjfeFDSPLJbHJxqreZV7iBp+p9i+U/UJQyL/euf0VfFTYM2Uj/OAb60QCxk8X1THx7nwEcVBuVtA8UkfZyEUD2Kp0VeT9bx22bRlm/4cS5eNWG+ahEN8fP08CooVbIzKWahD0U/eAmiGQ4a7cCl027rT+1chASM7LH6SAjyUuNbQg8WZScd5xI3qX0pm6lYcaTvDdVRntdotorDReB56MCNg5ZqmgmIyvsTS8XnXFroxvxYU/uq9RIx9qg+lxrIRizvH41wtWWBHdLa4HTj2gfcq9tb/P8zbjv/3Hztcf7rPdE8nH4q375lDv+rIqQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=nHX5hYTYU5Vx0dDy8P8XmUqnrwWHmblGMTu8xZWtmV4=; b=ujhtVSCdM7bbHn+yY3TJDdNkUwNiQo4baEyvU73Bhh6zE3taubNqY8AWxZOLVQAVID7EDhRn2mKhh4gcoJEHek03bPlslJMl17SGWPFUmuLrJo9Z+kL6x5+ccM3SFgbUVr/f5dNjLWKMM44T0VOdYaUddjb3X76Lqi/4tPTRauKXp5ovDWY9HwGkcTZMN5kbWzeF47NX5odAhpSrjJzFc0lLHiA14V3iKmPFJoXZALxCiU13aLIJyJLpbZR/eBlV/CWG3CCMyt+8gTL/+SdaPL+MsQkr9cYCHsQIAzd7FeE9rqIzEjQVguZxA6ta/RyyK/jwCOEAeP4A1mml7em4Wg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by PA2PR04MB10129.eurprd04.prod.outlook.com (2603:10a6:102:3ff::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Wed, 13 Nov 2024 10:12:36 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%4]) with mapi id 15.20.8158.013; Wed, 13 Nov 2024 10:12:35 +0000 From: Andrei Stefanescu To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Larisa Grigore , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lee Jones , Shawn Guo , Sascha Hauer , Fabio Estevam , Dong Aisheng , Jacky Bai Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP S32 Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Pengutronix Kernel Team , imx@lists.linux.dev, Andrei Stefanescu Subject: [PATCH v6 2/7] mfd: nxp-siul2: add support for NXP SIUL2 Date: Wed, 13 Nov 2024 12:10:54 +0200 Message-ID: <20241113101124.1279648-3-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> References: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AM8P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::10) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8487:EE_|PA2PR04MB10129:EE_ X-MS-Office365-Filtering-Correlation-Id: c6591fdf-9b8e-41bb-99e7-08dd03cbb1fa X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|52116014|1800799024|38350700014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?B6Ip/EJy5x3grq2Q70qorqau/DFTBuK?= =?utf-8?q?USC0BClysA4C99eLcDQCGXc2LKvkZBxgHDFTuvr/SwM6W2LNdXqJfu6jFi8NzX8Ea?= =?utf-8?q?3k2qrZFxi1VcE8Qd7yCO5V8P2TrcqboA/UE0Od9txqwXZXYW1kdSsPiPXOr4nJxad?= =?utf-8?q?Zcl2vUFYJ7mlY69swcoAWdfHZNfWQj6Bq4DxeEXMtEv8SlacjAEZ2wAqnUH9lpUQy?= =?utf-8?q?Dra1fBFjra9qy1ZvJMuT2TeSpqc69NPI7gZShchxwwbza3PARQqsmoXZng5uHjgxx?= =?utf-8?q?rf+d/Z1hKgs4lXNfT+WKF24b6RtnLj2EN4H209+uqhFxrsq1SUim/ywgJPRWq8v8/?= =?utf-8?q?/mADyKJBr0/N32k1WUsxkDEisnLUEK8pTbEaNG/jjzJ8XXyNKW0sKiMl8TO4jwGxd?= =?utf-8?q?rQdEQSb1dM4YUECBlwaqoV2yoGyODN5bZ+XN0ky9DzYnu2Cj622tkcxwMb60f7Nma?= =?utf-8?q?+yW+vEDtj2Z/hWYpKhzJpzJ0OSZpdjEnow5BQEdi0iVJbHiISE55e8KjqnLDyV8+E?= =?utf-8?q?WaMPZlrG5KbxiOrShnoKNSnADkIyICsFWqLrqYLUnjR6aLoONus9ZAFJ1t/UmM1i3?= =?utf-8?q?NA3UXP1oX3AkfmXyop5ZdVedChp5chX1piixFs65sntfXA1vCvxrp7r3i/tmv81rF?= =?utf-8?q?0Y8QSxCcnGfA/Cv0bEP+CR+UGGcuYFvqWXddbKx2BxvYLE1+Ul2NUVDtpkIqA9IUi?= =?utf-8?q?xopUeCjH25a4lIo5LVbDB6PZdcgeLS8E14tWr5VikY0LeKJn/f83SX/f7yFNK8mpF?= =?utf-8?q?IA/uLm0aN0I2Zl2YFeBxwv2jqkrRyDftwZ/VJUyxwfhqqLVKQoNRijgfZbIElldlX?= =?utf-8?q?U5uCczRHB/m0dU3fFlZWEGt1l5Wk8fgBMCS7B9VHTLcCY5RF5IisfA1Na4a68TNiX?= =?utf-8?q?ioihKzxNiF3kPXLD3IP9ezE5ePFriyB4djDj6u8/pe6MxOzfjCG1+Iy7odIqOA39s?= =?utf-8?q?BX8n/uroUv+cdigRDnz6QHXlcUaZPXS8xJuli0KUdtNUSYK1qeF9XO/VDip8DEeGW?= =?utf-8?q?d8m1lm1UJNJSh8ZUTfHhR2uckpEKXdU52ULCU/d4ZYFQ56wghQbGwFJ/n+3CJMf8q?= =?utf-8?q?lubV4trRVUX2Bog6JFOC5DX9/hnD7tgh5poYcPFq1aFVbfQ+M9tFWkFlXyhZBZ+8n?= =?utf-8?q?jVHHCCByJq3RJauz2RAblm1mmb2n6HZz64kqxxjhx+wehyLrhcG0Esd9y7R//XTJ6?= =?utf-8?q?05DIj2RbWb8ZwXGMlCQm0/OE+2NTGF/jA6B44UOza3di2H2nqfwNbSAN5VzXWjyZO?= =?utf-8?q?meuJgGZY3bDUuAKepL5XbjnhDBlOwOPOXxeBd1gO4hbP1dds+qGgrt/OL4gH2qQCf?= =?utf-8?q?ZsanlTGdvX6o?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8487.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(52116014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?xxAlveNELhci1wtD4+U47tPaT8qs?= =?utf-8?q?UQC9N9oqByxfRYjcnWxbCD3/X32uawpR3LYfRuf4rPMN9K8HPORbZ/AeP1mvWF3Rf?= =?utf-8?q?u2la53NCc4mRZTojEvh7UqCjM4PC2GITOd8whlGmNWtNZjwwIkMHr6kw26CMmVP95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utf-8?q?uy1jXRTn7RsCEAVRrlSdxu85wVwfEpz22sZ6ZrOK8oOcyBlgxBlI+7msRIY8ZZY88?= =?utf-8?q?Q0iR/TorCKXN9uO31Bv3WxuC4fztD9grrL5VmpwoWMToeUTd4+AcGGSuKXpXHbSjc?= =?utf-8?q?SnL2Ho2fbxcFf0WVoFUej6Vm40cZXhsz1uDsFuY+3hRWAPTVKkHFw1kYUXpXAVvO3?= =?utf-8?q?3hw6ppmcQNS9NTCl3Zf+oH7zPr6N48rJ3f+jv6U+gDGsyEAb/3V8byp4jTWrhEgIu?= =?utf-8?q?cPej0Dl0wR7E/cajvkht1XIqKTQZsn1Vl72jPUc18AQzYKOspWm0/uNFfuyhLBOR3?= =?utf-8?q?O5QD7iVR0Kio34QMowu8tWCZI7/Bo3/CHp96C9p+hqh2TDnjK9CkGpmd2iXg3nak0?= =?utf-8?q?YO6UqeBBkj+YFQzeoVmmH3FY76Mdeg/Rw8X6kvu3/SxS6qlx8kRjWYfV7uVXm5hQz?= =?utf-8?q?Wrot0yAJ/+okCJWgSyDhm4bQqrC4MsACjt9i0F8Xyq8jLN1YqMcyxzGD0XE1Ia+Ju?= =?utf-8?q?eAIIDatUxGUPDpn6EscanrQP5T4aX/N2zQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: c6591fdf-9b8e-41bb-99e7-08dd03cbb1fa X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 10:12:35.8989 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: N98eUuO9MRg+cz4uQsJMiN+o09PIFSV/DvKnKNlmwob+GEOVuTopebgn2ZjbXdwlhAZTGli3y05mB4P6wxtnf0oPiTMvIlQ+p+L2WH9nfKw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10129 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241113_021241_712000_3124EF13 X-CRM114-Status: GOOD ( 24.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 SIUL2 (System Integration Unit Lite) is a hardware module which implements various functionalities: - reading SoC information - pinctrl - GPIO (including interrupts) This commit only adds support for pinctrl&GPIO(one cell). Further commits will add nvmem functionality(a second cell). There are multiple register types in the SIUL2 module: - MIDR (MCU ID Register) * contains information about the SoC. - Interrupt related registers * There are 32 interrupts named EIRQ. An EIRQ may be routed to one or more GPIOs. Not all GPIOs have EIRQs associated with them - MSCR (Multiplexed Signal Configuration Register) * handle pinmuxing and pinconf - IMCR (Input Multiplexed Signal Configuration Register) * are part of pinmuxing - PGPDO/PGPDI (Parallel GPIO Pad Data Out/In Register) * Write/Read the GPIO value There are two SIUL2 modules in the S32G SoC. This driver handles both because functionality is shared between them. For example: some GPIOs in SIUL2_0 have interrupt capability but the registers configuring this are in SIUL2_1. Signed-off-by: Andrei Stefanescu --- drivers/mfd/Kconfig | 12 + drivers/mfd/Makefile | 1 + drivers/mfd/nxp-siul2.c | 410 ++++++++++++++++++++++++++++++++++ include/linux/mfd/nxp-siul2.h | 55 +++++ 4 files changed, 478 insertions(+) create mode 100644 drivers/mfd/nxp-siul2.c create mode 100644 include/linux/mfd/nxp-siul2.h diff --git a/drivers/mfd/Kconfig b/drivers/mfd/Kconfig index f9325bcce1b9..fc590789e8b3 100644 --- a/drivers/mfd/Kconfig +++ b/drivers/mfd/Kconfig @@ -1098,6 +1098,18 @@ config MFD_NTXEC certain e-book readers designed by the original design manufacturer Netronix. +config MFD_NXP_SIUL2 + tristate "NXP SIUL2 MFD driver" + select MFD_CORE + select REGMAP_MMIO + depends on ARCH_S32 || COMPILE_TEST + help + Select this to get support for the NXP SIUL2 (System Integration + Unit Lite) module. This hardware block contains registers for + SoC information, pinctrl and GPIO functionality. This will + probe a MFD driver which will contain cells for a combined + pinctrl&GPIO driver and nvmem drivers for the SoC information. + config MFD_RETU tristate "Nokia Retu and Tahvo multi-function device" select MFD_CORE diff --git a/drivers/mfd/Makefile b/drivers/mfd/Makefile index 2a9f91e81af8..7b19ea014221 100644 --- a/drivers/mfd/Makefile +++ b/drivers/mfd/Makefile @@ -226,6 +226,7 @@ obj-$(CONFIG_MFD_INTEL_PMC_BXT) += intel_pmc_bxt.o obj-$(CONFIG_MFD_PALMAS) += palmas.o obj-$(CONFIG_MFD_VIPERBOARD) += viperboard.o obj-$(CONFIG_MFD_NTXEC) += ntxec.o +obj-$(CONFIG_MFD_NXP_SIUL2) += nxp-siul2.o obj-$(CONFIG_MFD_RC5T583) += rc5t583.o rc5t583-irq.o obj-$(CONFIG_MFD_RK8XX) += rk8xx-core.o obj-$(CONFIG_MFD_RK8XX_I2C) += rk8xx-i2c.o diff --git a/drivers/mfd/nxp-siul2.c b/drivers/mfd/nxp-siul2.c new file mode 100644 index 000000000000..7751992e4df3 --- /dev/null +++ b/drivers/mfd/nxp-siul2.c @@ -0,0 +1,410 @@ +// SPDX-License-Identifier: GPL-2.0-or-later +/* + * SIUL2(System Integration Unit Lite) MFD driver + * + * Copyright 2024 NXP + */ +#include +#include +#include +#include +#include + +#define S32G_NUM_SIUL2 2 + +#define S32_REG_RANGE(start, end, name, access) \ + { \ + .reg_name = (name), \ + .reg_start_offset = (start), \ + .reg_end_offset = (end), \ + .reg_access = (access), \ + .valid = true, \ + } + +#define S32_INVALID_REG_RANGE \ + { \ + .reg_name = NULL, \ + .reg_access = NULL, \ + .valid = false, \ + } + +static const struct mfd_cell nxp_siul2_devs[] = { + { + .name = "s32g-siul2-pinctrl", + } +}; + +/** + * struct nxp_siul2_reg_range_info: a register range in SIUL2 + * @reg_name: the name for the register range + * @reg_start_offset: the first valid register offset + * @reg_end_offset: the last valid register offset + * @reg_access: the read/write access tables if not NULL + * @valid: whether the register range is valid or not + */ +struct nxp_siul2_reg_range_info { + const char *reg_name; + unsigned int reg_start_offset; + unsigned int reg_end_offset; + const struct regmap_access_table *reg_access; + bool valid; +}; + +static const struct regmap_range s32g2_siul2_0_imcr_reg_ranges[] = { + /* IMCR0 - IMCR1 */ + regmap_reg_range(0, 4), + /* IMCR3 - IMCR61 */ + regmap_reg_range(0xC, 0xF4), + /* IMCR68 - IMCR83 */ + regmap_reg_range(0x110, 0x14C) +}; + +static const struct regmap_access_table s32g2_siul2_0_imcr = { + .yes_ranges = s32g2_siul2_0_imcr_reg_ranges, + .n_yes_ranges = ARRAY_SIZE(s32g2_siul2_0_imcr_reg_ranges) +}; + +static const struct regmap_range s32g2_siul2_0_pgpd_reg_ranges[] = { + /* PGPD*0 - PGPD*5 */ + regmap_reg_range(0, 0xA), + /* PGPD*6 - PGPD*6 */ + regmap_reg_range(0xE, 0xE), +}; + +static const struct regmap_access_table s32g2_siul2_0_pgpd = { + .yes_ranges = s32g2_siul2_0_pgpd_reg_ranges, + .n_yes_ranges = ARRAY_SIZE(s32g2_siul2_0_pgpd_reg_ranges) +}; + +static const struct regmap_range s32g2_siul2_1_irq_reg_ranges[] = { + /* DISR0 */ + regmap_reg_range(0x10, 0x10), + /* DIRER0 */ + regmap_reg_range(0x18, 0x18), + /* DIRSR0 */ + regmap_reg_range(0x20, 0x20), + /* IREER0 */ + regmap_reg_range(0x28, 0x28), + /* IFEER0 */ + regmap_reg_range(0x30, 0x30), +}; + +static const struct regmap_access_table s32g2_siul2_1_irq = { + .yes_ranges = s32g2_siul2_1_irq_reg_ranges, + .n_yes_ranges = ARRAY_SIZE(s32g2_siul2_1_irq_reg_ranges), +}; + +static const struct regmap_range s32g2_siul2_1_irq_volatile_reg_range[] = { + /* DISR0 */ + regmap_reg_range(0x10, 0x10) +}; + +static const struct regmap_access_table s32g2_siul2_1_irq_volatile = { + .yes_ranges = s32g2_siul2_1_irq_volatile_reg_range, + .n_yes_ranges = ARRAY_SIZE(s32g2_siul2_1_irq_volatile_reg_range), +}; + +static const struct regmap_range s32g2_siul2_1_mscr_reg_ranges[] = { + /* MSCR112 - MSCR122 */ + regmap_reg_range(0, 0x28), + /* MSCR144 - MSCR190 */ + regmap_reg_range(0x80, 0x138) +}; + +static const struct regmap_access_table s32g2_siul2_1_mscr = { + .yes_ranges = s32g2_siul2_1_mscr_reg_ranges, + .n_yes_ranges = ARRAY_SIZE(s32g2_siul2_1_mscr_reg_ranges), +}; + +static const struct regmap_range s32g2_siul2_1_imcr_reg_ranges[] = { + /* IMCR119 - IMCR121 */ + regmap_reg_range(0, 8), + /* IMCR128 - IMCR129 */ + regmap_reg_range(0x24, 0x28), + /* IMCR143 - IMCR151 */ + regmap_reg_range(0x60, 0x80), + /* IMCR153 - IMCR161 */ + regmap_reg_range(0x88, 0xA8), + /* IMCR205 - IMCR212 */ + regmap_reg_range(0x158, 0x174), + /* IMCR224 - IMCR225 */ + regmap_reg_range(0x1A4, 0x1A8), + /* IMCR233 - IMCR248 */ + regmap_reg_range(0x1C8, 0x204), + /* IMCR273 - IMCR274 */ + regmap_reg_range(0x268, 0x26C), + /* IMCR278 - IMCR281 */ + regmap_reg_range(0x27C, 0x288), + /* IMCR283 - IMCR286 */ + regmap_reg_range(0x290, 0x29C), + /* IMCR288 - IMCR294 */ + regmap_reg_range(0x2A4, 0x2BC), + /* IMCR296 - IMCR302 */ + regmap_reg_range(0x2C4, 0x2DC), + /* IMCR304 - IMCR310 */ + regmap_reg_range(0x2E4, 0x2FC), + /* IMCR312 - IMCR314 */ + regmap_reg_range(0x304, 0x30C), + /* IMCR316 */ + regmap_reg_range(0x314, 0x314), + /* IMCR 318 */ + regmap_reg_range(0x31C, 0x31C), + /* IMCR322 - IMCR340 */ + regmap_reg_range(0x32C, 0x374), + /* IMCR343 - IMCR360 */ + regmap_reg_range(0x380, 0x3C4), + /* IMCR363 - IMCR380 */ + regmap_reg_range(0x3D0, 0x414), + /* IMCR383 - IMCR393 */ + regmap_reg_range(0x420, 0x448), + /* IMCR398 - IMCR433 */ + regmap_reg_range(0x45C, 0x4E8), + /* IMCR467 - IMCR470 */ + regmap_reg_range(0x570, 0x57C), + /* IMCR473 - IMCR475 */ + regmap_reg_range(0x588, 0x590), + /* IMCR478 - IMCR480*/ + regmap_reg_range(0x59C, 0x5A4), + /* IMCR483 - IMCR485 */ + regmap_reg_range(0x5B0, 0x5B8), + /* IMCR488 - IMCR490 */ + regmap_reg_range(0x5C4, 0x5CC), + /* IMCR493 - IMCR495 */ + regmap_reg_range(0x5D8, 0x5E0), +}; + +static const struct regmap_access_table s32g2_siul2_1_imcr = { + .yes_ranges = s32g2_siul2_1_imcr_reg_ranges, + .n_yes_ranges = ARRAY_SIZE(s32g2_siul2_1_imcr_reg_ranges) +}; + +static const struct regmap_range s32g2_siul2_1_pgpd_reg_ranges[] = { + /* PGPD*7 */ + regmap_reg_range(0xC, 0xC), + /* PGPD*9 */ + regmap_reg_range(0x10, 0x10), + /* PDPG*10 - PGPD*11 */ + regmap_reg_range(0x14, 0x16), +}; + +static const struct regmap_access_table s32g2_siul2_1_pgpd = { + .yes_ranges = s32g2_siul2_1_pgpd_reg_ranges, + .n_yes_ranges = ARRAY_SIZE(s32g2_siul2_1_pgpd_reg_ranges) +}; + +static const struct nxp_siul2_reg_range_info +s32g2_reg_ranges[S32G_NUM_SIUL2][SIUL2_NUM_REG_TYPES] = { + /* SIUL2_0 */ + { + [SIUL2_MPIDR] = S32_REG_RANGE(4, 8, "SIUL2_0_MPIDR", NULL), + /* Interrupts are to be controlled from SIUL2_1 */ + [SIUL2_IRQ] = S32_INVALID_REG_RANGE, + [SIUL2_MSCR] = S32_REG_RANGE(0x240, 0x3D4, "SIUL2_0_MSCR", + NULL), + [SIUL2_IMCR] = S32_REG_RANGE(0xA40, 0xB8C, "SIUL2_0_IMCR", + &s32g2_siul2_0_imcr), + [SIUL2_PGPDO] = S32_REG_RANGE(0x1700, 0x170E, + "SIUL2_0_PGPDO", + &s32g2_siul2_0_pgpd), + [SIUL2_PGPDI] = S32_REG_RANGE(0x1740, 0x174E, + "SIUL2_0_PGPDI", + &s32g2_siul2_0_pgpd), + }, + /* SIUL2_1 */ + { + [SIUL2_MPIDR] = S32_REG_RANGE(4, 8, "SIUL2_1_MPIDR", NULL), + [SIUL2_IRQ] = S32_REG_RANGE(0x10, 0xC0, "SIUL2_1_IRQ", + &s32g2_siul2_1_irq), + [SIUL2_MSCR] = S32_REG_RANGE(0x400, 0x538, "SIUL2_1_MSCR", + &s32g2_siul2_1_mscr), + [SIUL2_IMCR] = S32_REG_RANGE(0xC1C, 0x11FC, "SIUL2_1_IMCR", + &s32g2_siul2_1_imcr), + [SIUL2_PGPDO] = S32_REG_RANGE(0x1700, 0x1716, + "SIUL2_1_PGPDO", + &s32g2_siul2_1_pgpd), + [SIUL2_PGPDI] = S32_REG_RANGE(0x1740, 0x1756, + "SIUL2_1_PGPDI", + &s32g2_siul2_1_pgpd), + }, +}; + +static const struct regmap_config nxp_siul2_regmap_irq_conf = { + .val_bits = 32, + .val_format_endian = REGMAP_ENDIAN_LITTLE, + .reg_bits = 32, + .reg_stride = 4, + .cache_type = REGCACHE_FLAT, + .use_raw_spinlock = true, + .volatile_table = &s32g2_siul2_1_irq_volatile, +}; + +static const struct regmap_config nxp_siul2_regmap_generic_conf = { + .val_bits = 32, + .val_format_endian = REGMAP_ENDIAN_LITTLE, + .reg_bits = 32, + .reg_stride = 4, + .cache_type = REGCACHE_FLAT, + .use_raw_spinlock = true, +}; + +static const struct regmap_config nxp_siul2_regmap_pgpdo_conf = { + .val_bits = 16, + .val_format_endian = REGMAP_ENDIAN_LITTLE, + .reg_bits = 32, + .reg_stride = 2, + .cache_type = REGCACHE_FLAT, + .use_raw_spinlock = true, +}; + +static const struct regmap_config nxp_siul2_regmap_pgpdi_conf = { + .val_bits = 16, + .val_format_endian = REGMAP_ENDIAN_LITTLE, + .reg_bits = 32, + .reg_stride = 2, + .cache_type = REGCACHE_NONE, + .use_raw_spinlock = true, +}; + +static int nxp_siul2_init_regmap(struct platform_device *pdev, + void __iomem *base, unsigned int siul) +{ + const struct regmap_config *regmap_configs[SIUL2_NUM_REG_TYPES] = { + [SIUL2_MPIDR] = &nxp_siul2_regmap_generic_conf, + [SIUL2_IRQ] = &nxp_siul2_regmap_irq_conf, + [SIUL2_MSCR] = &nxp_siul2_regmap_generic_conf, + [SIUL2_IMCR] = &nxp_siul2_regmap_generic_conf, + [SIUL2_PGPDO] = &nxp_siul2_regmap_pgpdo_conf, + [SIUL2_PGPDI] = &nxp_siul2_regmap_pgpdi_conf, + }; + const struct nxp_siul2_reg_range_info *tmp_range; + struct regmap_config tmp_conf; + struct nxp_siul2_info *info; + struct nxp_siul2_mfd *priv; + void __iomem *reg_start; + int i; + + priv = platform_get_drvdata(pdev); + info = &priv->siul2[siul]; + + for (i = 0; i < SIUL2_NUM_REG_TYPES; i++) { + if (!s32g2_reg_ranges[siul][i].valid) + continue; + + tmp_range = &s32g2_reg_ranges[siul][i]; + tmp_conf = *regmap_configs[i]; + tmp_conf.name = tmp_range->reg_name; + tmp_conf.max_register = + tmp_range->reg_end_offset - tmp_range->reg_start_offset; + + if (tmp_conf.cache_type != REGCACHE_NONE) + tmp_conf.num_reg_defaults_raw = + tmp_conf.max_register / tmp_conf.reg_stride; + + if (tmp_range->reg_access) { + tmp_conf.wr_table = tmp_range->reg_access; + tmp_conf.rd_table = tmp_range->reg_access; + } + + reg_start = base + tmp_range->reg_start_offset; + info->regmaps[i] = devm_regmap_init_mmio(&pdev->dev, reg_start, + &tmp_conf); + if (IS_ERR(info->regmaps[i])) + return dev_err_probe(&pdev->dev, + PTR_ERR(info->regmaps[i]), + "regmap %d init failed: %ld\n", i, + PTR_ERR(info->regmaps[i])); + } + + return 0; +} + +static int nxp_siul2_parse_dtb(struct platform_device *pdev) +{ + struct device_node *np = pdev->dev.of_node; + struct of_phandle_args pinspec; + struct nxp_siul2_mfd *priv; + void __iomem *base; + char reg_name[16]; + int i, ret; + + priv = platform_get_drvdata(pdev); + + for (i = 0; i < priv->num_siul2; i++) { + ret = snprintf(reg_name, ARRAY_SIZE(reg_name), "siul2%d", i); + if (ret < 0 || ret >= ARRAY_SIZE(reg_name)) + return ret; + + base = devm_platform_ioremap_resource_byname(pdev, reg_name); + if (IS_ERR(base)) + return dev_err_probe(&pdev->dev, PTR_ERR(base), + "Failed to get MEM resource: %s\n", + reg_name); + + ret = nxp_siul2_init_regmap(pdev, base, i); + if (ret) + return ret; + + ret = of_parse_phandle_with_fixed_args(np, "gpio-ranges", 3, + i, &pinspec); + if (ret) + return ret; + + of_node_put(pinspec.np); + + if (pinspec.args_count != 3) + return dev_err_probe(&pdev->dev, -EINVAL, + "Invalid pinspec count: %d\n", + pinspec.args_count); + + priv->siul2[i].gpio_base = pinspec.args[1]; + priv->siul2[i].gpio_num = pinspec.args[2]; + } + + return 0; +} + +static int nxp_siul2_probe(struct platform_device *pdev) +{ + struct nxp_siul2_mfd *priv; + int ret; + + priv = devm_kzalloc(&pdev->dev, sizeof(*priv), GFP_KERNEL); + if (!priv) + return -ENOMEM; + + priv->num_siul2 = S32G_NUM_SIUL2; + priv->siul2 = devm_kcalloc(&pdev->dev, priv->num_siul2, + sizeof(*priv->siul2), GFP_KERNEL); + if (!priv->siul2) + return -ENOMEM; + + platform_set_drvdata(pdev, priv); + ret = nxp_siul2_parse_dtb(pdev); + if (ret) + return ret; + + return devm_mfd_add_devices(&pdev->dev, PLATFORM_DEVID_AUTO, + nxp_siul2_devs, ARRAY_SIZE(nxp_siul2_devs), + NULL, 0, NULL); +} + +static const struct of_device_id nxp_siul2_dt_ids[] = { + { .compatible = "nxp,s32g2-siul2" }, + { .compatible = "nxp,s32g3-siul2" }, + { /* sentinel */ }, +}; +MODULE_DEVICE_TABLE(of, nxp_siul2_dt_ids); + +static struct platform_driver nxp_siul2_mfd_driver = { + .driver = { + .name = "nxp-siul2-mfd", + .of_match_table = nxp_siul2_dt_ids, + }, + .probe = nxp_siul2_probe, +}; + +module_platform_driver(nxp_siul2_mfd_driver); + +MODULE_LICENSE("GPL"); +MODULE_DESCRIPTION("NXP SIUL2 MFD driver"); +MODULE_AUTHOR("Andrei Stefanescu "); diff --git a/include/linux/mfd/nxp-siul2.h b/include/linux/mfd/nxp-siul2.h new file mode 100644 index 000000000000..238c812dba29 --- /dev/null +++ b/include/linux/mfd/nxp-siul2.h @@ -0,0 +1,55 @@ +/* SPDX-License-Identifier: GPL-2.0-or-later + * + * S32 SIUL2 core definitions + * + * Copyright 2024 NXP + */ + +#ifndef __DRIVERS_MFD_NXP_SIUL2_H +#define __DRIVERS_MFD_NXP_SIUL2_H + +#include + +/** + * enum nxp_siul2_reg_type - an enum for SIUL2 reg types + * @SIUL2_MPIDR - SoC info + * @SIUL2_IRQ - IRQ related registers, only valid in SIUL2_1 + * @SIUL2_MSCR - used for pinmuxing and pinconf + * @SIUL2_IMCR - used for pinmuxing + * @SIUL2_PGPDO - writing the GPIO value + * @SIUL2_PGPDI - reading the GPIO value + */ +enum nxp_siul2_reg_type { + SIUL2_MPIDR, + SIUL2_IRQ, + SIUL2_MSCR, + SIUL2_IMCR, + SIUL2_PGPDO, + SIUL2_PGPDI, + + SIUL2_NUM_REG_TYPES +}; + +/** + * struct nxp_siul2_info - details about one SIUL2 hardware instance + * @regmaps: the regmaps for each register type for a SIUL2 hardware instance + * @gpio_base: the first GPIO in this SIUL2 module + * @gpio_num: the number of GPIOs in this SIUL2 module + */ +struct nxp_siul2_info { + struct regmap *regmaps[SIUL2_NUM_REG_TYPES]; + u32 gpio_base; + u32 gpio_num; +}; + +/** + * struct nxp_siul2_mfd - driver data + * @siul2: info about the SIUL2 modules present + * @num_siul2: number of siul2 modules + */ +struct nxp_siul2_mfd { + struct nxp_siul2_info *siul2; + u8 num_siul2; +}; + +#endif /* __DRIVERS_MFD_NXP_SIUL2_H */ From patchwork Wed Nov 13 10:10:55 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 13873416 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 2022BD41C27 for ; Wed, 13 Nov 2024 10:20: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:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type: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=2Kzz7QtLVI+Cdc28fXOJnGYj1Ph+zENPv3rBRnyqP2Q=; b=Q68PuX7fsCteHRDfzs0j5c3sOQ 6QZz7FneU5qz+h87FOeBDdUGOSAyPH8tip0JCugT4QXWI9Ls1ICcJjh3/M6vWofTtKUJpAc+fXjMP kl+XVN99AvGBaxQ06lK/kQqQ/1lj74MoDxsl3SIubCtdgAoFb3DOHSTFQPDVvyNrg3uaIg90bHda5 9jltCIYJgLa9Q/TaY94ow80AeUdl0QoSHO66aiGf05bgp6hYuk+/5TLjQiLbXrAlw2U3gVbLHd1ea 2VHT2lul4WaACnNXv/7FS2vNBfyfpx3s+PoJtgS0+P1qne/IlZ5/2ENFKfpeWmCwWeztPoUPGXWl7 /28WpV0A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tBAUM-00000006QHb-3De7; Wed, 13 Nov 2024 10:20:42 +0000 Received: from mail-vi1eur05on20621.outbound.protection.outlook.com ([2a01:111:f403:2613::621] helo=EUR05-VI1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tBAMd-00000006Oah-3A9p for linux-arm-kernel@lists.infradead.org; Wed, 13 Nov 2024 10:12:45 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Pzt2+mQQqvfSZaPg2URoY2ZZU0TD+SVLESgKAafre2VPeLmRW+6HbQ+WWO8/jL8wi7fMd/TDULjlWGs4PpJwWposEzY4zaBCe6bQl8uuTvQ7Kk+qIQbWZOvBZrBO67VPtqw8mNN4AgDsijih9ifvCk+OCdvwTw/XxfRdkHG0UuCi/cFTewSghOhBufGcvUT1zk2N0AS50SW7AqnPewKw6EkJGv2D4dUoYLvObSjfTPztJgTsjRiaAgKE0FDxeS+XrQJ6esPxIyrdPp/va9VHmhTbR69KySIMLi1EhXYJrI0Wxlv+5uslPqJQyAPyVvmulwrrneIJNEv+OyViJ6GNig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=2Kzz7QtLVI+Cdc28fXOJnGYj1Ph+zENPv3rBRnyqP2Q=; b=dqxeil0j1hn3tCZKPajzENCbr3zUt2HK2LI9WTkoXNbI1dtCpspxqMyeqIHD0YNOCozxzA1BhpuXK3H1jCe/ueorYmt/zghwANqNv1Updm4Z4864LkihlLe44qfU4is4nKHcBWzyE45IYMeZSqP2Z0ChQYOiOVCzA2sxQMA2KiV7P49N8ZMbG5szC3uWhPniHJDUt5AmoJ9AMP1hgqJ6zuXLVkVGrlaTQmxIQ/+/o8DK+OpCR4hBI4dqOGer92cyCerHVFMLSf0mYZaivCmfMcO8fZfxZCxC01ZkkDVfncyWUZCfdZG7V6Bb00cvzZzLCd6kjwryphPkOcxp9RErNw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=2Kzz7QtLVI+Cdc28fXOJnGYj1Ph+zENPv3rBRnyqP2Q=; b=XmAXm5FZHJCNcaJQDsBBvD+9k7dlE4XTMatjfxDGQ99QOvgyEnkUGrogaSnS+Hr1bxeJsSl6xRveQwrZ0iQK/fiTB7RwdnYOxtasVCzVw08dwz+uMwifVdtA+fREW3FIt2ZtOJqHIMf7XiPCcynYf8al2NFBimPZyWOJIIAVX2JcvLcqvpi0VpTnzsNtYAuVBHbHuj+l7hNmNtSKqFstNPffxyG1f4pY+2GoLxO0SCCXLUFlhxnngMtgbxYO7VqC1t5MLqmwY44QsXTT/QLuZQllnL+2JOOrQpUV06vlFRXy2fSk2n+de361BFRZnjNTYx2W34RaujAuLUM/Phi0iQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by PA2PR04MB10129.eurprd04.prod.outlook.com (2603:10a6:102:3ff::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.28; Wed, 13 Nov 2024 10:12:38 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%4]) with mapi id 15.20.8158.013; Wed, 13 Nov 2024 10:12:38 +0000 From: Andrei Stefanescu To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Larisa Grigore , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lee Jones , Shawn Guo , Sascha Hauer , Fabio Estevam , Dong Aisheng , Jacky Bai Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP S32 Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Pengutronix Kernel Team , imx@lists.linux.dev, Andrei Stefanescu Subject: [PATCH v6 3/7] arm64: dts: s32g: make pinctrl part of mfd node Date: Wed, 13 Nov 2024 12:10:55 +0200 Message-ID: <20241113101124.1279648-4-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> References: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AM8P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::10) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8487:EE_|PA2PR04MB10129:EE_ X-MS-Office365-Filtering-Correlation-Id: f5ecfd34-d9d6-4de6-75b5-08dd03cbb358 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|366016|7416014|376014|52116014|1800799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?q?PuKfRDpAdV0BQQKkdalBY1gbyrYSgoUNq22CTLbwjt8PKIlGbY4IpZVm4BNCdmom3?= =?utf-8?q?KXLQlamUVol0GIYDBCilHYb3Xbl+ViYFns4N/CML7VrRcx+MZWst1rSz8p3JSBgKh?= =?utf-8?q?nRdZBohJcyuHOpnj6f0QP3k6QsTFolyeKDKTdr7Ji7TwIpdKlAtzU0vQ5u1DRPlpo?= =?utf-8?q?YuNtp8PiyDuGwRKHV/LiQFYqCtxv6G/B5NmI9MP2/Matrt/Eb6tBVlKpeigIDSGmr?= =?utf-8?q?pEJ6BuYl+7qZ1Zd0oA27DlUZdA3aw25v0Uk3afnnYw2w24EUWRpxF4E2+gm4YByvA?= =?utf-8?q?XIpQiCw/bYArObayqvkTXMTvu51EMxMxpZ4hRTF/xkk2zB1LtblCnFO2BiTiPZJTi?= =?utf-8?q?Aq6xXYLuhpVvbF6MgBB8Dyes8WIxyGH0My07pIcBQGaNqvqVWuVmA9TSEaP87ZhNj?= =?utf-8?q?+p9wO9rpZgMFReW1KDBEtUMMUtKrGsPi6HFrcY/rbrtu7EE1zXB3re89etESLPUvm?= =?utf-8?q?oVfP+QG8M97wz3zUVO7+H12xxFyWqrgp2w=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8487.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(366016)(7416014)(376014)(52116014)(1800799024)(38350700014)(921020);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?eDlO63R49o4n/XAFdYj/Y2bduJyd?= =?utf-8?q?1rUrn+tDdKy1D9qeyaaSF94OduEEoxDin9oxZot/d+umaSZWbZNezCORZzVIT1sip?= =?utf-8?q?5fKKks5SktgS/RWx0A3hfMJi29yRcGsFqJilnZb4qqC5brC+xSoIEgClDz1zGbR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C1tdpNL?= =?utf-8?q?1keGfxvPRVeFcXBSagb1YKWbvRxnJf0RfEGy6X9ydsdxH8WzzQ2wFb+c8Q+WmNFgt?= =?utf-8?q?Pfm8SS0T+6Hc0IxidtL94i9VEcVO1PFT22XzOIZTMhsUJVmRyXihTeZ3IgQmmFO6y?= =?utf-8?q?QpoIeeHcjVY05iSNa3IV9jMwgRJY9l5KmuBdBL8pRRLhEeqzKtRoo4FZ5splTQ1e2?= =?utf-8?q?do9cn856rBJR8fx3OKp4pXicG6WQt5me/LytFW43InuXYosOUFiKTHexoLJ9pxkFv?= =?utf-8?q?edij86a5i0B6Oh0NMsmEU6TjDkSxGoCaz7vbHq3HHuP+tJTR/Pu8IUKiXAByEy9TN?= =?utf-8?q?7sJ8cD235ThYoTyrfuH18GyQ6D8T1ShYXJgFrfRzUltp4LHXI1cyQuEjXUbjv/lsU?= =?utf-8?q?IOCXGnJQBP2FZLv+/fZgYXk4wcxkFYSkHjJun60hQ9copER8TsTGJsljFalul9DNB?= =?utf-8?q?ne8fZ8jntM2m56YI+qfbt7kHTyNnRdl9SNBylKy/v5PmQux3YIPBdy03hDXANrVrI?= =?utf-8?q?QkLUkdZqtsN5P6I0Kl64GEqj5rW5TczGbg=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: f5ecfd34-d9d6-4de6-75b5-08dd03cbb358 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 10:12:38.0439 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: lKcmuNPZdAr8O+nBHuc12A7VoNo1bsnzHX3JVBTvDu44eYA4d7W4YOFXIO2yN94n1AGtTClluaSPq04qjJYQhK/X52Zsdz51LeDLggUpwpI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA2PR04MB10129 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241113_021243_820116_F352C7B1 X-CRM114-Status: GOOD ( 14.79 ) 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 SIUL2 is now represented as an mfd device. Therefore, the old pinctrl node is deprecated. Move the pinctrl related properties inside the new "nxp-siul2" node. The latter one is now used to represent the mfd device. This change came as a result of upstream review in the following series: https://lore.kernel.org/linux-gpio/a924bbb6-96ec-40be-9d82-a76b2ab73afd@oss.nxp.com/ https://lore.kernel.org/all/20240926143122.1385658-3-andrei.stefanescu@oss.nxp.com/ The SIUL2 module has multiple capabilities. It has support for reading SoC information, pinctrl and GPIO. All of this functionality is part of the same register space. The initial pinctrl driver treated the pinctrl functionality as separate from the GPIO one. However, they do rely on common registers and a long, detailed and specific register range list would be required for pinctrl&GPIO (carving out the necessary memory for each function). Moreover, in some cases this wouldn't be enough. For example reading a GPIO's direction would require a read of the MSCR register corresponding to that pin. This would not be possible in the GPIO driver because all of the MSCR registers are referenced by the pinctrl driver. Signed-off-by: Andrei Stefanescu --- arch/arm64/boot/dts/freescale/s32g2.dtsi | 26 +++++++++++------------- arch/arm64/boot/dts/freescale/s32g3.dtsi | 26 +++++++++++------------- 2 files changed, 24 insertions(+), 28 deletions(-) diff --git a/arch/arm64/boot/dts/freescale/s32g2.dtsi b/arch/arm64/boot/dts/freescale/s32g2.dtsi index fa054bfe7d5c..e14ce5503e1f 100644 --- a/arch/arm64/boot/dts/freescale/s32g2.dtsi +++ b/arch/arm64/boot/dts/freescale/s32g2.dtsi @@ -114,20 +114,18 @@ soc@0 { #size-cells = <1>; ranges = <0 0 0 0x80000000>; - pinctrl: pinctrl@4009c240 { - compatible = "nxp,s32g2-siul2-pinctrl"; - /* MSCR0-MSCR101 registers on siul2_0 */ - reg = <0x4009c240 0x198>, - /* MSCR112-MSCR122 registers on siul2_1 */ - <0x44010400 0x2c>, - /* MSCR144-MSCR190 registers on siul2_1 */ - <0x44010480 0xbc>, - /* IMCR0-IMCR83 registers on siul2_0 */ - <0x4009ca40 0x150>, - /* IMCR119-IMCR397 registers on siul2_1 */ - <0x44010c1c 0x45c>, - /* IMCR430-IMCR495 registers on siul2_1 */ - <0x440110f8 0x108>; + siul2: siul2@4009c000 { + compatible = "nxp,s32g2-siul2"; + reg = <0x4009c000 0x179c>, + <0x44010000 0x17b0>; + reg-names = "siul20", "siul21"; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&siul2 0 0 102>, <&siul2 112 112 79>; + gpio-reserved-ranges = <102 10>, <123 21>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; jtag_pins: jtag-pins { jtag-grp0 { diff --git a/arch/arm64/boot/dts/freescale/s32g3.dtsi b/arch/arm64/boot/dts/freescale/s32g3.dtsi index b4226a9143c8..fa43d036686f 100644 --- a/arch/arm64/boot/dts/freescale/s32g3.dtsi +++ b/arch/arm64/boot/dts/freescale/s32g3.dtsi @@ -171,20 +171,18 @@ soc@0 { #size-cells = <1>; ranges = <0 0 0 0x80000000>; - pinctrl: pinctrl@4009c240 { - compatible = "nxp,s32g2-siul2-pinctrl"; - /* MSCR0-MSCR101 registers on siul2_0 */ - reg = <0x4009c240 0x198>, - /* MSCR112-MSCR122 registers on siul2_1 */ - <0x44010400 0x2c>, - /* MSCR144-MSCR190 registers on siul2_1 */ - <0x44010480 0xbc>, - /* IMCR0-IMCR83 registers on siul2_0 */ - <0x4009ca40 0x150>, - /* IMCR119-IMCR397 registers on siul2_1 */ - <0x44010c1c 0x45c>, - /* IMCR430-IMCR495 registers on siul2_1 */ - <0x440110f8 0x108>; + siul2: siul2@4009c000 { + compatible = "nxp,s32g3-siul2"; + reg = <0x4009c000 0x179c>, + <0x44010000 0x17b0>; + reg-names = "siul20", "siul21"; + gpio-controller; + #gpio-cells = <2>; + gpio-ranges = <&siul2 0 0 102>, <&siul2 112 112 79>; + gpio-reserved-ranges = <102 10>, <123 21>; + interrupt-controller; + #interrupt-cells = <2>; + interrupts = ; jtag_pins: jtag-pins { jtag-grp0 { From patchwork Wed Nov 13 10:10:56 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 13873417 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 F3940D41C2E for ; Wed, 13 Nov 2024 10:22:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type: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=PZEz9b3B1i1ILao0v9v90lW1lAX8gf1SnYxp2LX+RRs=; b=ynciSCGNfwnNATiYEh9WB6iYyL QC/DvItJw3cziRL8SZfFUPxVmvN2goXcuDiTjHN2BJjZUj5I1UCaxGqG/Q6Dx/vQasYPfjRlKykiB 6dGK+iEm/iFnFSx6wCVVzvuDSNABmMo/rKUcLowPC+6zPDhJpb1F3AUjGc0cvL49LOszGEee7w+gt WbiNzb7m4y6YAEtFVfcYkeQdcLro6aDltBamUcod/+fODD8dRUw0hQfXhergqPNgb/VNYGvxghOhM gunYsO4sYuy9V8YJByJVjBlnB2CRv0r4qFB5JtqFOb8YuZbEGvA76koyU2jSgafqva4DfCBb6Rty7 QhBsbm7Q==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tBAW8-00000006QaB-3LZ2; Wed, 13 Nov 2024 10:22:32 +0000 Received: from mail-francecentralazlp170130007.outbound.protection.outlook.com ([2a01:111:f403:c20a::7] helo=PA4PR04CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tBAMe-00000006OdC-1LJ9 for linux-arm-kernel@lists.infradead.org; Wed, 13 Nov 2024 10:12:46 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nSNC1+Xi8XpBxLcl4OKPhRshaTPWgiTIUaOvqRWJOkA+RNW0JssTMu17JriFjFowC1ZEDfYr1blSBaMIulhyX0Rz32J/jyC8098NkCniOMUXNXXXJOETU7pPjzK3NXApgfIBC7v/1VWALxETaIXmNsgSkCTVjFTFAGnO4xuNMIDwXLKxyPbxMlraa0ikUf8hVs4fZphJpq7QLxPA4L8FpPkUYC+L51E/oQ6R5nmrJWe8PVLmb0w6x+EJtSlAX2mR3gfwiErtcwhTIGTx9y7yZTETNVpxfRHOPLi1AJmbNZRzdfxiq/ZJqhJg7EnVtP9PaKHVivvSEaWWaJe3q3U/3g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=PZEz9b3B1i1ILao0v9v90lW1lAX8gf1SnYxp2LX+RRs=; b=GHE6zC0t5AZ6Jz0subwe25Vl2wt27adUuiGefC+Bct2nqvIAJ9Wao3WK0akqELJxAq4OftuJQsOV2542OqNzPutN6fAghEQsP60Um7r0oGcKYRoZBA4eOv7MRyM7aitG1BVPOLlJ/Pz4JCvx7s7qMwwnRrLNJby25x++N4/IeKYDu1XvbvaOHzxqo0hNu8uLkH3Cjt/5gxMiv/YD+s9pL51e785ilGo4Bq1WkF78WTrUD8VEVxjFXv0wd+jcQ0slA4BREaYnKAGwnnsEPiyFXIOfal7XOL9QOkw8Fk0yt2kXXo0UpssCs977swqkw+dt/RHq7rw12ktJYbqKMuKlyw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=PZEz9b3B1i1ILao0v9v90lW1lAX8gf1SnYxp2LX+RRs=; b=uAfgl4zaJsFZGxQ7+JwPBfniGm11WgXuc1YwtSoEwwiFB5iK0TE6wO2qWhTzfndEnfYCQYvEDyMEmJu5izcldxSrEzwENfsqPxYtdhpeLrQeAX/K4ncbq/kohykHWt/w1hnq0B68lPQvZp8BSJnvLsdoGfBDwQmL5IVLf/Pk07n73ok6GRnEJJEUnyDEYKU1/+rS0sw1W5gYdMncQ6muojvDgiXNG2Z+ieW3XTGxIzcS5Ei/r+4pZsdm3nnlUWmqSkQpPFaYnA0SUJQmyZYkX+SvvXZWrMVlOwXfNtREKeUlyoTD1XPB8NuF9LkDfYxoVdi+YCEeegWi8p3/ZWRpqg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by DBBPR04MB7739.eurprd04.prod.outlook.com (2603:10a6:10:1eb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29; Wed, 13 Nov 2024 10:12:39 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%4]) with mapi id 15.20.8158.013; Wed, 13 Nov 2024 10:12:39 +0000 From: Andrei Stefanescu To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Larisa Grigore , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lee Jones , Shawn Guo , Sascha Hauer , Fabio Estevam , Dong Aisheng , Jacky Bai Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP S32 Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Pengutronix Kernel Team , imx@lists.linux.dev, Andrei Stefanescu Subject: [PATCH v6 4/7] pinctrl: s32: convert the driver into an mfd cell Date: Wed, 13 Nov 2024 12:10:56 +0200 Message-ID: <20241113101124.1279648-5-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> References: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AM8P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::10) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8487:EE_|DBBPR04MB7739:EE_ X-MS-Office365-Filtering-Correlation-Id: 9a8deaf5-cd19-4692-0620-08dd03cbb458 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?/u+MzLtXJHVWbbZ+ujf5nuSGo3+C/lK?= =?utf-8?q?KTfOkjacnLF/fjMtjPMSdVKImfmVJritVmWcRkWLq72vCPI35NGIXo44UqRb3UFto?= =?utf-8?q?jNjBAmrhh4beauNGzql+WH/ibKVru9RkVFmlHEWnaE8SeW1478TrUyH2CJYtcUG0j?= =?utf-8?q?iyyeZ7eJMrUOIpL/lYMA+TAq3jjrfBGh0zC7hPgCvjReSUHMVHhOywEVDMiL77tpT?= =?utf-8?q?4NzLLGD+PPdHW4r7BfyKt2X/nEYXZMtgRmnTWV10paTj19p612ndIrr5ZTyaJPecj?= =?utf-8?q?UbX1sxjaQgUn458FOabBOr5GVb/i7Vi9iuUyFPpuudqQQdkUtZBFlZRCj2+ROazgj?= =?utf-8?q?6AAclE35e3PmIgaGBS4bT8lMJFE/OMG81RT/M+dt6BUAhvfQY/MQhmPUCvAngtN2h?= =?utf-8?q?0/9z7TSb0XNhF+M90tFltVuXrAYgOulm/U7PSBHC1VjEnA2s/f0778i9DVXe+6eD7?= =?utf-8?q?aKWmxERFxQU4SnHa609CoM4f8a/OYlxxUgv/EbJHq36gyGfwBfFed7h9aai8rSXim?= =?utf-8?q?ahbLvnwN7F1snp641p47A/47P7n6VTiTxI5n0T3VIWdm7pCuKmFH4xNtN0Ysmwp+b?= =?utf-8?q?Fu2wvDhC3Jw3mtBPACEOzJ7sz56ZDpmgaqOeC1dSDQjmWjsFHexceofflYq8jT4Cm?= =?utf-8?q?Ior4FPKE/DZuwY7ao7g7GMDYht4FFAPERsaJm8WIrphUsDCNnhiwkrONXg49yVhl5?= =?utf-8?q?RphSk0o7VXkaL+JAVI4Ju9bNXUwH+92dhuGs5nPmsQaG7Pk8l09SaLShN+hLnkzjo?= =?utf-8?q?YmolovY5pqZsgIV2mIwbek2dBZCjOsZaZPjS2KR4qSnAlHzBKOtaq9kDcA4nMWVrS?= =?utf-8?q?P0sY8g+AuOCI2YsvxJV/a1VsfrBIKx3rsd2vb5AzFQluDpXekWHgWAL7GC6KrXXUX?= =?utf-8?q?YPKuhNDy9CE+EgPvWfBJGriHHiIWFDh2ENmsKvo7VwqH/XrODHcOgLChTjKxiX2ka?= =?utf-8?q?b3xsfUIOUtwQMM13SIyFnlE62mU/wI2uS94wESOxahDfv7ITIPHqD3MXCZQcTz/Il?= =?utf-8?q?81FqP60S7ysIDcunHcV7ylTke8eDzIYOfITRuPgE6DA/K8sPL5GBOxdAc+W1EjJ8K?= =?utf-8?q?JPcGFHw7IXqEA32jDa/+DBczF1rV6RuKaM76UvTJ1RTpj0nuCrz1ObnfuIo7jd+UO?= =?utf-8?q?0wTWlwLcrByTBRPuoHG/4souSIrJWecoBOEupjzJim+JTeiqoAsc6EPxZijH9x0cQ?= =?utf-8?q?95ruNgvevD758dO0CE89ranRfPTULkm7nMJEMtB+F/a+zWHB1NTdrLk0YXCCEJ2Xc?= =?utf-8?q?WXg7D5Lp1zyHa66elU5SiCRAxyoR81K/7ZOEwdLV8+jp+5sJmtiYq7oJyoD+m20zr?= =?utf-8?q?DkMXRfrfVzExZsnG/lZsnduOBp6giuPM7w=3D=3D?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8487.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?NP3qhO77qoiuhhzHldzU1/O0sakH?= =?utf-8?q?n1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f-8?q?QkXTdr/gEOd1NkdeWAzslycDb/3gZ2db38KNe5hOpaXvzKfpMYmgrkM69ygybGYoU?= =?utf-8?q?isvrOmLBDIiL5B6w0dzlcYllHJRNEqEwEPrfU7cUYL61woBgLfhPheKDjejIkISJL?= =?utf-8?q?3Com3NUfdFoyY4dzHF/bART+WxN3560NoLcrQWGv7K3yQHbL67bPR4uIZRiF28UHL?= =?utf-8?q?uN57BdeIF08rV54gvAV4rEXYBmKfTf8vTaxo9CQUtf7nFW6+YN/EZxTz6av6+kDOe?= =?utf-8?q?zK1jYU8OUL789eACFrmiBzIjK1nlLujpncxn9yx7lTgEZJg54jQU9ZoVbOvgCvpGU?= =?utf-8?q?Hj4kXttupjEyztDhe+Bils7nBIJVr03giGZBtL+5KxFi3NYGNLlV4YHuciCKt4StB?= =?utf-8?q?5YYL1Azt06cpBQIved3LEcRSU7vz1Ou6gw2rTQpZLHj8C5Xq/B81PuCh8jHVEg4AQ?= =?utf-8?q?lY1M1OsAd1QyIbLvgrISB+q5YZTKagp2RQxnBhFPkQThHxh6gqQ0AHUwA5SP7Imum?= =?utf-8?q?/9oOM76u1wqXE8BdGjuM1Kv7MY0K/qxlvaMwANxxxl+P6GVgkPaI39EaBAJkDTOa1?= =?utf-8?q?X9cnLSunEdrBHtiod9zB2dUZo8HyZH2YPCDzRjE1sevgAVpYtmIcoTkWmIndgVok+?= =?utf-8?q?4K+wHt/tFvL7F1GXq2gHPxSFSlgrQ34FOw=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 9a8deaf5-cd19-4692-0620-08dd03cbb458 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 10:12:39.7823 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /OiMOghpUL9OMQJawkpIYjyziNr+0GdT5RTBLZscsRvJwVQkpT7MgQyNrY2iXcUEF/IBmPpJe2h8gda2wgj0XIvBhem3uL8+hSX10QIDWyE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7739 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241113_021244_556303_8DBE18DF X-CRM114-Status: GOOD ( 18.02 ) 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 The SIUL2 module is now represented as an mfd device. The pinctrl driver is now an mfd_cell. Therefore, remove its compatible and adjust its probing in order to get the necessary information from its mfd parent. This change came as a result of upstream review in the following series: https://lore.kernel.org/linux-gpio/a924bbb6-96ec-40be-9d82-a76b2ab73afd@oss.nxp.com/ https://lore.kernel.org/all/20240926143122.1385658-3-andrei.stefanescu@oss.nxp.com/ The SIUL2 module has multiple capabilities. It has support for reading SoC information, pinctrl and GPIO. All of this functionality is part of the same register space. The initial pinctrl driver treated the pinctrl functionality as separate from the GPIO one. However, they do rely on common registers and a long, detailed and specific register range list would be required for pinctrl&GPIO (carving out the necessary memory for each function). Moreover, in some cases this wouldn't be enough. For example reading a GPIO's direction would require a read of the MSCR register corresponding to that pin. This would not be possible in the GPIO driver because all of the MSCR registers are referenced by the pinctrl driver. Acked-by: Linus Walleij Signed-off-by: Andrei Stefanescu --- drivers/pinctrl/nxp/pinctrl-s32.h | 3 +- drivers/pinctrl/nxp/pinctrl-s32cc.c | 143 ++++++++++++---------------- drivers/pinctrl/nxp/pinctrl-s32g2.c | 25 +---- 3 files changed, 66 insertions(+), 105 deletions(-) diff --git a/drivers/pinctrl/nxp/pinctrl-s32.h b/drivers/pinctrl/nxp/pinctrl-s32.h index add3c77ddfed..d52c6f814de8 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32.h +++ b/drivers/pinctrl/nxp/pinctrl-s32.h @@ -2,7 +2,7 @@ * * S32 pinmux core definitions * - * Copyright 2016-2020, 2022 NXP + * Copyright 2016-2020, 2022, 2024 NXP * Copyright (C) 2022 SUSE LLC * Copyright 2015-2016 Freescale Semiconductor, Inc. * Copyright (C) 2012 Linaro Ltd. @@ -38,6 +38,7 @@ struct s32_pinctrl_soc_data { const struct pinctrl_pin_desc *pins; unsigned int npins; const struct s32_pin_range *mem_pin_ranges; + const struct regmap **regmaps; unsigned int mem_regions; }; diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index 501eb296c760..bb2f8127c2b7 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -12,6 +12,7 @@ #include #include #include +#include #include #include #include @@ -44,12 +45,6 @@ enum s32_write_type { S32_PINCONF_OVERWRITE, }; -static struct regmap_config s32_regmap_config = { - .reg_bits = 32, - .val_bits = 32, - .reg_stride = 4, -}; - static u32 get_pin_no(u32 pinmux) { return (pinmux & S32_PIN_ID_MASK) >> S32_PIN_ID_SHIFT; @@ -85,14 +80,15 @@ struct s32_pinctrl_context { unsigned int *pads; }; -/* +/** + * struct s32_pinctrl - private driver data * @dev: a pointer back to containing device * @pctl: a pointer to the pinctrl device structure * @regions: reserved memory regions with start/end pin * @info: structure containing information about the pin * @gpio_configs: Saved configurations for GPIO pins - * @gpiop_configs_lock: lock for the `gpio_configs` list - * @s32_pinctrl_context: Configuration saved over system sleep + * @gpio_configs_lock: lock for the `gpio_configs` list + * @saved_context: Configuration saved over system sleep */ struct s32_pinctrl { struct device *dev; @@ -123,14 +119,13 @@ s32_get_region(struct pinctrl_dev *pctldev, unsigned int pin) return NULL; } -static inline int s32_check_pin(struct pinctrl_dev *pctldev, - unsigned int pin) +static int s32_check_pin(struct pinctrl_dev *pctldev, unsigned int pin) { return s32_get_region(pctldev, pin) ? 0 : -EINVAL; } -static inline int s32_regmap_read(struct pinctrl_dev *pctldev, - unsigned int pin, unsigned int *val) +static int s32_regmap_read(struct pinctrl_dev *pctldev, unsigned int pin, + unsigned int *val) { struct s32_pinctrl_mem_region *region; unsigned int offset; @@ -145,7 +140,7 @@ static inline int s32_regmap_read(struct pinctrl_dev *pctldev, return regmap_read(region->map, offset, val); } -static inline int s32_regmap_write(struct pinctrl_dev *pctldev, +static int s32_regmap_write(struct pinctrl_dev *pctldev, unsigned int pin, unsigned int val) { @@ -163,7 +158,7 @@ static inline int s32_regmap_write(struct pinctrl_dev *pctldev, } -static inline int s32_regmap_update(struct pinctrl_dev *pctldev, unsigned int pin, +static int s32_regmap_update(struct pinctrl_dev *pctldev, unsigned int pin, unsigned int mask, unsigned int val) { struct s32_pinctrl_mem_region *region; @@ -236,10 +231,10 @@ static int s32_dt_group_node_to_map(struct pinctrl_dev *pctldev, } ret = pinconf_generic_parse_dt_config(np, pctldev, &cfgs, &n_cfgs); - if (ret) { - dev_err(dev, "%pOF: could not parse node property\n", np); - return ret; - } + if (ret) + return dev_err_probe(dev, ret, + "%pOF: could not parse node property\n", + np); if (n_cfgs) reserve++; @@ -321,7 +316,7 @@ static int s32_pmx_set(struct pinctrl_dev *pctldev, unsigned int selector, /* Check beforehand so we don't have a partial config. */ for (i = 0; i < grp->data.npins; i++) { if (s32_check_pin(pctldev, grp->data.pins[i]) != 0) { - dev_err(info->dev, "invalid pin: %u in group: %u\n", + dev_err(info->dev, "Invalid pin: %u in group: %u\n", grp->data.pins[i], group); return -EINVAL; } @@ -475,8 +470,8 @@ static int s32_get_slew_regval(int arg) return -EINVAL; } -static inline void s32_pin_set_pull(enum pin_config_param param, - unsigned int *mask, unsigned int *config) +static void s32_pin_set_pull(enum pin_config_param param, + unsigned int *mask, unsigned int *config) { switch (param) { case PIN_CONFIG_BIAS_DISABLE: @@ -762,15 +757,15 @@ static int s32_pinctrl_parse_groups(struct device_node *np, grp->data.name = np->name; npins = of_property_count_elems_of_size(np, "pinmux", sizeof(u32)); - if (npins < 0) { - dev_err(dev, "Failed to read 'pinmux' property in node %s.\n", - grp->data.name); - return -EINVAL; - } - if (!npins) { - dev_err(dev, "The group %s has no pins.\n", grp->data.name); - return -EINVAL; - } + if (npins < 0) + return dev_err_probe(dev, -EINVAL, + "Failed to read 'pinmux' in node %s\n", + grp->data.name); + + if (!npins) + return dev_err_probe(dev, -EINVAL, + "The group %s has no pins\n", + grp->data.name); grp->data.npins = npins; @@ -811,11 +806,9 @@ static int s32_pinctrl_parse_functions(struct device_node *np, /* Initialise function */ func->name = np->name; func->ngroups = of_get_child_count(np); - if (func->ngroups == 0) { - dev_err(info->dev, "no groups defined in %pOF\n", np); - return -EINVAL; - } - + if (func->ngroups == 0) + return dev_err_probe(info->dev, -EINVAL, + "No groups defined in %pOF\n", np); groups = devm_kcalloc(info->dev, func->ngroups, sizeof(*func->groups), GFP_KERNEL); if (!groups) @@ -838,57 +831,42 @@ static int s32_pinctrl_parse_functions(struct device_node *np, static int s32_pinctrl_probe_dt(struct platform_device *pdev, struct s32_pinctrl *ipctl) { + struct nxp_siul2_mfd *mfd = dev_get_drvdata(pdev->dev.parent); struct s32_pinctrl_soc_info *info = ipctl->info; - struct device_node *np = pdev->dev.of_node; - struct resource *res; - struct regmap *map; - void __iomem *base; - unsigned int mem_regions = info->soc_data->mem_regions; + unsigned int mem_regions; + struct device_node *np; + u32 nfuncs = 0, i = 0, j; + u8 regmap_type; int ret; - u32 nfuncs = 0; - u32 i = 0; + np = pdev->dev.parent->of_node; if (!np) return -ENODEV; - if (mem_regions == 0 || mem_regions >= 10000) { - dev_err(&pdev->dev, "mem_regions is invalid: %u\n", mem_regions); - return -EINVAL; - } + /* one MSCR and one IMCR region per SIUL2 module */ + mem_regions = info->soc_data->mem_regions; + if (mem_regions != mfd->num_siul2 * 2) + return dev_err_probe(&pdev->dev, -EINVAL, + "Mem_regions is invalid: %u\n", + mem_regions); ipctl->regions = devm_kcalloc(&pdev->dev, mem_regions, sizeof(*ipctl->regions), GFP_KERNEL); if (!ipctl->regions) return -ENOMEM; + /* Order is MSCR regions first, then IMCR ones */ for (i = 0; i < mem_regions; i++) { - base = devm_platform_get_and_ioremap_resource(pdev, i, &res); - if (IS_ERR(base)) - return PTR_ERR(base); - - snprintf(ipctl->regions[i].name, - sizeof(ipctl->regions[i].name), "map%u", i); - - s32_regmap_config.name = ipctl->regions[i].name; - s32_regmap_config.max_register = resource_size(res) - - s32_regmap_config.reg_stride; - - map = devm_regmap_init_mmio(&pdev->dev, base, - &s32_regmap_config); - if (IS_ERR(map)) { - dev_err(&pdev->dev, "Failed to init regmap[%u]\n", i); - return PTR_ERR(map); - } - - ipctl->regions[i].map = map; + regmap_type = i < mem_regions / 2 ? SIUL2_MSCR : SIUL2_IMCR; + j = i % mfd->num_siul2; + ipctl->regions[i].map = mfd->siul2[j].regmaps[regmap_type]; ipctl->regions[i].pin_range = &info->soc_data->mem_pin_ranges[i]; } nfuncs = of_get_child_count(np); - if (nfuncs <= 0) { - dev_err(&pdev->dev, "no functions defined\n"); - return -EINVAL; - } + if (nfuncs <= 0) + return dev_err_probe(&pdev->dev, -EINVAL, + "No functions defined\n"); info->nfunctions = nfuncs; info->functions = devm_kcalloc(&pdev->dev, nfuncs, @@ -918,18 +896,17 @@ static int s32_pinctrl_probe_dt(struct platform_device *pdev, int s32_pinctrl_probe(struct platform_device *pdev, const struct s32_pinctrl_soc_data *soc_data) { - struct s32_pinctrl *ipctl; - int ret; - struct pinctrl_desc *s32_pinctrl_desc; - struct s32_pinctrl_soc_info *info; #ifdef CONFIG_PM_SLEEP struct s32_pinctrl_context *saved_context; #endif + struct pinctrl_desc *s32_pinctrl_desc; + struct s32_pinctrl_soc_info *info; + struct s32_pinctrl *ipctl; + int ret; - if (!soc_data || !soc_data->pins || !soc_data->npins) { - dev_err(&pdev->dev, "wrong pinctrl info\n"); - return -EINVAL; - } + if (!soc_data || !soc_data->pins || !soc_data->npins) + return dev_err_probe(&pdev->dev, -EINVAL, + "Wrong pinctrl info\n"); info = devm_kzalloc(&pdev->dev, sizeof(*info), GFP_KERNEL); if (!info) @@ -964,17 +941,15 @@ int s32_pinctrl_probe(struct platform_device *pdev, s32_pinctrl_desc->owner = THIS_MODULE; ret = s32_pinctrl_probe_dt(pdev, ipctl); - if (ret) { - dev_err(&pdev->dev, "fail to probe dt properties\n"); - return ret; - } + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Failed to probe dt properties\n"); ipctl->pctl = devm_pinctrl_register(&pdev->dev, s32_pinctrl_desc, ipctl); if (IS_ERR(ipctl->pctl)) return dev_err_probe(&pdev->dev, PTR_ERR(ipctl->pctl), - "could not register s32 pinctrl driver\n"); - + "Could not register s32 pinctrl driver\n"); #ifdef CONFIG_PM_SLEEP saved_context = &ipctl->saved_context; saved_context->pads = diff --git a/drivers/pinctrl/nxp/pinctrl-s32g2.c b/drivers/pinctrl/nxp/pinctrl-s32g2.c index 440ff1879424..27669991c339 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32g2.c +++ b/drivers/pinctrl/nxp/pinctrl-s32g2.c @@ -3,13 +3,14 @@ * NXP S32G pinctrl driver * * Copyright 2015-2016 Freescale Semiconductor, Inc. - * Copyright 2017-2018, 2020-2022 NXP + * Copyright 2017-2018, 2020-2022, 2024 NXP * Copyright (C) 2022 SUSE LLC */ #include #include #include +#include #include #include #include @@ -713,12 +714,10 @@ static const struct pinctrl_pin_desc s32_pinctrl_pads_siul2[] = { static const struct s32_pin_range s32_pin_ranges_siul2[] = { /* MSCR pin ID ranges */ S32_PIN_RANGE(0, 101), - S32_PIN_RANGE(112, 122), - S32_PIN_RANGE(144, 190), + S32_PIN_RANGE(112, 190), /* IMCR pin ID ranges */ S32_PIN_RANGE(512, 595), - S32_PIN_RANGE(631, 909), - S32_PIN_RANGE(942, 1007), + S32_PIN_RANGE(631, 1007), }; static const struct s32_pinctrl_soc_data s32_pinctrl_data = { @@ -728,22 +727,9 @@ static const struct s32_pinctrl_soc_data s32_pinctrl_data = { .mem_regions = ARRAY_SIZE(s32_pin_ranges_siul2), }; -static const struct of_device_id s32_pinctrl_of_match[] = { - { - .compatible = "nxp,s32g2-siul2-pinctrl", - .data = &s32_pinctrl_data, - }, - { /* sentinel */ } -}; -MODULE_DEVICE_TABLE(of, s32_pinctrl_of_match); - static int s32g_pinctrl_probe(struct platform_device *pdev) { - const struct s32_pinctrl_soc_data *soc_data; - - soc_data = of_device_get_match_data(&pdev->dev); - - return s32_pinctrl_probe(pdev, soc_data); + return s32_pinctrl_probe(pdev, &s32_pinctrl_data); } static const struct dev_pm_ops s32g_pinctrl_pm_ops = { @@ -753,7 +739,6 @@ static const struct dev_pm_ops s32g_pinctrl_pm_ops = { static struct platform_driver s32g_pinctrl_driver = { .driver = { .name = "s32g-siul2-pinctrl", - .of_match_table = s32_pinctrl_of_match, .pm = pm_sleep_ptr(&s32g_pinctrl_pm_ops), .suppress_bind_attrs = true, }, From patchwork Wed Nov 13 10:10:57 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 13873418 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 20A26D41C27 for ; Wed, 13 Nov 2024 10:24:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type: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=wiP7UIlersJYQQUVj+ieic4nekKdRvNUeyEKCnitCJ0=; b=voMKnDQYJMd8pYEsAasRhe8CN3 10TTiA9gSyh1ZK2TetwE6lnQ9lRDR/peyW2hdV0HoWFTPwB84lGpiPs6AOpgE13N0RD0KGx539oXM ACCdooZ8axecjSc9lzk4YHtrQK4DmBVl9R192XHcO/H18NF3S7Npo/2/lOUtuM2yPenHTYIJdB5dk fMJ91v5YwiPubaP11GorrnzsRNDTjM1Iqq8JLOoUWDWY2y9RNScUXGxuTrhNqgzxt/L8qgeA3wGu+ 7UkSVIJR6qmtrgwmoRNBKG3YXxZ8Uk7HOz3oJTZ5TrHYYwVPBhoUneUqsCUlR+JbnEdwwLBw0LQWr 3YfHyAcg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tBAXu-00000006Qrp-1wxT; Wed, 13 Nov 2024 10:24:22 +0000 Received: from mail-francecentralazlp170130007.outbound.protection.outlook.com ([2a01:111:f403:c20a::7] helo=PA4PR04CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tBAMg-00000006OdC-20Dm for linux-arm-kernel@lists.infradead.org; Wed, 13 Nov 2024 10:12:47 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PlyvtZgkBQG8riDQ4fne9SwjZZ58bAAt8esD3UCBISFWMzCRPqMcGNn0EvRMA3gO5sm1hd1MiwyDxayu5MNDiOihIGl7n78QOG9i5pU+3bQTQq7LqydY3rOPtMebwPq8VGgJL3tm9xlCPe1hRKWSnCI3atBJ/mbx39mTEAsFHuIN6z8D6K5+jrtskIr2xESTFlykpxzqI94pCouTfmsTt0LQ+oYgjihRefGB8xg/n10fGxjTPy1YJ6cqkP3z9LFlidVzouIHUDCqPgZt0dops/JBgrZ2+8fk0mmUXSnV4uwFq0LhdG7LV4ojnnatlc/EwQGO2ofisWjlTpmUVNDhgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=wiP7UIlersJYQQUVj+ieic4nekKdRvNUeyEKCnitCJ0=; b=COXsKyOOJ+GxP9z4b9zmSKdLnpLEIDWk+Z+oWzEuBuvibmWWiR1VNkT/+ZLLfaOtmboRHvXsCAogV1ZcIrZouSCCiboIZKaYoalt/zOBYjO95A+QZAND+1jvoefsJo2HR1MbWJT+9xY/M8gjsuAapLmIZpjLGIlOPiYpU0i0zbYOc0Oh0ZbFr26GZHbQbchBf8CuHzoSe5yNiwgSBu/Idwzy07gdaWrQ8Qv13+jQ+m3j6g22qdgvatzJ1LHWLqkWLebdfcaamH1AHyPV1bshpDrjnkYCNXlXs9kgtFOc8NTew/6/JUK7mNNokVgKuVWpXzzOgiI8sAJ4fD1pDrhrqg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=wiP7UIlersJYQQUVj+ieic4nekKdRvNUeyEKCnitCJ0=; b=rNYCsnJueXYyWrXQtUumILy9XocCHHU540x+Rna/ZxtRD5nfZE+pWTe7bakN3kFeJBg32p3USljYuEh0EmGwuIXlXcJzQYSlJ23xK2Zh05Xm4lmMHe8meVZ5qOnP6QI34/kBK8XIu7cj1GxDH1vcfJiu4THRW9Z7sC9aiv01s66T3lXtcN9wWHmAzfa6+YJFnqfu+AcA+T70dTVb8I2/zIs+pEyWPnMj3gvXKYsHE6jyfrpu75WP3zmH2+JVj57mfaRjK350lz+w+sw3BQyQblG6jnzYdp43cIQJaJNJeroSxhIoJvlttKLIi4wDsmg5bVqGG+uU8lhKcFny+YdMDw== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by DBBPR04MB7739.eurprd04.prod.outlook.com (2603:10a6:10:1eb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29; Wed, 13 Nov 2024 10:12:41 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%4]) with mapi id 15.20.8158.013; Wed, 13 Nov 2024 10:12:41 +0000 From: Andrei Stefanescu To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Larisa Grigore , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lee Jones , Shawn Guo , Sascha Hauer , Fabio Estevam , Dong Aisheng , Jacky Bai Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP S32 Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Pengutronix Kernel Team , imx@lists.linux.dev, Andrei Stefanescu Subject: [PATCH v6 5/7] pinctrl: s32cc: change to "devm_pinctrl_register_and_init" Date: Wed, 13 Nov 2024 12:10:57 +0200 Message-ID: <20241113101124.1279648-6-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> References: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AM8P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::10) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8487:EE_|DBBPR04MB7739:EE_ X-MS-Office365-Filtering-Correlation-Id: 4d6e7a88-10e5-460a-83f2-08dd03cbb560 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?cRt7SKEg3fCK1dLXBeV7JDSGsji5I3J?= =?utf-8?q?evHU5m1uhimIgUpXLfD6wnFVytqMc+EZqSZUBBAVjY/cFo9HzoxSiiCk9AqYzLADa?= =?utf-8?q?nl6SX92YfyGEohi8HArt5bTTguZpPEQVYmg4dIDWl89fMoN8YZLl5hNLHMeiaFdq4?= =?utf-8?q?G3gESQ3HwS63MB3gNLkyW+N9aWca+hmHkUGo8nU5+pIg/rjCrcLZRXrY1a8hH0JtX?= =?utf-8?q?AVSHCMXRifWoxK5O3LErFTehmT3kjInQVPbw0rivA/d8r5YFW3EfrIB8L08WpUMFB?= =?utf-8?q?kquYRSpW2ZLnsz7goIiIs1QGhcKeDto79LczxO7Jyj9qN5E6VpxpmWpF2LNV0FjpA?= =?utf-8?q?aUr8WzaBAlkNYmypraEt5GuugQAOs4bV8+5WzETjvGkgimgOULjbJqY8Ta+5u612u?= =?utf-8?q?pxZ8gPC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8?q?c3VqF6x4gw4ruuZcvj6gPU0e7tpM5IxmLlYA7BSezus4MuzwUC/7o2z+2GwTEemne?= =?utf-8?q?0eqsN318yNZr?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8487.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?3tRkuWXiYc3E2mv93czPAqx3DqZl?= =?utf-8?q?0eARgx5/1d7f3R/pn+aEsXGCtmi/sKC/N5P2NEDnQ7Xylbp7hjLMVdJ+xOhNDm7LB?= =?utf-8?q?2cv60QGQmAyCxHy3AOsSPe+URDmfod1fAkAMug+89XKiCSIJz2o3adF1wKsM/7nDE?= =?utf-8?q?l20tOfS2Ihe2BVGJxA150JNpyu6uVZbEJh2ZANAWrFggtrt1iPxm3mVGjQ2w9Kl5H?= =?utf-8?q?ISdnpn8GLypEQnifUwEaX2v2yxz8ObkfCjofp8nLL6qsG/7wlvswSBLq1iGtsjAIa?= =?utf-8?q?er1aKs47JFW9Bbce2wLylUKcmm6aGaCcXrC04aOlFpBUcnx2NOrs/UulnodT8oBhs?= =?utf-8?q?H3CFNGyPRwpzY1KOptWad5VBl2Y9HgbCeBGCUm3EQLVxE/TS/An4oKmd//ma3E6La?= =?utf-8?q?VewFBfboUzC0KYFPZG/LKNztFq7qsRm7lJJa+/TRN9vPGZST3Ncaw35n2q2hmXhQ+?= =?utf-8?q?/tBE7shDNOB9Z80lrEnWxliv7PyMbUpaP1NvRfDq2ZVDsisG39rborbqi17tplRyK?= =?utf-8?q?bPZe7H3z1Xgn37CsrN/2kIOHSfscMvqRc1x3kT6KQF94chGLms7bMPfcqevNPda0q?= =?utf-8?q?oKTmd01Gy4FqG3piqZ/f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u4dNgKBM37TVf/0udP9yuef4RhtfR?= =?utf-8?q?UIdgHeKwmhbHPQbY2PT5ax+ZiRkvk8ilzQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 4d6e7a88-10e5-460a-83f2-08dd03cbb560 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 10:12:41.5003 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: iO/RC+jiMN4+/vvKy/cisJUWVaTO6ydFbYgXfOcuaErhSdGAn3Wp/wROEbitjvj37gQBbWDK5LDNP7ztrVlwXGNM/CRlrPahTWsQ0RuBkvM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7739 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241113_021246_541799_132AB2A7 X-CRM114-Status: GOOD ( 12.16 ) 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 Switch from "devm_pinctrl_register" to "devm_pinctrl_register_and_init" and "pinctrl_enable" since this is the recommended way. Reviewed-by: Linus Walleij Signed-off-by: Andrei Stefanescu --- drivers/pinctrl/nxp/pinctrl-s32cc.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index bb2f8127c2b7..0b79c7445929 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -945,10 +945,10 @@ int s32_pinctrl_probe(struct platform_device *pdev, return dev_err_probe(&pdev->dev, ret, "Failed to probe dt properties\n"); - ipctl->pctl = devm_pinctrl_register(&pdev->dev, s32_pinctrl_desc, - ipctl); - if (IS_ERR(ipctl->pctl)) - return dev_err_probe(&pdev->dev, PTR_ERR(ipctl->pctl), + ret = devm_pinctrl_register_and_init(&pdev->dev, s32_pinctrl_desc, + ipctl, &ipctl->pctl); + if (ret) + return dev_err_probe(&pdev->dev, ret, "Could not register s32 pinctrl driver\n"); #ifdef CONFIG_PM_SLEEP saved_context = &ipctl->saved_context; @@ -960,7 +960,12 @@ int s32_pinctrl_probe(struct platform_device *pdev, return -ENOMEM; #endif - dev_info(&pdev->dev, "initialized s32 pinctrl driver\n"); + ret = pinctrl_enable(ipctl->pctl); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Failed to enable pinctrl\n"); + + dev_info(&pdev->dev, "Initialized s32 pinctrl driver\n"); return 0; } From patchwork Wed Nov 13 10:10:58 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 13873419 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 73ABED41C27 for ; Wed, 13 Nov 2024 10:26:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type: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=+54voebqoeKg4PDvduKb7kbojQ1Q0j2NGqVvHwKT85I=; b=E74/9dDH2Wo6Hhq9nIPskBw5gR OWaKSBU1c7AdhmFtTw53+Mx4JwoLXWdzBJ3ZBhAHyjqcEGM5HGKkKslBZT82GyZ2/637A9ntiNf7D x+WW4qquv4wdkN3wLQNGbwY06tL1gtjGT4niQtLnwLArpcc1xHRz1kAbZhsMgLgvL2iKqIJk8B7vm w9JIx+jo+39abUgcpRVX8AkEF7m9H2FKX0dl+9mDKepzXcH0TXvtAkTD4o6oWHyzA7ZZZ4VyCjhJk yK5e46noNBCFGPBOZFZzW/OBuMg2sCs8c1vCSdR++2rENtplgi6wsIZAuppURc2C4TpnS7OByLn+o kGYknTKQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tBAZg-00000006RCN-17el; Wed, 13 Nov 2024 10:26:12 +0000 Received: from mail-francecentralazlp170130007.outbound.protection.outlook.com ([2a01:111:f403:c20a::7] helo=PA4PR04CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tBAMi-00000006OdC-0kjM for linux-arm-kernel@lists.infradead.org; Wed, 13 Nov 2024 10:12:49 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uP4zjWBVZwDojD1Yvhe6PJ9CECthvggq3Yy7PtM1ZN97tIAzbM9WR8qd+0JW+GOZjAmVi1cbsf9axG0+gkblY8ROgctMUO5NEDBkYOsexPWMTyMHH5qz+xShWtz7kGodDNh1cNnQZ1lq6ibagqOqGlNZ5CfagIjRTNM4ZxMVTb+gGLBTIKKmYU//E0ThCEgtKoeSmOgE5CVJrlSFeNUmPIX6bRvDfu7uQvtxum267QWou2zXcG+BWzx+Avk3ZI1ri+7uk+/2GUZmabN2ZXbJt3MkDr9m4upwjv8iJ1r6mUPJWMrIK3aA9pBjoxmrjlZ0orLjw6AH/vmyVbrEzBTIlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=+54voebqoeKg4PDvduKb7kbojQ1Q0j2NGqVvHwKT85I=; b=NG/zewrueEkYdVdkKEKAyZCFfnkrstQSfgEj4wTgztzk0hkgSVgSAQPXYZkXm8wNDZtORw73vBhySWOaiG3dq7+Dx3uj2M6qnOCsaNaQBiGGftpar0EmGfXT8rNXlLA6tP5tozXO87NOWnAxzvp9JTxWs/LPhGeDBV0qgv+0YcfZfQfqa9B1rT7jrYz7zIuR1h7VitsW+H4kEgsqDgACSfUpKZR2cIGeo7Rl2s3gS9Pzp8egp5qiL3YvcJKMUy8voebV/g2zAvEvr44laDh2IGDptx1wJQTDLlyh9eZmYSpZbQMlhkpF8mz06AKsQUOR5WZF61oZjF8SUVkqMzwO4g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=+54voebqoeKg4PDvduKb7kbojQ1Q0j2NGqVvHwKT85I=; b=KYtIXwD9DJydHpGvp5awOFWvKECoIhi4FReSg7P+uzGV5Hg5byarPiiO64B8KuqyDuYBmBI6O8zDRUpSk2MpHFkkcW2YXUVlKcrYpr/uEp7PrJ25XlLOCX1MJV0euDF8Cx71le8wu6xr9xmfVRlBkZZBdmGZGQDYWmlm2p7Qs1hJtchfacLDhjz/vVONPAqDfoRBM78bKtvManiyxCZXXet3rKXGP40wXFUpt2fybWozfttCBmylPDGbePj8xBX9uOlc8DEpnQwEOd5cMryp2NqHfMYhS1RpVCGkMeUGDZIQ+BWDtfzfH4UnwsDvcY8Nrp3zoOmCT+5eUwoGKlYR1A== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by DBBPR04MB7739.eurprd04.prod.outlook.com (2603:10a6:10:1eb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29; Wed, 13 Nov 2024 10:12:43 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%4]) with mapi id 15.20.8158.013; Wed, 13 Nov 2024 10:12:43 +0000 From: Andrei Stefanescu To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Larisa Grigore , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lee Jones , Shawn Guo , Sascha Hauer , Fabio Estevam , Dong Aisheng , Jacky Bai Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP S32 Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Pengutronix Kernel Team , imx@lists.linux.dev, Andrei Stefanescu Subject: [PATCH v6 6/7] pinctrl: s32cc: implement GPIO functionality Date: Wed, 13 Nov 2024 12:10:58 +0200 Message-ID: <20241113101124.1279648-7-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> References: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AM8P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::10) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8487:EE_|DBBPR04MB7739:EE_ X-MS-Office365-Filtering-Correlation-Id: 2cbab589-f131-46f2-47f9-08dd03cbb66d X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?BXpwXrFmxvtDHQocJrLLfVhdNchokcn?= =?utf-8?q?+p4FxjM6EHOxR6SrHOnEJS5oLsL4LR93Zpv8hjf/O1AEJuuJqAjRUDJHrVaEpdvgi?= =?utf-8?q?LnA9VNpRd+FMPWhva9LRLrpEaVToSh88YoYnTC3zKs92LEw6MP1fo78YHIjxAdnD1?= =?utf-8?q?qMiZd3WFANueyymkWKoPUdkCDTP+nC2r3e+NdvAKWf8pN9hUbVslToOzItfu48Tdc?= =?utf-8?q?M/xsAj6RCFmVlh8JIUOIVBLD3kbgJ4jQkkiFhYhg5pqDf/7g0OFdW91BVpO5upcIX?= =?utf-8?q?evmPFA2wnAStCZ49j6US0XPpI690Vz+EVDCTddMtEcOw/RN8SDaREuA4e7rRBrLEE?= =?utf-8?q?oz+/qh8fb9BR1g1gZHKotlORLGfzwRvaXZ/h38/ilZoWgYF4irqRjbTTKyCinM8Hn?= =?utf-8?q?kta7zm3WafefPXW4a7IW02vei7Dq58AFnTn6YN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WHU2cdmTrcNXr42f13PyLqPKyJO?= =?utf-8?q?1MxXAMobhlx5?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8487.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?WB7RSkjM5KpJbaSo09JbPclg9cbp?= =?utf-8?q?NXUm+thhLc2rAghw4AKCVPb2PiJJpAM0HPt7La/+klzUB5USviaW0Szi2pkx/C1Iz?= =?utf-8?q?Q4OE+yBYrsoQkcXMVBDF+qCLuvdPhKUkZJHedP+ueaWkHyTbdEX3+XxEx4/jSrN7J?= =?utf-8?q?ovNFHbnPSODhZ/XUlyXFqChlpo/qVd+EdQk59CcTZUP/LRO+vukNrviW/J9VnO39w?= =?utf-8?q?4uAPL9kYaV//Od0qnwVy+DC32y4vDSmH/ruWPg/8Afaiac7Xm/6txm7DQ2MLJd1v4?= =?utf-8?q?SVBxuCLSvzVIpOR54Dw2VCZ90n3WW96Q2qn/XtPxirxOOsEmBXV0elxdrAqcXoVsW?= =?utf-8?q?G2OOG4sKabjkL73kIJde2al9AvJgE5G5/+jD5s13jfc5rZjK7mvdV6TjjYmahPmg8?= =?utf-8?q?O+az3WGXFu2PLFqG9fuLpHQ73c/vNbtAxkeEP+Rlov7+gC5gG5jLziFq8o5yNwVL4?= =?utf-8?q?4Y5CCLJ97FiUYvnyNKS5NSIHtPwvfpLNF02ClmzljZhFetbXHwGN6dWQj5StvlKes?= =?utf-8?q?415Q1SUCisrlPEzoqV41g6d5cqoF10TnJNBly10P5U+VLssvl6GXapOqeZl/u076X?= =?utf-8?q?l46Aztu4jk1C5CnEJTwKHbIdfmSmU9X+AdeuxfNMbZ3UqtL1W6qOiWDbZE897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glYOx2+LbIDzIR?= =?utf-8?q?oV8Vj28aScFucdwInjujg20yQWCZkvjlRQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 2cbab589-f131-46f2-47f9-08dd03cbb66d X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 10:12:43.3145 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 7B1WWiva/XvoHxAKtmUy/Pd6LiKQABV9Ni8MJVtJkttSO6klW4OyApsJTnS8BrE4Eg8hnqjy/rDs9RTZVJWVFc61PndrzfbUJh99wKVe1fU= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7739 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241113_021248_261421_34E7C1B3 X-CRM114-Status: GOOD ( 18.56 ) 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 Add basic GPIO functionality (request, free, get, set) for the existing pinctrl SIUL2 driver since the hardware for pinctrl&GPIO is tightly coupled. Also, remove pinmux_ops which are no longer needed. Signed-off-by: Andrei Stefanescu --- drivers/pinctrl/nxp/pinctrl-s32cc.c | 406 +++++++++++++++++++++++----- 1 file changed, 344 insertions(+), 62 deletions(-) diff --git a/drivers/pinctrl/nxp/pinctrl-s32cc.c b/drivers/pinctrl/nxp/pinctrl-s32cc.c index 0b79c7445929..e213a910d958 100644 --- a/drivers/pinctrl/nxp/pinctrl-s32cc.c +++ b/drivers/pinctrl/nxp/pinctrl-s32cc.c @@ -40,6 +40,14 @@ #define S32_MSCR_ODE BIT(20) #define S32_MSCR_OBE BIT(21) +/* PGPDOs are 16bit registers that come in big endian + * order if they are grouped in pairs of two. + * + * For example, the order is PGPDO1, PGPDO0, PGPDO3, PGPDO2... + */ +#define S32_PGPD(N) (((N) ^ 1) * 2) +#define S32_PGPD_SIZE 16 + enum s32_write_type { S32_PINCONF_UPDATE_ONLY, S32_PINCONF_OVERWRITE, @@ -84,6 +92,7 @@ struct s32_pinctrl_context { * struct s32_pinctrl - private driver data * @dev: a pointer back to containing device * @pctl: a pointer to the pinctrl device structure + * @gc: a pointer to the gpio_chip * @regions: reserved memory regions with start/end pin * @info: structure containing information about the pin * @gpio_configs: Saved configurations for GPIO pins @@ -93,6 +102,7 @@ struct s32_pinctrl_context { struct s32_pinctrl { struct device *dev; struct pinctrl_dev *pctl; + struct gpio_chip gc; struct s32_pinctrl_mem_region *regions; struct s32_pinctrl_soc_info *info; struct list_head gpio_configs; @@ -366,66 +376,6 @@ static int s32_pmx_get_groups(struct pinctrl_dev *pctldev, return 0; } -static int s32_pmx_gpio_request_enable(struct pinctrl_dev *pctldev, - struct pinctrl_gpio_range *range, - unsigned int offset) -{ - struct s32_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); - struct gpio_pin_config *gpio_pin; - unsigned int config; - unsigned long flags; - int ret; - - ret = s32_regmap_read(pctldev, offset, &config); - if (ret) - return ret; - - /* Save current configuration */ - gpio_pin = kmalloc(sizeof(*gpio_pin), GFP_KERNEL); - if (!gpio_pin) - return -ENOMEM; - - gpio_pin->pin_id = offset; - gpio_pin->config = config; - - spin_lock_irqsave(&ipctl->gpio_configs_lock, flags); - list_add(&gpio_pin->list, &ipctl->gpio_configs); - spin_unlock_irqrestore(&ipctl->gpio_configs_lock, flags); - - /* GPIO pin means SSS = 0 */ - config &= ~S32_MSCR_SSS_MASK; - - return s32_regmap_write(pctldev, offset, config); -} - -static void s32_pmx_gpio_disable_free(struct pinctrl_dev *pctldev, - struct pinctrl_gpio_range *range, - unsigned int offset) -{ - struct s32_pinctrl *ipctl = pinctrl_dev_get_drvdata(pctldev); - struct gpio_pin_config *gpio_pin, *tmp; - unsigned long flags; - int ret; - - spin_lock_irqsave(&ipctl->gpio_configs_lock, flags); - - list_for_each_entry_safe(gpio_pin, tmp, &ipctl->gpio_configs, list) { - if (gpio_pin->pin_id == offset) { - ret = s32_regmap_write(pctldev, gpio_pin->pin_id, - gpio_pin->config); - if (ret != 0) - goto unlock; - - list_del(&gpio_pin->list); - kfree(gpio_pin); - break; - } - } - -unlock: - spin_unlock_irqrestore(&ipctl->gpio_configs_lock, flags); -} - static int s32_pmx_gpio_set_direction(struct pinctrl_dev *pctldev, struct pinctrl_gpio_range *range, unsigned int offset, @@ -449,8 +399,6 @@ static const struct pinmux_ops s32_pmx_ops = { .get_function_name = s32_pmx_get_func_name, .get_function_groups = s32_pmx_get_groups, .set_mux = s32_pmx_set, - .gpio_request_enable = s32_pmx_gpio_request_enable, - .gpio_disable_free = s32_pmx_gpio_disable_free, .gpio_set_direction = s32_pmx_gpio_set_direction, }; @@ -669,6 +617,311 @@ static const struct pinconf_ops s32_pinconf_ops = { .pin_config_group_dbg_show = s32_pinconf_group_dbg_show, }; +static struct s32_pinctrl *to_s32_pinctrl(struct gpio_chip *chip) +{ + return container_of(chip, struct s32_pinctrl, gc); +} + +static struct regmap *s32_gpio_get_pgpd_regmap(struct gpio_chip *chip, + unsigned int pin, + bool output) +{ + struct s32_pinctrl *ipctl = to_s32_pinctrl(chip); + struct nxp_siul2_mfd *mfd; + u32 base, num; + int i; + + mfd = dev_get_drvdata(ipctl->dev->parent); + + for (i = 0; i < mfd->num_siul2; i++) { + base = mfd->siul2[i].gpio_base; + num = mfd->siul2[i].gpio_num; + + if (pin >= base && pin < base + num) + return output ? mfd->siul2[i].regmaps[SIUL2_PGPDO] : + mfd->siul2[i].regmaps[SIUL2_PGPDI]; + } + + return NULL; +} + +static int s32_gpio_request(struct gpio_chip *gc, unsigned int gpio) +{ + struct s32_pinctrl *ipctl = to_s32_pinctrl(gc); + struct pinctrl_dev *pctldev = ipctl->pctl; + struct gpio_pin_config *gpio_pin; + unsigned int config; + int ret; + + ret = s32_regmap_read(pctldev, gpio, &config); + if (ret) + return ret; + + /* Save current configuration */ + gpio_pin = kmalloc(sizeof(*gpio_pin), GFP_KERNEL); + if (!gpio_pin) + return -ENOMEM; + + gpio_pin->pin_id = gpio; + gpio_pin->config = config; + + scoped_guard(spinlock_irqsave, &ipctl->gpio_configs_lock) + list_add(&gpio_pin->list, &ipctl->gpio_configs); + + /* GPIO pin means SSS = 0 */ + config &= ~S32_MSCR_SSS_MASK; + + return s32_regmap_write(pctldev, gpio, config); +} + +static void s32_gpio_free(struct gpio_chip *gc, unsigned int gpio) +{ + struct s32_pinctrl *ipctl = to_s32_pinctrl(gc); + struct pinctrl_dev *pctldev = ipctl->pctl; + struct gpio_pin_config *gpio_pin, *tmp; + unsigned long flags; + int ret; + + spin_lock_irqsave(&ipctl->gpio_configs_lock, flags); + + list_for_each_entry_safe(gpio_pin, tmp, &ipctl->gpio_configs, list) { + if (gpio_pin->pin_id == gpio) { + ret = s32_regmap_write(pctldev, gpio_pin->pin_id, + gpio_pin->config); + if (ret != 0) + goto unlock; + + list_del(&gpio_pin->list); + kfree(gpio_pin); + break; + } + } + +unlock: + spin_unlock_irqrestore(&ipctl->gpio_configs_lock, flags); +} + +static int s32_gpio_get_dir(struct gpio_chip *chip, unsigned int gpio) +{ + struct s32_pinctrl *ipctl = to_s32_pinctrl(chip); + unsigned int reg_value; + int ret; + + ret = s32_regmap_read(ipctl->pctl, gpio, ®_value); + if (ret) + return ret; + + if (!(reg_value & S32_MSCR_IBE)) + return -EINVAL; + + return reg_value & S32_MSCR_OBE ? GPIO_LINE_DIRECTION_OUT : + GPIO_LINE_DIRECTION_IN; +} + +static unsigned int s32_pin2pad(unsigned int pin) +{ + return pin / S32_PGPD_SIZE; +} + +static u16 s32_pin2mask(unsigned int pin) +{ + /** + * From Reference manual : + * PGPDOx[PPDOy] = GPDO(x × 16) + (15 - y)[PDO_(x × 16) + (15 - y)] + */ + return BIT(S32_PGPD_SIZE - 1 - pin % S32_PGPD_SIZE); +} + +static struct regmap *s32_gpio_get_regmap_offset_mask(struct gpio_chip *chip, + unsigned int gpio, + unsigned int *reg_offset, + u16 *mask, + bool output) +{ + struct regmap *regmap; + unsigned int pad; + + regmap = s32_gpio_get_pgpd_regmap(chip, gpio, output); + if (!regmap) + return NULL; + + *mask = s32_pin2mask(gpio); + pad = s32_pin2pad(gpio); + + *reg_offset = S32_PGPD(pad); + + return regmap; +} + +static void s32_gpio_set_val(struct gpio_chip *chip, unsigned int gpio, + int value) +{ + unsigned int reg_offset; + struct regmap *regmap; + u16 mask; + + regmap = s32_gpio_get_regmap_offset_mask(chip, gpio, ®_offset, + &mask, true); + if (!regmap) + return; + + value = value ? mask : 0; + + regmap_update_bits(regmap, reg_offset, mask, value); +} + +static void s32_gpio_set(struct gpio_chip *chip, unsigned int gpio, + int value) +{ + if (s32_gpio_get_dir(chip, gpio) != GPIO_LINE_DIRECTION_OUT) + return; + + s32_gpio_set_val(chip, gpio, value); +} + +static int s32_gpio_get(struct gpio_chip *chip, unsigned int gpio) +{ + unsigned int reg_offset, value; + struct regmap *regmap; + u16 mask; + int ret; + + if (s32_gpio_get_dir(chip, gpio) != GPIO_LINE_DIRECTION_IN) + return -EINVAL; + + regmap = s32_gpio_get_regmap_offset_mask(chip, gpio, ®_offset, + &mask, false); + if (!regmap) + return -EINVAL; + + ret = regmap_read(regmap, reg_offset, &value); + if (ret) + return ret; + + return !!(value & mask); +} + +static int s32_gpio_dir_out(struct gpio_chip *chip, unsigned int gpio, + int val) +{ + struct s32_pinctrl *ipctl = to_s32_pinctrl(chip); + + s32_gpio_set_val(chip, gpio, val); + + return s32_pmx_gpio_set_direction(ipctl->pctl, NULL, gpio, false); +} + +static int s32_gpio_dir_in(struct gpio_chip *chip, unsigned int gpio) +{ + struct s32_pinctrl *ipctl = to_s32_pinctrl(chip); + + return s32_pmx_gpio_set_direction(ipctl->pctl, NULL, gpio, true); +} + +static int s32_gpio_gen_names(struct device *dev, unsigned int cnt, char **names, + char *ch_index, unsigned int *num_index) +{ + unsigned int i; + + for (i = 0; i < cnt; i++) { + if (i != 0 && !(*num_index % 16)) + (*ch_index)++; + + names[i] = devm_kasprintf(dev, GFP_KERNEL, "P%c_%02d", + *ch_index, 0xFU & (*num_index)++); + if (!names[i]) + return -ENOMEM; + } + + return 0; +} + +static int s32_gpio_remove_reserved_names(struct device *dev, + struct s32_pinctrl *ipctl, + char **names) +{ + struct device_node *np = dev->of_node; + u32 base_gpio, num_gpio, tmp; + int num_ranges, i, j, ret; + + /* Parse the gpio-reserved-ranges to know which GPIOs to exclude. */ + + num_ranges = of_property_count_u32_elems(dev->of_node, + "gpio-reserved-ranges"); + + /* The "gpio-reserved-ranges" is optional. */ + if (num_ranges < 0) + return 0; + num_ranges /= 2; + + for (i = 0; i < num_ranges; i++) { + ret = of_property_read_u32_index(np, "gpio-reserved-ranges", + i * 2, &base_gpio); + if (ret) + return dev_err_probe(dev, ret, + "Cannot parse start GPIO: %d\n", + ret); + + ret = of_property_read_u32_index(np, "gpio-reserved-ranges", + i * 2 + 1, &num_gpio); + if (ret) + return dev_err_probe(dev, ret, + "Cannot parse num. GPIOs: %d\n", + ret); + + if (check_add_overflow(base_gpio, num_gpio, &tmp) || + base_gpio + num_gpio > ipctl->gc.ngpio) + return dev_err_probe(dev, -EINVAL, + "Invalid reserved GPIOs\n"); + + /* Remove names set for reserved GPIOs. */ + for (j = base_gpio; j < base_gpio + num_gpio; j++) { + devm_kfree(dev, names[j]); + names[j] = NULL; + } + } + + return 0; +} + +static int s32_gpio_populate_names(struct device *dev, + struct s32_pinctrl *ipctl) +{ + struct nxp_siul2_mfd *mfd = dev_get_drvdata(ipctl->dev->parent); + unsigned int num_index = 0; + char ch_index = 'A'; + char **names; + int i, ret; + + names = devm_kcalloc(dev, ipctl->gc.ngpio, sizeof(*names), + GFP_KERNEL); + if (!names) + return -ENOMEM; + + for (i = 0; i < mfd->num_siul2; i++) { + if (mfd->siul2[i].gpio_base % 16 == 0) + num_index = 0; + + ret = s32_gpio_gen_names(dev, mfd->siul2[i].gpio_num, + names + mfd->siul2[i].gpio_base, + &ch_index, &num_index); + if (ret) + return dev_err_probe(dev, ret, + "Error setting SIUL2_%d names\n", + i); + + ch_index++; + } + + ret = s32_gpio_remove_reserved_names(dev, ipctl, names); + if (ret) + return ret; + + ipctl->gc.names = (const char *const *)names; + + return 0; +} + #ifdef CONFIG_PM_SLEEP static bool s32_pinctrl_should_save(struct s32_pinctrl *ipctl, unsigned int pin) @@ -896,12 +1149,14 @@ static int s32_pinctrl_probe_dt(struct platform_device *pdev, int s32_pinctrl_probe(struct platform_device *pdev, const struct s32_pinctrl_soc_data *soc_data) { + struct nxp_siul2_mfd *mfd = dev_get_drvdata(pdev->dev.parent); #ifdef CONFIG_PM_SLEEP struct s32_pinctrl_context *saved_context; #endif struct pinctrl_desc *s32_pinctrl_desc; struct s32_pinctrl_soc_info *info; struct s32_pinctrl *ipctl; + struct gpio_chip *gc; int ret; if (!soc_data || !soc_data->pins || !soc_data->npins) @@ -967,5 +1222,32 @@ int s32_pinctrl_probe(struct platform_device *pdev, dev_info(&pdev->dev, "Initialized s32 pinctrl driver\n"); + gc = &ipctl->gc; + gc->parent = &pdev->dev; + gc->label = dev_name(&pdev->dev); + gc->base = -1; + /* In some cases, there is a gap between the SIUL GPIOs. */ + gc->ngpio = mfd->siul2[mfd->num_siul2 - 1].gpio_base + + mfd->siul2[mfd->num_siul2 - 1].gpio_num; + ret = s32_gpio_populate_names(&pdev->dev, ipctl); + if (ret) + return ret; + + gc->set = s32_gpio_set; + gc->get = s32_gpio_get; + gc->set_config = gpiochip_generic_config; + gc->request = s32_gpio_request; + gc->free = s32_gpio_free; + gc->direction_output = s32_gpio_dir_out; + gc->direction_input = s32_gpio_dir_in; + gc->get_direction = s32_gpio_get_dir; + + ret = devm_gpiochip_add_data(&pdev->dev, gc, ipctl); + if (ret) + return dev_err_probe(&pdev->dev, ret, + "Unable to add gpiochip\n"); + + dev_info(&pdev->dev, "Initialized s32 GPIO functionality\n"); + return 0; } From patchwork Wed Nov 13 10:10:59 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 13873420 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 1C0D8D41C2E for ; Wed, 13 Nov 2024 10:28:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:MIME-Version: Content-Transfer-Encoding:Content-Type: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=LhuoVUdlxKCIAUVq6j+EX8ECSiAZSLCgHoHWNam5lQo=; b=wr7+22uPQRc02aQKPmlgYRWsQW Z7wLqlWetIJh7FEPqC20ksbGbDG8rSu97JGuObrbTkXBiCxDl7/L3+LAcpcInfCpXAmNOwqcomk4i CM16HGWdFtjkhpS2AMhqguvIfHEYDOG3Ub67iOFw6YrRP7w79L4bEwOCk1NFu3v87x2pUBFQoXnBt 5ws9f4GuXUFArqTNSgxdDmSXpx5DoxJmkifATmTe//9lzqRWvXAYlqw3gOqPWMlSp07EZxFDjaBw0 XGWnZpW7I9MlVaYbDV6WqT7Ki0qdrAe0O4C5Qt8KF6cZSqxS41hQuvqzFSObwmWJU1wj+TYxyBxb1 lfUks2zQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tBAbR-00000006RRx-30ek; Wed, 13 Nov 2024 10:28:01 +0000 Received: from mail-francecentralazlp170130007.outbound.protection.outlook.com ([2a01:111:f403:c20a::7] helo=PA4PR04CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tBAMk-00000006OdC-0cGi for linux-arm-kernel@lists.infradead.org; Wed, 13 Nov 2024 10:12:52 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=Devs/9wZtRbazkamS1f3iI5L1XeJQxx7P3uElr1n5kKUlyrG5k6LDc9e3QqPTYtaqpidubcgYtIrj1sDdgDlDKFXBONLBTonXyymMKBgsP/gqx+DeoNMWyKfpeCM8+5XdNJXcfFnDclArNiphQkhLdjUf9rgZK6BMbv8Siot8qhdqh460h/oFWjMdyumUM2R/waN58MPbDz3vk8Vv1F45gLUqqd6DggbStqW43QCKBenyyDUuTkQGDHbD/0a3NwL51yptSqHPGZFvetMSwUqJVJN6W5tzmJ022sbkMda86m8QsbjubA8dKzlgev9LA6Qu3+Tc4hL5y2hCq4w8HEmgQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=LhuoVUdlxKCIAUVq6j+EX8ECSiAZSLCgHoHWNam5lQo=; b=gNIBODEumuexhO0Q7JPfxpoosGKdSkvyOeq473Ucxh5rS/5TqrOHZn0PNlmB45DyfvmvSfS56X0nrpnbnj79rtS8lNIoasuvlSAcQw++BLeUaS+aJ9AAweWPo9/4U9JO7d6uvMNiA8ieWSpiYRH0N6Y2Z7qQKnJEXEkc7XNyn9nexoBY4L3jGtI5Lkfei7pzHBDcDSU8YobvMAzLFdAS9+qvHLYAVy8XJJ2zkV+mtNsdd7Yb2Hc5zKWHipLRbb0GBo73s8A+TeeWjX6aqeqWWLOksKiIoNIWYncjCj4xgGVspphC/IdW0KMVVnmW2JFIK+BBrB3OF8jABnVwgyYfSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oss.nxp.com; dmarc=pass action=none header.from=oss.nxp.com; dkim=pass header.d=oss.nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=NXP1.onmicrosoft.com; s=selector1-NXP1-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=LhuoVUdlxKCIAUVq6j+EX8ECSiAZSLCgHoHWNam5lQo=; b=ZvHQ81fdeGoMj2jgG1A/upAMAmnG1OrLgv/G1yn8/EJpzmY9Q/0gS8AUdkM07OO1PAs6VAqU+bWONIATZV3kOx8YP+Sg2LIVFzhus94benqicqv7rUNPSfrEmmGGe8kOrDHBwEELiVP2tTXKvTCB+3hmaK5BXKl1eBvVbjkYzmbicg7emy7IxSmNnvVgvWX3WyIDd1mltF8T91LsqBet7e6geLg49u2Bj/3VyImvPqKh2LBBQ4PzDRWFjkkr/Psx1kpz96zQeA+hdVBkK3sS75EJtK2oSXwDJamSlZ+uP6yROAZtlIDRsKkKa8U+ksyWpU2mjxhCM1ONvVm5RgRbwg== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=oss.nxp.com; Received: from AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) by DBBPR04MB7739.eurprd04.prod.outlook.com (2603:10a6:10:1eb::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.29; Wed, 13 Nov 2024 10:12:45 +0000 Received: from AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455]) by AM9PR04MB8487.eurprd04.prod.outlook.com ([fe80::6d7a:8d2:f020:455%4]) with mapi id 15.20.8158.013; Wed, 13 Nov 2024 10:12:45 +0000 From: Andrei Stefanescu To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Larisa Grigore , Greg Kroah-Hartman , "Rafael J. Wysocki" , Lee Jones , Shawn Guo , Sascha Hauer , Fabio Estevam , Dong Aisheng , Jacky Bai Cc: linux-gpio@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, NXP S32 Linux Team , Christophe Lizzi , Alberto Ruiz , Enric Balletbo , Pengutronix Kernel Team , imx@lists.linux.dev, Andrei Stefanescu Subject: [PATCH v6 7/7] MAINTAINERS: add MAINTAINER for NXP SIUL2 MFD driver Date: Wed, 13 Nov 2024 12:10:59 +0200 Message-ID: <20241113101124.1279648-8-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> References: <20241113101124.1279648-1-andrei.stefanescu@oss.nxp.com> X-ClientProxiedBy: AM8P251CA0005.EURP251.PROD.OUTLOOK.COM (2603:10a6:20b:21b::10) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8487:EE_|DBBPR04MB7739:EE_ X-MS-Office365-Filtering-Correlation-Id: 49d6c7aa-8b90-4792-2ef5-08dd03cbb7a5 X-MS-Exchange-SharedMailbox-RoutingAgent-Processed: True X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|52116014|7416014|376014|1800799024|366016|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?US6iQ33zop7xCFA1taDEuB79ifGGJ+Z?= =?utf-8?q?ZOm57YJhgDv4Iho8M+uugAP3a6dp/c1X2fo+qxCAHK/OwqIPTjbRe/2Ic3/onb0da?= =?utf-8?q?/OuA44If/5cgNkaxVFW9sFXEqDwMSCtdX5Rx1kjiLHZ80fQiWxy/YmXdvlxv4pu2G?= =?utf-8?q?5ilhV8SDUUpm+DhCfVr+X8yJ65bHBdXMIDicmeH1EsQoBR9cpqeqbD7Vw+Y4IMqr9?= =?utf-8?q?mYmbt7J96DZIkhyRB+y2GssvciuoHXNqgGmdan9bejSGj8Ju/rlfQI1/kJATqsr4n?= =?utf-8?q?E+mMcJFAFddNfJJTdJIRMq25Z1UxdBpNqdVR1oz1/+u7buwRPiUk2HsvVDiWzqbdf?= =?utf-8?q?ag3lm5iz73gxwMYr4vewbzP6DlPkmHGCbBIK8LvriJq5dFt0QG4reklKvE6BzzHS8?= =?utf-8?q?W55KbIBIEL0iKo2YkWTS5L/VEwWnRM78dIc+ldqXoemNjA8MxQgdSOVxXPqbpmFhW?= =?utf-8?q?Z6IlIrkTd7lfqvwGho7ntLB48RM4AhE4PC6Mbc7lrjobJAjwOoYiD7BCrd70hFc8+?= =?utf-8?q?ePnxmo16d/yTJajwBmM4x8QoQFwWyOeqL8C46isDep8hBvzqjQ/zmYui0UwTtRu6L?= =?utf-8?q?Cz0rPoQNgUHdvj04Z1C51uMoXd7d6ccKbUWuvAIUeL13HA3NN50OoA0Vj3CqzaBnu?= =?utf-8?q?C983eFSem2jxOvSVIDULBqR34cnL2vfSo/0pwBnr/qiUVqwecneSQg5fb35ijpM5N?= =?utf-8?q?P2EQP1qXN+/SlMGL2/8gf0Jb80ohdHi/DdyMZAx4AsZcJ3OihUihvO+IvXCsu/El5?= =?utf-8?q?axMLsRm4qRcCqOddeUIG1Q5DqhCo1E9eioUwii6kBuwKBiJYKP9OWpOE6SIj3MMHh?= =?utf-8?q?Cenu/vNcwf3SgIvWR2SnrnyPzDR92KRwWC8rz2aJzwvDlkPM3K5CbWhMpJtaq9AoT?= =?utf-8?q?06/8OtH0PVl1OIaCx81BbO65shKSo25Mw4FIneIs5vLYP9pwQKab8V3wT4eoA55LJ?= =?utf-8?q?7u0GC/CQ+RMLncPIVR4/8CR9wDnBONo/6QqdkPtggjcvgp0try6oRoNGkJavQYjlx?= =?utf-8?q?aqiKUvulMIRFXyMxf+jaa1YjBUS9Cf0GB5fBOYxxd3fJDajJCPXYRxexfVcpo0Y1S?= =?utf-8?q?Z7WPZpRXfOuyv40rw3txTk1jjxgxccmOA6Il4x4u6RKxSLZTwYgvbNgmr1DgONrrC?= =?utf-8?q?WfLFD2fmeNvWDne+QzPDVaOLV92x12wRnYkOir883p0K3zcAOKc5C0LSTiSQ3CfEW?= =?utf-8?q?1aWP/TSWQpaJYa7abBoYfOasyRSco0/wJWK8Hh2KpbcNj9hV/yTHMqiT1XPGuAaLL?= =?utf-8?q?Lf7Z0ToK21znJO9OjPLoU6Bj4LdJtdfSrCGDggPxFFDT7hNiCPMHgWKKpfwcABDpr?= =?utf-8?q?wtKgSuMa2Bz6?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:AM9PR04MB8487.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(52116014)(7416014)(376014)(1800799024)(366016)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?KGasHjMwyVPGacicSMcFdFTbBE1f?= =?utf-8?q?Q7n23ADU9UJPixnOTmxEop+rmerdR4RZWRrJXCTcVHboKoJWQcs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g2iZ3Z0zxi3C?= =?utf-8?q?pAPS4/LybOlHPQCJ9UMhIX5wJlZhmk7WZR+LfZcCsBwseYTJGJ6K0ecgybGXCSVJ6?= =?utf-8?q?fa195pl7rx5Z18nxQ4dCbo5lrRUEGsNupsNwhoQS9DLbhIna7MrqGe1G/IGDzNF/y?= =?utf-8?q?S5dnljdb6mC0WJaXLX9Q+rWSOIcIQZN94Xv3TPxW7PmEhwsIldzoW56YAHnMlOhgw?= =?utf-8?q?dZAoZLkJTZy8mdqs+etEu4mz9bnbuSM7ExvsDvC5wT3mBarz6dB1qHDReeXfopHaa?= =?utf-8?q?anw+DE8fj+JevcFr79voKOW6juEO/10x8lIHuimGGjm0XpuOclcTnTflHAOz0sQQ3?= =?utf-8?q?OcvrKx0GdKP3HE3srmXnif8ClUqfn9HZrIJKMg3js0+w+LW/iew3eIIm6XaYlIPCB?= =?utf-8?q?qPjn/pUXrW4XJuc95Tf5TV9CEN8OI4pvlgIeAKIu/i8BW4U2HNyWeYdjirKg2lJ1a?= =?utf-8?q?S1DXY5p7e5mCrK22w6NKDdALNGqWLzZ4iemJNdthJ40Uxw04vq0WJb2wkxsYlDVGA?= =?utf-8?q?V/yiRKN8TMDMctPwAvbGHOsfAKcUa2VuizSm6STXxddjQsZBV6l4I5EWEjtt7eXOQ?= =?utf-8?q?DvHQ7QsYbmQwsJ+ZmjTgpZIMHhIztP4xJQ=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 49d6c7aa-8b90-4792-2ef5-08dd03cbb7a5 X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Nov 2024 10:12:45.3041 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 686ea1d3-bc2b-4c6f-a92c-d99c5c301635 X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: kqIJUzeX81GRNy61KL29ZHPyGdnoXIYpAQV6eOcoBvc0syd9AWfnlJnMidaoum7PbdZuGgLyxKmfY1H9eW3lZbyLX7gylMTZYW819UPkPGE= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR04MB7739 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20241113_021250_295658_81634014 X-CRM114-Status: GOOD ( 12.93 ) 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 Add the new MFD driver for the SIUL2 module under the NXP S32G existing entry. This MFD driver currently has one cell for a combined pinctrl&GPIO driver and will, in the future, contain another cell for an NVMEM driver. Signed-off-by: Andrei Stefanescu --- MAINTAINERS | 2 ++ 1 file changed, 2 insertions(+) diff --git a/MAINTAINERS b/MAINTAINERS index bdae0faf000c..cfbaceea5f40 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -2787,7 +2787,9 @@ R: Ghennadi Procopciuc L: NXP S32 Linux Team L: linux-arm-kernel@lists.infradead.org (moderated for non-subscribers) S: Maintained +F: Documentation/devicetree/bindings/mfd/nxp,siul2.yaml F: arch/arm64/boot/dts/freescale/s32g*.dts* +F: drivers/mfd/nxp-siul2.c F: drivers/pinctrl/nxp/ ARM/Orion SoC/Technologic Systems TS-78xx platform support