OMAPDSS: remove omap_dss_start/stop_device()
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Thu, 25 Apr 2013 10:12:07 +0000 (13:12 +0300)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Mon, 17 Jun 2013 11:00:51 +0000 (14:00 +0300)
The omap_dss_start_device() and omap_dss_stop_device(), called by the
DSS output drivers, are old relics. They originally did something
totally else, but nowadays they increase the module ref count for panels
that are enabled.

This model is quite broken: the panel modules may be used even before
they are enabled. For example, configuring the panel requires calls to
functions located in the panel modules.

In the following patches we try to improve the ref count management for
the modules and display devices. The first step, however, is to remove
the omap_dss_start/stop_device() totally.

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/hdmi.c
drivers/video/omap2/dss/rfbi.c
drivers/video/omap2/dss/sdi.c
drivers/video/omap2/dss/venc.c
include/video/omapdss.h

index a9a1d5563aa0bb042da41c0d70aa512cbe1871fc..809676473a99e308349d09622b6b94909054cad9 100644 (file)
@@ -233,26 +233,6 @@ struct omap_dss_device *omap_dss_find_device(void *data,
 }
 EXPORT_SYMBOL(omap_dss_find_device);
 
-int omap_dss_start_device(struct omap_dss_device *dssdev)
-{
-       if (!dssdev->driver) {
-               DSSDBG("no driver\n");
-               return -ENODEV;
-       }
-
-       if (!try_module_get(dssdev->dev->driver->owner))
-               return -ENODEV;
-
-       return 0;
-}
-EXPORT_SYMBOL(omap_dss_start_device);
-
-void omap_dss_stop_device(struct omap_dss_device *dssdev)
-{
-       module_put(dssdev->dev->driver->owner);
-}
-EXPORT_SYMBOL(omap_dss_stop_device);
-
 void videomode_to_omap_video_timings(const struct videomode *vm,
                struct omap_video_timings *ovt)
 {
index aa653c46d9a492f26ce6681059f5bb3096e9e1fa..e8cbf86eff9d05f145e89f4f19c32fc97eef7402 100644 (file)
@@ -364,12 +364,6 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
                goto err_no_out_mgr;
        }
 
-       r = omap_dss_start_device(dssdev);
-       if (r) {
-               DSSERR("failed to start device\n");
-               goto err_start_dev;
-       }
-
        if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI)) {
                r = regulator_enable(dpi.vdds_dsi_reg);
                if (r)
@@ -424,8 +418,6 @@ err_get_dispc:
        if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
                regulator_disable(dpi.vdds_dsi_reg);
 err_reg_enable:
-       omap_dss_stop_device(dssdev);
-err_start_dev:
 err_no_out_mgr:
 err_no_reg:
        mutex_unlock(&dpi.lock);
@@ -452,8 +444,6 @@ void omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
        if (dss_has_feature(FEAT_DPI_USES_VDDS_DSI))
                regulator_disable(dpi.vdds_dsi_reg);
 
-       omap_dss_stop_device(dssdev);
-
        mutex_unlock(&dpi.lock);
 }
 EXPORT_SYMBOL(omapdss_dpi_display_disable);
index 7d9e5ccb41e11fe66255384948dad115da649528..26aa4c324c1849826be96924e1c3cb68888438c7 100644 (file)
@@ -4592,12 +4592,6 @@ int omapdss_dsi_display_enable(struct omap_dss_device *dssdev)
 
        mutex_lock(&dsi->lock);
 
-       r = omap_dss_start_device(dssdev);
-       if (r) {
-               DSSERR("failed to start device\n");
-               goto err_start_dev;
-       }
-
        r = dsi_runtime_get(dsidev);
        if (r)
                goto err_get_dsi;
@@ -4618,8 +4612,6 @@ err_init_dsi:
        dsi_enable_pll_clock(dsidev, 0);
        dsi_runtime_put(dsidev);
 err_get_dsi:
-       omap_dss_stop_device(dssdev);
-err_start_dev:
        mutex_unlock(&dsi->lock);
        DSSDBG("dsi_display_enable FAILED\n");
        return r;
@@ -4648,8 +4640,6 @@ void omapdss_dsi_display_disable(struct omap_dss_device *dssdev,
        dsi_runtime_put(dsidev);
        dsi_enable_pll_clock(dsidev, 0);
 
-       omap_dss_stop_device(dssdev);
-
        mutex_unlock(&dsi->lock);
 }
 EXPORT_SYMBOL(omapdss_dsi_display_disable);
index 86b495c4b90f74f55e8d3660423da7686ca890a5..1804f1e28b9790db48a7983f40dbf46f769d1f07 100644 (file)
@@ -735,23 +735,15 @@ int omapdss_hdmi_display_enable(struct omap_dss_device *dssdev)
 
        hdmi.ip_data.hpd_gpio = hdmi.hpd_gpio;
 
-       r = omap_dss_start_device(dssdev);
-       if (r) {
-               DSSERR("failed to start device\n");
-               goto err0;
-       }
-
        r = hdmi_power_on_full(dssdev);
        if (r) {
                DSSERR("failed to power on device\n");
-               goto err1;
+               goto err0;
        }
 
        mutex_unlock(&hdmi.lock);
        return 0;
 
-err1:
-       omap_dss_stop_device(dssdev);
 err0:
        mutex_unlock(&hdmi.lock);
        return r;
@@ -765,8 +757,6 @@ void omapdss_hdmi_display_disable(struct omap_dss_device *dssdev)
 
        hdmi_power_off_full(dssdev);
 
-       omap_dss_stop_device(dssdev);
-
        mutex_unlock(&hdmi.lock);
 }
 
index cfcb52f088a2bdd2225928ec2d8d0446ff6a634b..30ff0e0d46290ef36165c4db04af0e730e96c66f 100644 (file)
@@ -902,12 +902,6 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
        if (r)
                return r;
 
-       r = omap_dss_start_device(dssdev);
-       if (r) {
-               DSSERR("failed to start device\n");
-               goto err0;
-       }
-
        r = dss_mgr_register_framedone_handler(out->manager,
                        framedone_callback, NULL);
        if (r) {
@@ -924,8 +918,6 @@ int omapdss_rfbi_display_enable(struct omap_dss_device *dssdev)
 
        return 0;
 err1:
-       omap_dss_stop_device(dssdev);
-err0:
        rfbi_runtime_put();
        return r;
 }
@@ -937,7 +929,6 @@ void omapdss_rfbi_display_disable(struct omap_dss_device *dssdev)
 
        dss_mgr_unregister_framedone_handler(out->manager,
                        framedone_callback, NULL);
-       omap_dss_stop_device(dssdev);
 
        rfbi_runtime_put();
 }
index ab67953f09b18b49c6e09df22e0ee560281b757e..d4f3313bc378a6ec4e6d08955ebc47e02799f68d 100644 (file)
@@ -138,12 +138,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
                return -ENODEV;
        }
 
-       r = omap_dss_start_device(dssdev);
-       if (r) {
-               DSSERR("failed to start device\n");
-               goto err_start_dev;
-       }
-
        r = regulator_enable(sdi.vdds_sdi_reg);
        if (r)
                goto err_reg_enable;
@@ -215,8 +209,6 @@ err_calc_clock_div:
 err_get_dispc:
        regulator_disable(sdi.vdds_sdi_reg);
 err_reg_enable:
-       omap_dss_stop_device(dssdev);
-err_start_dev:
        return r;
 }
 EXPORT_SYMBOL(omapdss_sdi_display_enable);
@@ -232,8 +224,6 @@ void omapdss_sdi_display_disable(struct omap_dss_device *dssdev)
        dispc_runtime_put();
 
        regulator_disable(sdi.vdds_sdi_reg);
-
-       omap_dss_stop_device(dssdev);
 }
 EXPORT_SYMBOL(omapdss_sdi_display_disable);
 
index f6d2b3f9888596d12f57a0df9a96106e5a1cd862..d529a92494329a4616dca35de6ceaddb86588052 100644 (file)
@@ -513,23 +513,15 @@ int omapdss_venc_display_enable(struct omap_dss_device *dssdev)
                goto err0;
        }
 
-       r = omap_dss_start_device(dssdev);
-       if (r) {
-               DSSERR("failed to start device\n");
-               goto err0;
-       }
-
        r = venc_power_on(dssdev);
        if (r)
-               goto err1;
+               goto err0;
 
        venc.wss_data = 0;
 
        mutex_unlock(&venc.venc_lock);
 
        return 0;
-err1:
-       omap_dss_stop_device(dssdev);
 err0:
        mutex_unlock(&venc.venc_lock);
        return r;
@@ -543,8 +535,6 @@ void omapdss_venc_display_disable(struct omap_dss_device *dssdev)
 
        venc_power_off(dssdev);
 
-       omap_dss_stop_device(dssdev);
-
        mutex_unlock(&venc.venc_lock);
 }
 
index b7d975755cffc74b319064b0df51b50da30385f2..6a699f537a68863a5bb9ec89021235869ca1e7fd 100644 (file)
@@ -779,9 +779,6 @@ struct omap_dss_device *omap_dss_find_device(void *data,
                int (*match)(struct omap_dss_device *dssdev, void *data));
 const char *omapdss_get_default_display_name(void);
 
-int omap_dss_start_device(struct omap_dss_device *dssdev);
-void omap_dss_stop_device(struct omap_dss_device *dssdev);
-
 void videomode_to_omap_video_timings(const struct videomode *vm,
                struct omap_video_timings *ovt);
 void omap_video_timings_to_videomode(const struct omap_video_timings *ovt,