drm/panel-edp: Implement generic "edp-panel"s probed by EDID
authorDouglas Anderson <dianders@chromium.org>
Tue, 14 Sep 2021 20:22:02 +0000 (13:22 -0700)
committerDouglas Anderson <dianders@chromium.org>
Mon, 20 Sep 2021 16:26:30 +0000 (09:26 -0700)
commit5540cf8f3e8dac7ef2de28edcf2623c1516fbe45
tree90cfecbeed5beb3f85eb65074a6899e2481465e7
parent24e27de115608b04160d1d113b25f8a9f7e59416
drm/panel-edp: Implement generic "edp-panel"s probed by EDID

As discussed in the patch ("dt-bindings: drm/panel-simple: Introduce
generic eDP panels") we can actually support probing eDP panels at
runtime instead of hardcoding what panel is connected. Add support to
the panel-edp driver for this.

We'll implement a solution like this:
* We'll read in two delays from the device tree that are used for
  powering up the panel the initial time (to read the EDID).
* In the EDID we can find a 32-bit ID that identifies what panel we've
  found. From this ID we can look up the full set of delays.

After this change we'll still need to add per-panel delays into the
panel-simple driver but we will no longer need to specify exactly
which panel is connected to which board in the device tree. Nicely,
any panels that are only supported this way also don't need to
hardcode mode data since it's guaranteed that we can get that through
the EDID.

This patch will seed the ID-to-delay table with a few panels that I
have access to, many of which are on sc7180-trogdor devices.

Signed-off-by: Douglas Anderson <dianders@chromium.org>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20210914132020.v5.15.Id9c96cba4eba3e5ee519bfb09cd64b39f2490293@changeid
drivers/gpu/drm/panel/panel-edp.c