コード例 #1
0
ファイル: mx2fb.c プロジェクト: R0-Developers/YP-R0_Kernel
/*!
 * @brief Disable LCD controller.
 * @param info	framebuffer information pointer
 */
static void _disable_lcdc(struct fb_info *info)
{
	struct mx2fb_info *mx2fbi = (struct mx2fb_info *)info->par;

	if (mx2fbi->type == MX2FB_TYPE_GW)
		_disable_graphic_window(info);
	else {
		if (fb_enabled) {
			gpio_lcdc_inactive();
			board_power_lcd(0);
			clk_disable(lcdc_clk);
			fb_enabled = 0;
		}
#ifdef CONFIG_FB_MXC_TVOUT
		if (fb_mode) {
			int enable = 0;

			if ((strcmp(fb_mode, MODE_VGA) == 0)
			    || (strcmp(fb_mode, MODE_NTSC) == 0)
			    || (strcmp(fb_mode, MODE_PAL) == 0))
				fs453_ioctl(ENCODER_ENABLE_OUTPUT, &enable);
		}
#endif
	}
}
コード例 #2
0
ファイル: mx2fb.c プロジェクト: Timesys/linux-timesys
/*!
 * @brief Enable LCD controller.
 * @param info	framebuffer information pointer
 */
static void _enable_lcdc(struct fb_info *info)
{
	static int first_enable = 1;
	struct mx2fb_info *mx2fbi = (struct mx2fb_info *)info->par;

	/*
	 * Graphic window can only be enabled while the HCLK to the LCDC
	 * is disabled. Once enabled it can subsequently be disabled and
	 * enabled without turning off the HCLK.
	 * The graphic window is enabled and then disabled here. So next
	 * time to enable graphic window the HCLK to LCDC does not need
	 * to be disabled, and the flicker (due to disabling of HCLK to
	 * LCDC) is avoided.
	 */
	if (first_enable) {
		_enable_graphic_window(info);
		_disable_graphic_window(info);
		first_enable = 0;
	}

	if (mx2fbi->type == MX2FB_TYPE_GW)
		_enable_graphic_window(info);
	else if (!fb_enabled) {
		clk_enable(lcdc_clk);
		gpio_lcdc_active();
		board_power_lcd(1);
		_set_brightness(brightness);
		fb_enabled++;
#ifdef CONFIG_FB_MXC_TVOUT
		if (fb_mode) {
			unsigned long mode = 0;

			if (strcmp(fb_mode, MODE_VGA) == 0)
				mode = VIDEO_ENCODER_VGA;
			else if (strcmp(fb_mode, MODE_NTSC) == 0)
				mode = VIDEO_ENCODER_NTSC;
			else if (strcmp(fb_mode, MODE_PAL) == 0)
				mode = VIDEO_ENCODER_PAL;
			if (mode)
				fs453_ioctl(ENCODER_SET_NORM, &mode);
		}
#endif
	}
}