Skip to contentSkip to conversation

HID: i2c-hid: Do not set the ACPI companion field in the HID device

PATCH Applied Andrew Duggan 4 participants 4 messages Jun 2, 2015 – Jun 3, 2015 HID

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 HID: i2c-hid: Do not set the ACPI companion field in the HID device

The HID device does not need to know about the ACPI device associated with the underlying i2c device. Setting the ACPI companion field in the HID device also has the side effect of causing HID to be set as wake capable, since acpi_bind_one uses's the companion ACPI device's wakeup flags to set the device as wake capable. Which results in power/wakeup files in sysfs for the HID device which do not do anything.

---
 drivers/hid/i2c-hid/i2c-hid.c | 1 -
 1 file changed, 1 deletion(-)
drivers/hid/i2c-hid/i2c-hid.c +0 -1
index 92d6cdf..0dfb5d1 100644
@@ -1019,7 +1019,6 @@ static int i2c_hid_probe(struct i2c_client *client,
 	hid->driver_data = client;
 	hid->ll_driver = &i2c_hid_ll_driver;
 	hid->dev.parent = &client->dev;
-	ACPI_COMPANION_SET(&hid->dev, ACPI_COMPANION(&client->dev));
 	hid->bus = BUS_I2C;
 	hid->version = le16_to_cpu(ihid->hdesc.bcdVersion);
 	hid->vendor = le16_to_cpu(ihid->hdesc.wVendorID);
Signature · 1 line
2.1.4
Reviewed-by Tested-by on v1 1/1
#1 lore raw
Quoted 8 lines · Andrew Duggan

The HID device does not need to know about the ACPI device associated with the underlying i2c device. Setting the ACPI companion field in the HID device also has the side effect of causing HID to be set as wake capable, since acpi_bind_one uses's the companion ACPI device's wakeup flags to set the device as wake capable. Which results in power/wakeup files in sysfs for the HID device which do not do anything.

Quoted 19 lines
---
 drivers/hid/i2c-hid/i2c-hid.c | 1 -
 1 file changed, 1 deletion(-)
drivers/hid/i2c-hid/i2c-hid.c +0 -2
index 92d6cdf..0dfb5d1 100644
@@ -1019,7 +1019,6 @@ static int i2c_hid_probe(struct i2c_client *client,
        hid->driver_data = client;
        hid->ll_driver = &i2c_hid_ll_driver;
        hid->dev.parent = &client->dev;
-       ACPI_COMPANION_SET(&hid->dev, ACPI_COMPANION(&client->dev));
        hid->bus = BUS_I2C;
        hid->version = le16_to_cpu(ihid->hdesc.bcdVersion);
        hid->vendor = le16_to_cpu(ihid->hdesc.wVendorID);
--

2.1.4

Signature · 3 lines
Benson Leung
Software Engineer, Chrom* OS
[email protected]
Acked-by on v1 1/1
#2 lore raw
In reply to Andrew Duggan
Quoted 8 lines · Andrew Duggan

The HID device does not need to know about the ACPI device associated with the underlying i2c device. Setting the ACPI companion field in the HID device also has the side effect of causing HID to be set as wake capable, since acpi_bind_one uses's the companion ACPI device's wakeup flags to set the device as wake capable. Which results in power/wakeup files in sysfs for the HID device which do not do anything.

Applied
#3 lore raw
In reply to Andrew Duggan
Quoted 8 lines · Andrew Duggan

The HID device does not need to know about the ACPI device associated with the underlying i2c device. Setting the ACPI companion field in the HID device also has the side effect of causing HID to be set as wake capable, since acpi_bind_one uses's the companion ACPI device's wakeup flags to set the device as wake capable. Which results in power/wakeup files in sysfs for the HID device which do not do anything.

Applied to for-4.2/i2c-hid.

Signature · 2 lines
Jiri Kosina
SUSE Labs