diff mbox

[RESEND] media: adv7180: increase delay after reset to 5ms

Message ID 1453205956-9103-1-git-send-email-ulrich.hecht+renesas@gmail.com (mailing list archive)
State Accepted
Delegated to: Geert Uytterhoeven
Headers show

Commit Message

Ulrich Hecht Jan. 19, 2016, 12:19 p.m. UTC
Initialization of the ADV7180 chip fails on the Renesas R8A7790-based
Lager board about 50% of the time.  This patch resolves the issue by
increasing the minimum delay after reset from 2 ms to 5 ms, following the
recommendation in the ADV7180 datasheet:

"Executing a software reset takes approximately 2 ms. However, it is
recommended to wait 5 ms before any further I2C writes are performed."

Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Acked-by: Lars-Peter Clausen <lars@metafoo.de>
---
 drivers/media/i2c/adv7180.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Niklas Söderlund Jan. 19, 2016, 4:10 p.m. UTC | #1
Hi Ulrich,

This fixes the problems I have seen on Koelsch.

* Ulrich Hecht <ulrich.hecht+renesas@gmail.com> [2016-01-19 13:19:16 +0100]:

> Initialization of the ADV7180 chip fails on the Renesas R8A7790-based
> Lager board about 50% of the time.  This patch resolves the issue by
> increasing the minimum delay after reset from 2 ms to 5 ms, following the
> recommendation in the ADV7180 datasheet:
>
> "Executing a software reset takes approximately 2 ms. However, it is
> recommended to wait 5 ms before any further I2C writes are performed."
>
> Signed-off-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>
> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
> Acked-by: Lars-Peter Clausen <lars@metafoo.de>

Tested-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>
diff mbox

Patch

diff --git a/drivers/media/i2c/adv7180.c b/drivers/media/i2c/adv7180.c
index f82c8aa..3c3c4bf 100644
--- a/drivers/media/i2c/adv7180.c
+++ b/drivers/media/i2c/adv7180.c
@@ -1112,7 +1112,7 @@  static int init_device(struct adv7180_state *state)
 	mutex_lock(&state->mutex);
 
 	adv7180_write(state, ADV7180_REG_PWR_MAN, ADV7180_PWR_MAN_RES);
-	usleep_range(2000, 10000);
+	usleep_range(5000, 10000);
 
 	ret = state->chip_info->init(state);
 	if (ret)