HID: mcp2221: cancel last I2C command on read error
authorRomain Sioen <romain.sioen@microchip.com>
Fri, 6 Feb 2026 16:32:58 +0000 (17:32 +0100)
committerJiri Kosina <jkosina@suse.com>
Fri, 27 Feb 2026 17:54:09 +0000 (18:54 +0100)
commite31b556c0ba21f20c298aa61181b96541140b7b9
tree3b0b7b47aeec76b04d9f6da9985303998b4b757a
parent377f8e788945d45b012ed9cfc35ca56c02e86cd8
HID: mcp2221: cancel last I2C command on read error

When an I2C SMBus read operation fails, the MCP2221 internal state machine
may not reset correctly, causing subsequent transactions to fail.

By adding a short delay and explicitly cancelling the last command,
we ensure the device is ready for the next operation.

Fix an issue where i2cdetect was not able to detect all devices correctly
on the bus.

Signed-off-by: Romain Sioen <romain.sioen@microchip.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
drivers/hid/hid-mcp2221.c