aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/omap2
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/video/omap2')
-rw-r--r--drivers/video/omap2/dss/dss.c24
1 files changed, 19 insertions, 5 deletions
diff --git a/drivers/video/omap2/dss/dss.c b/drivers/video/omap2/dss/dss.c
index 54344184dd73..24b18258654f 100644
--- a/drivers/video/omap2/dss/dss.c
+++ b/drivers/video/omap2/dss/dss.c
@@ -223,7 +223,13 @@ void dss_dump_clocks(struct seq_file *s)
223 223
224 seq_printf(s, "dpll4_ck %lu\n", dpll4_ck_rate); 224 seq_printf(s, "dpll4_ck %lu\n", dpll4_ck_rate);
225 225
226 seq_printf(s, "dss1_alwon_fclk = %lu / %lu * 2 = %lu\n", 226 if (cpu_is_omap3630())
227 seq_printf(s, "dss1_alwon_fclk = %lu / %lu = %lu\n",
228 dpll4_ck_rate,
229 dpll4_ck_rate / dpll4_m4_ck_rate,
230 dss_clk_get_rate(DSS_CLK_FCK1));
231 else
232 seq_printf(s, "dss1_alwon_fclk = %lu / %lu * 2 = %lu\n",
227 dpll4_ck_rate, 233 dpll4_ck_rate,
228 dpll4_ck_rate / dpll4_m4_ck_rate, 234 dpll4_ck_rate / dpll4_m4_ck_rate,
229 dss_clk_get_rate(DSS_CLK_FCK1)); 235 dss_clk_get_rate(DSS_CLK_FCK1));
@@ -293,7 +299,8 @@ int dss_calc_clock_rates(struct dss_clock_info *cinfo)
293{ 299{
294 unsigned long prate; 300 unsigned long prate;
295 301
296 if (cinfo->fck_div > 16 || cinfo->fck_div == 0) 302 if (cinfo->fck_div > (cpu_is_omap3630() ? 32 : 16) ||
303 cinfo->fck_div == 0)
297 return -EINVAL; 304 return -EINVAL;
298 305
299 prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck)); 306 prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
@@ -329,7 +336,10 @@ int dss_get_clock_div(struct dss_clock_info *cinfo)
329 if (cpu_is_omap34xx()) { 336 if (cpu_is_omap34xx()) {
330 unsigned long prate; 337 unsigned long prate;
331 prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck)); 338 prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
332 cinfo->fck_div = prate / (cinfo->fck / 2); 339 if (cpu_is_omap3630())
340 cinfo->fck_div = prate / (cinfo->fck);
341 else
342 cinfo->fck_div = prate / (cinfo->fck / 2);
333 } else { 343 } else {
334 cinfo->fck_div = 0; 344 cinfo->fck_div = 0;
335 } 345 }
@@ -402,10 +412,14 @@ retry:
402 412
403 goto found; 413 goto found;
404 } else if (cpu_is_omap34xx()) { 414 } else if (cpu_is_omap34xx()) {
405 for (fck_div = 16; fck_div > 0; --fck_div) { 415 for (fck_div = (cpu_is_omap3630() ? 32 : 16);
416 fck_div > 0; --fck_div) {
406 struct dispc_clock_info cur_dispc; 417 struct dispc_clock_info cur_dispc;
407 418
408 fck = prate / fck_div * 2; 419 if (cpu_is_omap3630())
420 fck = prate / fck_div;
421 else
422 fck = prate / fck_div * 2;
409 423
410 if (fck > DISPC_MAX_FCK) 424 if (fck > DISPC_MAX_FCK)
411 continue; 425 continue;