From: Quan Nguyen <quan@os.amperecomputing.com>
To: Wolfram Sang <wsa@kernel.org>,
linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org,
Open Source Submission <patches@amperecomputing.com>
Cc: quan@os.amperecomputing.com,
Phong Vo <phong@os.amperecomputing.com>,
Thang Nguyen <thang@os.amperecomputing.com>
Subject: [PATCH] docs: i2c: slave-interface: return errno when handle I2C_SLAVE_WRITE_REQUESTED
Date: Thu, 15 Sep 2022 10:54:40 +0700 [thread overview]
Message-ID: <20220915035440.2862532-1-quan@os.amperecomputing.com> (raw)
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/
---
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
next reply other threads:[~2022-09-15 3:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-09-15 3:54 Quan Nguyen [this message]
2022-09-28 19:41 ` [PATCH] docs: i2c: slave-interface: return errno when handle I2C_SLAVE_WRITE_REQUESTED Wolfram Sang
2022-09-29 8:07 ` Quan Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220915035440.2862532-1-quan@os.amperecomputing.com \
--to=quan@os.amperecomputing.com \
--cc=linux-i2c@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=patches@amperecomputing.com \
--cc=phong@os.amperecomputing.com \
--cc=thang@os.amperecomputing.com \
--cc=wsa@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox