diff options
Diffstat (limited to 'drivers/video')
-rw-r--r-- | drivers/video/omap2/dss/dispc.c | 55 |
1 files changed, 52 insertions, 3 deletions
diff --git a/drivers/video/omap2/dss/dispc.c b/drivers/video/omap2/dss/dispc.c index 311e689409de..1f4a3275d101 100644 --- a/drivers/video/omap2/dss/dispc.c +++ b/drivers/video/omap2/dss/dispc.c | |||
@@ -2652,9 +2652,16 @@ bool dispc_mgr_timings_ok(enum omap_channel channel, | |||
2652 | } | 2652 | } |
2653 | 2653 | ||
2654 | static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw, | 2654 | static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw, |
2655 | int hfp, int hbp, int vsw, int vfp, int vbp) | 2655 | int hfp, int hbp, int vsw, int vfp, int vbp, |
2656 | enum omap_dss_signal_level vsync_level, | ||
2657 | enum omap_dss_signal_level hsync_level, | ||
2658 | enum omap_dss_signal_edge data_pclk_edge, | ||
2659 | enum omap_dss_signal_level de_level, | ||
2660 | enum omap_dss_signal_edge sync_pclk_edge) | ||
2661 | |||
2656 | { | 2662 | { |
2657 | u32 timing_h, timing_v; | 2663 | u32 timing_h, timing_v, l; |
2664 | bool onoff, rf, ipc; | ||
2658 | 2665 | ||
2659 | if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) { | 2666 | if (cpu_is_omap24xx() || omap_rev() < OMAP3430_REV_ES3_0) { |
2660 | timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) | | 2667 | timing_h = FLD_VAL(hsw-1, 5, 0) | FLD_VAL(hfp-1, 15, 8) | |
@@ -2672,6 +2679,44 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw, | |||
2672 | 2679 | ||
2673 | dispc_write_reg(DISPC_TIMING_H(channel), timing_h); | 2680 | dispc_write_reg(DISPC_TIMING_H(channel), timing_h); |
2674 | dispc_write_reg(DISPC_TIMING_V(channel), timing_v); | 2681 | dispc_write_reg(DISPC_TIMING_V(channel), timing_v); |
2682 | |||
2683 | switch (data_pclk_edge) { | ||
2684 | case OMAPDSS_DRIVE_SIG_RISING_EDGE: | ||
2685 | ipc = false; | ||
2686 | break; | ||
2687 | case OMAPDSS_DRIVE_SIG_FALLING_EDGE: | ||
2688 | ipc = true; | ||
2689 | break; | ||
2690 | case OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES: | ||
2691 | default: | ||
2692 | BUG(); | ||
2693 | } | ||
2694 | |||
2695 | switch (sync_pclk_edge) { | ||
2696 | case OMAPDSS_DRIVE_SIG_OPPOSITE_EDGES: | ||
2697 | onoff = false; | ||
2698 | rf = false; | ||
2699 | break; | ||
2700 | case OMAPDSS_DRIVE_SIG_FALLING_EDGE: | ||
2701 | onoff = true; | ||
2702 | rf = false; | ||
2703 | break; | ||
2704 | case OMAPDSS_DRIVE_SIG_RISING_EDGE: | ||
2705 | onoff = true; | ||
2706 | rf = true; | ||
2707 | break; | ||
2708 | default: | ||
2709 | BUG(); | ||
2710 | }; | ||
2711 | |||
2712 | l = dispc_read_reg(DISPC_POL_FREQ(channel)); | ||
2713 | l |= FLD_VAL(onoff, 17, 17); | ||
2714 | l |= FLD_VAL(rf, 16, 16); | ||
2715 | l |= FLD_VAL(de_level, 15, 15); | ||
2716 | l |= FLD_VAL(ipc, 14, 14); | ||
2717 | l |= FLD_VAL(hsync_level, 13, 13); | ||
2718 | l |= FLD_VAL(vsync_level, 12, 12); | ||
2719 | dispc_write_reg(DISPC_POL_FREQ(channel), l); | ||
2675 | } | 2720 | } |
2676 | 2721 | ||
2677 | /* change name to mode? */ | 2722 | /* change name to mode? */ |
@@ -2691,7 +2736,8 @@ void dispc_mgr_set_timings(enum omap_channel channel, | |||
2691 | 2736 | ||
2692 | if (dispc_mgr_is_lcd(channel)) { | 2737 | if (dispc_mgr_is_lcd(channel)) { |
2693 | _dispc_mgr_set_lcd_timings(channel, t.hsw, t.hfp, t.hbp, t.vsw, | 2738 | _dispc_mgr_set_lcd_timings(channel, t.hsw, t.hfp, t.hbp, t.vsw, |
2694 | t.vfp, t.vbp); | 2739 | t.vfp, t.vbp, t.vsync_level, t.hsync_level, |
2740 | t.data_pclk_edge, t.de_level, t.sync_pclk_edge); | ||
2695 | 2741 | ||
2696 | xtot = t.x_res + t.hfp + t.hsw + t.hbp; | 2742 | xtot = t.x_res + t.hfp + t.hsw + t.hbp; |
2697 | ytot = t.y_res + t.vfp + t.vsw + t.vbp; | 2743 | ytot = t.y_res + t.vfp + t.vsw + t.vbp; |
@@ -2702,6 +2748,9 @@ void dispc_mgr_set_timings(enum omap_channel channel, | |||
2702 | DSSDBG("pck %u\n", timings->pixel_clock); | 2748 | DSSDBG("pck %u\n", timings->pixel_clock); |
2703 | DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n", | 2749 | DSSDBG("hsw %d hfp %d hbp %d vsw %d vfp %d vbp %d\n", |
2704 | t.hsw, t.hfp, t.hbp, t.vsw, t.vfp, t.vbp); | 2750 | t.hsw, t.hfp, t.hbp, t.vsw, t.vfp, t.vbp); |
2751 | DSSDBG("vsync_level %d hsync_level %d data_pclk_edge %d de_level %d sync_pclk_edge %d\n", | ||
2752 | t.vsync_level, t.hsync_level, t.data_pclk_edge, | ||
2753 | t.de_level, t.sync_pclk_edge); | ||
2705 | 2754 | ||
2706 | DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); | 2755 | DSSDBG("hsync %luHz, vsync %luHz\n", ht, vt); |
2707 | } else { | 2756 | } else { |