OSDN Git Service

drm/panel-simple: Support hpd-gpios for delaying prepare()
authorDouglas Anderson <dianders@chromium.org>
Thu, 7 May 2020 21:34:57 +0000 (14:34 -0700)
committerSam Ravnborg <sam@ravnborg.org>
Sat, 9 May 2020 20:11:45 +0000 (22:11 +0200)
commit48834e6084f185776b0c567d6f9b8e0b099f4b19
tree105a5bc5e8aa98463104a68867bb4559685a602c
parentd2528306528d6cca4e1608642a8efec95d7b13dd
drm/panel-simple: Support hpd-gpios for delaying prepare()

People use panel-simple when they have panels that are builtin to
their device.  In these cases the HPD (Hot Plug Detect) signal isn't
really used for hotplugging devices but instead is used for power
sequencing.  Panel timing diagrams (especially for eDP panels) usually
have the HPD signal in them and it acts as an indicator that the panel
is ready for us to talk to it.

Sometimes the HPD signal is hooked up to a normal GPIO on a system.
In this case we need to poll it in the correct place to know that the
panel is ready for us.  In some system designs the right place for
this is panel-simple.

When adding this support, we'll account for the case that there might
be a circular dependency between panel-simple and the provider of the
GPIO.  The case this was designed for was for the "ti-sn65dsi86"
bridge chip.  If HPD is hooked up to one of the GPIOs provided by the
bridge chip then in our probe function we'll always get back
-EPROBE_DEFER.  Let's handle this by allowing this GPIO to show up
late if we saw -EPROBE_DEFER during probe.  NOTE: since the
gpio_get_optional() is used, if the "hpd-gpios" isn't there our
variable will just be NULL and we won't do anything in prepare().

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: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200507143354.v5.3.I53fed5b501a31e7a7fa13268ebcdd6b77bd0cadd@changeid
drivers/gpu/drm/panel/panel-simple.c