From mboxrd@z Thu Jan 1 00:00:00 1970 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 BE356EEA852 for ; Thu, 12 Feb 2026 21:38: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-Type: Content-Transfer-Encoding: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=WebKrxRlyhQT8ggoK9Qy7iVHQbwQ7XNNHQo1FQKijFo=; b=Ugs5Gc4vST1IvI5PbSq8Ni6iOu M2vCKmJY7jG/wzuW9oQbPOarwW6BZMBzaDAYHhfnI/bk46YKOsdztx3F/JGUoruOCZ/NAO3CLTCD6 1Sj/MSfQmOiI3pn5hWR6MeR4a8SebWZuS0z8ypJ3y+rPhGpDK9dTxA4SaXPmoEl5bChE1NZbnlcER 090FxHkfy58e8u5+vq5EiW/GR9AXhfKuXq0pdpCOHWgshMfDDjd02rOdg145debVVEij18bIAKFPS ebtSjyF0bwUOfNV/z2QFEIpkojaYunJB6mQEsH2wIhQz/2GccUlUAWDtSlADaFifPIfwwubU3HP2x yD8wd/Ug==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98.2 #2 (Red Hat Linux)) id 1vqeNq-00000002edd-0vjt; Thu, 12 Feb 2026 21:37:58 +0000 Received: from mail-francecentralazon11013038.outbound.protection.outlook.com ([40.107.162.38] helo=PA4PR04CU001.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.98.2 #2 (Red Hat Linux)) id 1vqeNn-00000002ec9-03nc for linux-arm-kernel@lists.infradead.org; Thu, 12 Feb 2026 21:37:56 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mujHw5puhkoJpoBUE0rIgSCPBa9VKkCaXHrbxkHAO6ONvUCLMLOvK27JX34jW+K8w+yhUTBHGectfEG4JijfKOTm6h2FwC2i3A0BrnZ/ceMNosmUVJfkCUUTWKOCxoGW27pDc4lpYTAn/EqxvkYjasx2MIR/ePgq03CiBHg9HipIWis71lSqp4+bI2RQSneU+XF8XRp6hMCajY4lZc/emYZr/h16/VwOO4ubw01MSPMv8bUGc3KaxnuVrB5pMAdkdf2y3VsNabnh99hLcCnom3DqfmqZY8OJi32We2aDWpKmtvNU3UysspFtk1hb474XqmaFdvHMpL9loNNWu6/A1g== 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=WebKrxRlyhQT8ggoK9Qy7iVHQbwQ7XNNHQo1FQKijFo=; b=bMtab+/7leM5yye7IFI21f0an81BqHeGPMyrq7FyxwMM/uvicly8sBsCf8iH6RDApJo7eSEJ7CTMuwG0UHS/pDtfk26NVA8nXJAL/r7wy55EPM7Y9fqTE9sOJMI5V1/5Tz74ftyUGFQC9oQI+o5ux3YPXMazpSTsVhs8BdC3zwkez/Bq1pkKKEVZwZeXZarUMcx39F0xRpDM+Eam1HXE/95U0i7m2oWUYMOcUuaIwGlmKI2tivW+M9FYpLbOQAvdQGyQjaaZZXiEgMKykKiwBcmjmrbwMGY1ch/OoJNgADs9pITkShvwdBAR2069p1TX81jUJOgpLnXRoOXkltBhfQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nxp.com; dmarc=pass action=none header.from=nxp.com; dkim=pass header.d=nxp.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nxp.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=WebKrxRlyhQT8ggoK9Qy7iVHQbwQ7XNNHQo1FQKijFo=; b=B+2kif12fv3/l+UIE4lY0wXpITaE1YCRBUIB740M+SXEH+Ii4HlSjqu3WFN7vRWnjPDVk+gBoOejFX7jo3Z4xcXILJgWGuyJUX+xphKgU4SFbqMMORiDx+qzUn1uAqu8StZLaiMLHr6TC7ujmkSPi4gRXCXnOwzis//0rrY0CdjxgD2tPIa9u52rzMMHUoADAfIGJ2bflwz7/LLKWYK6IiC/RhyCCBMjir2wLSBJX2xrv7SSCouX3+TEv03gl34Iny3hV1c6K7FFKPi17nLIZIoMZGwMCY/V9PjMqWU28dEmPyGk/LAnKiyjMNl6SDXQvwG2VjVGGA1aKqutC688CQ== Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=nxp.com; Received: from PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) by PA4PR04MB7936.eurprd04.prod.outlook.com (2603:10a6:102:c6::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.9611.10; Thu, 12 Feb 2026 21:37:52 +0000 Received: from PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::b4c0:6119:2228:2ceb]) by PAXPR04MB9185.eurprd04.prod.outlook.com ([fe80::b4c0:6119:2228:2ceb%4]) with mapi id 15.20.9611.008; Thu, 12 Feb 2026 21:37:52 +0000 From: Shenwei Wang To: Linus Walleij , Bartosz Golaszewski , Jonathan Corbet , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Bjorn Andersson , Mathieu Poirier , Frank Li , Sascha Hauer Cc: Shuah Khan , linux-gpio@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Pengutronix Kernel Team , Fabio Estevam , Shenwei Wang , Peng Fan , devicetree@vger.kernel.org, linux-remoteproc@vger.kernel.org, imx@lists.linux.dev, linux-arm-kernel@lists.infradead.org, linux-imx@nxp.com, arnaud.pouliquen@foss.st.com Subject: [PATCH v8 1/4] docs: driver-api: gpio: rpmsg gpio driver over rpmsg bus Date: Thu, 12 Feb 2026 15:36:53 -0600 Message-ID: <20260212213656.662437-2-shenwei.wang@nxp.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20260212213656.662437-1-shenwei.wang@nxp.com> References: <20260212213656.662437-1-shenwei.wang@nxp.com> Content-Transfer-Encoding: 8bit Content-Type: text/plain X-ClientProxiedBy: PH7PR17CA0032.namprd17.prod.outlook.com (2603:10b6:510:323::22) To PAXPR04MB9185.eurprd04.prod.outlook.com (2603:10a6:102:231::11) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: PAXPR04MB9185:EE_|PA4PR04MB7936:EE_ X-MS-Office365-Filtering-Correlation-Id: 929dbb04-eb61-48b7-01df-08de6a7ef99a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|19092799006|366016|7416014|52116014|376014|1800799024|921020|38350700014; X-Microsoft-Antispam-Message-Info: =?us-ascii?Q?YMu7+0t73VkmJuPhcMej6BS2IqTbeqH8chb3NOBHXsb01q31d2MttSjRi8wG?= =?us-ascii?Q?9Or6ieIEzmUGUGG2s3T82O3tzRjYSunDpL69oGEe1GoiWZyJpVvrp7FbuMy0?= =?us-ascii?Q?9EzNLrQbZjz1lCPcsnMQlxMv3TlzCIkVZWkgpSNLvvcHViJ2sXYrRBuWGuKU?= =?us-ascii?Q?LLFFs+DqtGIs8GB6BvXTmFIcW7KoNTkl+0iIU2xt7zBMW3w6bqAkhSUk2J58?= =?us-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9UkNP4KHrHYVbix?= =?us-ascii?Q?sL4okSaF3k1cArBstJinpKRtItS0Rkvqi307eIfI6w5m5/oKKenWGhdtyAbf?= =?us-ascii?Q?pSPImPmKDvhwDl71c0hETrc8V9UwLGGuUMPqE1NbAuenjc19x5NlX7qoGPtm?= =?us-ascii?Q?uzP6q5hhRKQCrhbyWpCjLmOuqbpwVW4Gcv7Q7Yqr4AaoHoBwdHv+taBxF3kE?= =?us-ascii?Q?oVUMqBpad81eHeT43VyD2lxQ1NbrZHfEaRU/TMfpIrIK+1A31gp8JOg1C1pW?= =?us-ascii?Q?M3wIEeYXCrvzwU8Hcc0iHhtETE+vyxWZN+kDTeZlsFDMoWBkFymEl6Znov2z?= =?us-ascii?Q?585S3tptu/mRbQiatsTrIa0KJ2NE+oWhfWtPDoHQFDll8K5T5PcUzbfdKQ1P?= =?us-ascii?Q?9zJsiNUVcA4KuLyYR4ybSm4liY5QYuFFPMCWjzX9aCjKNjeRXRp/Usf738Eg?= =?us-ascii?Q?uC6YQcWFqjMoSBV0ZCAhevgF3ndK2OoTdCWBT4LEYcfcXkAn9g94MwR2QEJe?= =?us-ascii?Q?dICi70ZRNQ31NjvvDSuziugoJa+x7kWSqXUp9jTIUXXH?= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:PAXPR04MB9185.eurprd04.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230040)(19092799006)(366016)(7416014)(52116014)(376014)(1800799024)(921020)(38350700014);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?us-ascii?Q?WC+gqONV/qMq+rEa58yWhSuYsSzBbFsxCOHiE4/r0xcjoWmPWeUuBzZCYMWU?= =?us-ascii?Q?e1t4sjcCtp7Fw/iVqH4qbgHHfhDcI3KjkLecrDlOXpjzlQEsiW8y2DIP66dS?= =?us-ascii?Q?JGHUJGcoZ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3AYtmJ2sl?= =?us-ascii?Q?A/p9Mx3ZPnOcyLIhDCmQOmFYxLUfQjAYPmUbFUBNccPd/GdHvYCgIJytumX7?= =?us-ascii?Q?4yGXpn1JPK3PzSRuTylVMq1fXzSJqkyBK7+Q88FC0bamxNMqbFH4Lx+L7Y4u?= =?us-ascii?Q?op0+7pBko8285ewA22wLp2JFC13WEDVQpq5dofRIYzSukX7/78eCH351GbIC?= =?us-ascii?Q?GcnIZbph0vr7Oln9fItT1o/KNbDe/e2IgZnzdfW9XN3CXnUU6EZA/nLnHxHq?= =?us-ascii?Q?9lNy81yqzSTjZW/nyzX/XPIbf/DVv791Kl6RYSy1oWXxax8+jfEWLdkoJrwq?= =?us-ascii?Q?clJx2u1FxjkaQbSE5RG1uzzrP+0g3efG+QCpHhy8MIzR0y6izbCUE9CvHGc+?= =?us-ascii?Q?4g0x/pWn9kPvc3PnhIJpxsS3rdxuIxevtdrJwywJ1DhaP6VEvDEi6rQEqPGz?= =?us-ascii?Q?8T//07V3qmwfvLZZhgLLNB99C5tyYGEzImSS/25kZAHZnr+2ngXaneiWdyOK?= =?us-ascii?Q?i+yChqT2vcoeNJ9RL/Ov/iUQmZN2qyYwdgkGAKVw/2OnDSFADgpxFToMDGG8?= =?us-ascii?Q?QRAlvXWeJuzAY7p/NBcQN8GYqj8kDZQdequXloxEBwrTGN7+M2v/LUln1+w3?= =?us-ascii?Q?iyDaD6rEoSV/OXMaB+SFIjYFHcGZx1CFxLjtX7rovzds7Ae6RSKNdTz90WT0?= =?us-ascii?Q?RwooP1MElrj3XUDx/EcoGCEm3Pzg5yxGVWWlSACTkal1BLIqstgWU6uUA3xB?= =?us-ascii?Q?Z2+f4vSuog=3D=3D?= X-OriginatorOrg: nxp.com X-MS-Exchange-CrossTenant-Network-Message-Id: 929dbb04-eb61-48b7-01df-08de6a7ef99a X-MS-Exchange-CrossTenant-AuthSource: PAXPR04MB9185.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Feb 2026 21:37:52.2146 (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: YNOrJAJJh+KFrAIpBfLyIxqPSeUwnPG7hrBTwXKKxPVPyu7UTzgxjkbHpuE/ADg84f0A7PQGbGXB3eoeBXEfVA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR04MB7936 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20260212_133755_058692_BE59D1CC X-CRM114-Status: GOOD ( 24.11 ) 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 Describes the gpio rpmsg transport protocol over the rpmsg bus between the remote system and Linux. Signed-off-by: Shenwei Wang --- Documentation/driver-api/gpio/gpio-rpmsg.rst | 236 +++++++++++++++++++ Documentation/driver-api/gpio/index.rst | 1 + 2 files changed, 237 insertions(+) create mode 100644 Documentation/driver-api/gpio/gpio-rpmsg.rst diff --git a/Documentation/driver-api/gpio/gpio-rpmsg.rst b/Documentation/driver-api/gpio/gpio-rpmsg.rst new file mode 100644 index 000000000000..59eb0d49002a --- /dev/null +++ b/Documentation/driver-api/gpio/gpio-rpmsg.rst @@ -0,0 +1,236 @@ +.. SPDX-License-Identifier: GPL-2.0-or-later + +GPIO RPMSG Protocol +=================== + +The GPIO RPMSG transport protocol is used for communication and interaction +with GPIO controllers located on remote cores on the RPMSG bus. + +Message Format +-------------- + +The RPMSG message consists of a 14-byte packet with the following layout: + +.. code-block:: none + + +-----+-------+--------+-----+-----+------------+-----+-----+-----+----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D| + | ID |vendor |version |type |cmd |reserved[5] |line |port | data | + +-----+-------+--------+-----+-----+------------+-----+-----+-----+----+ + +- **ID (Message Identification Code)**: Must be 0x5. Indicates the GPIO message. + +- **Vendor**: Vendor ID number. + - 0: Reserved + - 1: NXP + +- **Version**: Vendor-specific version number (such as software release). + +- **Type (Message Type)**: The message type can be one of: + + - 0: GPIO_RPMSG_SETUP + - 1: GPIO_RPMSG_REPLY + - 2: GPIO_RPMSG_NOTIFY + +- **Cmd**: Command code, used for GPIO_RPMSG_SETUP messages. + +- **reserved[5]**: Reserved bytes. Should always be 0. + +- **line**: The GPIO line(pin) index of the port. + +- **port**: The GPIO port(bank) index. + +- **data**: See details in the command description below. + +GPIO Commands +------------- + +Commands are specified in the **Cmd** field for **GPIO_RPMSG_SETUP** (Type=0) messages. + +The SETUP message is always sent from Linux to the remote firmware. Each +SETUP corresponds to a single REPLY message. The GPIO driver should +serialize messages and determine whether a REPLY message is required. If a +REPLY message is expected but not received within the specified timeout +period (currently 1 second in the Linux driver), the driver should return +-ETIMEOUT. + +GPIO_RPMSG_INPUT_INIT (Cmd=0) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Request:** + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D| + | 5 | 1 | 0 | 0 | 0 | 0 |line |port | val | wk | + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + +- **val**: Interrupt trigger type. + + - 0: Interrupt disabled + - 1: Rising edge trigger + - 2: Falling edge trigger + - 3: Both edge trigger + - 4: Low level trigger + - 5: High level trigger + +- **wk**: Wakeup enable. + + The remote system should always aim to stay in a power-efficient state by + shutting down or clock-gating the GPIO blocks that aren't in use. Since + the remoteproc driver is responsible for managing the power states of the + remote firmware, the GPIO driver does not require to know the firmware's + running states. + + When the wakeup bit is set, the remote firmware should configure the line + as a wakeup source. The firmware should send the notification message to + Linux after it is woken from the GPIO line. + + - 0: Disable wakeup from GPIO + - 1: Enable wakeup from GPIO + +**Reply:** + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D| + | 5 | 1 | 0 | 1 | 1 | 0 |line |port | err | 0 | + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + +- **err**: Error code from the remote core. + + - 0: Success + - 1: General error (Early remote software only returns this unclassified error) + - 2: Not supported (A command is not supported by the remote firmware) + - 3: Resource not available (The resource is not allocated to Linux) + - 4: Resource busy (The resource is already in use) + - 5: Parameter error + +GPIO_RPMSG_OUTPUT_INIT (Cmd=1) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Request:** + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D| + | 5 | 1 | 0 | 0 | 1 | 0 |line |port | val | 0 | + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + +- **val**: Output level. + + - 0: Low + - 1: High + +**Reply:** + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D| + | 5 | 1 | 0 | 1 | 1 | 0 |line |port | err | 0 | + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + +- **err**: See above for definitions. + +GPIO_RPMSG_INPUT_GET (Cmd=2) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Request:** + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D| + | 5 | 1 | 0 | 0 | 2 | 0 |line |port | 0 | 0 | + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + +**Reply:** + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+-----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D | + | 5 | 1 | 0 | 1 | 2 | 0 |line |port | err |level| + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+-----+ + +- **err**: See above for definitions. + +- **level**: Input level. + + - 0: Low + - 1: High + +GPIO_RPMSG_GET_DIRECTION (Cmd=3) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +**Request:** + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D| + | 5 | 1 | 0 | 0 | 3 | 0 |line |port | 0 | 0 | + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + +**Reply:** + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+-----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D | + | 5 | 1 | 0 | 1 | 3 | 0 |line |port | err | dir | + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+-----+ + +- **err**: See above for definitions. + +- **dir**: Direction. + + - 0: Output + - 1: Input + +GPIO_RPMSG_NOTIFY_REPLY (Cmd=4) +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +The reply message for the notification is optional. The remote firmware can +implement it to simulate the interrupt acknowledgment behavior. + +**Request:** + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D| + | 5 | 1 | 0 | 0 | 4 | 0 |line |port |level| 0 | + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + +- **line**: The GPIO line(pin) index of the port. +- **port**: The GPIO port(bank) index. + +Notification Message +-------------------- + +Notifications are sent with **Type=2 (GPIO_RPMSG_NOTIFY)**: + +When a GPIO line asserts an interrupt on the remote processor, the firmware +should immediately mask the corresponding interrupt source and send a +notification message to the Linux. Upon completion of the interrupt +handling on the Linux side, the driver should issue a +**GPIO_RPMSG_INPUT_INIT** command to the firmware to unmask the interrupt. + +A Notification message can arrive between a SETUP and its REPLY message, +and the driver is expected to handle this scenario. + +.. code-block:: none + + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + |0x00 |0x01 |0x02 |0x03 |0x04 |0x05..0x09 |0x0A |0x0B |0x0C |0x0D| + | 5 | 1 | 0 | 2 | 0 | 0 |line |port |type | 0 | + +-----+-----+-----+-----+-----+-----------+-----+-----+-----+----+ + +- **line**: The GPIO line(pin) index of the port. +- **port**: The GPIO port(bank) index. +- **type**: Optional parameter to indicate the trigger event type. + diff --git a/Documentation/driver-api/gpio/index.rst b/Documentation/driver-api/gpio/index.rst index bee58f709b9a..e5eb1f82f01f 100644 --- a/Documentation/driver-api/gpio/index.rst +++ b/Documentation/driver-api/gpio/index.rst @@ -16,6 +16,7 @@ Contents: drivers-on-gpio bt8xxgpio pca953x + gpio-rpmsg Core ==== -- 2.43.0