diff options
author | Douglas Anderson <dianders@chromium.org> | 2021-01-16 01:44:17 +0300 |
---|---|---|
committer | Linus Walleij <linus.walleij@linaro.org> | 2021-03-11 19:14:40 +0300 |
commit | 6ec52621e77c81079e7d3858cca00344d4266a89 (patch) | |
tree | d43c5308e6b2c2c3db4d001216c3637dd156de6f /drivers/gpu/drm/panel/panel-simple.c | |
parent | 5e7222a3674ea7422370779884dd53aabe9e4a9d (diff) | |
download | linux-6ec52621e77c81079e7d3858cca00344d4266a89.tar.xz |
drm/panel-simple: Don't wait longer for HPD than hpd_absent_delay
If a panel has an hpd_absent_delay specified then we know exactly how
long the maximum time is before HPD must be asserted. That means we
can use it as a timeout for polling the HPD pin instead of using an
arbitrary timeout. This is especially useful for dealing with panels
that periodically fail to power on and need to be retried. We can
detect the problem sooner.
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210115144345.v2.2.I183b1817610d7a82fdd3bc852e96d2985df9623f@changeid
Diffstat (limited to 'drivers/gpu/drm/panel/panel-simple.c')
-rw-r--r-- | drivers/gpu/drm/panel/panel-simple.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c index e236ff7f5ca2..e8634c146270 100644 --- a/drivers/gpu/drm/panel/panel-simple.c +++ b/drivers/gpu/drm/panel/panel-simple.c @@ -382,6 +382,7 @@ static int panel_simple_prepare(struct drm_panel *panel) unsigned int delay; int err; int hpd_asserted; + unsigned long hpd_wait_us; if (p->prepared_time != 0) return 0; @@ -409,9 +410,14 @@ static int panel_simple_prepare(struct drm_panel *panel) goto error; } + if (p->desc->delay.hpd_absent_delay) + hpd_wait_us = p->desc->delay.hpd_absent_delay * 1000UL; + else + hpd_wait_us = 2000000; + err = readx_poll_timeout(gpiod_get_value_cansleep, p->hpd_gpio, hpd_asserted, hpd_asserted, - 1000, 2000000); + 1000, hpd_wait_us); if (hpd_asserted < 0) err = hpd_asserted; |