All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <architt@codeaurora.org>
To: dri-devel@lists.freedesktop.org
Cc: robdclark@gmail.com, linux-arm-msm@vger.kernel.org,
	hali@codeaurora.org, wentaox@codeaurora.org,
	sviau@codeaurora.org, jilaiw@codeaurora.org,
	Archit Taneja <architt@codeaurora.org>
Subject: [PATCH 2/5] drm/msm/dsi: Refer to connected device as 'device' instead of 'panel'
Date: Fri, 26 Jun 2015 13:15:11 +0530	[thread overview]
Message-ID: <1435304714-4684-3-git-send-email-architt@codeaurora.org> (raw)
In-Reply-To: <1435304714-4684-1-git-send-email-architt@codeaurora.org>

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: Archit Taneja <architt@codeaurora.org>
---
 drivers/gpu/drm/msm/dsi/dsi.c         |  2 +-
 drivers/gpu/drm/msm/dsi/dsi.h         |  2 +-
 drivers/gpu/drm/msm/dsi/dsi_host.c    | 31 +++++++++++++++++--------------
 drivers/gpu/drm/msm/dsi/dsi_manager.c |  4 ++--
 4 files changed, 21 insertions(+), 18 deletions(-)

diff --git a/drivers/gpu/drm/msm/dsi/dsi.c b/drivers/gpu/drm/msm/dsi/dsi.c
index 1f2561e..9f5fe59 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.c
+++ b/drivers/gpu/drm/msm/dsi/dsi.c
@@ -18,7 +18,7 @@ struct drm_encoder *msm_dsi_get_encoder(struct msm_dsi *msm_dsi)
 	if (!msm_dsi || !msm_dsi->panel)
 		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_CMD_ENCODER_ID];
 }
diff --git a/drivers/gpu/drm/msm/dsi/dsi.h b/drivers/gpu/drm/msm/dsi/dsi.h
index 5e29aad..2bf4859 100644
--- a/drivers/gpu/drm/msm/dsi/dsi.h
+++ b/drivers/gpu/drm/msm/dsi/dsi.h
@@ -59,7 +59,7 @@ struct msm_dsi {
 	struct mipi_dsi_host *host;
 	struct msm_dsi_phy *phy;
 	struct drm_panel *panel;
-	unsigned long panel_flags;
+	unsigned long device_flags;
 
 	struct device *phy_dev;
 	bool phy_enabled;
diff --git a/drivers/gpu/drm/msm/dsi/dsi_host.c b/drivers/gpu/drm/msm/dsi/dsi_host.c
index 3785083f..e5a44e7 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_host.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_host.c
@@ -213,8 +213,8 @@ struct msm_dsi_host {
 
 	struct drm_display_mode *mode;
 
-	/* Panel info */
-	struct device_node *panel_node;
+	/* connected device info */
+	struct device_node *device_node;
 	unsigned int channel;
 	unsigned int lanes;
 	enum mipi_dsi_pixel_format format;
@@ -1385,7 +1385,7 @@ static int dsi_host_attach(struct mipi_dsi_host *host,
 	msm_host->format = dsi->format;
 	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 */
 	ret = dsi_host_init_panel_gpios(msm_host, &dsi->dev);
@@ -1404,7 +1404,7 @@ static int dsi_host_detach(struct mipi_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);
 	if (msm_host->dev)
@@ -1439,7 +1439,7 @@ static int msm_dsi_host_parse_dt(struct msm_dsi_host *msm_host)
 {
 	struct device *dev = &msm_host->pdev->dev;
 	struct device_node *np = dev->of_node;
-	struct device_node *endpoint, *panel_node;
+	struct device_node *endpoint, *device_node;
 	int ret;
 
 	ret = of_property_read_u32(np, "qcom,dsi-host-index", &msm_host->id);
@@ -1451,7 +1451,7 @@ static int msm_dsi_host_parse_dt(struct msm_dsi_host *msm_host)
 
 	/*
 	 * get the first endpoint node. in our case, dsi has one output port
-	 * to which the panel is connected.
+	 * to which the device is connected.
 	 */
 	endpoint = of_graph_get_next_endpoint(np, NULL);
 	if (IS_ERR(endpoint)) {
@@ -1459,18 +1459,21 @@ static int msm_dsi_host_parse_dt(struct msm_dsi_host *msm_host)
 		return PTR_ERR(endpoint);
 	}
 
-	/* get panel node from the output port's endpoint data */
-	panel_node = of_graph_get_remote_port_parent(endpoint);
-	if (IS_ERR(panel_node)) {
+	/*
+	 * get connected device(panel/bridge) node from the output port's
+	 * endpoint data
+	 */
+	device_node = of_graph_get_remote_port_parent(endpoint);
+	if (IS_ERR(device_node)) {
 		dev_err(dev, "%s: no valid device\n", __func__);
 		of_node_put(endpoint);
-		return PTR_ERR(panel_node);
+		return PTR_ERR(device_node);
 	}
 
 	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;
 }
@@ -1622,7 +1625,7 @@ int msm_dsi_host_register(struct mipi_dsi_host *host, bool check_defer)
 		 * create framebuffer.
 		 */
 		if (check_defer) {
-			if (!of_drm_find_panel(msm_host->panel_node))
+			if (!of_drm_find_panel(msm_host->device_node))
 				return -EPROBE_DEFER;
 		}
 	}
@@ -2032,7 +2035,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 drm_panel *panel;
 
-	panel = of_drm_find_panel(msm_host->panel_node);
+	panel = of_drm_find_panel(msm_host->device_node);
 	if (panel_flags)
 			*panel_flags = msm_host->mode_flags;
 
diff --git a/drivers/gpu/drm/msm/dsi/dsi_manager.c b/drivers/gpu/drm/msm/dsi/dsi_manager.c
index bd247b7..ec8db80 100644
--- a/drivers/gpu/drm/msm/dsi/dsi_manager.c
+++ b/drivers/gpu/drm/msm/dsi/dsi_manager.c
@@ -156,7 +156,7 @@ static enum drm_connector_status dsi_mgr_connector_detect(
 	DBG("id=%d", id);
 	if (!msm_dsi->panel) {
 		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
 		 * for dual DSI mode. Therefore slave dsi should get
@@ -177,7 +177,7 @@ static enum drm_connector_status dsi_mgr_connector_detect(
 		 */
 		if (msm_dsi->panel && IS_DUAL_DSI() &&
 			other_dsi && other_dsi->panel) {
-			bool cmd_mode = !(msm_dsi->panel_flags &
+			bool cmd_mode = !(msm_dsi->device_flags &
 						MIPI_DSI_MODE_VIDEO);
 			struct drm_encoder *encoder = msm_dsi_get_encoder(
 					dsi_mgr_get_dsi(DSI_ENCODER_MASTER));
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
hosted by The Linux Foundation

  parent reply	other threads:[~2015-06-26  7:45 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-06-26  7:45 [PATCH 0/5] drm/msm/dsi: Add support for external bridge chips Archit Taneja
2015-06-26  7:45 ` [PATCH 1/5] drm/msm/dsi: Make TE gpio optional Archit Taneja
2015-06-26  7:45 ` Archit Taneja [this message]
2015-06-26  7:45 ` [PATCH 3/5] drm/msm/dsi: Create a helper to check if there is a connected device Archit Taneja
2015-06-26  7:45 ` [PATCH 4/5] drm/msm/dsi: Allow dsi to connect to an external bridge Archit Taneja
2015-06-26  7:45 ` [PATCH 5/5] drm/msm/dsi: Modify dsi manager bridge ops to work with external bridges Archit Taneja
2015-08-02 16:20 ` [PATCH v2 0/5] drm/msm/dsi: Add support for external bridge chips Archit Taneja
2015-08-02 16:20   ` [PATCH v2 1/5] drm/msm/dsi: Make TE gpio optional Archit Taneja
2015-08-02 16:20   ` [PATCH v2 2/5] drm/msm/dsi: Refer to connected device as 'device' instead of 'panel' Archit Taneja
2015-08-02 16:20   ` [PATCH v2 3/5] drm/msm/dsi: Create a helper to check if there is a connected device Archit Taneja
2015-08-02 16:20   ` [PATCH v2 4/5] drm/msm/dsi: Allow dsi to connect to an external bridge Archit Taneja
2015-08-02 16:20   ` [PATCH v2 5/5] drm/msm/dsi: Modify dsi manager bridge ops to work with external bridges Archit Taneja

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1435304714-4684-3-git-send-email-architt@codeaurora.org \
    --to=architt@codeaurora.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=hali@codeaurora.org \
    --cc=jilaiw@codeaurora.org \
    --cc=linux-arm-msm@vger.kernel.org \
    --cc=robdclark@gmail.com \
    --cc=sviau@codeaurora.org \
    --cc=wentaox@codeaurora.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.