Commit 9f069c6f authored by Sam Ravnborg's avatar Sam Ravnborg

drm/panel: panel-simple: add default connector_type

All panels shall report a connector type.
panel-simple has a lot of panels with no connector_type,
and for these fall back to DPI as the default.

v2:
  - Rebased on top of validation of panel description
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarLaurent 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-3-sam@ravnborg.org
parent ddb8e853
...@@ -500,6 +500,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) ...@@ -500,6 +500,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
struct panel_simple *panel; struct panel_simple *panel;
struct display_timing dt; struct display_timing dt;
struct device_node *ddc; struct device_node *ddc;
int connector_type;
u32 bus_flags; u32 bus_flags;
int err; int err;
...@@ -550,10 +551,12 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) ...@@ -550,10 +551,12 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
panel_simple_parse_panel_timing_node(dev, panel, &dt); panel_simple_parse_panel_timing_node(dev, panel, &dt);
} }
connector_type = desc->connector_type;
/* Catch common mistakes for panels. */ /* Catch common mistakes for panels. */
switch (desc->connector_type) { switch (connector_type) {
case 0: case 0:
dev_warn(dev, "Specify missing connector_type\n"); dev_warn(dev, "Specify missing connector_type\n");
connector_type = DRM_MODE_CONNECTOR_DPI;
break; break;
case DRM_MODE_CONNECTOR_LVDS: case DRM_MODE_CONNECTOR_LVDS:
WARN_ON(desc->bus_flags & WARN_ON(desc->bus_flags &
...@@ -600,11 +603,11 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc) ...@@ -600,11 +603,11 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
break; break;
default: default:
dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type); dev_warn(dev, "Specify a valid connector_type: %d\n", desc->connector_type);
connector_type = DRM_MODE_CONNECTOR_DPI;
break; break;
} }
drm_panel_init(&panel->base, dev, &panel_simple_funcs, drm_panel_init(&panel->base, dev, &panel_simple_funcs, connector_type);
desc->connector_type);
err = drm_panel_of_backlight(&panel->base); err = drm_panel_of_backlight(&panel->base);
if (err) if (err)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment