During the mode set procedure, some dsi client device may detach
itself first and then attach it again according to the target
display mode parameters. In this case, the dsi client device
should be allowed to be re-attached again. So this is also true
for panel device.
Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit
f586625dd1a665c58b976405c7980b7414554481)
(cherry picked from commit
75f65aebfd661151811339d652e3704f5a7e3936)
struct device *dev = dsim->dev;
struct drm_panel *panel;
- /* Don't support multiple panels */
- if (dsim->panel)
- return -EBUSY;
-
if (!dsi->lanes || dsi->lanes > pdata->max_data_lanes) {
dev_err(dev, "invalid data lanes number\n");
return -EINVAL;
return -EINVAL;
}
- if (!dsim->next && !dsim->panel) {
+ if (!dsim->next) {
/* 'dsi' must be panel device */
panel = of_drm_find_panel(dsi->dev.of_node);
WARN_ON(!panel);
+ /* Don't support multiple panels */
+ if (dsim->panel && panel && dsim->panel != panel) {
+ dev_err(dev, "don't support multiple panels\n");
+ return -EBUSY;
+ }
+
dsim->panel = panel;
}