* OMAP DSS: panel-dpi and enable gpios
@ 2014-05-12 17:58 Joachim Eastwood
2014-05-15 13:18 ` Tomi Valkeinen
0 siblings, 1 reply; 5+ messages in thread
From: Joachim Eastwood @ 2014-05-12 17:58 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: Tony Lindgren, linux-omap
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
[ 0.976989] panel-dpi display.12: failed to parse enable gpio
[ 0.977050] panel-dpi: probe of display.12 failed with error -2
regards
Joachim Eastwood
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: OMAP DSS: panel-dpi and enable gpios
2014-05-12 17:58 OMAP DSS: panel-dpi and enable gpios Joachim Eastwood
@ 2014-05-15 13:18 ` Tomi Valkeinen
2014-05-15 21:02 ` Joachim Eastwood
0 siblings, 1 reply; 5+ messages in thread
From: Tomi Valkeinen @ 2014-05-15 13:18 UTC (permalink / raw)
To: Joachim Eastwood; +Cc: Tony Lindgren, linux-omap
[-- Attachment #1: Type: text/plain, Size: 1484 bytes --]
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);
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: OMAP DSS: panel-dpi and enable gpios
2014-05-15 13:18 ` Tomi Valkeinen
@ 2014-05-15 21:02 ` Joachim Eastwood
2014-05-16 7:44 ` Tomi Valkeinen
0 siblings, 1 reply; 5+ messages in thread
From: Joachim Eastwood @ 2014-05-15 21:02 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: Tony Lindgren, linux-omap
On 15 May 2014 15:18, Tomi Valkeinen <tomi.valkeinen@ti.com> 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
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: OMAP DSS: panel-dpi and enable gpios
2014-05-15 21:02 ` Joachim Eastwood
@ 2014-05-16 7:44 ` Tomi Valkeinen
2014-05-16 18:28 ` Joachim Eastwood
0 siblings, 1 reply; 5+ messages in thread
From: Tomi Valkeinen @ 2014-05-16 7:44 UTC (permalink / raw)
To: Joachim Eastwood; +Cc: Tony Lindgren, linux-omap
[-- Attachment #1: Type: text/plain, Size: 3458 bytes --]
On 16/05/14 00:02, Joachim Eastwood wrote:
> On 15 May 2014 15:18, Tomi Valkeinen <tomi.valkeinen@ti.com> 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 :)
The check above was a bit too complex. Here's an updated patch.
From f48b44ca73e29b2328e7852d9beb06b161bb1cb4 Mon Sep 17 00:00:00 2001
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
Date: Thu, 15 May 2014 16:19:44 +0300
Subject: [PATCH] OMAPDSS: panel-dpi: enable-gpio
The enable gpio should be optional, but the driver returns an error if
it doesn't get the gpio.
So change the driver to accept -ENOENT error.
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
index dca6b10d1157..3636b61dc9b4 100644
--- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
+++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
@@ -210,14 +210,18 @@ 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);
+ if (PTR_ERR(gpio) != -ENOENT)
+ return PTR_ERR(gpio);
+ 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);
--
1.9.1
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: OMAP DSS: panel-dpi and enable gpios
2014-05-16 7:44 ` Tomi Valkeinen
@ 2014-05-16 18:28 ` Joachim Eastwood
0 siblings, 0 replies; 5+ messages in thread
From: Joachim Eastwood @ 2014-05-16 18:28 UTC (permalink / raw)
To: Tomi Valkeinen; +Cc: Tony Lindgren, linux-omap
On 16 May 2014 09:44, Tomi Valkeinen <tomi.valkeinen@ti.com> wrote:
> On 16/05/14 00:02, Joachim Eastwood wrote:
>> On 15 May 2014 15:18, Tomi Valkeinen <tomi.valkeinen@ti.com> 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 :)
>
> The check above was a bit too complex. Here's an updated patch.
>
> From f48b44ca73e29b2328e7852d9beb06b161bb1cb4 Mon Sep 17 00:00:00 2001
> From: Tomi Valkeinen <tomi.valkeinen@ti.com>
> Date: Thu, 15 May 2014 16:19:44 +0300
> Subject: [PATCH] OMAPDSS: panel-dpi: enable-gpio
>
> The enable gpio should be optional, but the driver returns an error if
> it doesn't get the gpio.
>
> So change the driver to accept -ENOENT error.
>
> Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
> ---
> drivers/video/fbdev/omap2/displays-new/panel-dpi.c | 10 +++++++---
> 1 file changed, 7 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> index dca6b10d1157..3636b61dc9b4 100644
> --- a/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> +++ b/drivers/video/fbdev/omap2/displays-new/panel-dpi.c
> @@ -210,14 +210,18 @@ 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);
> + if (PTR_ERR(gpio) != -ENOENT)
> + return PTR_ERR(gpio);
> + 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);
> --
> 1.9.1
Tested-by: Joachim Eastwood <manabian@gmail.com>
This also works fine.
regards
Joachim Eastwood
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2014-05-16 18:28 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-12 17:58 OMAP DSS: panel-dpi and enable gpios Joachim Eastwood
2014-05-15 13:18 ` Tomi Valkeinen
2014-05-15 21:02 ` Joachim Eastwood
2014-05-16 7:44 ` Tomi Valkeinen
2014-05-16 18:28 ` Joachim Eastwood
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).