aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video/fbdev/omap2/dss/dispc.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2014-10-02 13:58:49 -0400
committerTomi Valkeinen <tomi.valkeinen@ti.com>2015-02-26 05:15:12 -0500
commited35188158552d4b1e7a8df2a10dedf88c813539 (patch)
treea1251e1d5a7c880d01442846644e24c8001433eb /drivers/video/fbdev/omap2/dss/dispc.c
parent7a16360d56f6846da5a7c8cb50b14e3464ad133a (diff)
OMAPDSS: DISPC: explicit handling for sync and de levels
When configuring the lcd timings, instead of writing enum values directly to the HW, use switch-case to get the value to be programmed. This is safer and also allows us to change the enum values. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
Diffstat (limited to 'drivers/video/fbdev/omap2/dss/dispc.c')
-rw-r--r--drivers/video/fbdev/omap2/dss/dispc.c41
1 files changed, 37 insertions, 4 deletions
diff --git a/drivers/video/fbdev/omap2/dss/dispc.c b/drivers/video/fbdev/omap2/dss/dispc.c
index 11bd780fcdfa..8805266a52f4 100644
--- a/drivers/video/fbdev/omap2/dss/dispc.c
+++ b/drivers/video/fbdev/omap2/dss/dispc.c
@@ -2915,7 +2915,7 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw,
2915 2915
2916{ 2916{
2917 u32 timing_h, timing_v, l; 2917 u32 timing_h, timing_v, l;
2918 bool onoff, rf, ipc; 2918 bool onoff, rf, ipc, vs, hs, de;
2919 2919
2920 timing_h = FLD_VAL(hsw-1, dispc.feat->sw_start, 0) | 2920 timing_h = FLD_VAL(hsw-1, dispc.feat->sw_start, 0) |
2921 FLD_VAL(hfp-1, dispc.feat->fp_start, 8) | 2921 FLD_VAL(hfp-1, dispc.feat->fp_start, 8) |
@@ -2927,6 +2927,39 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw,
2927 dispc_write_reg(DISPC_TIMING_H(channel), timing_h); 2927 dispc_write_reg(DISPC_TIMING_H(channel), timing_h);
2928 dispc_write_reg(DISPC_TIMING_V(channel), timing_v); 2928 dispc_write_reg(DISPC_TIMING_V(channel), timing_v);
2929 2929
2930 switch (vsync_level) {
2931 case OMAPDSS_SIG_ACTIVE_LOW:
2932 vs = true;
2933 break;
2934 case OMAPDSS_SIG_ACTIVE_HIGH:
2935 vs = false;
2936 break;
2937 default:
2938 BUG();
2939 }
2940
2941 switch (hsync_level) {
2942 case OMAPDSS_SIG_ACTIVE_LOW:
2943 hs = true;
2944 break;
2945 case OMAPDSS_SIG_ACTIVE_HIGH:
2946 hs = false;
2947 break;
2948 default:
2949 BUG();
2950 }
2951
2952 switch (de_level) {
2953 case OMAPDSS_SIG_ACTIVE_LOW:
2954 de = true;
2955 break;
2956 case OMAPDSS_SIG_ACTIVE_HIGH:
2957 de = false;
2958 break;
2959 default:
2960 BUG();
2961 }
2962
2930 switch (data_pclk_edge) { 2963 switch (data_pclk_edge) {
2931 case OMAPDSS_DRIVE_SIG_RISING_EDGE: 2964 case OMAPDSS_DRIVE_SIG_RISING_EDGE:
2932 ipc = false; 2965 ipc = false;
@@ -2954,10 +2987,10 @@ static void _dispc_mgr_set_lcd_timings(enum omap_channel channel, int hsw,
2954 2987
2955 l = FLD_VAL(onoff, 17, 17) | 2988 l = FLD_VAL(onoff, 17, 17) |
2956 FLD_VAL(rf, 16, 16) | 2989 FLD_VAL(rf, 16, 16) |
2957 FLD_VAL(de_level, 15, 15) | 2990 FLD_VAL(de, 15, 15) |
2958 FLD_VAL(ipc, 14, 14) | 2991 FLD_VAL(ipc, 14, 14) |
2959 FLD_VAL(hsync_level, 13, 13) | 2992 FLD_VAL(hs, 13, 13) |
2960 FLD_VAL(vsync_level, 12, 12); 2993 FLD_VAL(vs, 12, 12);
2961 2994
2962 dispc_write_reg(DISPC_POL_FREQ(channel), l); 2995 dispc_write_reg(DISPC_POL_FREQ(channel), l);
2963 2996