Commit d688f6b5 authored by Marek Vasut's avatar Marek Vasut Committed by Robert Foss

drm/bridge: tc358767: Handle bridge past DPI output

Currently the driver only handles panel directly connected to the DPI output.
Handle the case where a bridge is connected past DPI output of this bridge.
This could be e.g. DPI to LVDS encoder chip.
Signed-off-by: default avatarMarek Vasut <marex@denx.de>
Cc: Jonas Karlman <jonas@kwiboo.se>
Cc: Laurent Pinchart <Laurent.pinchart@ideasonboard.com>
Cc: Lucas Stach <l.stach@pengutronix.de>
Cc: Maxime Ripard <maxime@cerno.tech>
Cc: Neil Armstrong <narmstrong@baylibre.com>
Cc: Robert Foss <robert.foss@linaro.org>
Cc: Sam Ravnborg <sam@ravnborg.org>
Reviewed-by: default avatarRobert Foss <robert.foss@linaro.org>
Signed-off-by: default avatarRobert Foss <robert.foss@linaro.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20220724224317.288727-1-marex@denx.de
parent f8e1fa0f
...@@ -1913,22 +1913,23 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc) ...@@ -1913,22 +1913,23 @@ static int tc_mipi_dsi_host_attach(struct tc_data *tc)
static int tc_probe_dpi_bridge_endpoint(struct tc_data *tc) static int tc_probe_dpi_bridge_endpoint(struct tc_data *tc)
{ {
struct device *dev = tc->dev; struct device *dev = tc->dev;
struct drm_bridge *bridge;
struct drm_panel *panel; struct drm_panel *panel;
int ret; int ret;
/* port@1 is the DPI input/output port */ /* port@1 is the DPI input/output port */
ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, NULL); ret = drm_of_find_panel_or_bridge(dev->of_node, 1, 0, &panel, &bridge);
if (ret && ret != -ENODEV) if (ret && ret != -ENODEV)
return ret; return ret;
if (panel) { if (panel) {
struct drm_bridge *panel_bridge; bridge = devm_drm_panel_bridge_add(dev, panel);
if (IS_ERR(bridge))
panel_bridge = devm_drm_panel_bridge_add(dev, panel); return PTR_ERR(bridge);
if (IS_ERR(panel_bridge)) }
return PTR_ERR(panel_bridge);
tc->panel_bridge = panel_bridge; if (bridge) {
tc->panel_bridge = bridge;
tc->bridge.type = DRM_MODE_CONNECTOR_DPI; tc->bridge.type = DRM_MODE_CONNECTOR_DPI;
tc->bridge.funcs = &tc_dpi_bridge_funcs; tc->bridge.funcs = &tc_dpi_bridge_funcs;
......
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