Skip to content

Commit 2de1108

Browse files
Murthy, Raghuveertomba
Murthy, Raghuveer
authored andcommitted
OMAP: DSS2: Implement OMAP4 DSS fclk support
Add dss.dpll4_m4_ck (DSS FCLK) initialization for OMAP4. This is used to compute the pixel clock for DPI interface and also to reconfigure the DSS FCLK to the desired rate, corresponding to the rate computed for pixel clock. Adding these cpu_is_44xx() checks are meant to be temporary, until a cleaner implementation to manage these checks are added. Currently this is needed to get DVI display running on OMAP4 PandaBoard Signed-off-by: Raghuveer Murthy <[email protected]> [[email protected]: minor changes due to conflicts] Signed-off-by: Tomi Valkeinen <[email protected]>
1 parent 0acf659 commit 2de1108

File tree

1 file changed

+22
-12
lines changed
  • drivers/video/omap2/dss

1 file changed

+22
-12
lines changed

drivers/video/omap2/dss/dss.c

+22-12
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ void dss_dump_clocks(struct seq_file *s)
256256

257257
seq_printf(s, "dpll4_ck %lu\n", dpll4_ck_rate);
258258

259-
if (cpu_is_omap3630())
259+
if (cpu_is_omap3630() || cpu_is_omap44xx())
260260
seq_printf(s, "%s (%s) = %lu / %lu = %lu\n",
261261
fclk_name, fclk_real_name,
262262
dpll4_ck_rate,
@@ -394,9 +394,12 @@ int dss_calc_clock_rates(struct dss_clock_info *cinfo)
394394
{
395395
if (dss.dpll4_m4_ck) {
396396
unsigned long prate;
397+
u16 fck_div_max = 16;
397398

398-
if (cinfo->fck_div > (cpu_is_omap3630() ? 32 : 16) ||
399-
cinfo->fck_div == 0)
399+
if (cpu_is_omap3630() || cpu_is_omap44xx())
400+
fck_div_max = 32;
401+
402+
if (cinfo->fck_div > fck_div_max || cinfo->fck_div == 0)
400403
return -EINVAL;
401404

402405
prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
@@ -442,7 +445,7 @@ int dss_get_clock_div(struct dss_clock_info *cinfo)
442445

443446
prate = clk_get_rate(clk_get_parent(dss.dpll4_m4_ck));
444447

445-
if (cpu_is_omap3630())
448+
if (cpu_is_omap3630() || cpu_is_omap44xx())
446449
cinfo->fck_div = prate / (cinfo->fck);
447450
else
448451
cinfo->fck_div = prate / (cinfo->fck / 2);
@@ -471,7 +474,7 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
471474

472475
unsigned long fck, max_dss_fck;
473476

474-
u16 fck_div;
477+
u16 fck_div, fck_div_max = 16;
475478

476479
int match = 0;
477480
int min_fck_per_pck;
@@ -504,7 +507,7 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
504507
memset(&best_dss, 0, sizeof(best_dss));
505508
memset(&best_dispc, 0, sizeof(best_dispc));
506509

507-
if (cpu_is_omap24xx()) {
510+
if (dss.dpll4_m4_ck == NULL) {
508511
struct dispc_clock_info cur_dispc;
509512
/* XXX can we change the clock on omap2? */
510513
fck = dss_clk_get_rate(DSS_CLK_FCK);
@@ -519,12 +522,14 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
519522
best_dispc = cur_dispc;
520523

521524
goto found;
522-
} else if (cpu_is_omap34xx()) {
523-
for (fck_div = (cpu_is_omap3630() ? 32 : 16);
524-
fck_div > 0; --fck_div) {
525+
} else {
526+
if (cpu_is_omap3630() || cpu_is_omap44xx())
527+
fck_div_max = 32;
528+
529+
for (fck_div = fck_div_max; fck_div > 0; --fck_div) {
525530
struct dispc_clock_info cur_dispc;
526531

527-
if (cpu_is_omap3630())
532+
if (fck_div_max == 32)
528533
fck = prate / fck_div;
529534
else
530535
fck = prate / fck_div * 2;
@@ -552,8 +557,6 @@ int dss_calc_clock_div(bool is_tft, unsigned long req_pck,
552557
goto found;
553558
}
554559
}
555-
} else {
556-
BUG();
557560
}
558561

559562
found:
@@ -684,6 +687,13 @@ static int dss_init(void)
684687
r = PTR_ERR(dpll4_m4_ck);
685688
goto fail1;
686689
}
690+
} else if (cpu_is_omap44xx()) {
691+
dpll4_m4_ck = clk_get(NULL, "dpll_per_m5x2_ck");
692+
if (IS_ERR(dpll4_m4_ck)) {
693+
DSSERR("Failed to get dpll4_m4_ck\n");
694+
r = PTR_ERR(dpll4_m4_ck);
695+
goto fail1;
696+
}
687697
} else { /* omap24xx */
688698
dpll4_m4_ck = NULL;
689699
}

0 commit comments

Comments
 (0)