Skip to content

Commit 09a7bab

Browse files
qnguyen-amperewsakernel
authored andcommitted
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@os.amperecomputing.com> Links:https://lore.kernel.org/linux-arm-kernel/556fa9e1-c54b-8370-4de7-c2d3ec7d6906@os.amperecomputing.com/ [wsa: made some wording more precise] Signed-off-by: Wolfram Sang <wsa@kernel.org>
1 parent be18c5e commit 09a7bab

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

Documentation/i2c/slave-interface.rst

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,15 @@ Event types:
7272

7373
'val': unused
7474

75-
'ret': always 0
75+
'ret': 0 if the backend is ready, otherwise some errno
7676

7777
Another I2C master wants to write data to us. This event should be sent once
7878
our own address and the write bit was detected. The data did not arrive yet, so
79-
there is nothing to process or return. Wakeup or initialization probably needs
80-
to be done, though.
79+
there is nothing to process or return. After returning, the bus driver must
80+
always ack the address phase. If 'ret' is zero, backend initialization or
81+
wakeup is done and further data may be received. If 'ret' is an errno, the bus
82+
driver should nack all incoming bytes until the next stop condition to enforce
83+
a retry of the transmission.
8184

8285
* I2C_SLAVE_READ_REQUESTED (mandatory)
8386

0 commit comments

Comments
 (0)