All of lore.kernel.org
 help / color / mirror / Atom feed
From: Archit Taneja <archit@ti.com>
To: tomi.valkeinen@ti.com
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	rob@ti.com, sumit.semwal@ti.com, Archit Taneja <archit@ti.com>
Subject: [PATCH 17/23] OMAPDSS: HDMI: Pass outputs from panel driver to HDMI interface driver
Date: Tue, 21 Aug 2012 06:10:24 +0000	[thread overview]
Message-ID: <1345528711-27801-18-git-send-email-archit@ti.com> (raw)
In-Reply-To: <1345528711-27801-1-git-send-email-archit@ti.com>

With outputs introduces as new entities, we can now pass output pointer to
functions used to configure the connected interface. These functions currently
pass the omap_dss_device pointer, and extract output information via
omap_dss_device. This is unnecessary, and it doesn't make sense for interface
related functions to get the panel's/device's pointer, it should receive a
pointer related to the connected interface, which in our case is the output
entity.

With the addition of outputs. There is a possibility that an omap_dss_device
isn't connected to an output yet. Ensure that panel drivers call the interface
functions only if outputs are non NULL.

Modify HDMI functions to pass omap_dss_output pointer instead of omap_dss_device
pointer. Modify the panel drivers to call the updated functions.

Signed-off-by: Archit Taneja <archit@ti.com>
---
 drivers/video/omap2/dss/dss.h        |   10 +++----
 drivers/video/omap2/dss/hdmi.c       |   50 +++++++++++++++++++---------------
 drivers/video/omap2/dss/hdmi_panel.c |   47 ++++++++++++++++++++++++--------
 3 files changed, 69 insertions(+), 38 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 5fd3cc5..bfa8b4d 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -503,12 +503,12 @@ static inline unsigned long hdmi_get_pixel_clock(void)
 	return 0;
 }
 #endif
-int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev);
-void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
-void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
+int omapdss_hdmi_display_enable(struct omap_dss_output *out);
+void omapdss_hdmi_display_disable(struct omap_dss_output *out);
+void omapdss_hdmi_display_set_timing(struct omap_dss_output *out,
+		struct omap_video_timings *timings);
+int omapdss_hdmi_display_check_timing(struct omap_dss_output *out,
 		struct omap_video_timings *timings);
-int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
-					struct omap_video_timings *timings);
 int omapdss_hdmi_read_edid(u8 *buf, int len);
 bool omapdss_hdmi_detect(void);
 int hdmi_panel_init(void);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index d32dbc3..16b745c 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -405,9 +405,10 @@ unsigned long hdmi_get_pixel_clock(void)
 	return hdmi.ip_data.cfg.timings.pixel_clock * 1000;
 }
 
-static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
+static void hdmi_compute_pll(struct omap_dss_output *out, int phy,
 		struct hdmi_pll_info *pi)
 {
+	struct omap_dss_device *dssdev = out->device;
 	unsigned long clkin, refclk;
 	u32 mf;
 
@@ -456,7 +457,7 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
 	DSSDBG("range = %d sd = %d\n", pi->dcofreq, pi->regsd);
 }
 
-static int hdmi_power_on(struct omap_dss_device *dssdev)
+static int hdmi_power_on(struct omap_dss_output *out)
 {
 	int r;
 	struct omap_video_timings *p;
@@ -466,7 +467,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
 	if (r)
 		return r;
 
-	dss_mgr_disable(dssdev->manager);
+	dss_mgr_disable(out->manager);
 
 	p = &hdmi.ip_data.cfg.timings;
 
@@ -474,7 +475,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
 
 	phy = p->pixel_clock;
 
-	hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data);
+	hdmi_compute_pll(out, phy, &hdmi.ip_data.pll_data);
 
 	hdmi.ip_data.ops->video_disable(&hdmi.ip_data);
 
@@ -502,19 +503,19 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
 	 * dynamically by user. This can be moved to single location , say
 	 * Boardfile.
 	 */
-	dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src);
+	dss_select_dispc_clk_source(out->device->clocks.dispc.dispc_fclk_src);
 
 	/* bypass TV gamma table */
 	dispc_enable_gamma_table(0);
 
 	/* tv size */
-	dss_mgr_set_timings(dssdev->manager, p);
+	dss_mgr_set_timings(out->manager, p);
 
 	r = hdmi.ip_data.ops->video_enable(&hdmi.ip_data);
 	if (r)
 		goto err_vid_enable;
 
-	r = dss_mgr_enable(dssdev->manager);
+	r = dss_mgr_enable(out->manager);
 	if (r)
 		goto err_mgr_enable;
 
@@ -531,9 +532,9 @@ err:
 	return -EIO;
 }
 
-static void hdmi_power_off(struct omap_dss_device *dssdev)
+static void hdmi_power_off(struct omap_dss_output *out)
 {
-	dss_mgr_disable(dssdev->manager);
+	dss_mgr_disable(out->manager);
 
 	hdmi.ip_data.ops->video_disable(&hdmi.ip_data);
 	hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
@@ -541,8 +542,8 @@ static void hdmi_power_off(struct omap_dss_device *dssdev)
 	hdmi_runtime_put();
 }
 
-int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
-					struct omap_video_timings *timings)
+int omapdss_hdmi_display_check_timing(struct omap_dss_output *out,
+		struct omap_video_timings *timings)
 {
 	struct hdmi_cm cm;
 
@@ -555,7 +556,7 @@ int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
 
 }
 
-void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
+void omapdss_hdmi_display_set_timing(struct omap_dss_output *out,
 		struct omap_video_timings *timings)
 {
 	struct hdmi_cm cm;
@@ -570,16 +571,16 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
 	if (t != NULL)
 		hdmi.ip_data.cfg = *t;
 
-	if (dssdev->state = OMAP_DSS_DISPLAY_ACTIVE) {
+	if (out->device->state = OMAP_DSS_DISPLAY_ACTIVE) {
 		int r;
 
-		hdmi_power_off(dssdev);
+		hdmi_power_off(out);
 
-		r = hdmi_power_on(dssdev);
+		r = hdmi_power_on(out);
 		if (r)
 			DSSERR("failed to power on device\n");
 	} else {
-		dss_mgr_set_timings(dssdev->manager, &t->timings);
+		dss_mgr_set_timings(out->manager, &t->timings);
 	}
 
 	mutex_unlock(&hdmi.lock);
@@ -635,21 +636,24 @@ bool omapdss_hdmi_detect(void)
 	return r = 1;
 }
 
-int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)
+int omapdss_hdmi_display_enable(struct omap_dss_output *out)
 {
-	struct omap_dss_hdmi_data *priv = dssdev->data;
+	struct omap_dss_device *dssdev = out->device;
+	struct omap_dss_hdmi_data *priv;
 	int r = 0;
 
 	DSSDBG("ENTER hdmi_display_enable\n");
 
 	mutex_lock(&hdmi.lock);
 
-	if (dssdev->manager = NULL) {
+	if (out = NULL || out->manager = NULL || dssdev = NULL) {
 		DSSERR("failed to enable display: no manager\n");
 		r = -ENODEV;
 		goto err0;
 	}
 
+	priv = dssdev->data;
+
 	hdmi.ip_data.hpd_gpio = priv->hpd_gpio;
 
 	r = omap_dss_start_device(dssdev);
@@ -666,7 +670,7 @@ int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)
 		}
 	}
 
-	r = hdmi_power_on(dssdev);
+	r = hdmi_power_on(out);
 	if (r) {
 		DSSERR("failed to power on device\n");
 		goto err2;
@@ -685,13 +689,15 @@ err0:
 	return r;
 }
 
-void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
+void omapdss_hdmi_display_disable(struct omap_dss_output *out)
 {
+	struct omap_dss_device *dssdev = out->device;
+
 	DSSDBG("Enter hdmi_display_disable\n");
 
 	mutex_lock(&hdmi.lock);
 
-	hdmi_power_off(dssdev);
+	hdmi_power_off(out);
 
 	if (dssdev->platform_disable)
 		dssdev->platform_disable(dssdev);
diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c
index 2feb2cd..fb35bbb 100644
--- a/drivers/video/omap2/dss/hdmi_panel.c
+++ b/drivers/video/omap2/dss/hdmi_panel.c
@@ -233,9 +233,13 @@ static int hdmi_panel_audio_config(struct omap_dss_device *dssdev,
 
 static int hdmi_panel_enable(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r = 0;
 	DSSDBG("ENTER hdmi_panel_enable\n");
 
+	if (out = NULL)
+		return -ENODEV;
+
 	mutex_lock(&hdmi.lock);
 
 	if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
@@ -243,9 +247,9 @@ static int hdmi_panel_enable(struct omap_dss_device *dssdev)
 		goto err;
 	}
 
-	omapdss_hdmi_display_set_timing(dssdev, &dssdev->panel.timings);
+	omapdss_hdmi_display_set_timing(out, &dssdev->panel.timings);
 
-	r = omapdss_hdmi_display_enable(dssdev);
+	r = omapdss_hdmi_display_enable(out);
 	if (r) {
 		DSSERR("failed to power on\n");
 		goto err;
@@ -261,6 +265,7 @@ err:
 
 static void hdmi_panel_disable(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	mutex_lock(&hdmi.lock);
 
 	if (dssdev->state = OMAP_DSS_DISPLAY_ACTIVE) {
@@ -270,7 +275,7 @@ static void hdmi_panel_disable(struct omap_dss_device *dssdev)
 		 * machine.
 		 */
 		hdmi_panel_audio_disable(dssdev);
-		omapdss_hdmi_display_disable(dssdev);
+		omapdss_hdmi_display_disable(out);
 	}
 
 	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
@@ -280,6 +285,7 @@ static void hdmi_panel_disable(struct omap_dss_device *dssdev)
 
 static int hdmi_panel_suspend(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r = 0;
 
 	mutex_lock(&hdmi.lock);
@@ -296,7 +302,7 @@ static int hdmi_panel_suspend(struct omap_dss_device *dssdev)
 	hdmi_panel_audio_disable(dssdev);
 
 	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	omapdss_hdmi_display_disable(dssdev);
+	omapdss_hdmi_display_disable(out);
 
 err:
 	mutex_unlock(&hdmi.lock);
@@ -306,6 +312,7 @@ err:
 
 static int hdmi_panel_resume(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r = 0;
 
 	mutex_lock(&hdmi.lock);
@@ -315,7 +322,7 @@ static int hdmi_panel_resume(struct omap_dss_device *dssdev)
 		goto err;
 	}
 
-	r = omapdss_hdmi_display_enable(dssdev);
+	r = omapdss_hdmi_display_enable(out);
 	if (r) {
 		DSSERR("failed to power on\n");
 		goto err;
@@ -343,8 +350,13 @@ static void hdmi_get_timings(struct omap_dss_device *dssdev,
 static void hdmi_set_timings(struct omap_dss_device *dssdev,
 			struct omap_video_timings *timings)
 {
+	struct omap_dss_output *out = dssdev->output;
+
 	DSSDBG("hdmi_set_timings\n");
 
+	if (out = NULL)
+		return;
+
 	mutex_lock(&hdmi.lock);
 
 	/*
@@ -353,7 +365,8 @@ static void hdmi_set_timings(struct omap_dss_device *dssdev,
 	 */
 	hdmi_panel_audio_disable(dssdev);
 
-	omapdss_hdmi_display_set_timing(dssdev, timings);
+	omapdss_hdmi_display_set_timing(out, timings);
+
 	dssdev->panel.timings = *timings;
 
 	mutex_unlock(&hdmi.lock);
@@ -362,13 +375,17 @@ static void hdmi_set_timings(struct omap_dss_device *dssdev,
 static int hdmi_check_timings(struct omap_dss_device *dssdev,
 			struct omap_video_timings *timings)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r = 0;
 
 	DSSDBG("hdmi_check_timings\n");
 
+	if (out = NULL)
+		return -ENODEV;
+
 	mutex_lock(&hdmi.lock);
 
-	r = omapdss_hdmi_display_check_timing(dssdev, timings);
+	r = omapdss_hdmi_display_check_timing(out, timings);
 
 	mutex_unlock(&hdmi.lock);
 	return r;
@@ -376,12 +393,16 @@ static int hdmi_check_timings(struct omap_dss_device *dssdev,
 
 static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r;
 
+	if (out = NULL)
+		return -ENODEV;
+
 	mutex_lock(&hdmi.lock);
 
 	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
-		r = omapdss_hdmi_display_enable(dssdev);
+		r = omapdss_hdmi_display_enable(out);
 		if (r)
 			goto err;
 	}
@@ -390,7 +411,7 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
 
 	if (dssdev->state = OMAP_DSS_DISPLAY_DISABLED ||
 			dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED)
-		omapdss_hdmi_display_disable(dssdev);
+		omapdss_hdmi_display_disable(out);
 err:
 	mutex_unlock(&hdmi.lock);
 
@@ -399,12 +420,16 @@ err:
 
 static bool hdmi_detect(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r;
 
+	if (out = NULL)
+		return false;
+
 	mutex_lock(&hdmi.lock);
 
 	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
-		r = omapdss_hdmi_display_enable(dssdev);
+		r = omapdss_hdmi_display_enable(out);
 		if (r)
 			goto err;
 	}
@@ -413,7 +438,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev)
 
 	if (dssdev->state = OMAP_DSS_DISPLAY_DISABLED ||
 			dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED)
-		omapdss_hdmi_display_disable(dssdev);
+		omapdss_hdmi_display_disable(out);
 err:
 	mutex_unlock(&hdmi.lock);
 
-- 
1.7.9.5


WARNING: multiple messages have this Message-ID (diff)
From: Archit Taneja <archit@ti.com>
To: tomi.valkeinen@ti.com
Cc: linux-omap@vger.kernel.org, linux-fbdev@vger.kernel.org,
	rob@ti.com, sumit.semwal@ti.com, Archit Taneja <archit@ti.com>
Subject: [PATCH 17/23] OMAPDSS: HDMI: Pass outputs from panel driver to HDMI interface driver
Date: Tue, 21 Aug 2012 11:28:24 +0530	[thread overview]
Message-ID: <1345528711-27801-18-git-send-email-archit@ti.com> (raw)
In-Reply-To: <1345528711-27801-1-git-send-email-archit@ti.com>

With outputs introduces as new entities, we can now pass output pointer to
functions used to configure the connected interface. These functions currently
pass the omap_dss_device pointer, and extract output information via
omap_dss_device. This is unnecessary, and it doesn't make sense for interface
related functions to get the panel's/device's pointer, it should receive a
pointer related to the connected interface, which in our case is the output
entity.

With the addition of outputs. There is a possibility that an omap_dss_device
isn't connected to an output yet. Ensure that panel drivers call the interface
functions only if outputs are non NULL.

Modify HDMI functions to pass omap_dss_output pointer instead of omap_dss_device
pointer. Modify the panel drivers to call the updated functions.

Signed-off-by: Archit Taneja <archit@ti.com>
---
 drivers/video/omap2/dss/dss.h        |   10 +++----
 drivers/video/omap2/dss/hdmi.c       |   50 +++++++++++++++++++---------------
 drivers/video/omap2/dss/hdmi_panel.c |   47 ++++++++++++++++++++++++--------
 3 files changed, 69 insertions(+), 38 deletions(-)

diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 5fd3cc5..bfa8b4d 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -503,12 +503,12 @@ static inline unsigned long hdmi_get_pixel_clock(void)
 	return 0;
 }
 #endif
-int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev);
-void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev);
-void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
+int omapdss_hdmi_display_enable(struct omap_dss_output *out);
+void omapdss_hdmi_display_disable(struct omap_dss_output *out);
+void omapdss_hdmi_display_set_timing(struct omap_dss_output *out,
+		struct omap_video_timings *timings);
+int omapdss_hdmi_display_check_timing(struct omap_dss_output *out,
 		struct omap_video_timings *timings);
-int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
-					struct omap_video_timings *timings);
 int omapdss_hdmi_read_edid(u8 *buf, int len);
 bool omapdss_hdmi_detect(void);
 int hdmi_panel_init(void);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index d32dbc3..16b745c 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -405,9 +405,10 @@ unsigned long hdmi_get_pixel_clock(void)
 	return hdmi.ip_data.cfg.timings.pixel_clock * 1000;
 }
 
-static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
+static void hdmi_compute_pll(struct omap_dss_output *out, int phy,
 		struct hdmi_pll_info *pi)
 {
+	struct omap_dss_device *dssdev = out->device;
 	unsigned long clkin, refclk;
 	u32 mf;
 
@@ -456,7 +457,7 @@ static void hdmi_compute_pll(struct omap_dss_device *dssdev, int phy,
 	DSSDBG("range = %d sd = %d\n", pi->dcofreq, pi->regsd);
 }
 
-static int hdmi_power_on(struct omap_dss_device *dssdev)
+static int hdmi_power_on(struct omap_dss_output *out)
 {
 	int r;
 	struct omap_video_timings *p;
@@ -466,7 +467,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
 	if (r)
 		return r;
 
-	dss_mgr_disable(dssdev->manager);
+	dss_mgr_disable(out->manager);
 
 	p = &hdmi.ip_data.cfg.timings;
 
@@ -474,7 +475,7 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
 
 	phy = p->pixel_clock;
 
-	hdmi_compute_pll(dssdev, phy, &hdmi.ip_data.pll_data);
+	hdmi_compute_pll(out, phy, &hdmi.ip_data.pll_data);
 
 	hdmi.ip_data.ops->video_disable(&hdmi.ip_data);
 
@@ -502,19 +503,19 @@ static int hdmi_power_on(struct omap_dss_device *dssdev)
 	 * dynamically by user. This can be moved to single location , say
 	 * Boardfile.
 	 */
-	dss_select_dispc_clk_source(dssdev->clocks.dispc.dispc_fclk_src);
+	dss_select_dispc_clk_source(out->device->clocks.dispc.dispc_fclk_src);
 
 	/* bypass TV gamma table */
 	dispc_enable_gamma_table(0);
 
 	/* tv size */
-	dss_mgr_set_timings(dssdev->manager, p);
+	dss_mgr_set_timings(out->manager, p);
 
 	r = hdmi.ip_data.ops->video_enable(&hdmi.ip_data);
 	if (r)
 		goto err_vid_enable;
 
-	r = dss_mgr_enable(dssdev->manager);
+	r = dss_mgr_enable(out->manager);
 	if (r)
 		goto err_mgr_enable;
 
@@ -531,9 +532,9 @@ err:
 	return -EIO;
 }
 
-static void hdmi_power_off(struct omap_dss_device *dssdev)
+static void hdmi_power_off(struct omap_dss_output *out)
 {
-	dss_mgr_disable(dssdev->manager);
+	dss_mgr_disable(out->manager);
 
 	hdmi.ip_data.ops->video_disable(&hdmi.ip_data);
 	hdmi.ip_data.ops->phy_disable(&hdmi.ip_data);
@@ -541,8 +542,8 @@ static void hdmi_power_off(struct omap_dss_device *dssdev)
 	hdmi_runtime_put();
 }
 
-int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
-					struct omap_video_timings *timings)
+int omapdss_hdmi_display_check_timing(struct omap_dss_output *out,
+		struct omap_video_timings *timings)
 {
 	struct hdmi_cm cm;
 
@@ -555,7 +556,7 @@ int omapdss_hdmi_display_check_timing(struct omap_dss_device *dssdev,
 
 }
 
-void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
+void omapdss_hdmi_display_set_timing(struct omap_dss_output *out,
 		struct omap_video_timings *timings)
 {
 	struct hdmi_cm cm;
@@ -570,16 +571,16 @@ void omapdss_hdmi_display_set_timing(struct omap_dss_device *dssdev,
 	if (t != NULL)
 		hdmi.ip_data.cfg = *t;
 
-	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
+	if (out->device->state == OMAP_DSS_DISPLAY_ACTIVE) {
 		int r;
 
-		hdmi_power_off(dssdev);
+		hdmi_power_off(out);
 
-		r = hdmi_power_on(dssdev);
+		r = hdmi_power_on(out);
 		if (r)
 			DSSERR("failed to power on device\n");
 	} else {
-		dss_mgr_set_timings(dssdev->manager, &t->timings);
+		dss_mgr_set_timings(out->manager, &t->timings);
 	}
 
 	mutex_unlock(&hdmi.lock);
@@ -635,21 +636,24 @@ bool omapdss_hdmi_detect(void)
 	return r == 1;
 }
 
-int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)
+int omapdss_hdmi_display_enable(struct omap_dss_output *out)
 {
-	struct omap_dss_hdmi_data *priv = dssdev->data;
+	struct omap_dss_device *dssdev = out->device;
+	struct omap_dss_hdmi_data *priv;
 	int r = 0;
 
 	DSSDBG("ENTER hdmi_display_enable\n");
 
 	mutex_lock(&hdmi.lock);
 
-	if (dssdev->manager == NULL) {
+	if (out == NULL || out->manager == NULL || dssdev == NULL) {
 		DSSERR("failed to enable display: no manager\n");
 		r = -ENODEV;
 		goto err0;
 	}
 
+	priv = dssdev->data;
+
 	hdmi.ip_data.hpd_gpio = priv->hpd_gpio;
 
 	r = omap_dss_start_device(dssdev);
@@ -666,7 +670,7 @@ int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)
 		}
 	}
 
-	r = hdmi_power_on(dssdev);
+	r = hdmi_power_on(out);
 	if (r) {
 		DSSERR("failed to power on device\n");
 		goto err2;
@@ -685,13 +689,15 @@ err0:
 	return r;
 }
 
-void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
+void omapdss_hdmi_display_disable(struct omap_dss_output *out)
 {
+	struct omap_dss_device *dssdev = out->device;
+
 	DSSDBG("Enter hdmi_display_disable\n");
 
 	mutex_lock(&hdmi.lock);
 
-	hdmi_power_off(dssdev);
+	hdmi_power_off(out);
 
 	if (dssdev->platform_disable)
 		dssdev->platform_disable(dssdev);
diff --git a/drivers/video/omap2/dss/hdmi_panel.c b/drivers/video/omap2/dss/hdmi_panel.c
index 2feb2cd..fb35bbb 100644
--- a/drivers/video/omap2/dss/hdmi_panel.c
+++ b/drivers/video/omap2/dss/hdmi_panel.c
@@ -233,9 +233,13 @@ static int hdmi_panel_audio_config(struct omap_dss_device *dssdev,
 
 static int hdmi_panel_enable(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r = 0;
 	DSSDBG("ENTER hdmi_panel_enable\n");
 
+	if (out == NULL)
+		return -ENODEV;
+
 	mutex_lock(&hdmi.lock);
 
 	if (dssdev->state != OMAP_DSS_DISPLAY_DISABLED) {
@@ -243,9 +247,9 @@ static int hdmi_panel_enable(struct omap_dss_device *dssdev)
 		goto err;
 	}
 
-	omapdss_hdmi_display_set_timing(dssdev, &dssdev->panel.timings);
+	omapdss_hdmi_display_set_timing(out, &dssdev->panel.timings);
 
-	r = omapdss_hdmi_display_enable(dssdev);
+	r = omapdss_hdmi_display_enable(out);
 	if (r) {
 		DSSERR("failed to power on\n");
 		goto err;
@@ -261,6 +265,7 @@ err:
 
 static void hdmi_panel_disable(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	mutex_lock(&hdmi.lock);
 
 	if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
@@ -270,7 +275,7 @@ static void hdmi_panel_disable(struct omap_dss_device *dssdev)
 		 * machine.
 		 */
 		hdmi_panel_audio_disable(dssdev);
-		omapdss_hdmi_display_disable(dssdev);
+		omapdss_hdmi_display_disable(out);
 	}
 
 	dssdev->state = OMAP_DSS_DISPLAY_DISABLED;
@@ -280,6 +285,7 @@ static void hdmi_panel_disable(struct omap_dss_device *dssdev)
 
 static int hdmi_panel_suspend(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r = 0;
 
 	mutex_lock(&hdmi.lock);
@@ -296,7 +302,7 @@ static int hdmi_panel_suspend(struct omap_dss_device *dssdev)
 	hdmi_panel_audio_disable(dssdev);
 
 	dssdev->state = OMAP_DSS_DISPLAY_SUSPENDED;
-	omapdss_hdmi_display_disable(dssdev);
+	omapdss_hdmi_display_disable(out);
 
 err:
 	mutex_unlock(&hdmi.lock);
@@ -306,6 +312,7 @@ err:
 
 static int hdmi_panel_resume(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r = 0;
 
 	mutex_lock(&hdmi.lock);
@@ -315,7 +322,7 @@ static int hdmi_panel_resume(struct omap_dss_device *dssdev)
 		goto err;
 	}
 
-	r = omapdss_hdmi_display_enable(dssdev);
+	r = omapdss_hdmi_display_enable(out);
 	if (r) {
 		DSSERR("failed to power on\n");
 		goto err;
@@ -343,8 +350,13 @@ static void hdmi_get_timings(struct omap_dss_device *dssdev,
 static void hdmi_set_timings(struct omap_dss_device *dssdev,
 			struct omap_video_timings *timings)
 {
+	struct omap_dss_output *out = dssdev->output;
+
 	DSSDBG("hdmi_set_timings\n");
 
+	if (out == NULL)
+		return;
+
 	mutex_lock(&hdmi.lock);
 
 	/*
@@ -353,7 +365,8 @@ static void hdmi_set_timings(struct omap_dss_device *dssdev,
 	 */
 	hdmi_panel_audio_disable(dssdev);
 
-	omapdss_hdmi_display_set_timing(dssdev, timings);
+	omapdss_hdmi_display_set_timing(out, timings);
+
 	dssdev->panel.timings = *timings;
 
 	mutex_unlock(&hdmi.lock);
@@ -362,13 +375,17 @@ static void hdmi_set_timings(struct omap_dss_device *dssdev,
 static int hdmi_check_timings(struct omap_dss_device *dssdev,
 			struct omap_video_timings *timings)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r = 0;
 
 	DSSDBG("hdmi_check_timings\n");
 
+	if (out == NULL)
+		return -ENODEV;
+
 	mutex_lock(&hdmi.lock);
 
-	r = omapdss_hdmi_display_check_timing(dssdev, timings);
+	r = omapdss_hdmi_display_check_timing(out, timings);
 
 	mutex_unlock(&hdmi.lock);
 	return r;
@@ -376,12 +393,16 @@ static int hdmi_check_timings(struct omap_dss_device *dssdev,
 
 static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r;
 
+	if (out == NULL)
+		return -ENODEV;
+
 	mutex_lock(&hdmi.lock);
 
 	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
-		r = omapdss_hdmi_display_enable(dssdev);
+		r = omapdss_hdmi_display_enable(out);
 		if (r)
 			goto err;
 	}
@@ -390,7 +411,7 @@ static int hdmi_read_edid(struct omap_dss_device *dssdev, u8 *buf, int len)
 
 	if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED ||
 			dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
-		omapdss_hdmi_display_disable(dssdev);
+		omapdss_hdmi_display_disable(out);
 err:
 	mutex_unlock(&hdmi.lock);
 
@@ -399,12 +420,16 @@ err:
 
 static bool hdmi_detect(struct omap_dss_device *dssdev)
 {
+	struct omap_dss_output *out = dssdev->output;
 	int r;
 
+	if (out == NULL)
+		return false;
+
 	mutex_lock(&hdmi.lock);
 
 	if (dssdev->state != OMAP_DSS_DISPLAY_ACTIVE) {
-		r = omapdss_hdmi_display_enable(dssdev);
+		r = omapdss_hdmi_display_enable(out);
 		if (r)
 			goto err;
 	}
@@ -413,7 +438,7 @@ static bool hdmi_detect(struct omap_dss_device *dssdev)
 
 	if (dssdev->state == OMAP_DSS_DISPLAY_DISABLED ||
 			dssdev->state == OMAP_DSS_DISPLAY_SUSPENDED)
-		omapdss_hdmi_display_disable(dssdev);
+		omapdss_hdmi_display_disable(out);
 err:
 	mutex_unlock(&hdmi.lock);
 
-- 
1.7.9.5


  parent reply	other threads:[~2012-08-21  6:10 UTC|newest]

Thread overview: 148+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-21  5:58 [PATCH 00/23] OMAPDSS: Create output entities Archit Taneja
2012-08-21  6:10 ` Archit Taneja
2012-08-21  5:58 ` [PATCH 01/23] OMAPDSS: outputs: Create a new entity called outputs Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-24 12:41   ` Tomi Valkeinen
2012-08-24 12:41     ` Tomi Valkeinen
2012-08-24 12:51     ` Archit Taneja
2012-08-24 12:53       ` Archit Taneja
2012-08-29 10:32       ` Tomi Valkeinen
2012-08-29 10:32         ` Tomi Valkeinen
2012-08-29 10:57         ` Archit Taneja
2012-08-29 10:58           ` Archit Taneja
2012-08-21  5:58 ` [PATCH 02/23] OMAPDSS: outputs: Create and initialize output instances Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-24 13:14   ` Tomi Valkeinen
2012-08-24 13:14     ` Tomi Valkeinen
2012-08-27  6:19     ` Archit Taneja
2012-08-27  6:31       ` Archit Taneja
2012-08-27  6:44       ` Tomi Valkeinen
2012-08-27  6:44         ` Tomi Valkeinen
2012-08-21  5:58 ` [PATCH 03/23] OMAPDSS: output: Add set/unset device ops for omap_dss_output Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 04/23] OMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 05/23] OMAPDSS: Remove manager->device references Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 06/23] OMAP_VOUT: " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 07/23] OMAPFB: remove " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 08/23] OMAPDRM: Remove " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 09/23] OMAPDSS: Create links between managers, outputs and devices Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 10/23] OMAPDSS: DPI: Pass outputs from panel driver to DPI interface driver Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 11/23] OMAPDSS: DSI: Remove dsi_pdev_map global struct Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 12/23] OMAPDSS: DSI: Pass outputs from panel driver to DSI interface driver Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 13/23] OMAPDSS: SDI: Pass outputs from panel driver to SDI " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 14/23] OMAPDSS: RFBI: Pass outputs from panel driver to RFBI " Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 15/23] OMAPDSS: RFBI: Add output pointers as arguments to all exported functions Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 16/23] OMAPDSS: VENC: Pass outputs from panel driver to VENC interface driver Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` Archit Taneja [this message]
2012-08-21  6:10   ` [PATCH 17/23] OMAPDSS: HDMI: Pass outputs from panel driver to HDMI " Archit Taneja
2012-08-21  5:58 ` [PATCH 18/23] OMAPDSS: HDMI: Add output pointers as arguments to all functions used by hdmi panel driver Archit Taneja
2012-08-21  6:10   ` [PATCH 18/23] OMAPDSS: HDMI: Add output pointers as arguments to all functions used by hdmi panel dr Archit Taneja
2012-08-21  5:58 ` [PATCH 19/23] OMAPDSS/OMAPFB: Change dssdev->manager references Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 20/23] OMAPDSS: MANAGER: Update display sysfs store Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 21/23] OMAPDSS: MANAGER: Get device via output Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 22/23] OMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-21  5:58 ` [PATCH 23/23] OMAPDSS: Remove old way of setting manager and device links Archit Taneja
2012-08-21  6:10   ` Archit Taneja
2012-08-30 11:40 ` [PATCH v2 00/23] OMAPDSS: Create output entities Archit Taneja
2012-08-30 11:52   ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 01/23] OMAPDSS: outputs: Create a new entity called outputs Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 02/23] OMAPDSS: outputs: Create and register output instances Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 11:57     ` Tomi Valkeinen
2012-08-31 11:57       ` Tomi Valkeinen
2012-08-31 12:03       ` Archit Taneja
2012-08-31 12:15         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 03/23] OMAPDSS: output: Add set/unset device ops for omap_dss_output Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 12:03     ` Tomi Valkeinen
2012-08-31 12:03       ` Tomi Valkeinen
2012-08-31 12:24       ` Archit Taneja
2012-08-31 12:36         ` Archit Taneja
2012-08-31 12:28         ` Tomi Valkeinen
2012-08-31 12:28           ` Tomi Valkeinen
2012-08-30 11:40   ` [PATCH v2 04/23] OMAPDSS: APPLY: Add manager set/unset output ops for omap_overlay_manager Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 05/23] OMAPDSS: Remove manager->device references Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 06/23] OMAP_VOUT: " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 12:11     ` Tomi Valkeinen
2012-08-31 12:11       ` Tomi Valkeinen
2012-08-31 12:34       ` Archit Taneja
2012-08-31 12:46         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 07/23] OMAPFB: remove " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 08/23] OMAPDRM: Remove " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 09/23] OMAPDSS: Create links between managers, outputs and devices Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 14:10     ` Tomi Valkeinen
2012-08-31 14:10       ` Tomi Valkeinen
2012-08-31 14:24       ` Archit Taneja
2012-08-31 14:36         ` Archit Taneja
2012-08-31 14:45         ` Tomi Valkeinen
2012-08-31 14:45           ` Tomi Valkeinen
2012-08-31 15:08           ` Tomi Valkeinen
2012-08-31 15:08             ` Tomi Valkeinen
2012-09-03  9:26             ` Archit Taneja
2012-09-03  9:38               ` Archit Taneja
2012-09-03  9:35               ` Tomi Valkeinen
2012-09-03  9:35                 ` Tomi Valkeinen
2012-08-30 11:40   ` [PATCH v2 10/23] OMAPDSS: DPI: Pass omap_dss_output within the driver Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 13:48     ` Tomi Valkeinen
2012-08-31 13:48       ` Tomi Valkeinen
2012-08-31 13:59       ` Archit Taneja
2012-08-31 14:00         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 11/23] OMAPDSS: DSI: Remove dsi_pdev_map global struct Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 12/23] OMAPDSS: DSI: Pass omap_dss_output within the driver Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 13/23] OMAPDSS: SDI: " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 14/23] OMAPDSS: RFBI: " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 15/23] OMAPDSS: RFBI: Add dssdev pointers as arguments to all exported functions Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 14:20     ` Tomi Valkeinen
2012-08-31 14:20       ` Tomi Valkeinen
2012-08-31 14:30       ` Archit Taneja
2012-08-31 14:42         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 16/23] OMAPDSS: VENC: Pass omap_dss_output within the driver Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 17/23] OMAPDSS: HDMI: " Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 18/23] OMAPDSS: HDMI: Add dssdev pointer as an argument to all functions used by hdmi panel driver Archit Taneja
2012-08-30 11:52     ` [PATCH v2 18/23] OMAPDSS: HDMI: Add dssdev pointer as an argument to all functions used by hdmi pane Archit Taneja
2012-08-30 11:40   ` [PATCH v2 19/23] OMAPDSS/OMAPFB: Change dssdev->manager references Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 20/23] OMAPDSS: MANAGER: Update display sysfs store Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-31 14:30     ` Tomi Valkeinen
2012-08-31 14:30       ` Tomi Valkeinen
2012-08-31 14:41       ` Archit Taneja
2012-08-31 14:53         ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 21/23] OMAPDSS: MANAGER: Get device via output Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 22/23] OMAPDSS: APPLY: Remove omap_dss_device references from dss_ovl_enable/disable Archit Taneja
2012-08-30 11:52     ` Archit Taneja
2012-08-30 11:40   ` [PATCH v2 23/23] OMAPDSS: Remove old way of setting manager and device links Archit Taneja
2012-08-30 11:52     ` 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=1345528711-27801-18-git-send-email-archit@ti.com \
    --to=archit@ti.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-omap@vger.kernel.org \
    --cc=rob@ti.com \
    --cc=sumit.semwal@ti.com \
    --cc=tomi.valkeinen@ti.com \
    /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.