aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-02-23 06:00:51 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-11 07:44:52 -0400
commitc018c6738bdae8c9f49766fd3d8b3770be2572f9 (patch)
treecca221bd0afb92d5acaffad11bcad984cef90c1d /drivers/video/omap2
parentd64f14e191310570264454998201a84d211f30aa (diff)
OMAPDSS: change default_device handling
We currently have a two ways to set a "default panel device" for dss, to which the overlays are connected when the omapdss driver is loaded: - in textual format (name of the display) as cmdline parameter - as a pointer to the panel device from board file via pdata The current code handles this in a bit too complex way by using both of the above methods during runtime. However, with DT we don't have pdata anymore, so the code handling the second case won't work anymore. The current code has also the problem that it modifies the platform_data. This patch simplifies the code a bit by using the pointer method only inside the probe function, and stores the name of the panel device. This way we only need to handle the textual format during operation and also avoid modifying the platform_data. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/core.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 9b84f134357e..c3566a05d168 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -43,6 +43,8 @@ static struct {
43 43
44 struct regulator *vdds_dsi_reg; 44 struct regulator *vdds_dsi_reg;
45 struct regulator *vdds_sdi_reg; 45 struct regulator *vdds_sdi_reg;
46
47 const char *default_display_name;
46} core; 48} core;
47 49
48static char *def_disp_name; 50static char *def_disp_name;
@@ -222,6 +224,11 @@ static int __init omap_dss_probe(struct platform_device *pdev)
222 if (r) 224 if (r)
223 goto err_debugfs; 225 goto err_debugfs;
224 226
227 if (def_disp_name)
228 core.default_display_name = def_disp_name;
229 else if (pdata->default_device)
230 core.default_display_name = pdata->default_device->name;
231
225 for (i = 0; i < pdata->num_devices; ++i) { 232 for (i = 0; i < pdata->num_devices; ++i) {
226 struct omap_dss_device *dssdev = pdata->devices[i]; 233 struct omap_dss_device *dssdev = pdata->devices[i];
227 234
@@ -235,9 +242,6 @@ static int __init omap_dss_probe(struct platform_device *pdev)
235 242
236 goto err_register; 243 goto err_register;
237 } 244 }
238
239 if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
240 pdata->default_device = dssdev;
241 } 245 }
242 246
243 return 0; 247 return 0;
@@ -360,7 +364,6 @@ static int dss_driver_probe(struct device *dev)
360 int r; 364 int r;
361 struct omap_dss_driver *dssdrv = to_dss_driver(dev->driver); 365 struct omap_dss_driver *dssdrv = to_dss_driver(dev->driver);
362 struct omap_dss_device *dssdev = to_dss_device(dev); 366 struct omap_dss_device *dssdev = to_dss_device(dev);
363 struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
364 bool force; 367 bool force;
365 368
366 DSSDBG("driver_probe: dev %s/%s, drv %s\n", 369 DSSDBG("driver_probe: dev %s/%s, drv %s\n",
@@ -369,7 +372,8 @@ static int dss_driver_probe(struct device *dev)
369 372
370 dss_init_device(core.pdev, dssdev); 373 dss_init_device(core.pdev, dssdev);
371 374
372 force = pdata->default_device == dssdev; 375 force = core.default_display_name &&
376 strcmp(core.default_display_name, dssdev->name) == 0;
373 dss_recheck_connections(dssdev, force); 377 dss_recheck_connections(dssdev, force);
374 378
375 r = dssdrv->probe(dssdev); 379 r = dssdrv->probe(dssdev);