Commit Graph

10 Commits

Author SHA1 Message Date
Wolfram Sang
3d16973f77 i2c: testunit: add SMBusAlert trigger
To test SMBusAlert handlers, let the testunit be able to trigger
SMBusAlert interrupts. This new command needs a GPIO connected to the
SMBAlert# line.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2024-08-26 15:15:48 +02:00
Wolfram Sang
bbec612963 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>
2024-08-26 15:15:22 +02:00
Wolfram Sang
45c03c65ea i2c: testunit: return current command on read messages
Because the testunit can start tests in the future via the DELAY
register, it may happen that a command is still pending. Support
detecting that by returning the number of a command in progress (if
there is one).

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2024-08-14 19:56:51 +02:00
Wolfram Sang
6b21470af0 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>
2024-08-14 19:55:40 +02:00
Wolfram Sang
faf3c102c6 i2c: testunit: use decimal values in docs when appropriate
Sometimes decimal values are just shorter (like for cmds), sometimes
they are even easier to understand (like for the delay value). Make use
of them.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2024-08-14 19:55:10 +02:00
Wolfram Sang
500c20fe3e i2c: add debug message for detected HostNotify alerts
Setting up HostNotify can be tricky. Support debugging by stating
when a HostNotify alert was received independent of the irq being
mapped. Especially useful with the in-kernel i2c testunit. Update
documentation as well.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Andi Shyti <andi.shyti@kernel.org>
2024-07-10 08:31:59 +02:00
Wolfram Sang
256ed3108b Documentation: i2c: testunit: use proper reST
This document is hardly readable when converted to HTML. Mark code
sections as such and use tables to improve readability a lot. Some
content has slightly been moved around, but no significant changes were
made.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
2024-06-26 12:45:25 +02:00
Wolfram Sang
b39ab96aa8 i2c: testunit: add support for block process calls
Devices offering SMBus block process calls are rare, so add it to the
testunit. This is also a good test case for testing proper
I2C_M_RECV_LEN flag handling of I2C bus masters emulating SMBus.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2021-02-12 11:11:04 +01:00
Wolfram Sang
35baff672f i2c: testunit: improve documentation
Mention that new CMDs will be NACKed while the old one is still
on-going, that the I2C address parameter of READ_BYTES is 7 bit only,
and reword one paragraph to be more precise.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2020-10-05 22:57:39 +02:00
Wolfram Sang
a8335c64c5 i2c: add slave testunit driver
Here is an I2C slave backend driver which allows to test some uncommon
functionalities of the I2C and SMBus world. Usually, you need specific
devices to test e.g. SMBus Host Notify and such. With this driver you
just need the slave interface of another I2C controller.

This initial version has testcases for multi-master and SMBus Host
Notify. Already planned but not yet implemented are SMBus Alert and
messages with I2C_M_RECV_LEN.

Please read the documentation for further details.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Signed-off-by: Wolfram Sang <wsa@kernel.org>
2020-09-21 11:02:17 +02:00