linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Gabriele Mazzotta <gabriele.mzt@gmail.com>
To: Mika Westerberg <mika.westerberg@linux.intel.com>
Cc: Jiri Kosina <jkosina@suse.cz>,
	linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Benjamin Tissoires <benjamin.tissoires@redhat.com>
Subject: Re: Hidden dependency of i2c-hid on GPIOLIB
Date: Tue, 14 Apr 2015 12:03:51 +0200	[thread overview]
Message-ID: <7007524.JGeOHMMZVW@xps13> (raw)
In-Reply-To: <20150414095924.GB1677@lahna.fi.intel.com>

On Tuesday 14 April 2015 12:59:24 Mika Westerberg wrote:
> On Tue, Apr 14, 2015 at 12:55:20AM +0200, Gabriele Mazzotta wrote:
> > Hi,
> > 
> > my touchpad stopped working because of a485923efbb8 ("HID: i2c-hid:
> > Add support for ACPI GPIO interrupts"). It turned out that I need
> > CONFIG_GPIOLIB. I think this dependency should be made explicit or the
> > driver should not depend on it.
> 
> Using GPIOs should be optional. Gpiolib stubs functions out whenever it
> is not enabled.
> 
> However, I made a mistake when GPIOs are fed to the driver. If gpiolib
> is not enabled acpi_dev_add_driver_gpios() returns -ENXIO and prevents
> your touchpad from working.
> 
> I think it is alright to ignore the error here. Can you try if below
> patch helps?

Sorry for not being more specific. Yes, the problem is that
acpi_dev_add_driver_gpios() returns -ENXIO if CONFIG_GPIOLIB is not set.

> diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
> index ab4dd952b6ba..b427c11d4cd3 100644
> --- a/drivers/hid/i2c-hid/i2c-hid.c
> +++ b/drivers/hid/i2c-hid/i2c-hid.c
> @@ -877,7 +877,8 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client,
>  	pdata->hid_descriptor_address = obj->integer.value;
>  	ACPI_FREE(obj);
>  
> -	return acpi_dev_add_driver_gpios(adev, i2c_hid_acpi_gpios);
> +	acpi_dev_add_driver_gpios(adev, i2c_hid_acpi_gpios);
> +	return 0;
>  }
>  
>  static const struct acpi_device_id i2c_hid_acpi_match[] = {

  reply	other threads:[~2015-04-14 10:03 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-04-13 22:55 Hidden dependency of i2c-hid on GPIOLIB Gabriele Mazzotta
2015-04-14  9:59 ` Mika Westerberg
2015-04-14 10:03   ` Gabriele Mazzotta [this message]
2015-04-14 14:35     ` [PATCH] HID: i2c-hid: Do not fail probing if gpiolib is not enabled Mika Westerberg
2015-04-23  8:58       ` Jiri Kosina

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=7007524.JGeOHMMZVW@xps13 \
    --to=gabriele.mzt@gmail.com \
    --cc=benjamin.tissoires@redhat.com \
    --cc=jkosina@suse.cz \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mika.westerberg@linux.intel.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).