OMAPDSS: remove uses of dss_runtime_get/put
authorTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 17 Feb 2012 15:58:04 +0000 (17:58 +0200)
committerTomi Valkeinen <tomi.valkeinen@ti.com>
Fri, 11 May 2012 11:44:51 +0000 (14:44 +0300)
Now that the omapdss_core device is the parent for all other dss
devices, we don't need to use the dss_runtime_get/put anymore. Instead,
enabling omapdss_core will happen automatically when a child device is
enabled.

Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
drivers/video/omap2/dss/dispc.c
drivers/video/omap2/dss/dpi.c
drivers/video/omap2/dss/dsi.c
drivers/video/omap2/dss/dss.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 242efe9f702af475fd37cea47ebce5756fe426f8..25707732cb68ad2abb9efd4cdb6c105bcb41f6cd 100644 (file)
@@ -3571,19 +3571,12 @@ static int omap_dispchw_remove(struct platform_device *pdev)
 static int dispc_runtime_suspend(struct device *dev)
 {
        dispc_save_context();
-       dss_runtime_put();
 
        return 0;
 }
 
 static int dispc_runtime_resume(struct device *dev)
 {
-       int r;
-
-       r = dss_runtime_get();
-       if (r < 0)
-               return r;
-
        dispc_restore_context();
 
        return 0;
index 79d242a42607b35fc356ed499bd97720843c7c9f..0bb2c48db81723fd39637b1f08f52b94c2f42498 100644 (file)
@@ -202,10 +202,6 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
                        goto err_reg_enable;
        }
 
-       r = dss_runtime_get();
-       if (r)
-               goto err_get_dss;
-
        r = dispc_runtime_get();
        if (r)
                goto err_get_dispc;
@@ -244,8 +240,6 @@ err_dsi_pll_init:
 err_get_dsi:
        dispc_runtime_put();
 err_get_dispc:
-       dss_runtime_put();
-err_get_dss:
        if (cpu_is_omap34xx())
                regulator_disable(dpi.vdds_dsi_reg);
 err_reg_enable:
@@ -266,7 +260,6 @@ void omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
        }
 
        dispc_runtime_put();
-       dss_runtime_put();
 
        if (cpu_is_omap34xx())
                regulator_disable(dpi.vdds_dsi_reg);
@@ -283,20 +276,13 @@ void dpi_set_timings(struct omap_dss_device *dssdev,
        DSSDBG("dpi_set_timings\n");
        dssdev->panel.timings = *timings;
        if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
-               r = dss_runtime_get();
-               if (r)
-                       return;
-
                r = dispc_runtime_get();
-               if (r) {
-                       dss_runtime_put();
+               if (r)
                        return;
-               }
 
                dpi_set_mode(dssdev);
 
                dispc_runtime_put();
-               dss_runtime_put();
        } else {
                dss_mgr_set_timings(dssdev->manager, timings);
        }
index 43eeb0d04d4739c9ec13eb4c38ed008319668e3b..9fdeb213198765af9cb11c46f9d47086539d09d9 100644 (file)
@@ -4767,7 +4767,6 @@ static int omap_dsihw_remove(struct platform_device *dsidev)
 static int dsi_runtime_suspend(struct device *dev)
 {
        dispc_runtime_put();
-       dss_runtime_put();
 
        return 0;
 }
@@ -4776,20 +4775,11 @@ static int dsi_runtime_resume(struct device *dev)
 {
        int r;
 
-       r = dss_runtime_get();
-       if (r)
-               goto err_get_dss;
-
        r = dispc_runtime_get();
        if (r)
-               goto err_get_dispc;
+               return r;
 
        return 0;
-
-err_get_dispc:
-       dss_runtime_put();
-err_get_dss:
-       return r;
 }
 
 static const struct dev_pm_ops dsi_pm_ops = {
index 7a7ddd8fbf5e65fc672684a98befe16cdb9dcea5..900002a6c7ddf40b5f913d76ec6faa955818bec2 100644 (file)
@@ -62,6 +62,9 @@ struct dss_reg {
 #define REG_FLD_MOD(idx, val, start, end) \
        dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))
 
+static int dss_runtime_get(void);
+static void dss_runtime_put(void);
+
 static struct {
        struct platform_device *pdev;
        void __iomem    *base;
@@ -707,7 +710,7 @@ static void dss_put_clocks(void)
        clk_put(dss.dss_clk);
 }
 
-int dss_runtime_get(void)
+static int dss_runtime_get(void)
 {
        int r;
 
@@ -718,7 +721,7 @@ int dss_runtime_get(void)
        return r < 0 ? r : 0;
 }
 
-void dss_runtime_put(void)
+static void dss_runtime_put(void)
 {
        int r;
 
index 5496134c280b412cd22bf76b9c51e0e9ceee7df2..28a856822a876f32e6d6098ee3a72175d28f8544 100644 (file)
@@ -233,9 +233,6 @@ int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,
 int dss_init_platform_driver(void);
 void dss_uninit_platform_driver(void);
 
-int dss_runtime_get(void);
-void dss_runtime_put(void);
-
 void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select);
 enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);
 const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
index 1d73ee7a53672632037cb145fd494f64a2f93b24..45e98419d95288812b489cad5dc132f99e996ed0 100644 (file)
@@ -129,25 +129,12 @@ static int hdmi_runtime_get(void)
 
        DSSDBG("hdmi_runtime_get\n");
 
-       /*
-        * HACK: Add dss_runtime_get() to ensure DSS clock domain is enabled.
-        * This should be removed later.
-        */
-       r = dss_runtime_get();
-       if (r < 0)
-               goto err_get_dss;
-
        r = pm_runtime_get_sync(&hdmi.pdev->dev);
        WARN_ON(r < 0);
        if (r < 0)
-               goto err_get_hdmi;
+               return r;
 
        return 0;
-
-err_get_hdmi:
-       dss_runtime_put();
-err_get_dss:
-       return r;
 }
 
 static void hdmi_runtime_put(void)
@@ -158,12 +145,6 @@ static void hdmi_runtime_put(void)
 
        r = pm_runtime_put_sync(&hdmi.pdev->dev);
        WARN_ON(r < 0);
-
-       /*
-        * HACK: This is added to complement the dss_runtime_get() call in
-        * hdmi_runtime_get(). This should be removed later.
-        */
-       dss_runtime_put();
 }
 
 int hdmi_init_display(struct omap_dss_device *dssdev)
@@ -866,7 +847,6 @@ static int hdmi_runtime_suspend(struct device *dev)
        clk_disable(hdmi.sys_clk);
 
        dispc_runtime_put();
-       dss_runtime_put();
 
        return 0;
 }
@@ -875,23 +855,13 @@ static int hdmi_runtime_resume(struct device *dev)
 {
        int r;
 
-       r = dss_runtime_get();
-       if (r < 0)
-               goto err_get_dss;
-
        r = dispc_runtime_get();
        if (r < 0)
-               goto err_get_dispc;
-
+               return r;
 
        clk_enable(hdmi.sys_clk);
 
        return 0;
-
-err_get_dispc:
-       dss_runtime_put();
-err_get_dss:
-       return r;
 }
 
 static const struct dev_pm_ops hdmi_pm_ops = {
index 31c992662457b7279f4a261562bed0fb4007586f..c5e69068489dcd5709b78f03dde337a1a2baed0c 100644 (file)
@@ -992,7 +992,6 @@ static int omap_rfbihw_remove(struct platform_device *pdev)
 static int rfbi_runtime_suspend(struct device *dev)
 {
        dispc_runtime_put();
-       dss_runtime_put();
 
        return 0;
 }
@@ -1001,20 +1000,11 @@ static int rfbi_runtime_resume(struct device *dev)
 {
        int r;
 
-       r = dss_runtime_get();
-       if (r < 0)
-               goto err_get_dss;
-
        r = dispc_runtime_get();
        if (r < 0)
-               goto err_get_dispc;
+               return r;
 
        return 0;
-
-err_get_dispc:
-       dss_runtime_put();
-err_get_dss:
-       return r;
 }
 
 static const struct dev_pm_ops rfbi_pm_ops = {
index 4ae2d8f55048d0b8f448da042cd73f26d4c2b4f2..9e3ee87ffc9ceaa974a770aa897c726498b8b28b 100644 (file)
@@ -72,10 +72,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
        if (r)
                goto err_reg_enable;
 
-       r = dss_runtime_get();
-       if (r)
-               goto err_get_dss;
-
        r = dispc_runtime_get();
        if (r)
                goto err_get_dispc;
@@ -138,8 +134,6 @@ err_set_dss_clock_div:
 err_calc_clock_div:
        dispc_runtime_put();
 err_get_dispc:
-       dss_runtime_put();
-err_get_dss:
        regulator_disable(sdi.vdds_sdi_reg);
 err_reg_enable:
        omap_dss_stop_device(dssdev);
@@ -155,7 +149,6 @@ void omapdss_sdi_display_disable(struct omap_dss_device *dssdev)
        dss_sdi_disable();
 
        dispc_runtime_put();
-       dss_runtime_put();
 
        regulator_disable(sdi.vdds_sdi_reg);
 
index 1884e347b630c1137d59378257768634ad57d91b..90b57c5317bf70ab93c2ed91e4100196ca3e6c38 100644 (file)
@@ -903,7 +903,6 @@ static int venc_runtime_suspend(struct device *dev)
                clk_disable(venc.tv_dac_clk);
 
        dispc_runtime_put();
-       dss_runtime_put();
 
        return 0;
 }
@@ -912,23 +911,14 @@ static int venc_runtime_resume(struct device *dev)
 {
        int r;
 
-       r = dss_runtime_get();
-       if (r < 0)
-               goto err_get_dss;
-
        r = dispc_runtime_get();
        if (r < 0)
-               goto err_get_dispc;
+               return r;
 
        if (venc.tv_dac_clk)
                clk_enable(venc.tv_dac_clk);
 
        return 0;
-
-err_get_dispc:
-       dss_runtime_put();
-err_get_dss:
-       return r;
 }
 
 static const struct dev_pm_ops venc_pm_ops = {