From: Chen-Yu Tsai <wens@csie.org>
To: Icenowy Zheng <icenowy@aosc.xyz>
Cc: Thierry Reding <thierry.reding@gmail.com>,
David Airlie <airlied@linux.ie>, Chen-Yu Tsai <wens@csie.org>,
dri-devel <dri-devel@lists.freedesktop.org>,
linux-kernel <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] drm: panel: simple-panel: get the enable gpio as-is
Date: Mon, 7 Nov 2016 18:12:43 +0800 [thread overview]
Message-ID: <CAGb2v65RiMyiW4RSv3PE2_Doru1KMohEkHCc+v2-WH-MgiKxAA@mail.gmail.com> (raw)
In-Reply-To: <20161106110903.14594-1-icenowy@aosc.xyz>
On Sun, Nov 6, 2016 at 7:09 PM, Icenowy Zheng <icenowy@aosc.xyz> wrote:
> The enable gpio of simple-panel may be used by a simplefb or other
> driver on the panel's display before the KMS driver get load.
>
> Get the GPIO as-is, so the panel won't be disabled, and the simplefb
> can work.
>
> Signed-off-by: Icenowy Zheng <icenowy@aosc.xyz>
> ---
> drivers/gpu/drm/panel/panel-simple.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/panel/panel-simple.c b/drivers/gpu/drm/panel/panel-simple.c
> index 113db3c..ccee4c1 100644
> --- a/drivers/gpu/drm/panel/panel-simple.c
> +++ b/drivers/gpu/drm/panel/panel-simple.c
> @@ -312,7 +312,7 @@ static int panel_simple_probe(struct device *dev, const struct panel_desc *desc)
> return PTR_ERR(panel->supply);
>
> panel->enable_gpio = devm_gpiod_get_optional(dev, "enable",
> - GPIOD_OUT_LOW);
> + GPIOD_ASIS);
The GPIO requested as-is might be in input mode. You should change the
gpiod_set_value calls to gpiod_direction_output calls. The later also
allows you to give an initial value. Not sure if it checks for cansleep
like the set_value calls though.
Regards
ChenYu
> if (IS_ERR(panel->enable_gpio)) {
> err = PTR_ERR(panel->enable_gpio);
> dev_err(dev, "failed to request GPIO: %d\n", err);
> --
> 2.10.1
>
next parent reply other threads:[~2016-11-07 10:13 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20161106110903.14594-1-icenowy@aosc.xyz>
2016-11-07 10:12 ` Chen-Yu Tsai [this message]
2016-11-07 13:17 ` [PATCH] drm: panel: simple-panel: get the enable gpio as-is Thierry Reding
2016-11-07 14:26 ` Philipp Zabel
2016-11-08 11:30 ` Thierry Reding
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=CAGb2v65RiMyiW4RSv3PE2_Doru1KMohEkHCc+v2-WH-MgiKxAA@mail.gmail.com \
--to=wens@csie.org \
--cc=airlied@linux.ie \
--cc=dri-devel@lists.freedesktop.org \
--cc=icenowy@aosc.xyz \
--cc=linux-kernel@vger.kernel.org \
--cc=thierry.reding@gmail.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 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).