[U-Boot] [PATCH v3 09/18] tegra: Add LCD driver

Thierry Reding thierry.reding at avionic-design.de
Thu Jul 19 09:41:55 CEST 2012


On Thu, Jul 12, 2012 at 08:25:09AM -0700, Simon Glass wrote:
> This driver supports driving a single LCD and providing a U-Boot console
> on it.
> 
> Signed-off-by: Simon Glass <sjg at chromium.org>
> ---
> Changes in v2:
> - Update LCD driver to deal with new fdt bindings
> 
> Changes in v3:
> - Adjust LCD driver to use new SOC display driver structures
> - Move some fdt decode code from LCD driver to SOC display driver
> - Rename fdt config structures
> - Use new pwm binding from pre-linux-next
> 
>  drivers/video/Makefile |    1 +
>  drivers/video/tegra.c  |  357 ++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 358 insertions(+), 0 deletions(-)
>  create mode 100644 drivers/video/tegra.c
> 
[...]
> diff --git a/drivers/video/tegra.c b/drivers/video/tegra.c
[...]
> +static int fdt_decode_lcd(const void *blob, struct fdt_panel_config *config)
> +{
> +	int err;
> +	int display_node;
> +
> +	disp_config = tegra_display_get_config();
> +	if (!disp_config) {
> +		debug("%s: Display controller is not configured\n", __func__);
> +		return -1;
> +	}
> +	display_node = disp_config->panel_node;
> +	if (display_node < 0) {
> +		debug("%s: No panel configuration available\n", __func__);
> +		return -1;
> +	}
> +
> +	config->pwm_channel = pwm_request(blob, display_node, "nvidia,pwm");
> +	if (config->pwm_channel < 0) {
> +		debug("%s: Unable to request PWM channel\n", __func__);
> +		return -1;
> +	}
> +
> +	config->cache_type = fdtdec_get_int(blob, display_node,
> +					    "nvidia,cache-type",
> +					    FDT_LCD_CACHE_WRITE_BACK_FLUSH);
> +
> +	err = fdtdec_decode_gpio(blob, display_node,
> +				  "nvidia,backlight-enable-gpios",
> +				  &config->backlight_en);
> +	err |= fdtdec_decode_gpio(blob, display_node,
> +			"nvidia,lvds-shutdown-gpios", &config->lvds_shutdown);
> +	fdtdec_decode_gpio(blob, display_node, "nvidia,backlight-vdd-gpios",
> +			   &config->backlight_vdd);
> +	err |= fdtdec_decode_gpio(blob, display_node, "nvidia,panel-vdd-gpios",
> +				  &config->panel_vdd);
> +	if (err)
> +		return -FDT_ERR_NOTFOUND;

This effectively makes those GPIOs mandatory. The Medcom, however,
doesn't have any of these, so I had to comment this return out to test
the series. I know that this might be an unusual setup, but it's
something that needs to be supported anyway.

Thierry
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 836 bytes
Desc: not available
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20120719/59692bf3/attachment.pgp>


More information about the U-Boot mailing list