Skip to content

Commit bbec612

Browse files
author
Wolfram Sang
committed
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 <[email protected]>
1 parent 45c03c6 commit bbec612

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Documentation/i2c/slave-testunit-backend.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,18 @@ Instantiating the device is regular. Example for bus 0, address 0x30::
2020

2121
# echo "slave-testunit 0x1030" > /sys/bus/i2c/devices/i2c-0/new_device
2222

23+
Or using firmware nodes. Here is a devicetree example (note this is only a
24+
debug device, so there are no official DT bindings)::
25+
26+
&i2c0 {
27+
...
28+
29+
testunit@30 {
30+
compatible = "slave-testunit";
31+
reg = <(0x30 | I2C_OWN_SLAVE_ADDRESS)>;
32+
};
33+
};
34+
2335
After that, you will have the device listening. Reading will return a single
2436
byte. Its value is 0 if the testunit is idle, otherwise the command number of
2537
the currently running command.

0 commit comments

Comments
 (0)