drm/panel: panel-simple: validate panel description
authorSam Ravnborg <sam@ravnborg.org>
Sun, 26 Jul 2020 20:33:10 +0000 (22:33 +0200)
committerSam Ravnborg <sam@ravnborg.org>
Mon, 27 Jul 2020 15:17:32 +0000 (17:17 +0200)
commitddb8e853dc8507ecf9c7b4630857771da1f89752
treea0541dffa40b0f0724df6954ce001eb8a57e2c79
parent2a5c2ff5848efc77a115c53d59655aa6016237e8
drm/panel: panel-simple: validate panel description

Warn if we detect a panel with incomplete/wrong description.
This is inspired by a similar patch by Laurent that introduced checks
for LVDS panels - this extends the checks to the remaining type of
connectors.

This is known to warn for some of the existing panels but added
despite this as we need help from people using the panels to
add the missing info.
The checks are not complete but will catch the most common mistakes.

The checks at the same time serve as documentation for the minimum
required description for a panel.

The checks uses dev_warn() as we know this will hit. WARN() was
too noisy at the moment for anything else than LVDS.

v3:
  - %d => %u for bpc (Laurent)
v2:
  - Use dev_warn (Laurent)
  - Check for empty bus_flags

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Cc: Thierry Reding <thierry.reding@gmail.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200726203324.3722593-2-sam@ravnborg.org
drivers/gpu/drm/panel/panel-simple.c