summaryrefslogtreecommitdiffstats
path: root/drivers/hid/i2c-hid
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2018-04-03 09:16:34 -0400
committerJiri Kosina <jkosina@suse.cz>2018-04-16 08:22:42 -0400
commit2dcc8197fefc7eb1d255f1856fc0f642c38cf78d (patch)
tree4a891383a1fd1588a9c73568b2b7a7ee705ba7c8 /drivers/hid/i2c-hid
parent67767a5f7c6d8b48e2f43475bd4d47bb58397d6d (diff)
HID: i2c-hid: Silently fail probe for CHPN0001 touchscreen
The CHPN0001 ACPI device has a _CID of PNP0C50 and even has the _DSM to get the HID descriptor address, but it is not a HID device at all. It uses its own protocol which is handled by the (still being upstreamed) chipone_icn8505 driver. I guess the _CID and the _DSM are the result of a copy and paste job when the vendor was building the ACPI tables. Before this patch the i2c_hid_driver's probe function will fail with a "hid_descr_cmd failed" error. This commit makes the i2c_hid_driver's probe function instead silently ignored devices with an ACPI id of CHPN0001. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers/hid/i2c-hid')
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 78ca994e6254..cf71c33ac2b2 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -863,6 +863,15 @@ static int i2c_hid_fetch_hid_descriptor(struct i2c_hid *ihid)
863} 863}
864 864
865#ifdef CONFIG_ACPI 865#ifdef CONFIG_ACPI
866static const struct acpi_device_id i2c_hid_acpi_blacklist[] = {
867 /*
868 * The CHPN0001 ACPI device, which is used to describe the Chipone
869 * ICN8505 controller, has a _CID of PNP0C50 but is not HID compatible.
870 */
871 {"CHPN0001", 0 },
872 { },
873};
874
866static int i2c_hid_acpi_pdata(struct i2c_client *client, 875static int i2c_hid_acpi_pdata(struct i2c_client *client,
867 struct i2c_hid_platform_data *pdata) 876 struct i2c_hid_platform_data *pdata)
868{ 877{
@@ -879,6 +888,9 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client,
879 return -ENODEV; 888 return -ENODEV;
880 } 889 }
881 890
891 if (acpi_match_device_ids(adev, i2c_hid_acpi_blacklist) == 0)
892 return -ENODEV;
893
882 obj = acpi_evaluate_dsm_typed(handle, &i2c_hid_guid, 1, 1, NULL, 894 obj = acpi_evaluate_dsm_typed(handle, &i2c_hid_guid, 1, 1, NULL,
883 ACPI_TYPE_INTEGER); 895 ACPI_TYPE_INTEGER);
884 if (!obj) { 896 if (!obj) {