Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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>

authored by

Romain Sioen and committed by
Jiri Kosina
e31b556c 377f8e78

+2
+2
drivers/hid/hid-mcp2221.c
··· 353 353 usleep_range(90, 100); 354 354 retries++; 355 355 } else { 356 + usleep_range(980, 1000); 357 + mcp_cancel_last_cmd(mcp); 356 358 return ret; 357 359 } 358 360 } else {