static int lvds_set_current_vmode(vmode_t mode) { int i, j, count = ARRAY_SIZE(lvds_info); long m = 10, n = 10; for(i=0; i<count; i++) { if(lvds_info[i].mode==mode) { cur_lvds_index = i; break; } } if(i == count) return -EINVAL; /* to do */ if (lvds_init_flag == 0) { /*for (j=0; j<m; j++) udelay(1000);*/ clk_util_set_video_clock( 0x00000641, 1 ); // divide by 1 init_lvds_phy(); init_lvds(); Wr(ENCP_VIDEO_EN, 1); Wr(VPP_HOLD_LINES, 0x08080808); lvds_enable_vsync_interrupt(); WRITE_MPEG_REG(VPP_POSTBLEND_H_SIZE, lvds_info[0].width); /*for (j=0; j<n; j++) udelay(1000);*/ lvds_init_flag = 1; } return 0; }
static inline void _init_display_driver(Lcd_Config_t *pConf) { int lcd_type; const char* lcd_type_table[]={ "NULL", "TTL", "LVDS", "MINILVDS", "VBYONE", "invalid", }; lcd_type = pDev->conf.lcd_basic.lcd_type; printf("\nInit LCD type: %s.\n", lcd_type_table[lcd_type]); switch (lcd_type) { case LCD_DIGITAL_TTL: printf("ttl mode is selected!\n"); set_pll_ttl(pConf); venc_set_ttl(pConf); set_tcon_ttl(pConf); set_ttl_pinmux(); break; case LCD_DIGITAL_LVDS: printf("lvds mode is selected!\n"); set_pll_lvds(pConf); venc_set_lvds(pConf); set_control_lvds(pConf); init_lvds_phy(pConf); set_tcon_lvds(pConf); break; case LCD_DIGITAL_VBYONE: printf("vx1 mode is selected!\n"); set_pll_vbyone(pConf); venc_set_vx1(pConf); set_control_vbyone(pConf); init_vbyone_phy(pConf); set_tcon_vbyone(pConf); set_vx1_pinmux(); break; default: printf("Invalid LCD type.\n"); break; } }