Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1515979

Re: [PATCH] drm: panel: simple-panel: get the enable gpio as-is

From Chen-Yu Tsai <wens@csie.org>
Newsgroups linux.kernel
Subject Re: [PATCH] drm: panel: simple-panel: get the enable gpio as-is
Date 2016-11-07 11:20 +0100
Message-ID <sAPbX-1LW-3@gated-at.bofh.it> (permalink)
References <sAPbX-1LW-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


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
>

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] drm: panel: simple-panel: get the enable gpio as-is Chen-Yu Tsai <wens@csie.org> - 2016-11-07 11:20 +0100
  Re: [PATCH] drm: panel: simple-panel: get the enable gpio as-is Thierry Reding <thierry.reding@gmail.com> - 2016-11-07 14:40 +0100
    Re: [PATCH] drm: panel: simple-panel: get the enable gpio as-is Philipp Zabel <p.zabel@pengutronix.de> - 2016-11-07 15:40 +0100
      Re: [PATCH] drm: panel: simple-panel: get the enable gpio as-is Thierry Reding <thierry.reding@gmail.com> - 2016-11-08 12:40 +0100

csiph-web