]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
OMAPDSS: omap_dss_register_device() doesn't take display index
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 6 Sep 2012 10:57:39 +0000 (13:57 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Tue, 18 Sep 2012 13:10:32 +0000 (16:10 +0300)
We used to have all the displays of the board in one list, and we made a
"displayX" directory in the sysfs, where X was the index of the display
in the list.

This doesn't work anymore with device tree, as there's no single list to
get the number from, and it doesn't work very well even with non-DT as
we need to do some tricks to get the index nowadays.

This patch changes omap_dss_register_device() so that it doesn't take
disp_num as a parameter anymore, but uses a private increasing counter
for the display number.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/core.c
drivers/video/omap2/dss/dpi.c
drivers/video/omap2/dss/dsi.c
drivers/video/omap2/dss/dss.h
drivers/video/omap2/dss/hdmi.c
drivers/video/omap2/dss/rfbi.c
drivers/video/omap2/dss/sdi.c
drivers/video/omap2/dss/venc.c

index 58bd9c27369df9d4a39d1352f9d9cad74ec51b37..20c8bc8291b49ccdd1e54a9f88e45447c355a0ce 100644 (file)
@@ -450,16 +450,17 @@ static void omap_dss_dev_release(struct device *dev)
        reset_device(dev, 0);
 }
 
+static int disp_num_counter;
+
 int omap_dss_register_device(struct omap_dss_device *dssdev,
-               struct device *parent, int disp_num)
+               struct device *parent)
 {
-       WARN_ON(!dssdev->driver_name);
-
        reset_device(&dssdev->dev, 1);
+
        dssdev->dev.bus = &dss_bus_type;
        dssdev->dev.parent = parent;
        dssdev->dev.release = omap_dss_dev_release;
-       dev_set_name(&dssdev->dev, "display%d", disp_num);
+       dev_set_name(&dssdev->dev, "display%d", disp_num_counter++);
        return device_register(&dssdev->dev);
 }
 
index 5ccce9b69e428fd555508bccbd2c5bddc0da64b3..703fc1d8ec80ca10efb3587a587510f2f8eb6323 100644 (file)
@@ -388,7 +388,7 @@ static void __init dpi_probe_pdata(struct platform_device *pdev)
                        continue;
                }
 
-               r = omap_dss_register_device(dssdev, &pdev->dev, i);
+               r = omap_dss_register_device(dssdev, &pdev->dev);
                if (r)
                        DSSERR("device %s register failed: %d\n",
                                        dssdev->name, r);
index 8d815e39e45d41d69a389f9c3f231f0898813c17..f7078fc904591d0ee98220befe76f925b2164e42 100644 (file)
@@ -5027,7 +5027,7 @@ static void __init dsi_probe_pdata(struct platform_device *dsidev)
                        continue;
                }
 
-               r = omap_dss_register_device(dssdev, &dsidev->dev, i);
+               r = omap_dss_register_device(dssdev, &dsidev->dev);
                if (r)
                        DSSERR("device %s register failed: %d\n",
                                        dssdev->name, r);
index 5e9fd7691728817ce0bdcea310fe0d43a73b163f..7bac8ee078ada0a9d41f4f347fa928a2505e3d32 100644 (file)
@@ -185,7 +185,7 @@ int dss_set_min_bus_tput(struct device *dev, unsigned long tput);
 int dss_debugfs_create_file(const char *name, void (*write)(struct seq_file *));
 
 int omap_dss_register_device(struct omap_dss_device *dssdev,
-               struct device *parent, int disp_num);
+               struct device *parent);
 void omap_dss_unregister_device(struct omap_dss_device *dssdev);
 void omap_dss_unregister_child_devices(struct device *parent);
 
index 83f18458a406658385ff32b9c453da5b4abda11c..bb07143a2d79387f9d7b9d960d16183483231600 100644 (file)
@@ -923,7 +923,7 @@ static void __init hdmi_probe_pdata(struct platform_device *pdev)
                        continue;
                }
 
-               r = omap_dss_register_device(dssdev, &pdev->dev, i);
+               r = omap_dss_register_device(dssdev, &pdev->dev);
                if (r)
                        DSSERR("device %s register failed: %d\n",
                                        dssdev->name, r);
index 2e520d3085c883c8f6f4f6436a80760f2e2d27c0..845b4e70a28ea10d7e64900478c411ab4c9d66cb 100644 (file)
@@ -959,7 +959,7 @@ static void __init rfbi_probe_pdata(struct platform_device *pdev)
                        continue;
                }
 
-               r = omap_dss_register_device(dssdev, &pdev->dev, i);
+               r = omap_dss_register_device(dssdev, &pdev->dev);
                if (r)
                        DSSERR("device %s register failed: %d\n",
                                dssdev->name, r);
index 66c8de4365d6fbf61eb752a4de3398947ea55dfe..c9a9045e19f283c7e19640b01d2b1707ff66660c 100644 (file)
@@ -212,7 +212,7 @@ static void __init sdi_probe_pdata(struct platform_device *pdev)
                        continue;
                }
 
-               r = omap_dss_register_device(dssdev, &pdev->dev, i);
+               r = omap_dss_register_device(dssdev, &pdev->dev);
                if (r)
                        DSSERR("device %s register failed: %d\n",
                                        dssdev->name, r);
index 17b31029a7934adbabb473a578078a0d80cee797..60bfc5801636de1b25b4503e7703ad9ec9c9ff55 100644 (file)
@@ -752,7 +752,7 @@ static void __init venc_probe_pdata(struct platform_device *pdev)
                        continue;
                }
 
-               r = omap_dss_register_device(dssdev, &pdev->dev, i);
+               r = omap_dss_register_device(dssdev, &pdev->dev);
                if (r)
                        DSSERR("device %s register failed: %d\n",
                                        dssdev->name, r);