summaryrefslogtreecommitdiff
path: root/Documentation/i2c
diff options
context:
space:
mode:
authorWolfram Sang <wsa+renesas@sang-engineering.com>2024-08-14 20:22:07 +0200
committerWolfram Sang <wsa+renesas@sang-engineering.com>2024-08-26 15:15:22 +0200
commitbbec612963fde8f6e5f0ce98aad63169d8c64553 (patch)
tree98a84255bab6c4faccb5d5c37dd853d83d08c27b /Documentation/i2c
parent45c03c65ea77bd1a28ed1791b61594f579ee01ab (diff)
i2c: testunit: describe fwnode based instantiation
The testunit can also be instantiated via firmware nodes. Give a devicetree node as an example. Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Diffstat (limited to 'Documentation/i2c')
-rw-r--r--Documentation/i2c/slave-testunit-backend.rst12
1 files changed, 12 insertions, 0 deletions
diff --git a/Documentation/i2c/slave-testunit-backend.rst b/Documentation/i2c/slave-testunit-backend.rst
index d3ab5944877d..3743188ecfc7 100644
--- a/Documentation/i2c/slave-testunit-backend.rst
+++ b/Documentation/i2c/slave-testunit-backend.rst
@@ -20,6 +20,18 @@ Instantiating the device is regular. Example for bus 0, address 0x30::
# echo "slave-testunit 0x1030" > /sys/bus/i2c/devices/i2c-0/new_device
+Or using firmware nodes. Here is a devicetree example (note this is only a
+debug device, so there are no official DT bindings)::
+
+ &i2c0 {
+ ...
+
+ testunit@30 {
+ compatible = "slave-testunit";
+ reg = <(0x30 | I2C_OWN_SLAVE_ADDRESS)>;
+ };
+ };
+
After that, you will have the device listening. Reading will return a single
byte. Its value is 0 if the testunit is idle, otherwise the command number of
the currently running command.