[U-Boot] [PATCH 09/17] sunxi: video: Add lcd output support

Ian Campbell ijc at hellion.org.uk
Mon Dec 29 14:43:41 CET 2014


On Wed, 2014-12-24 at 20:06 +0100, Hans de Goede wrote:

> +static void sunxi_lcdc_panel_enable(void)
> +{
> +	int pin;
> +
> +	/*
> +	 * Start with backlight disabled to avoid the screen flashing to
> +	 * white while the lcd inits.
> +	 */
> +	pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_BL_EN);
> +	if (pin != -1) {
> +		gpio_request(pin, "lcd_backlight_enable");

You request this and the backlight pwm again in backlight_enable. Are
such multiple requests OK?

> +		gpio_direction_output(pin, 0);
> +	}
> +
> +	pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_BL_PWM);
> +	if (pin != -1) {
> +		gpio_request(pin, "lcd_backlight_pwm");
> +		/* backlight pwm is inverted, set to 1 to disable backlight */
> +		gpio_direction_output(pin, 1);
> +	}
> +
> +	/* Give the backlight some time to turn off and power up the panel. */
> +	mdelay(40);
> +	pin = sunxi_name_to_gpio(CONFIG_VIDEO_LCD_POWER);
> +	if (pin != -1) {
> +		gpio_request(pin, "lcd_power");
> +		gpio_direction_output(pin, 1);
> +	}
> +}
> +
> +static void sunxi_lcdc_backlight_enable(void)
> +{
> +	int pin;
> +
> +	/*
> +	 * We want to have scanned out atleast one frame before enabling the

"at least".

> +	 * backlight to avoid the screen flashing to white when we enable it.
> +	 */
> +	mdelay(40);

I take it there isn't a vsync status bit or something we can watch for?

> [...] 
> +	switch (sunxi_display.monitor) {
> +	case sunxi_monitor_none:
> +		return 0;
> +	case sunxi_monitor_dvi:
> +	case sunxi_monitor_hdmi:
> +		pipeline = "de_be0-lcd0-hdmi";
> +		break;
> +	case sunxi_monitor_lcd:
> +		pipeline = "de_be0-lcd0";
> +		break;
> +	case sunxi_monitor_vga:
> +		break;
> +	}
> +
>  	/* Find a framebuffer node, with pipeline == "de_be0-lcd0-hdmi" */

This comment is no longer accurate.

>  	offset = fdt_node_offset_by_compatible(blob, -1,
>  					       "allwinner,simple-framebuffer");
>  	while (offset >= 0) {
>  		ret = fdt_find_string(blob, offset, "allwinner,pipeline",
> -				      "de_be0-lcd0-hdmi");
> +				      pipeline);
>  		if (ret == 0)
>  			break;
>  		offset = fdt_node_offset_by_compatible(blob, offset,

Ian.




More information about the U-Boot mailing list