Thread (74 messages) 74 messages, 3 authors, 2012-09-03

Re: [PATCH 02/23] OMAPDSS: outputs: Create and initialize output instances

flat view

From: Tomi Valkeinen <hidden>
Date: 2012-08-24 13:14:02
Also in: linux-omap

On Tue, 2012-08-21 at 11:28 +0530, Archit Taneja wrote:
Create output instances by having an init function in the probes of the platform
device drivers for different interfaces. Create a small function for each
interface to initialize the output entity's fields type and id.

In the probe of each interface driver, the output entities are created before
the *_probe_pdata() functions intentionally. This is done to ensure that the
output entity is prepared before the panels connected to the output are
registered. We need the output entities to be ready because OMAPDSS will try
to make connections between overlays, managers, outputs and devices during the
panel's probe.
You're referring to the recheck_connections stuff? I have a patch that
moves that to omapfb side. But of course it doesn't hurt to initialize
the output early.

We should generally do the initialization in output driver's probe more
or less so that we first setup everything related to the output driver,
and after that we register the dssdevs. But I think that's what is
already done.

So, no complaints =).
quoted hunk ↗ jump to hunk
Signed-off-by: Archit Taneja <redacted>
---
 drivers/video/omap2/dss/dpi.c  |   20 ++++++++++++++++++++
 drivers/video/omap2/dss/dsi.c  |   26 ++++++++++++++++++++++++--
 drivers/video/omap2/dss/hdmi.c |   18 ++++++++++++++++++
 drivers/video/omap2/dss/rfbi.c |   19 +++++++++++++++++++
 drivers/video/omap2/dss/sdi.c  |   20 ++++++++++++++++++++
 drivers/video/omap2/dss/venc.c |   20 ++++++++++++++++++++
 6 files changed, 121 insertions(+), 2 deletions(-)
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index f260343..4eca2e7 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -408,10 +408,30 @@ static void __init dpi_probe_pdata(struct platform_device *pdev)
 	}
 }
 
+static int __init dpi_init_output(struct platform_device *pdev)
+{
+	struct omap_dss_output *out;
+
+	out = dss_create_output(pdev);
+	if (!out)
+		return -ENOMEM;
+
+	out->id = OMAP_DSS_OUTPUT_DPI;
+	out->type = OMAP_DISPLAY_TYPE_DPI;
+
+	return 0;
+}
+
 static int __init omap_dpi_probe(struct platform_device *pdev)
 {
+	int r;
+
 	mutex_init(&dpi.lock);
 
+	r = dpi_init_output(pdev);
+	if (r)
+		return r;
+
 	dpi_probe_pdata(pdev);
 
 	return 0;
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 659b6cd..22e0873 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -4903,6 +4903,23 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev)
 	}
 }
 
+static int __init dsi_init_output(struct platform_device *dsidev,
+		struct dsi_data *dsi)
+{
+	struct omap_dss_output *out;
+
+	out = dss_create_output(dsidev);
+	if (!out)
+		return -ENOMEM;
+
+	out->id = dsi->module_id == 0 ?
+			OMAP_DSS_OUTPUT_DSI1 : OMAP_DSS_OUTPUT_DSI2;
+
+	out->type = OMAP_DISPLAY_TYPE_DSI;
+
+	return 0;
As I mentioned in the last email, I think this could be something like:

struct omap_dss_output *out = &dsi->output;

out->pdev = dsidev;
out->id = xxx;
out->type = yyy;
dss_register_output(out);

quoted hunk ↗ jump to hunk
+}
+
 /* DSI1 HW IP initialisation */
 static int __init omap_dsihw_probe(struct platform_device *dsidev)
 {
@@ -4997,10 +5014,14 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
 	else
 		dsi->num_lanes_supported = 3;
 
-	dsi_probe_pdata(dsidev);
-
 	dsi_runtime_put(dsidev);
 
+	r = dsi_init_output(dsidev, dsi);
+	if (r)
+		goto err_init_output;
+
+	dsi_probe_pdata(dsidev);
+
Why do you change the sequence here? Isn't it enough to just add the
init_output before probe_pdata?

 Tomi

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help