]> Pileus Git - ~andy/linux/commitdiff
OMAPDSS: change default_device handling
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 23 Feb 2012 11:00:51 +0000 (13:00 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 11 May 2012 11:44:52 +0000 (14:44 +0300)
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>
drivers/video/omap2/dss/core.c

index 9b84f134357e836b12dda7bdc5a253bce494d3c8..c3566a05d168c2a82aa37830375420845acdd846 100644 (file)
@@ -43,6 +43,8 @@ static struct {
 
        struct regulator *vdds_dsi_reg;
        struct regulator *vdds_sdi_reg;
+
+       const char *default_display_name;
 } core;
 
 static char *def_disp_name;
@@ -222,6 +224,11 @@ static int __init omap_dss_probe(struct platform_device *pdev)
        if (r)
                goto err_debugfs;
 
+       if (def_disp_name)
+               core.default_display_name = def_disp_name;
+       else if (pdata->default_device)
+               core.default_display_name = pdata->default_device->name;
+
        for (i = 0; i < pdata->num_devices; ++i) {
                struct omap_dss_device *dssdev = pdata->devices[i];
 
@@ -235,9 +242,6 @@ static int __init omap_dss_probe(struct platform_device *pdev)
 
                        goto err_register;
                }
-
-               if (def_disp_name && strcmp(def_disp_name, dssdev->name) == 0)
-                       pdata->default_device = dssdev;
        }
 
        return 0;
@@ -360,7 +364,6 @@ static int dss_driver_probe(struct device *dev)
        int r;
        struct omap_dss_driver *dssdrv = to_dss_driver(dev->driver);
        struct omap_dss_device *dssdev = to_dss_device(dev);
-       struct omap_dss_board_info *pdata = core.pdev->dev.platform_data;
        bool force;
 
        DSSDBG("driver_probe: dev %s/%s, drv %s\n",
@@ -369,7 +372,8 @@ static int dss_driver_probe(struct device *dev)
 
        dss_init_device(core.pdev, dssdev);
 
-       force = pdata->default_device == dssdev;
+       force = core.default_display_name &&
+               strcmp(core.default_display_name, dssdev->name) == 0;
        dss_recheck_connections(dssdev, force);
 
        r = dssdrv->probe(dssdev);