aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
authorArchit Taneja <archit@ti.com>2012-11-28 06:31:39 -0500
committerTomi Valkeinen <tomi.valkeinen@ti.com>2012-11-29 05:48:49 -0500
commitbdb736abfad5d61d1004dcc11dae2f7b651e5bb4 (patch)
tree0d6a328de87490b546ab84fa1ff831378316866f /drivers/video/omap2
parent8f46efadf30476692a2f311ad335077ba8fca383 (diff)
OMAPDSS: Use only "omapdss_dss" platform device to get context lost count
When enabling a hwmod, omap_hwmod refers to the register mentioned in the hwmod struct's member 'prcm.omap4.context_offs' to see whether context was lost or not. It increments the context lost count for the hwmod and then clears the register. All the DSS hwmods have the same register(RM_DSS_DSS_CONTEXT) as context_offs. When DSS is enabled, the first hwmod to be enabled is the "dss_core" hwmod since it's corresponding platform device is the parent platform device("omapdss_dss"). The dss_core hwmod updates it's context lost count correctly and clears the register. When the hwmods corresponding to the children platform devices are enabled, they see that the register is clear, and don't increment their context lost count. Therefore, all the children platform devices never report a loss in context. The DISPC driver currently gets the context lost count for DSS power domain from it's corresponding platform device instance("omapdss_dispc"). The DISPC platform device is one of the child devices, and it's corresponding hwmod("dss_dispc") doesn't report the context lost count correctly. Modify dss_get_ctx_loss_count() such that it always takes the "omapdss_dss" platform device as it's input, move the function to dss.c so that it has access to that platform device. Signed-off-by: Archit Taneja <archit@ti.com> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/core.c15
-rw-r--r--drivers/video/omap2/dss/dispc.c4
-rw-r--r--drivers/video/omap2/dss/dss.c15
-rw-r--r--drivers/video/omap2/dss/dss.h3
4 files changed, 19 insertions, 18 deletions
diff --git a/drivers/video/omap2/dss/core.c b/drivers/video/omap2/dss/core.c
index 8c308317a19..5c5e5919058 100644
--- a/drivers/video/omap2/dss/core.c
+++ b/drivers/video/omap2/dss/core.c
@@ -101,21 +101,6 @@ struct regulator *dss_get_vdds_sdi(void)
101 return reg; 101 return reg;
102} 102}
103 103
104int dss_get_ctx_loss_count(struct device *dev)
105{
106 struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;
107 int cnt;
108
109 if (!board_data->get_context_loss_count)
110 return -ENOENT;
111
112 cnt = board_data->get_context_loss_count(dev);
113
114 WARN_ONCE(cnt < 0, "get_context_loss_count failed: %d\n", cnt);
115
116 return cnt;
117}
118
119int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask) 104int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask)
120{ 105{
121 struct omap_dss_board_info *board_data = core.pdev->dev.platform_data; 106 struct omap_dss_board_info *board_data = core.pdev->dev.platform_data;
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c
index ce594a1d860..f7df5230678 100644
--- a/drivers/video/omap2/dss/dispc.c
+++ b/drivers/video/omap2/dss/dispc.c
@@ -382,7 +382,7 @@ static void dispc_save_context(void)
382 if (dss_has_feature(FEAT_CORE_CLK_DIV)) 382 if (dss_has_feature(FEAT_CORE_CLK_DIV))
383 SR(DIVISOR); 383 SR(DIVISOR);
384 384
385 dispc.ctx_loss_cnt = dss_get_ctx_loss_count(&dispc.pdev->dev); 385 dispc.ctx_loss_cnt = dss_get_ctx_loss_count();
386 dispc.ctx_valid = true; 386 dispc.ctx_valid = true;
387 387
388 DSSDBG("context saved, ctx_loss_count %d\n", dispc.ctx_loss_cnt); 388 DSSDBG("context saved, ctx_loss_count %d\n", dispc.ctx_loss_cnt);
@@ -397,7 +397,7 @@ static void dispc_restore_context(void)
397 if (!dispc.ctx_valid) 397 if (!dispc.ctx_valid)
398 return; 398 return;
399 399
400 ctx = dss_get_ctx_loss_count(&dispc.pdev->dev); 400 ctx = dss_get_ctx_loss_count();
401 401
402 if (ctx >= 0 && ctx == dispc.ctx_loss_cnt) 402 if (ctx >= 0 && ctx == dispc.ctx_loss_cnt)
403 return; 403 return;
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 6ca69d55cf5..833f1627dc7 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -154,6 +154,21 @@ static void dss_restore_context(void)
154#undef SR 154#undef SR
155#undef RR 155#undef RR
156 156
157int dss_get_ctx_loss_count(void)
158{
159 struct omap_dss_board_info *board_data = dss.pdev->dev.platform_data;
160 int cnt;
161
162 if (!board_data->get_context_loss_count)
163 return -ENOENT;
164
165 cnt = board_data->get_context_loss_count(&dss.pdev->dev);
166
167 WARN_ONCE(cnt < 0, "get_context_loss_count failed: %d\n", cnt);
168
169 return cnt;
170}
171
157void dss_sdi_init(int datapairs) 172void dss_sdi_init(int datapairs)
158{ 173{
159 u32 l; 174 u32 l;
diff --git a/drivers/video/omap2/dss/dss.h b/drivers/video/omap2/dss/dss.h
index 9ee3c881d1c..4d6f325cee8 100644
--- a/drivers/video/omap2/dss/dss.h
+++ b/drivers/video/omap2/dss/dss.h
@@ -164,7 +164,6 @@ struct platform_device *dss_get_core_pdev(void);
164struct bus_type *dss_get_bus(void); 164struct bus_type *dss_get_bus(void);
165struct regulator *dss_get_vdds_dsi(void); 165struct regulator *dss_get_vdds_dsi(void);
166struct regulator *dss_get_vdds_sdi(void); 166struct regulator *dss_get_vdds_sdi(void);
167int dss_get_ctx_loss_count(struct device *dev);
168int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask); 167int dss_dsi_enable_pads(int dsi_id, unsigned lane_mask);
169void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask); 168void dss_dsi_disable_pads(int dsi_id, unsigned lane_mask);
170int dss_set_min_bus_tput(struct device *dev, unsigned long tput); 169int dss_set_min_bus_tput(struct device *dev, unsigned long tput);
@@ -284,6 +283,8 @@ void dss_dump_clocks(struct seq_file *s);
284void dss_debug_dump_clocks(struct seq_file *s); 283void dss_debug_dump_clocks(struct seq_file *s);
285#endif 284#endif
286 285
286int dss_get_ctx_loss_count(void);
287
287void dss_sdi_init(int datapairs); 288void dss_sdi_init(int datapairs);
288int dss_sdi_enable(void); 289int dss_sdi_enable(void);
289void dss_sdi_disable(void); 290void dss_sdi_disable(void);