Commit 1b9883ea authored by Boris Brezillon's avatar Boris Brezillon Committed by Thierry Reding

drm/vc4: Support the case where the DSI device is disabled

Having a device with a status property != "okay" in the DT is a valid
use case, and we should not prevent the registration of the DRM device
when the DSI device connected to the DSI controller is disabled.

Consider the ENODEV return code as a valid result and do not expose the
DSI encoder/connector when it happens.
Signed-off-by: default avatarBoris Brezillon <boris.brezillon@bootlin.com>
Reviewed-by: default avatarEric Anholt <eric@anholt.net>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180509130042.9435-5-boris.brezillon@bootlin.com
parent 2e64a174
...@@ -1612,8 +1612,18 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) ...@@ -1612,8 +1612,18 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data)
ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0,
&panel, &dsi->bridge); &panel, &dsi->bridge);
if (ret) if (ret) {
/* If the bridge or panel pointed by dev->of_node is not
* enabled, just return 0 here so that we don't prevent the DRM
* dev from being registered. Of course that means the DSI
* encoder won't be exposed, but that's not a problem since
* nothing is connected to it.
*/
if (ret == -ENODEV)
return 0;
return ret; return ret;
}
if (panel) { if (panel) {
dsi->bridge = devm_drm_panel_bridge_add(dev, panel, dsi->bridge = devm_drm_panel_bridge_add(dev, panel,
...@@ -1664,7 +1674,8 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master, ...@@ -1664,7 +1674,8 @@ static void vc4_dsi_unbind(struct device *dev, struct device *master,
struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_dev *vc4 = to_vc4_dev(drm);
struct vc4_dsi *dsi = dev_get_drvdata(dev); struct vc4_dsi *dsi = dev_get_drvdata(dev);
pm_runtime_disable(dev); if (dsi->bridge)
pm_runtime_disable(dev);
vc4_dsi_encoder_destroy(dsi->encoder); vc4_dsi_encoder_destroy(dsi->encoder);
......
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