All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Joachim Eastwood <manabian@gmail.com>
Cc: Tony Lindgren <tony@atomide.com>, linux-omap@vger.kernel.org
Subject: Re: OMAP DSS: panel-dpi and enable gpios
Date: Thu, 15 May 2014 16:18:53 +0300	[thread overview]
Message-ID: <5374BEBD.4060305@ti.com> (raw)
In-Reply-To: <CAGhQ9VxDQaRzjCMm1RfxVmPt7Nk14ZTeS0-BmBfFDcxQNy__Tw@mail.gmail.com>

[-- 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 --]

  reply	other threads:[~2014-05-15 13:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 17:58 OMAP DSS: panel-dpi and enable gpios Joachim Eastwood
2014-05-15 13:18 ` Tomi Valkeinen [this message]
2014-05-15 21:02   ` Joachim Eastwood
2014-05-16  7:44     ` Tomi Valkeinen
2014-05-16 18:28       ` Joachim Eastwood

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=5374BEBD.4060305@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=linux-omap@vger.kernel.org \
    --cc=manabian@gmail.com \
    --cc=tony@atomide.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.