struct dw_mipi_dsi *dsi = host_to_dsi(host);
int lanes;
+ if (dsi->master)
+ return 0;
+
lanes = dsi->slave ? device->lanes / 2 : device->lanes;
if (lanes > dsi->pdata->max_data_lanes) {
dsi->slave->mode_flags = device->mode_flags;
}
+ dsi->panel = of_drm_find_panel(device->dev.of_node);
+ if (!dsi->panel) {
+ DRM_ERROR("failed to find panel\n");
+ return -ENODEV;
+ }
+
return 0;
}
if (dsi->master)
return 0;
- dsi->panel = of_drm_find_panel(dsi->panel_node);
if (!dsi->panel)
return -EPROBE_DEFER;
.unbind = dw_mipi_dsi_unbind,
};
-static int rockchip_dsi_parse_dt(struct dw_mipi_dsi *dsi)
-{
- struct device_node *np = dsi->dev->of_node;
- struct device_node *endpoint, *remote = NULL;
-
- endpoint = of_graph_get_endpoint_by_regs(np, 1, -1);
- if (endpoint) {
- remote = of_graph_get_remote_port_parent(endpoint);
- of_node_put(endpoint);
- if (!remote) {
- dev_err(dsi->dev, "No panel/bridge connected\n");
- return -ENODEV;
- }
- }
-
- dsi->panel_node = remote;
-
- return 0;
-}
-
static int rockchip_dsi_get_reset_handle(struct dw_mipi_dsi *dsi)
{
struct device *dev = dsi->dev;
dsi->dev = dev;
dsi->pdata = pdata;
- rockchip_dsi_parse_dt(dsi);
rockchip_dsi_ioremap_resource(pdev, dsi);
rockchip_dsi_clk_get(dsi);
rockchip_dsi_dphy_parse(dsi);