mirror of
https://github.com/torvalds/linux.git
synced 2026-03-08 01:24:47 +01:00
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>
This commit is contained in:
parent
377f8e7889
commit
e31b556c0b
1 changed files with 2 additions and 0 deletions
|
|
@ -353,6 +353,8 @@ static int mcp_i2c_smbus_read(struct mcp2221 *mcp,
|
|||
usleep_range(90, 100);
|
||||
retries++;
|
||||
} else {
|
||||
usleep_range(980, 1000);
|
||||
mcp_cancel_last_cmd(mcp);
|
||||
return ret;
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue