Re: OMAP DSS: panel-dpi and enable gpios

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 15 May 2014 15:18, Tomi Valkeinen <tomi.valkeinen@xxxxxx> wrote:
> On 12/05/14 20:58, Joachim Eastwood wrote:
>> Hello Tomi,
>>
>> There seems to be a mismatch between your panel-dpi code and DT docs.
>>
>> The docs state that enable-gpios is optinal but in panel-dpi.c you
>> have the following code
>> gpio = devm_gpiod_get(&pdev->dev, "enable");
>> if (IS_ERR(gpio)) {
>>     dev_err(&pdev->dev, "failed to parse enable gpio\n");
>>     return PTR_ERR(gpio);
>> } else {
>>     gpiod_direction_output(gpio, 0);
>>     ddata->enable_gpio = gpio;
>> }
>>
>> Making probing fail on my DT since I don't use enable-gpios with
>
> Would this work? Only compile tested.
>
> diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> index dca6b10d1157..2ac38eaa4c8f 100644
> --- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> +++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> @@ -210,14 +210,19 @@ static int panel_dpi_probe_of(struct platform_device *pdev)
>         struct gpio_desc *gpio;
>
>         gpio = devm_gpiod_get(&pdev->dev, "enable");
> +
>         if (IS_ERR(gpio)) {
> -               dev_err(&pdev->dev, "failed to parse enable gpio\n");
> -               return PTR_ERR(gpio);
> +               r = PTR_ERR(gpio);
> +               if (r == -EPROBE_DEFER || r != -ENOENT)
> +                       return r;
> +               else
> +                       gpio = NULL;
>         } else {
>                 gpiod_direction_output(gpio, 0);
> -               ddata->enable_gpio = gpio;
>         }
>
> +       ddata->enable_gpio = gpio;
> +
>         ddata->backlight_gpio = -ENOENT;
>
>         r = of_get_display_timing(node, "panel-timing", &timing);

Seems to do the trick here.

Display is showing Tux's on boot up again :)

regards
Joachim Eastwood
--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Arm (vger)]     [ARM Kernel]     [ARM MSM]     [Linux Tegra]     [Linux WPAN Networking]     [Linux Wireless Networking]     [Maemo Users]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux