diff options
author | Quan Nguyen <quan@os.amperecomputing.com> | 2022-09-15 06:54:40 +0300 |
---|---|---|
committer | Wolfram Sang <wsa@kernel.org> | 2022-09-28 22:41:59 +0300 |
commit | 09a7bab68b22ff862766d6ec543fdbaf126cd688 (patch) | |
tree | c86046a19b39c9c1cb4ac7d72e27fcd8a982da28 /Documentation/i2c/slave-interface.rst | |
parent | be18c5ede25da39a0eda541f6de3620a30cf731f (diff) | |
download | linux-09a7bab68b22ff862766d6ec543fdbaf126cd688.tar.xz |
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>
Diffstat (limited to 'Documentation/i2c/slave-interface.rst')
-rw-r--r-- | Documentation/i2c/slave-interface.rst | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/Documentation/i2c/slave-interface.rst b/Documentation/i2c/slave-interface.rst index 58fb143baee4..3f0d320bc80a 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 the backend is ready, otherwise 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 must +always ack the address phase. If 'ret' is zero, backend initialization or +wakeup is done and further data may be received. If 'ret' is an errno, the bus +driver should nack all incoming bytes until the next stop condition to enforce +a retry of the transmission. * I2C_SLAVE_READ_REQUESTED (mandatory) |