linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>
To: Hans de Goede <hdegoede@redhat.com>
Cc: "russianneuromancer @ ya . ru" <russianneuromancer@ya.ru>,
	Gregor Riepl <onitake@gmail.com>,
	linux-input@vger.kernel.org
Subject: Re: [PATCH 2/4] Input: silead_gsl1680: gpiod_get returning -EBUSY is not an error
Date: Tue, 27 Dec 2016 14:14:57 -0800	[thread overview]
Message-ID: <20161227221457.GC28140@dtor-ws> (raw)
In-Reply-To: <20161209103522.3833-2-hdegoede@redhat.com>

On Fri, Dec 09, 2016 at 11:35:20AM +0100, Hans de Goede wrote:
> ACPI gpios may return -EBUSY this means that the gpio is owned by the
> ACPI code, and will be set / cleared as needed by the ACPI code.
> 
> Treat gpiod_get returning -EBUSY as not having a gpio, fixing the
> driver not loading on tablets where this happens.

Hmm, I'd say ACPI should not be exposing existence of GPIO to the
drivers if it decides to manage it itself. Can we hide this in gpiolib
ACPI code?

> 
> Signed-off-by: Hans de Goede <hdegoede@redhat.com>
> ---
>  drivers/input/touchscreen/silead.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c
> index f502c84..4387cd8 100644
> --- a/drivers/input/touchscreen/silead.c
> +++ b/drivers/input/touchscreen/silead.c
> @@ -467,6 +467,14 @@ static int silead_ts_probe(struct i2c_client *client,
>  
>  	/* Power GPIO pin */
>  	data->gpio_power = devm_gpiod_get_optional(dev, "power", GPIOD_OUT_LOW);
> +#ifdef CONFIG_ACPI
> +	/*
> +	 * ACPI gpios may return -EBUSY this means that the gpio is owned by
> +	 * the ACPI code, and will be set / cleared by the ACPI code.
> +	 */
> +	if (IS_ERR(data->gpio_power) && PTR_ERR(data->gpio_power) == -EBUSY)
> +		data->gpio_power = NULL;
> +#endif
>  	if (IS_ERR(data->gpio_power)) {
>  		if (PTR_ERR(data->gpio_power) != -EPROBE_DEFER)
>  			dev_err(dev, "Shutdown GPIO request failed\n");
> -- 
> 2.9.3
> 

Thanks.

-- 
Dmitry

  reply	other threads:[~2016-12-27 22:15 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-12-09 10:35 [PATCH 1/4] input: of_touchscreen: Preserve flags passed into touchscreen_parse_properties Hans de Goede
2016-12-09 10:35 ` [PATCH 2/4] Input: silead_gsl1680: gpiod_get returning -EBUSY is not an error Hans de Goede
2016-12-27 22:14   ` Dmitry Torokhov [this message]
2016-12-31 16:45     ` Hans de Goede
2016-12-31 17:06       ` Gregor Riepl
2016-12-31 18:57         ` Hans de Goede
2016-12-09 10:35 ` [PATCH 3/4] Input: silead_gsl1680: Allow silead_ts_read_props to override default resolution Hans de Goede
2016-12-09 10:35 ` [PATCH 4/4] Input: silead_gsl1680: Add support for setting resolution based on dmi data Hans de Goede
2016-12-27 22:27   ` Dmitry Torokhov
2016-12-31 17:09     ` Hans de Goede

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=20161227221457.GC28140@dtor-ws \
    --to=dmitry.torokhov@gmail.com \
    --cc=hdegoede@redhat.com \
    --cc=linux-input@vger.kernel.org \
    --cc=onitake@gmail.com \
    --cc=russianneuromancer@ya.ru \
    /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).