rk3036:
authorZheng Yang <zhengyang@rock-chips.com>
Sat, 12 Jul 2014 07:03:35 +0000 (15:03 +0800)
committerZheng Yang <zhengyang@rock-chips.com>
Sat, 12 Jul 2014 07:03:35 +0000 (15:03 +0800)
fb: load_screen is called once in function rk_fb_switch_screen().
tve: fix 7.5 IRE configure error for NTSC and PAL.

drivers/video/rockchip/lcdc/rk3036_lcdc.c
drivers/video/rockchip/rk_fb.c
drivers/video/rockchip/tve/rk3036/rk3036_tve.c

index 2562ac175699670ce9eec65032fe002273986ba7..b67ceaecd36b11caa36f26d8d26f7ea1fc3db7b5 100644 (file)
@@ -1168,14 +1168,14 @@ static int rk3036_lcdc_reg_dump(struct rk_lcdc_driver *dev_drv)
        int i, j;
 
        printk("back up reg:\n");
-       for (i = 0; i <= (0x90 >> 4); i++) {
+       for (i = 0; i <= (0xDC >> 4); i++) {
                for (j = 0; j < 4; j++)
                        printk("%08x  ", *(regsbak + i * 4 + j));
                printk("\n");
        }
 
        printk("lcdc reg:\n");
-       for (i = 0; i <= (0x90 >> 4); i++) {
+       for (i = 0; i <= (0xDC >> 4); i++) {
                for (j = 0; j < 4; j++)
                        printk("%08x  ", readl_relaxed(cbase + i * 4 + j));
                printk("\n");
index 3cacdd847a41b0a15d6e3d43dc70a80a920c0980..b462d3a49fa29a6178867a5e87d93cae1702e8df 100755 (executable)
@@ -2917,7 +2917,7 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id)
        struct fb_info *info = NULL;
        struct rk_lcdc_driver *dev_drv = NULL;
        char name[6];
-       int i, win_id;
+       int i, win_id, load_screen = 0;
        
        if(screen == NULL)
                return -ENODEV;
@@ -2991,8 +2991,9 @@ int rk_fb_switch_screen(struct rk_screen *screen, int enable, int lcdc_id)
                        printk("%s win id %d state %d\n", info->fix.id, win_id, dev_drv->win[win_id]->logicalstate);
                        if( dev_drv->win[win_id]->logicalstate ) {
                                dev_drv->ops->open(dev_drv, win_id, 1);
-                               if(win_id == 1) {
+                               if(!load_screen) {
                                        dev_drv->ops->load_screen(dev_drv, 1);
+                                       load_screen = 1;
                                }
                                info->var.activate |= FB_ACTIVATE_FORCE;
                                info->fbops->fb_set_par(info);
index 6c3a1ea78f6ea70f0b8a7f4c6c2581a1fa0b94e9..537674fa8e9c4f89cdc296abc53c8dddf641efc9 100644 (file)
@@ -30,9 +30,9 @@
 #endif
 
 static const struct fb_videomode rk3036_cvbs_mode [] = {
-       /*      name            refresh xres    yres    pixclock        h_bp    h_fp    v_bp    v_fp    h_pw    v_pw    polariry        PorI            flag*/
-       {       "NTSC",         60,     720,    480,    27000000,       57,     19,     19,     0,      62,     3,      0,      FB_VMODE_INTERLACED,    0},
-       {       "PAL",          50,     720,    576,    27000000,       69,     12,     19,     2,      63,     3,      0,      FB_VMODE_INTERLACED,    0},
+       /*name  refresh xres    yres    pixclock        h_bp    h_fp    v_bp    v_fp    h_pw    v_pw                    polariry                                PorI            flag*/
+       {"NTSC",60,     720,    480,    27000000,       57,     19,     19,     0,      62,     3,      FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,    0},
+       {"PAL", 50,     720,    576,    27000000,       69,     12,     19,     2,      63,     3,      FB_SYNC_HOR_HIGH_ACT | FB_SYNC_VERT_HIGH_ACT,   FB_VMODE_INTERLACED,    0},
 };
 
 static struct rk3036_tve *rk3036_tve = NULL;
@@ -72,7 +72,7 @@ static void tve_set_mode (int mode)
        tve_writel(TV_LUMA_FILTER2, 0xF332d919);
        
        if(mode == TVOUT_CVBS_NTSC) {
-               tve_writel(TV_ROUTING, v_DAC_SENSE_EN(0) | v_Y_IRE_7_5(0) | 
+               tve_writel(TV_ROUTING, v_DAC_SENSE_EN(0) | v_Y_IRE_7_5(1) | 
                        v_Y_AGC_PULSE_ON(1) | v_Y_VIDEO_ON(1) | 
                        v_Y_SYNC_ON(1) | v_PIC_MODE(mode));
                tve_writel(TV_BW_CTRL, v_CHROMA_BW(BP_FILTER_NTSC) | v_COLOR_DIFF_BW(COLOR_DIFF_FILTER_BW_1_3));
@@ -86,7 +86,7 @@ static void tve_set_mode (int mode)
                tve_writel(TV_ACT_TIMING, 0x169800FC);
 
        } else if (mode == TVOUT_CVBS_PAL) {
-               tve_writel(TV_ROUTING, v_DAC_SENSE_EN(0) | v_Y_IRE_7_5(1) | 
+               tve_writel(TV_ROUTING, v_DAC_SENSE_EN(0) | v_Y_IRE_7_5(0) | 
                        v_Y_AGC_PULSE_ON(1) | v_Y_VIDEO_ON(1) | 
                        v_Y_SYNC_ON(1) | v_CVBS_MODE(mode));
                tve_writel(TV_BW_CTRL, v_CHROMA_BW(BP_FILTER_PAL) | v_COLOR_DIFF_BW(COLOR_DIFF_FILTER_BW_1_3));
@@ -119,14 +119,14 @@ static int tve_switch_fb(const struct fb_videomode *modedb, int enable)
        screen->mode = *modedb;
        
        /* Pin polarity */
-//     if(FB_SYNC_HOR_HIGH_ACT & modedb->sync)
+       if(FB_SYNC_HOR_HIGH_ACT & modedb->sync)
                screen->pin_hsync = 1;
-//     else
-//             screen->pin_hsync = 0;
-//     if(FB_SYNC_VERT_HIGH_ACT & modedb->sync)
+       else
+               screen->pin_hsync = 0;
+       if(FB_SYNC_VERT_HIGH_ACT & modedb->sync)
                screen->pin_vsync = 1;
-//     else
-//             screen->pin_vsync = 0;
+       else
+               screen->pin_vsync = 0;
                
        screen->pin_den = 0;
        screen->pin_dclk = 0;