Skip to content

Commit 500c20f

Browse files
author
Wolfram Sang
committed
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 <[email protected]> Reviewed-by: Andi Shyti <[email protected]>
1 parent 7117030 commit 500c20f

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

Documentation/i2c/slave-testunit-backend.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,11 @@ Example to send a notification after 10ms::
9999

100100
# i2cset -y 0 0x30 0x02 0x42 0x64 0x01 i
101101

102+
If the host controller supports HostNotify, this message with debug level
103+
should appear (Linux 6.11 and later)::
104+
105+
Detected HostNotify from address 0x30
106+
102107
0x03 SMBUS_BLOCK_PROC_CALL
103108
~~~~~~~~~~~~~~~~~~~~~~~~~~
104109

drivers/i2c/i2c-core-base.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,6 +1468,8 @@ int i2c_handle_smbus_host_notify(struct i2c_adapter *adap, unsigned short addr)
14681468
if (!adap)
14691469
return -EINVAL;
14701470

1471+
dev_dbg(&adap->dev, "Detected HostNotify from address 0x%02x", addr);
1472+
14711473
irq = irq_find_mapping(adap->host_notify_domain, addr);
14721474
if (irq <= 0)
14731475
return -ENXIO;

0 commit comments

Comments
 (0)