summaryrefslogtreecommitdiff
path: root/drivers/hid
diff options
context:
space:
mode:
authorRomain Sioen <romain.sioen@microchip.com>2026-02-06 19:32:58 +0300
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-04-02 14:22:57 +0300
commitbf0ffc028f829cde22164dba919a8ba9be77177a (patch)
treee3a3d75cfb6755f897744af0807eea61913276e5 /drivers/hid
parent0a4e44eb4b0c19549a9358fe7f68cb995de362b5 (diff)
downloadlinux-bf0ffc028f829cde22164dba919a8ba9be77177a.tar.xz
HID: mcp2221: cancel last I2C command on read error
[ Upstream commit e31b556c0ba21f20c298aa61181b96541140b7b9 ] 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> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-mcp2221.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c
index 33603b019f97..ef3b5c77c38e 100644
--- a/drivers/hid/hid-mcp2221.c
+++ b/drivers/hid/hid-mcp2221.c
@@ -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 {