From patchwork Mon Aug 26 08:42:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrei Stefanescu X-Patchwork-Id: 822804 Received: from AS8PR04CU009.outbound.protection.outlook.com (mail-westeuropeazon11011030.outbound.protection.outlook.com [52.101.70.30]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5548712BF25; Mon, 26 Aug 2024 08:42:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.70.30 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724661772; cv=fail; b=K08VEL1K5ioFPI0kU0eAUibPF4dgNdRTGqfgg9q0quuYuGjHZyMnDRkXfs8znq5SS+yqZBcLaxqGGcePWJgQEAcKTvrQuoUgUOzgsSsG6xKK32WBLAWiurvHl6WoIqL79l/LqG3p8bFrtz5SoCivxY35Z+CYxpXrJqGjEO2DiAg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1724661772; c=relaxed/simple; bh=I4IZ3daj30N8nx/B8gcerfNpA45fsIhyv5GmK6hx5aw=; h=From:To:Cc:Subject:Date:Message-ID:Content-Type:MIME-Version; b=FW1A0S3tcPIgBwKFN/c5soCeJ146zF/0hWhA3/L+PzthhsIYVglkEH52tZ2gKT1l5ACZRxBhtH8LhYZViznsogdlyiiui0z6T24Q5IU9ichUUw1hXe0oCCC4ZksPf09RObpI1LLX4qz2p+/vFfIdahzistEb9FaT2RVsVgKtFL4= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com; spf=pass smtp.mailfrom=oss.nxp.com; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b=JkgEwlWy; arc=fail smtp.client-ip=52.101.70.30 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.nxp.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=NXP1.onmicrosoft.com header.i=@NXP1.onmicrosoft.com header.b="JkgEwlWy" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TSUfhnvfdff9PgTBxOMstBJDmnKEF+Jw25gqHb9djdVTIAUFReuHDPrOQbU1nJiBlfQs9+cEOHjcxFeJ0SZf3OoYGqHipNsQ6tmgbJqe8c8zf76w4T6nlFpQ3BtQ+zEf1NPzOmZ70ykiqWSffDE55fMxg/9uebIvLtjH/jgSvvkaj6+uuxD8njR3lIAatoVGBamCDeB9uPTFk7RtEtO1Ue5mK4DOKEA0o4YbspfYzlbIcn/H9/sbMFhZnXZQzzuo/MbZNoPLpDpZoQ69DDt8WR6TggR4/B6Yx2pzZmk45VRZkV/+8HdHZBNl4vfaGGOZ3MsRqjdAowQga6tRqXXDUA== 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=CQ3Bt4/iEL4ldqZfk8r/bd6bT7li8msHDl9YSogD92o=; b=rxBGnJZP8h2fP5bwLm0LrYPFkH/HElTjDLoUAPyZ5tkGDvmApcXc2x0kxLbEej7mNfs+WoBcl0AEIU5pL/3Y3DA5VMW+N1cgWsbkBKlQRlncKK77gwugJATH7UDRVNUNUqU6T+thLWbVIQ+rZSgP05+VR8gMJKrnCJwpJevZZlEqcYEWHkQa9gOf8w0NCohp5IlXGQV3Qv4l65/o8SQB0nFeXaWHwCmWF+66X1QwPtgf1Qp3gOPR9+IVlZJjqgbVmksrZGRl4j2qjMC2NJAMrU2ay18vdZie7DJLqRPm880GzvvJ+oCb93Q6LPwo/BOGu4aYoikfO/mnkgFkGTG2/Q== 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=CQ3Bt4/iEL4ldqZfk8r/bd6bT7li8msHDl9YSogD92o=; b=JkgEwlWy7LXwQ0vQ/28TR+63GRknWgbx/aJ6yw88Mt5MKEsDOU95U2rz1dBavqsAYRver4SDGh6FLaO7ASpWzwAi7UVsIUa6apqXi20zdW/FnRXKoWdaRuQjiNEQ27f0fjGPW4WTthgoUwVHyZr/YaF4u7F4SLTPWFoEkU8KSaWB55pq7cSucDNy/pC8EY/r+hLXFswa3wADW6Tmm5O9j/PfJtRQA0PY8KZqa0efDjnY2UESlQEZ+dmSEsyPqDSDXU2MyK6YLCHFJETYXJAqWLo/iww8wDjeHlkBrbjsQmgWrb6ld72+tCoB0LsdOdtwlvQYPB5kT+aia59CkFMBNg== 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 PAXPR04MB9680.eurprd04.prod.outlook.com (2603:10a6:102:23e::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7897.23; Mon, 26 Aug 2024 08:42:47 +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.7897.021; Mon, 26 Aug 2024 08:42:47 +0000 From: Andrei Stefanescu To: Linus Walleij , Bartosz Golaszewski , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Chester Lin , Matthias Brugger , Ghennadi Procopciuc , Larisa Grigore 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 , Andrei Stefanescu Subject: [PATCH 0/3] gpio: siul2-s32g2: add initial GPIO driver Date: Mon, 26 Aug 2024 11:42:07 +0300 Message-ID: <20240826084214.2368673-1-andrei.stefanescu@oss.nxp.com> X-Mailer: git-send-email 2.45.2 X-ClientProxiedBy: AS4P191CA0043.EURP191.PROD.OUTLOOK.COM (2603:10a6:20b:657::10) To AM9PR04MB8487.eurprd04.prod.outlook.com (2603:10a6:20b:41a::6) Precedence: bulk X-Mailing-List: linux-gpio@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-MS-Exchange-MessageSentRepresentingType: 1 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM9PR04MB8487:EE_|PAXPR04MB9680:EE_ X-MS-Office365-Filtering-Correlation-Id: 1b16ca59-cb4b-43c2-14e0-08dcc5ab0f3b 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|7416014|376014|52116014|1800799024|366016|38350700014; X-Microsoft-Antispam-Message-Info: =?utf-8?q?FFO8+tNoSdf4bqEmaDC5xh1v7//z5DB?= =?utf-8?q?/7w/tAPsqrazKNYMy0C0MxYm18IZwlI5iXBEzYUxAH37DUIz+fZ9ET5Xl12ls5rHV?= =?utf-8?q?t6R2oYTiiLlVPjyczRTz2y8iy3CMQznz30tkvBn7jJKFo1uBA+ABr2/drXKyXzXLW?= =?utf-8?q?WWCxer09Pkq9fX0BAs/OnQ34Gwqbw1mdo4rvPJIMkYFPS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63oLe2En5J1tH32vnJjHVBcIbVv2VeJTVI?= =?utf-8?q?JYb8EIL/RxZcqdVpNv1HoSX4nyR85Luc2zbw4/++UEm5yBZv8/YJWKaIVcL9is1RU?= =?utf-8?q?jc7FjJ0tEnf9fxbeamZegESQyd+2OF6bhYXRG8MTifLjfZHS5Yu2CSb0DLjYLd0Xn?= =?utf-8?q?ICsfx6RdkhajA+5BWmuw4uFLODFbIZBn5EE/AjU+WL8p7rSj10Gp3BjuFkvkB9zSA?= =?utf-8?q?D+Hg+k8XwDI2hRZUiXPd16bOXIA9/Exmh99oCInV/P6v6I0Yh23sdpSfvwqMgfZXS?= =?utf-8?q?OL12uEYXwmSzIMYoceDeIw1xPol8n/y9LQ=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)(7416014)(376014)(52116014)(1800799024)(366016)(38350700014); DIR:OUT; SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?q?Wq6t3/vehcG2IGogQ+KqTnRHVanb?= =?utf-8?q?KKT5txQNbpOQy+IkCWAQwNUb1wfesb/nR5h8qeOj7wYAF/PqyFXESDxPGHInZOuxZ?= =?utf-8?q?SxfS3nVnS689IqQ9ktYqGtLrn28FqT83sF+3ttNx2AsRVEFd2JlTkYAkTPTCb617k?= =?utf-8?q?91ZpxdzcOQkDd1UOuQqctL/qZwXOPiSia8C4njt5RTTeaSYb1eLvWQjDvHpsJPfP3?= =?utf-8?q?lEQ+VOjUlWv+meoE9JVoTl/1/8LL7Qyo5UrzSAnq2lQO2ocgPFzcmAUBJ1MGjZPbZ?= =?utf-8?q?Wafdplb+Q7Nwgkj7oUek+B6D2M4lqOvM/NBOT3nmg0GnJFBmUb8wLudx5Yzqx/O2u?= =?utf-8?q?yPdmD5NA5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cgkRzerMRrsdwHCKa5fj1WFAFfZcjwhbGguX8+Ic0kFx2YYxzIk2XpoHj?= =?utf-8?q?mPzIWMq68wAS70/WzviYChZPNVKthBQxdcXzKwm32OALsYQl6CHa1MZM5N9FQl2Xy?= =?utf-8?q?uH7GVMvYYIYaBxJ+2jDU0zx/GzNeaguMYisOQEcp9rlZ60Bzi0aShGehGb9AETIz4?= =?utf-8?q?wpaxxxkW26wJRv4Ko1ut+SDvwfEfr1LuxufCEg2AeduqWi5FN+GgohkNyyZdBeyML?= =?utf-8?q?t7eHQjHuRcnL4HFTClPBulXGk41vOuqYOiBlUUWo/lix8JrulL4xfDJhfAwD+TGAr?= =?utf-8?q?dWmzlIay6xcsRuPVka87KzgQWo8xdQlPug=3D=3D?= X-OriginatorOrg: oss.nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1b16ca59-cb4b-43c2-14e0-08dcc5ab0f3b X-MS-Exchange-CrossTenant-AuthSource: AM9PR04MB8487.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Aug 2024 08:42:46.9873 (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: LvuXwo3wIysLr+1i7wpWTVNRK8S01xrdfEhlLnPCFPXMGcoF+faTlrlE73rKqMzJThUKRs7Yiffb/nFU7SwozeLedpi+rD5+cCfFVb+84pI= X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAXPR04MB9680 This patch series adds support for basic GPIO operations(set, get, direction_output/input, set_config). There are two SIUL2 hardware modules: SIUL2_0 and SIUL2_1. However, this driver exports both as a single GPIO driver. This is because the interrupt registers are located only in SIUL2_1, even for GPIOs that are part of SIUL2_0. There are two gaps in the GPIO ranges: - 102-111(inclusive) are invalid - 123-143(inclusive) are invalid These will be excluded via the `gpio-reserved-ranges` property. Writing and reading GPIO values is done via the PGPDO/PGPDI registers(Parallel GPIO Pad Data Output/Input) which are 16 bit registers, each bit corresponding to a GPIO. Note that the PGPDO order is similar to a big-endian grouping of two registers: PGPDO1, PGPDO0, PGPDO3, PGPDO2, PGPDO5, PGPDO4, gap, PGPDO6. I have other patches for this driver: - interrupt support - power management callbacks which I plan to upstream after this series gets merged in order to simplify the review process. Andrei Stefanescu (3): dt-bindings: gpio: add schema for NXP S32G2/S32G3 SoCs drivers: gpio: siul2-s32g2: add NXP S32G2/S32G3 SoCs support MAINTAINERS: add MAINTAINER for S32G2 SIUL2 GPIO driver .../bindings/gpio/nxp,gpio-siul2-s32g2.yaml | 134 ++++ MAINTAINERS | 2 + drivers/gpio/Kconfig | 8 + drivers/gpio/Makefile | 1 + drivers/gpio/gpio-siul2-s32g2.c | 607 ++++++++++++++++++ 5 files changed, 752 insertions(+) create mode 100644 Documentation/devicetree/bindings/gpio/nxp,gpio-siul2-s32g2.yaml create mode 100644 drivers/gpio/gpio-siul2-s32g2.c