Thread (5 messages) 5 messages, 3 authors, 2015-04-23

Re: Hidden dependency of i2c-hid on GPIOLIB

From: Mika Westerberg <mika.westerberg@linux.intel.com>
Date: 2015-04-14 09:59:37
Also in: lkml
Subsystem: hid core layer, the rest · Maintainers: Jiri Kosina, Benjamin Tissoires, Linus Torvalds

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?
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[] = {
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help