[PATCH 1/3] drm/bridge/sii8620: perform I2C bus recovery after reset

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Chip has known bug which causes I2C client state machine to frequently
enter non-idle mode after chip reset. Let's ask I2C adapter to perform
bus recovery to mitigate this bug.

Signed-off-by: Andrzej Hajda <a.hajda@xxxxxxxxxxx>
---
 drivers/gpu/drm/bridge/sil-sii8620.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/drivers/gpu/drm/bridge/sil-sii8620.c b/drivers/gpu/drm/bridge/sil-sii8620.c
index 86789f8918a4..db93e5e0497c 100644
--- a/drivers/gpu/drm/bridge/sil-sii8620.c
+++ b/drivers/gpu/drm/bridge/sil-sii8620.c
@@ -978,6 +978,8 @@ static int sii8620_hw_off(struct sii8620 *ctx)
 
 static void sii8620_hw_reset(struct sii8620 *ctx)
 {
+	struct i2c_client *i2c = to_i2c_client(ctx->dev);
+
 	usleep_range(10000, 20000);
 	gpiod_set_value(ctx->gpio_reset, 0);
 	usleep_range(5000, 20000);
@@ -985,6 +987,9 @@ static void sii8620_hw_reset(struct sii8620 *ctx)
 	usleep_range(10000, 20000);
 	gpiod_set_value(ctx->gpio_reset, 0);
 	msleep(300);
+
+	/* I2C bus recovery prevents I2C errors due to known bug in the chip */
+	i2c_recover_bus(i2c->adapter);
 }
 
 static void sii8620_cbus_reset(struct sii8620 *ctx)
-- 
2.15.1

--
To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux SoC Development]     [Linux Rockchip Development]     [Linux USB Development]     [Video for Linux]     [Linux Audio Users]     [Linux SCSI]     [Yosemite News]

  Powered by Linux