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

Simon Glass sjg at chromium.org
Thu Sep 27 19:28:31 CEST 2012


Hi Thierry,

On Thu, Jul 19, 2012 at 12:41 AM, Thierry Reding
<thierry.reding at avionic-design.de> wrote:
> 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.

I am taking another look at this. I will make these GPIOs optional.

Regards,
Simon

>
> Thierry


More information about the U-Boot mailing list