Example #1
0
int lcd_set_mode(unsigned int *option)
{
	if( option ){
		if( (p_lcd = lcd_get_parm((lcd_panel_t) option[0],option[1])) ){
			printk("[LCD] %s (id %d,bpp %d)\n",p_lcd->name,option[0],option[1]);
		}
		else {
			printk("[LCD] *E* lcd %d not support\n",option[0]);
			return -1;
		}
		
		if( p_lcd->initial ){
			p_lcd->initial();
		}
		lcd_blt_set_level(lcd_blt_id,lcd_blt_level);
		lcd_blt_set_freq(lcd_blt_id,lcd_blt_freq);
		lcd_blt_enable(lcd_blt_id,0);
		option[2] = p_lcd->capability;
	}
	else {
		lcd_blt_enable(lcd_blt_id,0);
		if( p_lcd && p_lcd->uninitial ){
			p_lcd->uninitial();
		}
		p_lcd = 0;
	}
	return 0;
}
Example #2
0
static int display_set_pwm(char *val, int on)
{

	if (val == NULL) {
		printf("error : can not get pwm parameter\n");
		return -1;
	}

	lcd_blt_enable(g_pwm_setting.pwm_no, 0);

	parse_pwm_params(NULL, val);

	if ((g_display_vaild&PWMDEFMASK) == PWMDEFTP) {
		lcd_blt_set_pwm(g_pwm_setting.pwm_no, g_pwm_setting.duty, g_pwm_setting.period);
	} else {
		// fan : may need to check PWM power ..
		pwm_set_period(g_pwm_setting.pwm_no, g_pwm_setting.period-1);
		pwm_set_duty(g_pwm_setting.pwm_no, g_pwm_setting.duty-1);
		pwm_set_control(g_pwm_setting.pwm_no, (g_pwm_setting.duty-1)? 0x35:0x8);
		pwm_set_gpio(g_pwm_setting.pwm_no, g_pwm_setting.duty-1);
		pwm_set_scalar(g_pwm_setting.pwm_no, g_pwm_setting.scalar-1);
	}

	lcd_blt_enable(g_pwm_setting.pwm_no, on);

	return 0;
}
Example #3
0
int display_init(int on, int force)
{
	mv_surface s;

	if ((g_display_vaild&DISPLAY_ENABLE) == DISPLAY_ENABLE) {
		if (force) { // force re-initial 
			if (g_display_param.vout == VPP_VOUT_LCD)
				lcd_blt_enable(g_pwm_setting.pwm_no, 0);
			govrh_set_dvo_enable(VPP_FLAG_DISABLE);
			govrh_set_tg_enable(VPP_FLAG_DISABLE);
			g_display_vaild = 0; 
		}
	} else 
		force = 1;
 
	if (force) {
		if (wmt_graphic_init()) {
			printf("wmt_graphic_init failed\n");
			return -1;
		} else
			printf("wmt_graphic_init ok\n");
		s.width = vfb_var.xres;
		s.height = vfb_var.yres;
		s.startAddr = (char *)g_fb_phy;
		s.bits_per_pixel = vfb_var.bits_per_pixel;
		s.lineBytes = s.width*(vfb_var.bits_per_pixel>>3);
		mv_initPrimary(&s);
	}
	if ((g_display_param.vout == VPP_VOUT_LCD) && (on != 0)) {
		printf("before lcd_blt_enable !!!!!!!!!\n");
		lcd_blt_enable(g_pwm_setting.pwm_no, 1);
		printf("lcd_blt_enable !!!!!!!!!\n");
	}
	text_x = 30;
	text_y = 30 - CHAR_HEIGHT;
	return 0;
}
Example #4
0
static int display_show(int format)
{
	if (g_img_phy == 0xFFFF) {
		printf("%s is not found , command (display show) is invaild\n", ENV_IMGADDR);
		return -1;
	}
	if (display_init(0, 0))
		return -1;

	printf("Loading BMP ..... ");
	if (mv_loadBmp((unsigned char *)g_img_phy)) {
		printf("failed\r\n");
		return -1;
	}
	printf("ok\n");
	if (g_display_param.vout == VPP_VOUT_LCD)
		lcd_blt_enable(g_pwm_setting.pwm_no, 1);

	return 0;
}
Example #5
0
/*----------------------- vout device plugin --------------------------------------*/
void lcd_set_power_down(int enable)
{
	lcd_blt_enable(lcd_blt_id,!enable);
}