Commit a9ddac9c authored by Archit Taneja's avatar Archit Taneja Committed by Rob Clark

drm/msm/dsi: Refer to connected device as 'device' instead of 'panel'

We currently support only panels connected to dsi output. We're going to
also support external bridge chips now.

Change 'panel_node' to 'device_node' in the struct msm_dsi_host and
'panel_flags' to 'device_flags' in msm_dsi. This makes things sound a
bit more generic.
Signed-off-by: default avatarArchit Taneja <architt@codeaurora.org>
Signed-off-by: default avatarRob Clark <robdclark@gmail.com>
parent 60d05cb4
...@@ -18,7 +18,7 @@ struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi) ...@@ -18,7 +18,7 @@ struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi)
if (!msm_dsi || !msm_dsi->panel) if (!msm_dsi || !msm_dsi->panel)
return NULL; return NULL;
return (msm_dsi->panel_flags & MIPI_DSI_MODE_VIDEO) ? return (msm_dsi->device_flags & MIPI_DSI_MODE_VIDEO) ?
msm_dsi->encoders[MSM_DSI_VIDEO_ENCODER_ID] : msm_dsi->encoders[MSM_DSI_VIDEO_ENCODER_ID] :
msm_dsi->encoders[MSM_DSI_CMD_ENCODER_ID]; msm_dsi->encoders[MSM_DSI_CMD_ENCODER_ID];
} }
......
...@@ -60,7 +60,7 @@ struct msm_dsi { ...@@ -60,7 +60,7 @@ struct msm_dsi {
struct mipi_dsi_host *host; struct mipi_dsi_host *host;
struct msm_dsi_phy *phy; struct msm_dsi_phy *phy;
struct drm_panel *panel; struct drm_panel *panel;
unsigned long panel_flags; unsigned long device_flags;
struct device *phy_dev; struct device *phy_dev;
bool phy_enabled; bool phy_enabled;
......
...@@ -232,8 +232,8 @@ struct msm_dsi_host { ...@@ -232,8 +232,8 @@ struct msm_dsi_host {
struct drm_display_mode *mode; struct drm_display_mode *mode;
/* Panel info */ /* connected device info */
struct device_node *panel_node; struct device_node *device_node;
unsigned int channel; unsigned int channel;
unsigned int lanes; unsigned int lanes;
enum mipi_dsi_pixel_format format; enum mipi_dsi_pixel_format format;
...@@ -1404,7 +1404,7 @@ static int dsi_host_attach(struct mipi_dsi_host *host, ...@@ -1404,7 +1404,7 @@ static int dsi_host_attach(struct mipi_dsi_host *host,
msm_host->format = dsi->format; msm_host->format = dsi->format;
msm_host->mode_flags = dsi->mode_flags; msm_host->mode_flags = dsi->mode_flags;
WARN_ON(dsi->dev.of_node != msm_host->panel_node); WARN_ON(dsi->dev.of_node != msm_host->device_node);
/* Some gpios defined in panel DT need to be controlled by host */ /* Some gpios defined in panel DT need to be controlled by host */
ret = dsi_host_init_panel_gpios(msm_host, &dsi->dev); ret = dsi_host_init_panel_gpios(msm_host, &dsi->dev);
...@@ -1423,7 +1423,7 @@ static int dsi_host_detach(struct mipi_dsi_host *host, ...@@ -1423,7 +1423,7 @@ static int dsi_host_detach(struct mipi_dsi_host *host,
{ {
struct msm_dsi_host *msm_host = to_msm_dsi_host(host); struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
msm_host->panel_node = NULL; msm_host->device_node = NULL;
DBG("id=%d", msm_host->id); DBG("id=%d", msm_host->id);
if (msm_host->dev) if (msm_host->dev)
...@@ -1458,7 +1458,7 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host) ...@@ -1458,7 +1458,7 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
{ {
struct device *dev = &msm_host->pdev->dev; struct device *dev = &msm_host->pdev->dev;
struct device_node *np = dev->of_node; struct device_node *np = dev->of_node;
struct device_node *endpoint, *panel_node; struct device_node *endpoint, *device_node;
int ret; int ret;
ret = of_property_read_u32(np, "qcom,dsi-host-index", &msm_host->id); ret = of_property_read_u32(np, "qcom,dsi-host-index", &msm_host->id);
...@@ -1481,17 +1481,17 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host) ...@@ -1481,17 +1481,17 @@ static int dsi_host_parse_dt(struct msm_dsi_host *msm_host)
} }
/* Get panel node from the output port's endpoint data */ /* Get panel node from the output port's endpoint data */
panel_node = of_graph_get_remote_port_parent(endpoint); device_node = of_graph_get_remote_port_parent(endpoint);
if (!panel_node) { if (!device_node) {
dev_err(dev, "%s: no valid device\n", __func__); dev_err(dev, "%s: no valid device\n", __func__);
of_node_put(endpoint); of_node_put(endpoint);
return -ENODEV; return -ENODEV;
} }
of_node_put(endpoint); of_node_put(endpoint);
of_node_put(panel_node); of_node_put(device_node);
msm_host->panel_node = panel_node; msm_host->device_node = device_node;
return 0; return 0;
} }
...@@ -1644,8 +1644,8 @@ int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer) ...@@ -1644,8 +1644,8 @@ int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
* Don't try to defer if there is nothing connected to the dsi * Don't try to defer if there is nothing connected to the dsi
* output * output
*/ */
if (check_defer && msm_host->panel_node) { if (check_defer && msm_host->device_node) {
if (!of_drm_find_panel(msm_host->panel_node)) if (!of_drm_find_panel(msm_host->device_node))
return -EPROBE_DEFER; return -EPROBE_DEFER;
} }
} }
...@@ -2066,7 +2066,7 @@ struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host, ...@@ -2066,7 +2066,7 @@ struct drm_panel *msm_dsi_host_get_panel(struct mipi_dsi_host *host,
struct msm_dsi_host *msm_host = to_msm_dsi_host(host); struct msm_dsi_host *msm_host = to_msm_dsi_host(host);
struct drm_panel *panel; struct drm_panel *panel;
panel = of_drm_find_panel(msm_host->panel_node); panel = of_drm_find_panel(msm_host->device_node);
if (panel_flags) if (panel_flags)
*panel_flags = msm_host->mode_flags; *panel_flags = msm_host->mode_flags;
......
...@@ -156,7 +156,7 @@ static enum drm_connector_status dsi_mgr_connector_detect( ...@@ -156,7 +156,7 @@ static enum drm_connector_status dsi_mgr_connector_detect(
DBG("id=%d", id); DBG("id=%d", id);
if (!msm_dsi->panel) { if (!msm_dsi->panel) {
msm_dsi->panel = msm_dsi_host_get_panel(msm_dsi->host, msm_dsi->panel = msm_dsi_host_get_panel(msm_dsi->host,
&msm_dsi->panel_flags); &msm_dsi->device_flags);
/* There is only 1 panel in the global panel list /* There is only 1 panel in the global panel list
* for dual DSI mode. Therefore slave dsi should get * for dual DSI mode. Therefore slave dsi should get
...@@ -177,7 +177,7 @@ static enum drm_connector_status dsi_mgr_connector_detect( ...@@ -177,7 +177,7 @@ static enum drm_connector_status dsi_mgr_connector_detect(
*/ */
if (msm_dsi->panel && IS_DUAL_DSI() && if (msm_dsi->panel && IS_DUAL_DSI() &&
other_dsi && other_dsi->panel) { other_dsi && other_dsi->panel) {
bool cmd_mode = !(msm_dsi->panel_flags & bool cmd_mode = !(msm_dsi->device_flags &
MIPI_DSI_MODE_VIDEO); MIPI_DSI_MODE_VIDEO);
struct drm_encoder *encoder = msm_dsi_get_encoder( struct drm_encoder *encoder = msm_dsi_get_encoder(
dsi_mgr_get_dsi(DSI_ENCODER_MASTER)); dsi_mgr_get_dsi(DSI_ENCODER_MASTER));
......
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