diff options
author | Hoegeun Kwon <hoegeun.kwon@samsung.com> | 2019-07-04 17:40:58 +0900 |
---|---|---|
committer | Seung-Woo Kim <sw0312.kim@samsung.com> | 2019-07-05 06:25:19 +0000 |
commit | 33628acb253b88e9c5a5f1777a292731b9217f81 (patch) | |
tree | 8c92382119eaea6142b88bef4864048196179e94 /drivers | |
parent | 9cb6b56a469925b658703b8d238334d1e91ea7bf (diff) | |
download | linux-rpi3-33628acb253b88e9c5a5f1777a292731b9217f81.tar.gz linux-rpi3-33628acb253b88e9c5a5f1777a292731b9217f81.tar.bz2 linux-rpi3-33628acb253b88e9c5a5f1777a292731b9217f81.zip |
drm/vc4: Fix change to find_panel in the dsi_attach func
There is a problem that crtc does not bind while continuously
requesting EPROBE_DEFER, if dsi_bind does not successfully bind.
We need to change the part of find_panel in bind to dsi_attach
function.
Change-Id: Ifce518f047f496079eb8fbe112dabbd9bc7488bb
Signed-off-by: Hoegeun Kwon <hoegeun.kwon@samsung.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_dsi.c | 57 |
1 files changed, 30 insertions, 27 deletions
diff --git a/drivers/gpu/drm/vc4/vc4_dsi.c b/drivers/gpu/drm/vc4/vc4_dsi.c index fa2e9db03821..2dcaabbe696f 100644 --- a/drivers/gpu/drm/vc4/vc4_dsi.c +++ b/drivers/gpu/drm/vc4/vc4_dsi.c @@ -1306,6 +1306,8 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct vc4_dsi *dsi = host_to_dsi(host); + struct drm_panel *panel; + int ret; dsi->lanes = device->lanes; dsi->channel = device->channel; @@ -1340,6 +1342,28 @@ static int vc4_dsi_host_attach(struct mipi_dsi_host *host, return 0; } + ret = drm_of_find_panel_or_bridge(dsi->pdev->dev.of_node, 0, 0, + &panel, &dsi->bridge); + 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; + } + + if (panel) { + dsi->bridge = devm_drm_panel_bridge_add(&dsi->pdev->dev, panel, + DRM_MODE_CONNECTOR_DSI); + if (IS_ERR(dsi->bridge)) + return PTR_ERR(dsi->bridge); + } + return 0; } @@ -1510,7 +1534,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) struct vc4_dev *vc4 = to_vc4_dev(drm); struct vc4_dsi *dsi = dev_get_drvdata(dev); struct vc4_dsi_encoder *vc4_dsi_encoder; - struct drm_panel *panel; const struct of_device_id *match; dma_cap_mask_t dma_mask; int ret; @@ -1616,28 +1639,6 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) return ret; } - ret = drm_of_find_panel_or_bridge(dev->of_node, 0, 0, - &panel, &dsi->bridge); - 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; - } - - if (panel) { - dsi->bridge = devm_drm_panel_bridge_add(dev, panel, - DRM_MODE_CONNECTOR_DSI); - if (IS_ERR(dsi->bridge)) - return PTR_ERR(dsi->bridge); - } - /* The esc clock rate is supposed to always be 100Mhz. */ ret = clk_set_rate(dsi->escape_clock, 100 * 1000000); if (ret) { @@ -1656,10 +1657,12 @@ static int vc4_dsi_bind(struct device *dev, struct device *master, void *data) DRM_MODE_ENCODER_DSI, NULL); drm_encoder_helper_add(dsi->encoder, &vc4_dsi_encoder_helper_funcs); - ret = drm_bridge_attach(dsi->encoder, dsi->bridge, NULL); - if (ret) { - dev_err(dev, "bridge attach failed: %d\n", ret); - return ret; + if (dsi->bridge) { + ret = drm_bridge_attach(dsi->encoder, dsi->bridge, NULL); + if (ret) { + dev_err(dev, "bridge attach failed: %d\n", ret); + return ret; + } } /* Disable the atomic helper calls into the bridge. We * manually call the bridge pre_enable / enable / etc. calls |