Commit 03848335 authored by Rob Clark's avatar Rob Clark Committed by Douglas Anderson

drm/bridge: sn65dsi86: defer if there is no dsi host

Otherwise we don't get another shot at it if the bridge probes before
the dsi host is registered.  It seems like this is what *most* (but not
all) of the other bridges do.

It looks like this was missed in the conversion to attach dsi host at
probe time.

Fixes: c3b75d47 ("drm/bridge: sn65dsi86: Register and attach our DSI device at probe")
Signed-off-by: default avatarRob Clark <robdclark@chromium.org>
Reviewed-by: default avatarDoug Anderson <dianders@chromium.org>
Tested-by: default avatarDoug Anderson <dianders@chromium.org>
Reviewed-by: default avatarStephen Boyd <swboyd@chromium.org>
[dianders: squashed in Stephen's simplification]
Signed-off-by: default avatarDouglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20211207215753.635841-1-robdclark@gmail.com
parent d6c75c29
...@@ -704,7 +704,7 @@ static struct ti_sn65dsi86 *bridge_to_ti_sn65dsi86(struct drm_bridge *bridge) ...@@ -704,7 +704,7 @@ static struct ti_sn65dsi86 *bridge_to_ti_sn65dsi86(struct drm_bridge *bridge)
static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata) static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata)
{ {
int ret, val; int val;
struct mipi_dsi_host *host; struct mipi_dsi_host *host;
struct mipi_dsi_device *dsi; struct mipi_dsi_device *dsi;
struct device *dev = pdata->dev; struct device *dev = pdata->dev;
...@@ -714,16 +714,12 @@ static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata) ...@@ -714,16 +714,12 @@ static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata)
}; };
host = of_find_mipi_dsi_host_by_node(pdata->host_node); host = of_find_mipi_dsi_host_by_node(pdata->host_node);
if (!host) { if (!host)
DRM_ERROR("failed to find dsi host\n"); return -EPROBE_DEFER;
return -ENODEV;
}
dsi = devm_mipi_dsi_device_register_full(dev, host, &info); dsi = devm_mipi_dsi_device_register_full(dev, host, &info);
if (IS_ERR(dsi)) { if (IS_ERR(dsi))
DRM_ERROR("failed to create dsi device\n");
return PTR_ERR(dsi); return PTR_ERR(dsi);
}
/* TODO: setting to 4 MIPI lanes always for now */ /* TODO: setting to 4 MIPI lanes always for now */
dsi->lanes = 4; dsi->lanes = 4;
...@@ -739,13 +735,7 @@ static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata) ...@@ -739,13 +735,7 @@ static int ti_sn_attach_host(struct ti_sn65dsi86 *pdata)
pdata->dsi = dsi; pdata->dsi = dsi;
ret = devm_mipi_dsi_attach(dev, dsi); return devm_mipi_dsi_attach(dev, dsi);
if (ret < 0) {
DRM_ERROR("failed to attach dsi to host\n");
return ret;
}
return 0;
} }
static int ti_sn_bridge_attach(struct drm_bridge *bridge, static int ti_sn_bridge_attach(struct drm_bridge *bridge,
...@@ -1267,8 +1257,10 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev, ...@@ -1267,8 +1257,10 @@ static int ti_sn_bridge_probe(struct auxiliary_device *adev,
drm_bridge_add(&pdata->bridge); drm_bridge_add(&pdata->bridge);
ret = ti_sn_attach_host(pdata); ret = ti_sn_attach_host(pdata);
if (ret) if (ret) {
dev_err_probe(pdata->dev, ret, "failed to attach dsi host\n");
goto err_remove_bridge; goto err_remove_bridge;
}
return 0; return 0;
......
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