OMAPDSS: init omap_dss_devices internally
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 1 Mar 2012 14:58:39 +0000 (16:58 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 11 May 2012 11:54:38 +0000 (14:54 +0300)
Now that each output driver creates their own display devices, the
output drivers can also initialize those devices.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/display.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 e688d10f061a976ab5c603e3578796cedb2a2914..faf7d91c4a84f971f9765082f0cd07a4fb34ccf8 100644 (file)
@@ -359,46 +359,6 @@ void dss_init_device(struct platform_device *pdev,
        int i;
        int r;
 
-       switch (dssdev->type) {
-#ifdef CONFIG_OMAP2_DSS_DPI
-       case OMAP_DISPLAY_TYPE_DPI:
-               r = dpi_init_display(dssdev);
-               break;
-#endif
-#ifdef CONFIG_OMAP2_DSS_RFBI
-       case OMAP_DISPLAY_TYPE_DBI:
-               r = rfbi_init_display(dssdev);
-               break;
-#endif
-#ifdef CONFIG_OMAP2_DSS_VENC
-       case OMAP_DISPLAY_TYPE_VENC:
-               r = venc_init_display(dssdev);
-               break;
-#endif
-#ifdef CONFIG_OMAP2_DSS_SDI
-       case OMAP_DISPLAY_TYPE_SDI:
-               r = sdi_init_display(dssdev);
-               break;
-#endif
-#ifdef CONFIG_OMAP2_DSS_DSI
-       case OMAP_DISPLAY_TYPE_DSI:
-               r = dsi_init_display(dssdev);
-               break;
-#endif
-       case OMAP_DISPLAY_TYPE_HDMI:
-               r = hdmi_init_display(dssdev);
-               break;
-       default:
-               DSSERR("Support for display '%s' not compiled in.\n",
-                               dssdev->name);
-               return;
-       }
-
-       if (r) {
-               DSSERR("failed to init display %s\n", dssdev->name);
-               return;
-       }
-
        /* create device sysfs files */
        i = 0;
        while ((attr = display_sysfs_attrs[i++]) != NULL) {
index 35eb29706934825ad7f5abc7bb58bb3cdd9fa8d1..de3454b91497d8c5b956e1f3ff6791a339f216d2 100644 (file)
@@ -339,7 +339,7 @@ int dpi_check_timings(struct omap_dss_device *dssdev,
 }
 EXPORT_SYMBOL(dpi_check_timings);
 
-int dpi_init_display(struct omap_dss_device *dssdev)
+static int __init dpi_init_display(struct omap_dss_device *dssdev)
 {
        DSSDBG("init_display\n");
 
@@ -376,6 +376,12 @@ static int __init omap_dpi_probe(struct platform_device *pdev)
                if (dssdev->type != OMAP_DISPLAY_TYPE_DPI)
                        continue;
 
+               r = dpi_init_display(dssdev);
+               if (r) {
+                       DSSERR("device %s init failed: %d\n", dssdev->name, r);
+                       continue;
+               }
+
                r = omap_dss_register_device(dssdev, &pdev->dev, i);
                if (r)
                        DSSERR("device %s register failed: %d\n",
index 78b962308a02f79d26d0f17ade978ad584d3b79b..8cc0b2d53c6f6eff03d91b23f06eeae98dcbe7a9 100644 (file)
@@ -4454,7 +4454,7 @@ int omapdss_dsi_enable_te(struct omap_dss_device *dssdev, bool enable)
 }
 EXPORT_SYMBOL(omapdss_dsi_enable_te);
 
-int dsi_init_display(struct omap_dss_device *dssdev)
+static int __init dsi_init_display(struct omap_dss_device *dssdev)
 {
        struct platform_device *dsidev = dsi_get_dsidev_from_dssdev(dssdev);
        struct dsi_data *dsi = dsi_get_dsidrv_data(dsidev);
@@ -4710,6 +4710,12 @@ static int __init omap_dsihw_probe(struct platform_device *dsidev)
                if (dssdev->phy.dsi.module != dsi_module)
                        continue;
 
+               r = dsi_init_display(dssdev);
+               if (r) {
+                       DSSERR("device %s init failed: %d\n", dssdev->name, r);
+                       continue;
+               }
+
                r = omap_dss_register_device(dssdev, &dsidev->dev, i);
                if (r)
                        DSSERR("device %s register failed: %d\n",
index 972b22d27972e5e100372c6e6f56d4139c039967..d5cb19fe7e8bbe8130faaf4374945af4f460ac8a 100644 (file)
@@ -275,7 +275,6 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
 /* SDI */
 int sdi_init_platform_driver(void) __init;
 void sdi_uninit_platform_driver(void) __exit;
-int sdi_init_display(struct omap_dss_device *display);
 
 /* DSI */
 #ifdef CONFIG_OMAP2_DSS_DSI
@@ -291,7 +290,6 @@ void dsi_runtime_put(struct platform_device *dsidev);
 
 void dsi_dump_clocks(struct seq_file *s);
 
-int dsi_init_display(struct omap_dss_device *display);
 void dsi_irq_handler(void);
 u8 dsi_get_pixel_size(enum omap_dss_dsi_pixel_format fmt);
 
@@ -366,7 +364,6 @@ static inline struct platform_device *dsi_get_dsidev_from_id(int module)
 /* DPI */
 int dpi_init_platform_driver(void) __init;
 void dpi_uninit_platform_driver(void) __exit;
-int dpi_init_display(struct omap_dss_device *dssdev);
 
 /* DISPC */
 int dispc_init_platform_driver(void) __init;
@@ -437,7 +434,6 @@ void dispc_mgr_setup(enum omap_channel channel,
 #ifdef CONFIG_OMAP2_DSS_VENC
 int venc_init_platform_driver(void) __init;
 void venc_uninit_platform_driver(void) __exit;
-int venc_init_display(struct omap_dss_device *display);
 unsigned long venc_get_pixel_clock(void);
 #else
 static inline unsigned long venc_get_pixel_clock(void)
@@ -451,13 +447,8 @@ static inline unsigned long venc_get_pixel_clock(void)
 #ifdef CONFIG_OMAP4_DSS_HDMI
 int hdmi_init_platform_driver(void) __init;
 void hdmi_uninit_platform_driver(void) __exit;
-int hdmi_init_display(struct omap_dss_device *dssdev);
 unsigned long hdmi_get_pixel_clock(void);
 #else
-static inline int hdmi_init_display(struct omap_dss_device *dssdev)
-{
-       return 0;
-}
 static inline unsigned long hdmi_get_pixel_clock(void)
 {
        WARN("%s: HDMI not compiled in, returning pclk as 0\n", __func__);
@@ -477,7 +468,6 @@ void hdmi_panel_exit(void);
 /* RFBI */
 int rfbi_init_platform_driver(void) __init;
 void rfbi_uninit_platform_driver(void) __exit;
-int rfbi_init_display(struct omap_dss_device *display);
 
 
 #ifdef CONFIG_OMAP2_DSS_COLLECT_IRQ_STATS
index faa91441a6b04e6b516a8b858d0b46c8ea04b16b..fa1a054bb03bcac6a10120d445096f1c03ebe791 100644 (file)
@@ -147,7 +147,7 @@ static void hdmi_runtime_put(void)
        WARN_ON(r < 0);
 }
 
-int hdmi_init_display(struct omap_dss_device *dssdev)
+static int __init hdmi_init_display(struct omap_dss_device *dssdev)
 {
        DSSDBG("init_display\n");
 
@@ -819,6 +819,12 @@ static int __init omapdss_hdmihw_probe(struct platform_device *pdev)
                if (dssdev->type != OMAP_DISPLAY_TYPE_HDMI)
                        continue;
 
+               r = hdmi_init_display(dssdev);
+               if (r) {
+                       DSSERR("device %s init failed: %d\n", dssdev->name, r);
+                       continue;
+               }
+
                r = omap_dss_register_device(dssdev, &pdev->dev, i);
                if (r)
                        DSSERR("device %s register failed: %d\n",
index 4c0a6c97d62bab7ff134c33db7b0438a413d67da..f081f01b0b7dc5093b18d6dd762c9ec3a944302f 100644 (file)
@@ -920,7 +920,7 @@ void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev)
 }
 EXPORT_SYMBOL(omapdss_rfbi_display_disable);
 
-int rfbi_init_display(struct omap_dss_device *dssdev)
+static int __init rfbi_init_display(struct omap_dss_device *dssdev)
 {
        rfbi.dssdev[dssdev->phy.rfbi.channel] = dssdev;
        dssdev->caps = OMAP_DSS_DISPLAY_CAP_MANUAL_UPDATE;
@@ -985,6 +985,12 @@ static int __init omap_rfbihw_probe(struct platform_device *pdev)
                if (dssdev->type != OMAP_DISPLAY_TYPE_DBI)
                        continue;
 
+               r = rfbi_init_display(dssdev);
+               if (r) {
+                       DSSERR("device %s init failed: %d\n", dssdev->name, r);
+                       continue;
+               }
+
                r = omap_dss_register_device(dssdev, &pdev->dev, i);
                if (r)
                        DSSERR("device %s register failed: %d\n",
index 3be8134ec2d96f86ce408b9d0075290910d4482f..2641a768f316b933193a9887c6ec2279b9e7f9a0 100644 (file)
@@ -156,7 +156,7 @@ void omapdss_sdi_display_disable(struct omap_dss_device *dssdev)
 }
 EXPORT_SYMBOL(omapdss_sdi_display_disable);
 
-int sdi_init_display(struct omap_dss_device *dssdev)
+static int __init sdi_init_display(struct omap_dss_device *dssdev)
 {
        DSSDBG("SDI init\n");
 
@@ -187,6 +187,12 @@ static int __init omap_sdi_probe(struct platform_device *pdev)
                if (dssdev->type != OMAP_DISPLAY_TYPE_SDI)
                        continue;
 
+               r = sdi_init_display(dssdev);
+               if (r) {
+                       DSSERR("device %s init failed: %d\n", dssdev->name, r);
+                       continue;
+               }
+
                r = omap_dss_register_device(dssdev, &pdev->dev, i);
                if (r)
                        DSSERR("device %s register failed: %d\n",
index c194dfab63568d0f04c2963573d26017f3c0120f..005fdaa2cf7db5c2400d12921654b08a7ec0e702 100644 (file)
@@ -725,7 +725,7 @@ static struct omap_dss_driver venc_driver = {
 };
 /* driver end */
 
-int venc_init_display(struct omap_dss_device *dssdev)
+static int __init venc_init_display(struct omap_dss_device *dssdev)
 {
        DSSDBG("init_display\n");
 
@@ -883,6 +883,12 @@ static int __init omap_venchw_probe(struct platform_device *pdev)
                if (dssdev->type != OMAP_DISPLAY_TYPE_VENC)
                        continue;
 
+               r = venc_init_display(dssdev);
+               if (r) {
+                       DSSERR("device %s init failed: %d\n", dssdev->name, r);
+                       continue;
+               }
+
                r = omap_dss_register_device(dssdev, &pdev->dev, i);
                if (r)
                        DSSERR("device %s register failed: %d\n",