mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
regulator: rpi-panel-attiny: Fix probe failure after a host cold boot
attiny_i2c_probe() reads REG_ID with attiny_i2c_read(), a function added
in commit e4a7e3f741 ("regulator/rpi-panel-attiny: Use two
transactions for I2C read") specifically for fixing REG_ID read failures
at probe.
On TI's BeagleY-AI (but also on other TI boards tested) with the
Raspberry Pi 7-inch touchscreen, the first I2C transfer to the attiny
after a cold boot of the board usually fails, so the probe fails.
Retrying the transfer once fixes the problem.
It is unclear why this happens, but as the earlier commit adding
attiny_i2c_read() shows, attiny seems to have i2c issues. It is not out
of the question that the issue could be on the TI i2c side, but as the
other i2c peripherals (like sensors) work fine, adding this workaround
to attiny driver feels sensible.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patch.msgid.link/20261016-attiny-probe-fix-v1-1-96337ba58dfa@ideasonboard.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
parent
98a375660b
commit
ba83dd4a47
|
|
@ -249,7 +249,13 @@ static int attiny_i2c_read(struct i2c_client *client, u8 reg, unsigned int *buf)
|
|||
msgs[0].len = ARRAY_SIZE(addr_buf);
|
||||
msgs[0].buf = addr_buf;
|
||||
|
||||
/*
|
||||
* The first transfer after a power-up of the host usually fails on
|
||||
* (at least) some TI boards, so retry the transfer on failure.
|
||||
*/
|
||||
ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
|
||||
if (ret != ARRAY_SIZE(msgs))
|
||||
ret = i2c_transfer(client->adapter, msgs, ARRAY_SIZE(msgs));
|
||||
if (ret != ARRAY_SIZE(msgs))
|
||||
return -EIO;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user