[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20220915035440.2862532-1-quan@os.amperecomputing.com>
Date: Thu, 15 Sep 2022 10:54:40 +0700
From: Quan Nguyen <quan@...amperecomputing.com>
To: Wolfram Sang <wsa@...nel.org>, linux-i2c@...r.kernel.org,
linux-kernel@...r.kernel.org,
Open Source Submission <patches@...erecomputing.com>
Cc: quan@...amperecomputing.com,
Phong Vo <phong@...amperecomputing.com>,
Thang Nguyen <thang@...amperecomputing.com>
Subject: [PATCH] docs: i2c: slave-interface: return errno when handle I2C_SLAVE_WRITE_REQUESTED
In case backend is not ready, ie: fail to wakeup or initialization, on
the returning of the I2C_SLAVE_WRITE_REQUESTED event, bus driver should
aware the backend status and might auto sending NACK on the next
incoming bytes for I2C master to retry.
Signed-off-by: Quan Nguyen <quan@...amperecomputing.com>
Links:https://lore.kernel.org/linux-arm-kernel/556fa9e1-c54b-8370-4de7-c2d3ec7d6906@os.amperecomputing.com/
---
Documentation/i2c/slave-interface.rst | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/Documentation/i2c/slave-interface.rst b/Documentation/i2c/slave-interface.rst
index 82ea3e1d6fe4..03b15b21d392 100644
--- a/Documentation/i2c/slave-interface.rst
+++ b/Documentation/i2c/slave-interface.rst
@@ -72,12 +72,15 @@ Event types:
'val': unused
- 'ret': always 0
+ 'ret': 0 if backend ready, otherwise, returns some errno
Another I2C master wants to write data to us. This event should be sent once
our own address and the write bit was detected. The data did not arrive yet, so
-there is nothing to process or return. Wakeup or initialization probably needs
-to be done, though.
+there is nothing to process or return. After returning, the bus driver should
+always ack on this address phase. If 'ret' is zero, backend initialization or
+wakeup is done and ready. If 'ret' is an errno, bus driver should aware the
+backend status and might need to nack all next incoming bytes for I2C master to
+retry.
* I2C_SLAVE_READ_REQUESTED (mandatory)
--
2.35.1
Powered by blists - more mailing lists