diff mbox

[RFC,2/3] drm/bridge: adv7511: Add 200ms delay on power-on

Message ID 1479775052-28194-3-git-send-email-john.stultz@linaro.org
State New
Headers show

Commit Message

John Stultz Nov. 22, 2016, 12:37 a.m. UTC
Secton 4.1 of the adv7511 programming guide advises one waits
200ms after powering on the chip before trying to communicate
with it via i2c. Not doing so can cause reliability issues when
probing the EDID.

See:
http://www.analog.com/media/en/technical-documentation/user-guides/ADV7511_Programming_Guide.pdf

So this patch simply adds a 200ms sleep at the end of the
power_on path. This greatly improves EDID probing reliabilty
on hotplug with the HiKey device.

Cc: David Airlie <airlied@linux.ie>
Cc: Archit Taneja <architt@codeaurora.org>
Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Lars-Peter Clausen <lars@metafoo.de>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: dri-devel@lists.freedesktop.org
Signed-off-by: John Stultz <john.stultz@linaro.org>

---
 drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 ++
 1 file changed, 2 insertions(+)

-- 
2.7.4

Comments

Laurent Pinchart Nov. 22, 2016, 8:25 a.m. UTC | #1
Hi John,

Thank you for the patch.

On Monday 21 Nov 2016 16:37:31 John Stultz wrote:
> Secton 4.1 of the adv7511 programming guide advises one waits

> 200ms after powering on the chip before trying to communicate

> with it via i2c. Not doing so can cause reliability issues when

> probing the EDID.

> 

> See:

> http://www.analog.com/media/en/technical-documentation/user-guides/ADV7511_P

> rogramming_Guide.pdf

> 

> So this patch simply adds a 200ms sleep at the end of the

> power_on path. This greatly improves EDID probing reliabilty

> on hotplug with the HiKey device.

> 

> Cc: David Airlie <airlied@linux.ie>

> Cc: Archit Taneja <architt@codeaurora.org>

> Cc: Wolfram Sang <wsa+renesas@sang-engineering.com>

> Cc: Lars-Peter Clausen <lars@metafoo.de>

> Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

> Cc: dri-devel@lists.freedesktop.org

> Signed-off-by: John Stultz <john.stultz@linaro.org>

> ---

>  drivers/gpu/drm/bridge/adv7511/adv7511_drv.c | 2 ++

>  1 file changed, 2 insertions(+)

> 

> diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

> b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c index b240e05..2114a4c

> 100644

> --- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

> +++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c

> @@ -361,6 +361,8 @@ static void __adv7511_power_on(struct adv7511 *adv7511)

>  	 */

>  	regcache_sync(adv7511->regmap);

> 

> +	msleep(200);

> +


The documentation states that

"The user should wait 200ms for the address to be decided, after the power 
supplies are high, before attempting to communicate with the ADV7511W using 
I2C."

The hardware user's guide further states that

"When initially powered up, there is a 200ms period before the device is ready 
to be addressed."

Not only the delay you add comes after lots of I2C communication, but the 
driver doesn't handle regulators, and thus doesn't power down the device at 
the hardware level. The initial power up should thus be long gone when this 
code is reached.

Could it be that, on the HiKey board, the power supply is controlled through 
another mean that doesn't comply with the 200ms rule ?

>  	if (adv7511->type == ADV7533)

>  		adv7533_dsi_power_on(adv7511);

>  }


-- 
Regards,

Laurent Pinchart
diff mbox

Patch

diff --git a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
index b240e05..2114a4c 100644
--- a/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
+++ b/drivers/gpu/drm/bridge/adv7511/adv7511_drv.c
@@ -361,6 +361,8 @@  static void __adv7511_power_on(struct adv7511 *adv7511)
 	 */
 	regcache_sync(adv7511->regmap);
 
+	msleep(200);
+
 	if (adv7511->type == ADV7533)
 		adv7533_dsi_power_on(adv7511);
 }