aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/hid
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2015-05-21 20:23:11 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2015-05-21 20:23:11 -0400
commit6efdb114b430000b6b96d5beb78cd1345d4513dd (patch)
tree519fe3c5709897c0d55b6130ba686baeeef99a59 /drivers/hid
parente51a3630565f61a5151f24f9ece191277ddaa320 (diff)
parent26ba61f871b4aa9958bcebffcbeb558094d75928 (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID fixes from Jiri Kosina: "Bugfixes for HID subsystem that should go in 4.1. Important highlights: - the patch that extended support for HID++ protocol for TK820 touchpad turns out to be causing regressions due to firmware issues; patch reverting back to basic support from Benjamin Tissoires - Wacom driver can oops for devices that report non-touch data on touch interfaces. Fix from Ping Cheng - gpiolib is not mandatory for i2c-hid, so the driver shouldn't fail if gpiolib is not enabled. Fix from Mika Westerberg" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: HID: wacom: fix an Oops caused by wacom_wac_finger_count_touches HID: usbhid: Add HID_QUIRK_NOGET for Aten DVI KVM switch HID: hid-sensor-hub: Fix debug lock warning Revert "HID: logitech-hidpp: support combo keyboard touchpad TK820" HID: i2c-hid: Do not fail probing if gpiolib is not enabled
Diffstat (limited to 'drivers/hid')
-rw-r--r--drivers/hid/hid-ids.h1
-rw-r--r--drivers/hid/hid-logitech-hidpp.c20
-rw-r--r--drivers/hid/hid-sensor-hub.c13
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c5
-rw-r--r--drivers/hid/usbhid/hid-quirks.c1
-rw-r--r--drivers/hid/wacom_wac.c3
6 files changed, 19 insertions, 24 deletions
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 41f167e4d75f..7ce93d927f62 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -164,6 +164,7 @@
164#define USB_DEVICE_ID_ATEN_2PORTKVM 0x2204 164#define USB_DEVICE_ID_ATEN_2PORTKVM 0x2204
165#define USB_DEVICE_ID_ATEN_4PORTKVM 0x2205 165#define USB_DEVICE_ID_ATEN_4PORTKVM 0x2205
166#define USB_DEVICE_ID_ATEN_4PORTKVMC 0x2208 166#define USB_DEVICE_ID_ATEN_4PORTKVMC 0x2208
167#define USB_DEVICE_ID_ATEN_CS682 0x2213
167 168
168#define USB_VENDOR_ID_ATMEL 0x03eb 169#define USB_VENDOR_ID_ATMEL 0x03eb
169#define USB_DEVICE_ID_ATMEL_MULTITOUCH 0x211c 170#define USB_DEVICE_ID_ATMEL_MULTITOUCH 0x211c
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid-logitech-hidpp.c
index b3cf6fd4be96..5fd530acf747 100644
--- a/drivers/hid/hid-logitech-hidpp.c
+++ b/drivers/hid/hid-logitech-hidpp.c
@@ -44,7 +44,6 @@ MODULE_PARM_DESC(disable_raw_mode,
44/* bits 1..20 are reserved for classes */ 44/* bits 1..20 are reserved for classes */
45#define HIDPP_QUIRK_DELAYED_INIT BIT(21) 45#define HIDPP_QUIRK_DELAYED_INIT BIT(21)
46#define HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS BIT(22) 46#define HIDPP_QUIRK_WTP_PHYSICAL_BUTTONS BIT(22)
47#define HIDPP_QUIRK_MULTI_INPUT BIT(23)
48 47
49/* 48/*
50 * There are two hidpp protocols in use, the first version hidpp10 is known 49 * There are two hidpp protocols in use, the first version hidpp10 is known
@@ -706,12 +705,6 @@ static int wtp_input_mapping(struct hid_device *hdev, struct hid_input *hi,
706 struct hid_field *field, struct hid_usage *usage, 705 struct hid_field *field, struct hid_usage *usage,
707 unsigned long **bit, int *max) 706 unsigned long **bit, int *max)
708{ 707{
709 struct hidpp_device *hidpp = hid_get_drvdata(hdev);
710
711 if ((hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT) &&
712 (field->application == HID_GD_KEYBOARD))
713 return 0;
714
715 return -1; 708 return -1;
716} 709}
717 710
@@ -720,10 +713,6 @@ static void wtp_populate_input(struct hidpp_device *hidpp,
720{ 713{
721 struct wtp_data *wd = hidpp->private_data; 714 struct wtp_data *wd = hidpp->private_data;
722 715
723 if ((hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT) && origin_is_hid_core)
724 /* this is the generic hid-input call */
725 return;
726
727 __set_bit(EV_ABS, input_dev->evbit); 716 __set_bit(EV_ABS, input_dev->evbit);
728 __set_bit(EV_KEY, input_dev->evbit); 717 __set_bit(EV_KEY, input_dev->evbit);
729 __clear_bit(EV_REL, input_dev->evbit); 718 __clear_bit(EV_REL, input_dev->evbit);
@@ -1245,10 +1234,6 @@ static int hidpp_probe(struct hid_device *hdev, const struct hid_device_id *id)
1245 if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT) 1234 if (hidpp->quirks & HIDPP_QUIRK_DELAYED_INIT)
1246 connect_mask &= ~HID_CONNECT_HIDINPUT; 1235 connect_mask &= ~HID_CONNECT_HIDINPUT;
1247 1236
1248 /* Re-enable hidinput for multi-input devices */
1249 if (hidpp->quirks & HIDPP_QUIRK_MULTI_INPUT)
1250 connect_mask |= HID_CONNECT_HIDINPUT;
1251
1252 ret = hid_hw_start(hdev, connect_mask); 1237 ret = hid_hw_start(hdev, connect_mask);
1253 if (ret) { 1238 if (ret) {
1254 hid_err(hdev, "%s:hid_hw_start returned error\n", __func__); 1239 hid_err(hdev, "%s:hid_hw_start returned error\n", __func__);
@@ -1296,11 +1281,6 @@ static const struct hid_device_id hidpp_devices[] = {
1296 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH, 1281 HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_LOGITECH,
1297 USB_DEVICE_ID_LOGITECH_T651), 1282 USB_DEVICE_ID_LOGITECH_T651),
1298 .driver_data = HIDPP_QUIRK_CLASS_WTP }, 1283 .driver_data = HIDPP_QUIRK_CLASS_WTP },
1299 { /* Keyboard TK820 */
1300 HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
1301 USB_VENDOR_ID_LOGITECH, 0x4102),
1302 .driver_data = HIDPP_QUIRK_DELAYED_INIT | HIDPP_QUIRK_MULTI_INPUT |
1303 HIDPP_QUIRK_CLASS_WTP },
1304 1284
1305 { HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE, 1285 { HID_DEVICE(BUS_USB, HID_GROUP_LOGITECH_DJ_DEVICE,
1306 USB_VENDOR_ID_LOGITECH, HID_ANY_ID)}, 1286 USB_VENDOR_ID_LOGITECH, HID_ANY_ID)},
diff --git a/drivers/hid/hid-sensor-hub.c b/drivers/hid/hid-sensor-hub.c
index c3f6f1e311ea..090a1ba0abb6 100644
--- a/drivers/hid/hid-sensor-hub.c
+++ b/drivers/hid/hid-sensor-hub.c
@@ -294,7 +294,7 @@ int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
294 if (!report) 294 if (!report)
295 return -EINVAL; 295 return -EINVAL;
296 296
297 mutex_lock(&hsdev->mutex); 297 mutex_lock(hsdev->mutex_ptr);
298 if (flag == SENSOR_HUB_SYNC) { 298 if (flag == SENSOR_HUB_SYNC) {
299 memset(&hsdev->pending, 0, sizeof(hsdev->pending)); 299 memset(&hsdev->pending, 0, sizeof(hsdev->pending));
300 init_completion(&hsdev->pending.ready); 300 init_completion(&hsdev->pending.ready);
@@ -328,7 +328,7 @@ int sensor_hub_input_attr_get_raw_value(struct hid_sensor_hub_device *hsdev,
328 kfree(hsdev->pending.raw_data); 328 kfree(hsdev->pending.raw_data);
329 hsdev->pending.status = false; 329 hsdev->pending.status = false;
330 } 330 }
331 mutex_unlock(&hsdev->mutex); 331 mutex_unlock(hsdev->mutex_ptr);
332 332
333 return ret_val; 333 return ret_val;
334} 334}
@@ -667,7 +667,14 @@ static int sensor_hub_probe(struct hid_device *hdev,
667 hsdev->vendor_id = hdev->vendor; 667 hsdev->vendor_id = hdev->vendor;
668 hsdev->product_id = hdev->product; 668 hsdev->product_id = hdev->product;
669 hsdev->usage = collection->usage; 669 hsdev->usage = collection->usage;
670 mutex_init(&hsdev->mutex); 670 hsdev->mutex_ptr = devm_kzalloc(&hdev->dev,
671 sizeof(struct mutex),
672 GFP_KERNEL);
673 if (!hsdev->mutex_ptr) {
674 ret = -ENOMEM;
675 goto err_stop_hw;
676 }
677 mutex_init(hsdev->mutex_ptr);
671 hsdev->start_collection_index = i; 678 hsdev->start_collection_index = i;
672 if (last_hsdev) 679 if (last_hsdev)
673 last_hsdev->end_collection_index = i; 680 last_hsdev->end_collection_index = i;
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index ab4dd952b6ba..92d6cdf02460 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -862,6 +862,7 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client,
862 union acpi_object *obj; 862 union acpi_object *obj;
863 struct acpi_device *adev; 863 struct acpi_device *adev;
864 acpi_handle handle; 864 acpi_handle handle;
865 int ret;
865 866
866 handle = ACPI_HANDLE(&client->dev); 867 handle = ACPI_HANDLE(&client->dev);
867 if (!handle || acpi_bus_get_device(handle, &adev)) 868 if (!handle || acpi_bus_get_device(handle, &adev))
@@ -877,7 +878,9 @@ static int i2c_hid_acpi_pdata(struct i2c_client *client,
877 pdata->hid_descriptor_address = obj->integer.value; 878 pdata->hid_descriptor_address = obj->integer.value;
878 ACPI_FREE(obj); 879 ACPI_FREE(obj);
879 880
880 return acpi_dev_add_driver_gpios(adev, i2c_hid_acpi_gpios); 881 /* GPIOs are optional */
882 ret = acpi_dev_add_driver_gpios(adev, i2c_hid_acpi_gpios);
883 return ret < 0 && ret != -ENXIO ? ret : 0;
881} 884}
882 885
883static const struct acpi_device_id i2c_hid_acpi_match[] = { 886static const struct acpi_device_id i2c_hid_acpi_match[] = {
diff --git a/drivers/hid/usbhid/hid-quirks.c b/drivers/hid/usbhid/hid-quirks.c
index a775143e6265..4696895eb708 100644
--- a/drivers/hid/usbhid/hid-quirks.c
+++ b/drivers/hid/usbhid/hid-quirks.c
@@ -61,6 +61,7 @@ static const struct hid_blacklist {
61 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET }, 61 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_2PORTKVM, HID_QUIRK_NOGET },
62 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET }, 62 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVM, HID_QUIRK_NOGET },
63 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET }, 63 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_4PORTKVMC, HID_QUIRK_NOGET },
64 { USB_VENDOR_ID_ATEN, USB_DEVICE_ID_ATEN_CS682, HID_QUIRK_NOGET },
64 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FIGHTERSTICK, HID_QUIRK_NOGET }, 65 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FIGHTERSTICK, HID_QUIRK_NOGET },
65 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET }, 66 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_COMBATSTICK, HID_QUIRK_NOGET },
66 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE, HID_QUIRK_NOGET }, 67 { USB_VENDOR_ID_CH, USB_DEVICE_ID_CH_FLIGHT_SIM_ECLIPSE_YOKE, HID_QUIRK_NOGET },
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index fa54d3290659..adf959dcfa5d 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -1072,6 +1072,9 @@ static int wacom_wac_finger_count_touches(struct wacom_wac *wacom)
1072 int count = 0; 1072 int count = 0;
1073 int i; 1073 int i;
1074 1074
1075 if (!touch_max)
1076 return 0;
1077
1075 /* non-HID_GENERIC single touch input doesn't call this routine */ 1078 /* non-HID_GENERIC single touch input doesn't call this routine */
1076 if ((touch_max == 1) && (wacom->features.type == HID_GENERIC)) 1079 if ((touch_max == 1) && (wacom->features.type == HID_GENERIC))
1077 return wacom->hid_data.tipswitch && 1080 return wacom->hid_data.tipswitch &&