From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752282AbcKGKNI (ORCPT ); Mon, 7 Nov 2016 05:13:08 -0500 Received: from smtp.csie.ntu.edu.tw ([140.112.30.61]:48692 "EHLO smtp.csie.ntu.edu.tw" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750995AbcKGKNH (ORCPT ); Mon, 7 Nov 2016 05:13:07 -0500 MIME-Version: 1.0 In-Reply-To: <20161106110903.14594-1-icenowy@aosc.xyz> References: <20161106110903.14594-1-icenowy@aosc.xyz> From: Chen-Yu Tsai Date: Mon, 7 Nov 2016 18:12:43 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] drm: panel: simple-panel: get the enable gpio as-is To: Icenowy Zheng Cc: Thierry Reding , David Airlie , Chen-Yu Tsai , dri-devel , linux-kernel Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Nov 6, 2016 at 7:09 PM, Icenowy Zheng 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 > --- > 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 >