Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid

Pull HID fixes from Jiri Kosina:

- regression fix (caused by me applying a wrong version of patch) for
sensor-hub driver, from Srinivas Pandruvada

- hid-sony fixes (mostly related to DS4 device) from Roderick
Colenbrander

- three device-specific quirks-fixes from Alex Wood, Brendan McGrath
and Marcel Hasler

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid:
HID: sensor-hub: Move the memset to sensor_hub_get_feature()
HID: usbhid: Add quirk for Mayflash/Dragonrise DolphinBar.
HID: usbhid: Add quirk for the Futaba TOSD-5711BB VFD
HID: sony: Ignore DS4 dongle reports when no device is connected
HID: sony: Use DS4 MAC address as unique identifier on USB
HID: sony: Fix error handling bug when touchpad registration fails
HID: asus: Fix keyboard support

+54 -8
+11 -6
drivers/hid/hid-asus.c
··· 64 64 #define QUIRK_SKIP_INPUT_MAPPING BIT(2) 65 65 #define QUIRK_IS_MULTITOUCH BIT(3) 66 66 67 - #define NOTEBOOK_QUIRKS QUIRK_FIX_NOTEBOOK_REPORT 67 + #define KEYBOARD_QUIRKS (QUIRK_FIX_NOTEBOOK_REPORT | \ 68 + QUIRK_NO_INIT_REPORTS) 68 69 #define TOUCHPAD_QUIRKS (QUIRK_NO_INIT_REPORTS | \ 69 70 QUIRK_SKIP_INPUT_MAPPING | \ 70 71 QUIRK_IS_MULTITOUCH) ··· 171 170 172 171 static int asus_input_configured(struct hid_device *hdev, struct hid_input *hi) 173 172 { 173 + struct input_dev *input = hi->input; 174 174 struct asus_drvdata *drvdata = hid_get_drvdata(hdev); 175 175 176 176 if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { 177 177 int ret; 178 - struct input_dev *input = hi->input; 179 178 180 179 input_set_abs_params(input, ABS_MT_POSITION_X, 0, MAX_X, 0, 0); 181 180 input_set_abs_params(input, ABS_MT_POSITION_Y, 0, MAX_Y, 0, 0); ··· 192 191 hid_err(hdev, "Asus input mt init slots failed: %d\n", ret); 193 192 return ret; 194 193 } 195 - 196 - drvdata->input = input; 197 194 } 195 + 196 + drvdata->input = input; 198 197 199 198 return 0; 200 199 } ··· 287 286 goto err_stop_hw; 288 287 } 289 288 290 - drvdata->input->name = "Asus TouchPad"; 289 + if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { 290 + drvdata->input->name = "Asus TouchPad"; 291 + } else { 292 + drvdata->input->name = "Asus Keyboard"; 293 + } 291 294 292 295 if (drvdata->quirks & QUIRK_IS_MULTITOUCH) { 293 296 ret = asus_start_multitouch(hdev); ··· 320 315 321 316 static const struct hid_device_id asus_devices[] = { 322 317 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, 323 - USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD), NOTEBOOK_QUIRKS}, 318 + USB_DEVICE_ID_ASUSTEK_NOTEBOOK_KEYBOARD), KEYBOARD_QUIRKS}, 324 319 { HID_I2C_DEVICE(USB_VENDOR_ID_ASUSTEK, 325 320 USB_DEVICE_ID_ASUSTEK_TOUCHPAD), TOUCHPAD_QUIRKS }, 326 321 { }
+4
drivers/hid/hid-ids.h
··· 319 319 #define USB_VENDOR_ID_DRAGONRISE 0x0079 320 320 #define USB_DEVICE_ID_DRAGONRISE_WIIU 0x1800 321 321 #define USB_DEVICE_ID_DRAGONRISE_PS3 0x1801 322 + #define USB_DEVICE_ID_DRAGONRISE_DOLPHINBAR 0x1803 322 323 #define USB_DEVICE_ID_DRAGONRISE_GAMECUBE 0x1843 323 324 324 325 #define USB_VENDOR_ID_DWAV 0x0eef ··· 365 364 366 365 #define USB_VENDOR_ID_FLATFROG 0x25b5 367 366 #define USB_DEVICE_ID_MULTITOUCH_3200 0x0002 367 + 368 + #define USB_VENDOR_ID_FUTABA 0x0547 369 + #define USB_DEVICE_ID_LED_DISPLAY 0x7000 368 370 369 371 #define USB_VENDOR_ID_ESSENTIAL_REALITY 0x0d7f 370 372 #define USB_DEVICE_ID_ESSENTIAL_REALITY_P5 0x0100
+2 -1
drivers/hid/hid-sensor-hub.c
··· 212 212 __s32 value; 213 213 int ret = 0; 214 214 215 - memset(buffer, 0, buffer_size); 216 215 mutex_lock(&data->mutex); 217 216 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT); 218 217 if (!report || (field_index >= report->maxfield)) { ··· 254 255 u8 *val_ptr; 255 256 int buffer_index = 0; 256 257 int i; 258 + 259 + memset(buffer, 0, buffer_size); 257 260 258 261 mutex_lock(&data->mutex); 259 262 report = sensor_hub_report(report_id, hsdev->hdev, HID_FEATURE_REPORT);
+35 -1
drivers/hid/hid-sony.c
··· 1099 1099 u8 led_delay_on[MAX_LEDS]; 1100 1100 u8 led_delay_off[MAX_LEDS]; 1101 1101 u8 led_count; 1102 + bool ds4_dongle_connected; 1102 1103 }; 1104 + 1105 + static void sony_set_leds(struct sony_sc *sc); 1103 1106 1104 1107 static inline void sony_schedule_work(struct sony_sc *sc) 1105 1108 { ··· 1433 1430 return -EILSEQ; 1434 1431 } 1435 1432 } 1433 + 1434 + /* 1435 + * In the case of a DS4 USB dongle, bit[2] of byte 31 indicates 1436 + * if a DS4 is actually connected (indicated by '0'). 1437 + * For non-dongle, this bit is always 0 (connected). 1438 + */ 1439 + if (sc->hdev->vendor == USB_VENDOR_ID_SONY && 1440 + sc->hdev->product == USB_DEVICE_ID_SONY_PS4_CONTROLLER_DONGLE) { 1441 + bool connected = (rd[31] & 0x04) ? false : true; 1442 + 1443 + if (!sc->ds4_dongle_connected && connected) { 1444 + hid_info(sc->hdev, "DualShock 4 USB dongle: controller connected\n"); 1445 + sony_set_leds(sc); 1446 + sc->ds4_dongle_connected = true; 1447 + } else if (sc->ds4_dongle_connected && !connected) { 1448 + hid_info(sc->hdev, "DualShock 4 USB dongle: controller disconnected\n"); 1449 + sc->ds4_dongle_connected = false; 1450 + /* Return 0, so hidraw can get the report. */ 1451 + return 0; 1452 + } else if (!sc->ds4_dongle_connected) { 1453 + /* Return 0, so hidraw can get the report. */ 1454 + return 0; 1455 + } 1456 + } 1457 + 1436 1458 dualshock4_parse_report(sc, rd, size); 1437 1459 } 1438 1460 ··· 2418 2390 } 2419 2391 2420 2392 memcpy(sc->mac_address, &buf[1], sizeof(sc->mac_address)); 2393 + 2394 + snprintf(sc->hdev->uniq, sizeof(sc->hdev->uniq), 2395 + "%02hhx:%02hhx:%02hhx:%02hhx:%02hhx:%02hhx", 2396 + sc->mac_address[5], sc->mac_address[4], 2397 + sc->mac_address[3], sc->mac_address[2], 2398 + sc->mac_address[1], sc->mac_address[0]); 2421 2399 } else if ((sc->quirks & SIXAXIS_CONTROLLER_USB) || 2422 2400 (sc->quirks & NAVIGATION_CONTROLLER_USB)) { 2423 2401 buf = kmalloc(SIXAXIS_REPORT_0xF2_SIZE, GFP_KERNEL); ··· 2582 2548 hid_err(sc->hdev, 2583 2549 "Unable to initialize multi-touch slots: %d\n", 2584 2550 ret); 2585 - return ret; 2551 + goto err_stop; 2586 2552 } 2587 2553 2588 2554 sony_init_output_report(sc, dualshock4_send_output_report);
+2
drivers/hid/usbhid/hid-quirks.c
··· 83 83 { USB_VENDOR_ID_DMI, USB_DEVICE_ID_DMI_ENC, HID_QUIRK_NOGET }, 84 84 { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_WIIU, HID_QUIRK_MULTI_INPUT }, 85 85 { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_PS3, HID_QUIRK_MULTI_INPUT }, 86 + { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_DOLPHINBAR, HID_QUIRK_MULTI_INPUT }, 86 87 { USB_VENDOR_ID_DRAGONRISE, USB_DEVICE_ID_DRAGONRISE_GAMECUBE, HID_QUIRK_MULTI_INPUT }, 87 88 { USB_VENDOR_ID_ELAN, HID_ANY_ID, HID_QUIRK_ALWAYS_POLL }, 88 89 { USB_VENDOR_ID_ELO, USB_DEVICE_ID_ELO_TS2700, HID_QUIRK_NOGET }, 89 90 { USB_VENDOR_ID_FORMOSA, USB_DEVICE_ID_FORMOSA_IR_RECEIVER, HID_QUIRK_NO_INIT_REPORTS }, 90 91 { USB_VENDOR_ID_FREESCALE, USB_DEVICE_ID_FREESCALE_MX28, HID_QUIRK_NOGET }, 92 + { USB_VENDOR_ID_FUTABA, USB_DEVICE_ID_LED_DISPLAY, HID_QUIRK_NO_INIT_REPORTS }, 91 93 { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0A4A, HID_QUIRK_ALWAYS_POLL }, 92 94 { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_LOGITECH_OEM_USB_OPTICAL_MOUSE_0B4A, HID_QUIRK_ALWAYS_POLL }, 93 95 { USB_VENDOR_ID_HP, USB_PRODUCT_ID_HP_PIXART_OEM_USB_OPTICAL_MOUSE, HID_QUIRK_ALWAYS_POLL },