aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2012-02-17 10:58:04 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-05-11 07:44:51 -0400
commit852f083843af618eaa8997f7803c9aed8293fdf9 (patch)
tree45d823a928788f772e30a13ae8b2b9b4dfd109f7 /drivers
parenta57dd4fe7bef557afaa1a6cdb77cd95b2cba094e (diff)
OMAPDSS: remove uses of dss_runtime_get/put
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/omap2/dss/dispc.c7
-rw-r--r--drivers/video/omap2/dss/dpi.c16
-rw-r--r--drivers/video/omap2/dss/dsi.c12
-rw-r--r--drivers/video/omap2/dss/dss.c7
-rw-r--r--drivers/video/omap2/dss/dss.h3
-rw-r--r--drivers/video/omap2/dss/hdmi.c34
-rw-r--r--drivers/video/omap2/dss/rfbi.c12
-rw-r--r--drivers/video/omap2/dss/sdi.c7
-rw-r--r--drivers/video/omap2/dss/venc.c12
9 files changed, 11 insertions, 99 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index 242efe9f702a..25707732cb68 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -3571,19 +3571,12 @@ static int omap_dispchw_remove(struct platform_device *pdev)
3571static int dispc_runtime_suspend(struct device *dev) 3571static int dispc_runtime_suspend(struct device *dev)
3572{ 3572{
3573 dispc_save_context(); 3573 dispc_save_context();
3574 dss_runtime_put();
3575 3574
3576 return 0; 3575 return 0;
3577} 3576}
3578 3577
3579static int dispc_runtime_resume(struct device *dev) 3578static int dispc_runtime_resume(struct device *dev)
3580{ 3579{
3581 int r;
3582
3583 r = dss_runtime_get();
3584 if (r < 0)
3585 return r;
3586
3587 dispc_restore_context(); 3580 dispc_restore_context();
3588 3581
3589 return 0; 3582 return 0;
diff --git a/drivers/video/omap2/dss/dpi.c b/drivers/video/omap2/dss/dpi.c
index 79d242a42607..0bb2c48db817 100644
--- a/drivers/video/omap2/dss/dpi.c
+++ b/drivers/video/omap2/dss/dpi.c
@@ -202,10 +202,6 @@ int omapdss_dpi_display_enable(struct omap_dss_device *dssdev)
202 goto err_reg_enable; 202 goto err_reg_enable;
203 } 203 }
204 204
205 r = dss_runtime_get();
206 if (r)
207 goto err_get_dss;
208
209 r = dispc_runtime_get(); 205 r = dispc_runtime_get();
210 if (r) 206 if (r)
211 goto err_get_dispc; 207 goto err_get_dispc;
@@ -244,8 +240,6 @@ err_dsi_pll_init:
244err_get_dsi: 240err_get_dsi:
245 dispc_runtime_put(); 241 dispc_runtime_put();
246err_get_dispc: 242err_get_dispc:
247 dss_runtime_put();
248err_get_dss:
249 if (cpu_is_omap34xx()) 243 if (cpu_is_omap34xx())
250 regulator_disable(dpi.vdds_dsi_reg); 244 regulator_disable(dpi.vdds_dsi_reg);
251err_reg_enable: 245err_reg_enable:
@@ -266,7 +260,6 @@ void omapdss_dpi_display_disable(struct omap_dss_device *dssdev)
266 } 260 }
267 261
268 dispc_runtime_put(); 262 dispc_runtime_put();
269 dss_runtime_put();
270 263
271 if (cpu_is_omap34xx()) 264 if (cpu_is_omap34xx())
272 regulator_disable(dpi.vdds_dsi_reg); 265 regulator_disable(dpi.vdds_dsi_reg);
@@ -283,20 +276,13 @@ void dpi_set_timings(struct omap_dss_device *dssdev,
283 DSSDBG("dpi_set_timings\n"); 276 DSSDBG("dpi_set_timings\n");
284 dssdev->panel.timings = *timings; 277 dssdev->panel.timings = *timings;
285 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) { 278 if (dssdev->state == OMAP_DSS_DISPLAY_ACTIVE) {
286 r = dss_runtime_get();
287 if (r)
288 return;
289
290 r = dispc_runtime_get(); 279 r = dispc_runtime_get();
291 if (r) { 280 if (r)
292 dss_runtime_put();
293 return; 281 return;
294 }
295 282
296 dpi_set_mode(dssdev); 283 dpi_set_mode(dssdev);
297 284
298 dispc_runtime_put(); 285 dispc_runtime_put();
299 dss_runtime_put();
300 } else { 286 } else {
301 dss_mgr_set_timings(dssdev->manager, timings); 287 dss_mgr_set_timings(dssdev->manager, timings);
302 } 288 }
diff --git a/drivers/video/omap2/dss/dsi.c b/drivers/video/omap2/dss/dsi.c
index 43eeb0d04d47..9fdeb2131987 100644
--- a/drivers/video/omap2/dss/dsi.c
+++ b/drivers/video/omap2/dss/dsi.c
@@ -4767,7 +4767,6 @@ static int omap_dsihw_remove(struct platform_device *dsidev)
4767static int dsi_runtime_suspend(struct device *dev) 4767static int dsi_runtime_suspend(struct device *dev)
4768{ 4768{
4769 dispc_runtime_put(); 4769 dispc_runtime_put();
4770 dss_runtime_put();
4771 4770
4772 return 0; 4771 return 0;
4773} 4772}
@@ -4776,20 +4775,11 @@ static int dsi_runtime_resume(struct device *dev)
4776{ 4775{
4777 int r; 4776 int r;
4778 4777
4779 r = dss_runtime_get();
4780 if (r)
4781 goto err_get_dss;
4782
4783 r = dispc_runtime_get(); 4778 r = dispc_runtime_get();
4784 if (r) 4779 if (r)
4785 goto err_get_dispc; 4780 return r;
4786 4781
4787 return 0; 4782 return 0;
4788
4789err_get_dispc:
4790 dss_runtime_put();
4791err_get_dss:
4792 return r;
4793} 4783}
4794 4784
4795static const struct dev_pm_ops dsi_pm_ops = { 4785static const struct dev_pm_ops dsi_pm_ops = {
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 7a7ddd8fbf5e..900002a6c7dd 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -62,6 +62,9 @@ struct dss_reg {
62#define REG_FLD_MOD(idx, val, start, end) \ 62#define REG_FLD_MOD(idx, val, start, end) \
63 dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end)) 63 dss_write_reg(idx, FLD_MOD(dss_read_reg(idx), val, start, end))
64 64
65static int dss_runtime_get(void);
66static void dss_runtime_put(void);
67
65static struct { 68static struct {
66 struct platform_device *pdev; 69 struct platform_device *pdev;
67 void __iomem *base; 70 void __iomem *base;
@@ -707,7 +710,7 @@ static void dss_put_clocks(void)
707 clk_put(dss.dss_clk); 710 clk_put(dss.dss_clk);
708} 711}
709 712
710int dss_runtime_get(void) 713static int dss_runtime_get(void)
711{ 714{
712 int r; 715 int r;
713 716
@@ -718,7 +721,7 @@ int dss_runtime_get(void)
718 return r < 0 ? r : 0; 721 return r < 0 ? r : 0;
719} 722}
720 723
721void dss_runtime_put(void) 724static void dss_runtime_put(void)
722{ 725{
723 int r; 726 int r;
724 727
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 5496134c280b..28a856822a87 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -233,9 +233,6 @@ int dss_ovl_check(struct omap_overlay *ovl, struct omap_overlay_info *info,
233int dss_init_platform_driver(void); 233int dss_init_platform_driver(void);
234void dss_uninit_platform_driver(void); 234void dss_uninit_platform_driver(void);
235 235
236int dss_runtime_get(void);
237void dss_runtime_put(void);
238
239void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select); 236void dss_select_hdmi_venc_clk_source(enum dss_hdmi_venc_clk_source_select);
240enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void); 237enum dss_hdmi_venc_clk_source_select dss_get_hdmi_venc_clk_source(void);
241const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src); 238const char *dss_get_generic_clk_source_name(enum omap_dss_clk_source clk_src);
diff --git a/drivers/video/omap2/dss/hdmi.c b/drivers/video/omap2/dss/hdmi.c
index 1d73ee7a5367..45e98419d952 100644
--- a/drivers/video/omap2/dss/hdmi.c
+++ b/drivers/video/omap2/dss/hdmi.c
@@ -129,25 +129,12 @@ static int hdmi_runtime_get(void)
129 129
130 DSSDBG("hdmi_runtime_get\n"); 130 DSSDBG("hdmi_runtime_get\n");
131 131
132 /*
133 * HACK: Add dss_runtime_get() to ensure DSS clock domain is enabled.
134 * This should be removed later.
135 */
136 r = dss_runtime_get();
137 if (r < 0)
138 goto err_get_dss;
139
140 r = pm_runtime_get_sync(&hdmi.pdev->dev); 132 r = pm_runtime_get_sync(&hdmi.pdev->dev);
141 WARN_ON(r < 0); 133 WARN_ON(r < 0);
142 if (r < 0) 134 if (r < 0)
143 goto err_get_hdmi; 135 return r;
144 136
145 return 0; 137 return 0;
146
147err_get_hdmi:
148 dss_runtime_put();
149err_get_dss:
150 return r;
151} 138}
152 139
153static void hdmi_runtime_put(void) 140static void hdmi_runtime_put(void)
@@ -158,12 +145,6 @@ static void hdmi_runtime_put(void)
158 145
159 r = pm_runtime_put_sync(&hdmi.pdev->dev); 146 r = pm_runtime_put_sync(&hdmi.pdev->dev);
160 WARN_ON(r < 0); 147 WARN_ON(r < 0);
161
162 /*
163 * HACK: This is added to complement the dss_runtime_get() call in
164 * hdmi_runtime_get(). This should be removed later.
165 */
166 dss_runtime_put();
167} 148}
168 149
169int hdmi_init_display(struct omap_dss_device *dssdev) 150int hdmi_init_display(struct omap_dss_device *dssdev)
@@ -866,7 +847,6 @@ static int hdmi_runtime_suspend(struct device *dev)
866 clk_disable(hdmi.sys_clk); 847 clk_disable(hdmi.sys_clk);
867 848
868 dispc_runtime_put(); 849 dispc_runtime_put();
869 dss_runtime_put();
870 850
871 return 0; 851 return 0;
872} 852}
@@ -875,23 +855,13 @@ static int hdmi_runtime_resume(struct device *dev)
875{ 855{
876 int r; 856 int r;
877 857
878 r = dss_runtime_get();
879 if (r < 0)
880 goto err_get_dss;
881
882 r = dispc_runtime_get(); 858 r = dispc_runtime_get();
883 if (r < 0) 859 if (r < 0)
884 goto err_get_dispc; 860 return r;
885
886 861
887 clk_enable(hdmi.sys_clk); 862 clk_enable(hdmi.sys_clk);
888 863
889 return 0; 864 return 0;
890
891err_get_dispc:
892 dss_runtime_put();
893err_get_dss:
894 return r;
895} 865}
896 866
897static const struct dev_pm_ops hdmi_pm_ops = { 867static const struct dev_pm_ops hdmi_pm_ops = {
diff --git a/drivers/video/omap2/dss/rfbi.c b/drivers/video/omap2/dss/rfbi.c
index 31c992662457..c5e69068489d 100644
--- a/drivers/video/omap2/dss/rfbi.c
+++ b/drivers/video/omap2/dss/rfbi.c
@@ -992,7 +992,6 @@ static int omap_rfbihw_remove(struct platform_device *pdev)
992static int rfbi_runtime_suspend(struct device *dev) 992static int rfbi_runtime_suspend(struct device *dev)
993{ 993{
994 dispc_runtime_put(); 994 dispc_runtime_put();
995 dss_runtime_put();
996 995
997 return 0; 996 return 0;
998} 997}
@@ -1001,20 +1000,11 @@ static int rfbi_runtime_resume(struct device *dev)
1001{ 1000{
1002 int r; 1001 int r;
1003 1002
1004 r = dss_runtime_get();
1005 if (r < 0)
1006 goto err_get_dss;
1007
1008 r = dispc_runtime_get(); 1003 r = dispc_runtime_get();
1009 if (r < 0) 1004 if (r < 0)
1010 goto err_get_dispc; 1005 return r;
1011 1006
1012 return 0; 1007 return 0;
1013
1014err_get_dispc:
1015 dss_runtime_put();
1016err_get_dss:
1017 return r;
1018} 1008}
1019 1009
1020static const struct dev_pm_ops rfbi_pm_ops = { 1010static const struct dev_pm_ops rfbi_pm_ops = {
diff --git a/drivers/video/omap2/dss/sdi.c b/drivers/video/omap2/dss/sdi.c
index 4ae2d8f55048..9e3ee87ffc9c 100644
--- a/drivers/video/omap2/dss/sdi.c
+++ b/drivers/video/omap2/dss/sdi.c
@@ -72,10 +72,6 @@ int omapdss_sdi_display_enable(struct omap_dss_device *dssdev)
72 if (r) 72 if (r)
73 goto err_reg_enable; 73 goto err_reg_enable;
74 74
75 r = dss_runtime_get();
76 if (r)
77 goto err_get_dss;
78
79 r = dispc_runtime_get(); 75 r = dispc_runtime_get();
80 if (r) 76 if (r)
81 goto err_get_dispc; 77 goto err_get_dispc;
@@ -138,8 +134,6 @@ err_set_dss_clock_div:
138err_calc_clock_div: 134err_calc_clock_div:
139 dispc_runtime_put(); 135 dispc_runtime_put();
140err_get_dispc: 136err_get_dispc:
141 dss_runtime_put();
142err_get_dss:
143 regulator_disable(sdi.vdds_sdi_reg); 137 regulator_disable(sdi.vdds_sdi_reg);
144err_reg_enable: 138err_reg_enable:
145 omap_dss_stop_device(dssdev); 139 omap_dss_stop_device(dssdev);
@@ -155,7 +149,6 @@ void omapdss_sdi_display_disable(struct omap_dss_device *dssdev)
155 dss_sdi_disable(); 149 dss_sdi_disable();
156 150
157 dispc_runtime_put(); 151 dispc_runtime_put();
158 dss_runtime_put();
159 152
160 regulator_disable(sdi.vdds_sdi_reg); 153 regulator_disable(sdi.vdds_sdi_reg);
161 154
diff --git a/drivers/video/omap2/dss/venc.c b/drivers/video/omap2/dss/venc.c
index 1884e347b630..90b57c5317bf 100644
--- a/drivers/video/omap2/dss/venc.c
+++ b/drivers/video/omap2/dss/venc.c
@@ -903,7 +903,6 @@ static int venc_runtime_suspend(struct device *dev)
903 clk_disable(venc.tv_dac_clk); 903 clk_disable(venc.tv_dac_clk);
904 904
905 dispc_runtime_put(); 905 dispc_runtime_put();
906 dss_runtime_put();
907 906
908 return 0; 907 return 0;
909} 908}
@@ -912,23 +911,14 @@ static int venc_runtime_resume(struct device *dev)
912{ 911{
913 int r; 912 int r;
914 913
915 r = dss_runtime_get();
916 if (r < 0)
917 goto err_get_dss;
918
919 r = dispc_runtime_get(); 914 r = dispc_runtime_get();
920 if (r < 0) 915 if (r < 0)
921 goto err_get_dispc; 916 return r;
922 917
923 if (venc.tv_dac_clk) 918 if (venc.tv_dac_clk)
924 clk_enable(venc.tv_dac_clk); 919 clk_enable(venc.tv_dac_clk);
925 920
926 return 0; 921 return 0;
927
928err_get_dispc:
929 dss_runtime_put();
930err_get_dss:
931 return r;
932} 922}
933 923
934static const struct dev_pm_ops venc_pm_ops = { 924static const struct dev_pm_ops venc_pm_ops = {