diff options
author | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2024-08-11 23:23:15 +0200 |
---|---|---|
committer | Wolfram Sang <wsa+renesas@sang-engineering.com> | 2024-08-14 19:55:40 +0200 |
commit | 6b21470af096e7f3acc4f0521354c5b044e2372c (patch) | |
tree | d48cca6eae5227891de4a1350f3e9b2965205aef /Documentation/i2c | |
parent | faf3c102c67a9d6b205e924d756769972ecce03f (diff) | |
download | linux-6b21470af096e7f3acc4f0521354c5b044e2372c.tar.gz linux-6b21470af096e7f3acc4f0521354c5b044e2372c.tar.bz2 linux-6b21470af096e7f3acc4f0521354c5b044e2372c.zip |
i2c: testunit: add command to support versioning and test rep_start
For some devices, it is essential that controllers handle repeated start
correctly and do not replace it with a stop/start combination. This
addition helps to test that because it will only return a version string
if repeated start is done properly.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Diffstat (limited to 'Documentation/i2c')
-rw-r--r-- | Documentation/i2c/slave-testunit-backend.rst | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/Documentation/i2c/slave-testunit-backend.rst b/Documentation/i2c/slave-testunit-backend.rst index ee019db53938..110c0055064f 100644 --- a/Documentation/i2c/slave-testunit-backend.rst +++ b/Documentation/i2c/slave-testunit-backend.rst @@ -133,3 +133,41 @@ later):: # i2ctransfer -y 0 w3@0x30 3 1 0x10 r? 0x10 0x0f 0x0e 0x0d 0x0c 0x0b 0x0a 0x09 0x08 0x07 0x06 0x05 0x04 0x03 0x02 0x01 0x00 + +0x04 GET_VERSION_WITH_REP_START +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +.. list-table:: + :header-rows: 1 + + * - CMD + - DATAL + - DATAH + - DELAY + + * - 0x04 + - currently unused + - currently unused + - leave out, partial command! + +Partial command. After sending this command, the testunit will reply to a read +message with a NUL terminated version string based on UTS_RELEASE. The first +character is always a 'v' and the length of the version string is at maximum +128 bytes. However, it will only respond if the read message is connected to +the write message via repeated start. If your controller driver handles +repeated start correctly, this will work:: + + # i2ctransfer -y 0 w3@0x30 4 0 0 r128 + 0x76 0x36 0x2e 0x31 0x31 0x2e 0x30 0x2d 0x72 0x63 0x31 0x2d 0x30 0x30 0x30 0x30 ... + +If you have i2c-tools 4.4 or later, you can print out the data right away:: + + # i2ctransfer -y -b 0 w3@0x30 4 0 0 r128 + v6.11.0-rc1-00009-gd37a1b4d3fd0 + +STOP/START combinations between the two messages will *not* work because they +are not equivalent to a REPEATED START. As an example, this returns just the +default response:: + + # i2cset -y 0 0x30 4 0 0 i; i2cget -y 0 0x30 + 0x01 |