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

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull HID fixes from Jiri Kosina:

- resume timing fix for intel-ish driver (Ye Xiang)

- fix for using incorrect MMIO register in amd_sfh driver (Dylan
MacKenzie)

- Cintiq 24HDT / 27QHDT regression fix and touch processing fix for
Wacom driver (Jason Gerecke)

- device removal bugfix for ft260 driver (Michael Zaidman)

- other small assorted fixes

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid:
HID: ft260: fix device removal due to USB disconnect
HID: wacom: Skip processing of touches with negative slot values
HID: wacom: Re-enable touch by default for Cintiq 24HDT / 27QHDT
HID: Kconfig: Fix spelling mistake "Uninterruptable" -> "Uninterruptible"
HID: apple: Add support for Keychron K1 wireless keyboard
HID: fix typo in Kconfig
HID: ft260: fix format type warning in ft260_word_show()
HID: amd_sfh: Use correct MMIO register for DMA address
HID: asus: Remove check for same LED brightness on set
HID: intel-ish-hid: use async resume function

+57 -33
+1 -1
drivers/hid/Kconfig
··· 576 576 depends on HID_LOGITECH 577 577 select POWER_SUPPLY 578 578 help 579 - Support for Logitech devices relyingon the HID++ Logitech specification 579 + Support for Logitech devices relying on the HID++ Logitech specification 580 580 581 581 Say Y if you want support for Logitech devices relying on the HID++ 582 582 specification. Such devices are the various Logitech Touchpads (T650,
+1 -1
drivers/hid/amd-sfh-hid/amd_sfh_pcie.c
··· 58 58 cmd_base.cmd_v2.sensor_id = sensor_idx; 59 59 cmd_base.cmd_v2.length = 16; 60 60 61 - writeq(0x0, privdata->mmio + AMD_C2P_MSG2); 61 + writeq(0x0, privdata->mmio + AMD_C2P_MSG1); 62 62 writel(cmd_base.ul, privdata->mmio + AMD_C2P_MSG0); 63 63 } 64 64
+2
drivers/hid/hid-apple.c
··· 501 501 APPLE_RDESC_JIS }, 502 502 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI), 503 503 .driver_data = APPLE_HAS_FN }, 504 + { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ANSI), 505 + .driver_data = APPLE_HAS_FN }, 504 506 { HID_USB_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO), 505 507 .driver_data = APPLE_HAS_FN }, 506 508 { HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_APPLE, USB_DEVICE_ID_APPLE_ALU_REVB_ISO),
-3
drivers/hid/hid-asus.c
··· 485 485 { 486 486 struct asus_kbd_leds *led = container_of(led_cdev, struct asus_kbd_leds, 487 487 cdev); 488 - if (led->brightness == brightness) 489 - return; 490 - 491 488 led->brightness = brightness; 492 489 schedule_work(&led->work); 493 490 }
+9 -18
drivers/hid/hid-ft260.c
··· 742 742 int ret; 743 743 744 744 ret = ft260_get_system_config(hdev, &cfg); 745 - if (ret) 745 + if (ret < 0) 746 746 return ret; 747 747 748 748 ft260_dbg("interface: 0x%02x\n", interface); ··· 754 754 switch (cfg.chip_mode) { 755 755 case FT260_MODE_ALL: 756 756 case FT260_MODE_BOTH: 757 - if (interface == 1) { 757 + if (interface == 1) 758 758 hid_info(hdev, "uart interface is not supported\n"); 759 - return 0; 760 - } 761 - ret = 1; 759 + else 760 + ret = 1; 762 761 break; 763 762 case FT260_MODE_UART: 764 - if (interface == 0) { 765 - hid_info(hdev, "uart is unsupported on interface 0\n"); 766 - ret = 0; 767 - } 763 + hid_info(hdev, "uart interface is not supported\n"); 768 764 break; 769 765 case FT260_MODE_I2C: 770 - if (interface == 1) { 771 - hid_info(hdev, "i2c is unsupported on interface 1\n"); 772 - ret = 0; 773 - } 766 + ret = 1; 774 767 break; 775 768 } 776 769 return ret; ··· 778 785 if (ret < 0) 779 786 return ret; 780 787 781 - return scnprintf(buf, PAGE_SIZE, "%hi\n", *field); 788 + return scnprintf(buf, PAGE_SIZE, "%d\n", *field); 782 789 } 783 790 784 791 static int ft260_word_show(struct hid_device *hdev, int id, u8 *cfg, int len, ··· 790 797 if (ret < 0) 791 798 return ret; 792 799 793 - return scnprintf(buf, PAGE_SIZE, "%hi\n", le16_to_cpu(*field)); 800 + return scnprintf(buf, PAGE_SIZE, "%d\n", le16_to_cpu(*field)); 794 801 } 795 802 796 803 #define FT260_ATTR_SHOW(name, reptype, id, type, func) \ ··· 997 1004 998 1005 static void ft260_remove(struct hid_device *hdev) 999 1006 { 1000 - int ret; 1001 1007 struct ft260_device *dev = hid_get_drvdata(hdev); 1002 1008 1003 - ret = ft260_is_interface_enabled(hdev); 1004 - if (ret <= 0) 1009 + if (!dev) 1005 1010 return; 1006 1011 1007 1012 sysfs_remove_group(&hdev->dev.kobj, &ft260_attr_group);
+14 -1
drivers/hid/intel-ish-hid/ishtp-hid-client.c
··· 784 784 } 785 785 } 786 786 787 + static void hid_ishtp_cl_resume_handler(struct work_struct *work) 788 + { 789 + struct ishtp_cl_data *client_data = container_of(work, struct ishtp_cl_data, resume_work); 790 + struct ishtp_cl *hid_ishtp_cl = client_data->hid_ishtp_cl; 791 + 792 + if (ishtp_wait_resume(ishtp_get_ishtp_device(hid_ishtp_cl))) { 793 + client_data->suspended = false; 794 + wake_up_interruptible(&client_data->ishtp_resume_wait); 795 + } 796 + } 797 + 787 798 ishtp_print_log ishtp_hid_print_trace; 788 799 789 800 /** ··· 833 822 init_waitqueue_head(&client_data->ishtp_resume_wait); 834 823 835 824 INIT_WORK(&client_data->work, hid_ishtp_cl_reset_handler); 825 + INIT_WORK(&client_data->resume_work, hid_ishtp_cl_resume_handler); 826 + 836 827 837 828 ishtp_hid_print_trace = ishtp_trace_callback(cl_device); 838 829 ··· 934 921 935 922 hid_ishtp_trace(client_data, "%s hid_ishtp_cl %p\n", __func__, 936 923 hid_ishtp_cl); 937 - client_data->suspended = false; 924 + schedule_work(&client_data->resume_work); 938 925 return 0; 939 926 } 940 927
+1
drivers/hid/intel-ish-hid/ishtp-hid.h
··· 135 135 int multi_packet_cnt; 136 136 137 137 struct work_struct work; 138 + struct work_struct resume_work; 138 139 struct ishtp_cl_device *cl_device; 139 140 }; 140 141
+22 -7
drivers/hid/intel-ish-hid/ishtp/bus.c
··· 314 314 if (!device) 315 315 return 0; 316 316 317 - /* 318 - * When ISH needs hard reset, it is done asynchrnously, hence bus 319 - * resume will be called before full ISH resume 320 - */ 321 - if (device->ishtp_dev->resume_flag) 322 - return 0; 323 - 324 317 driver = to_ishtp_cl_driver(dev->driver); 325 318 if (driver && driver->driver.pm) { 326 319 if (driver->driver.pm->resume) ··· 841 848 return &device->dev; 842 849 } 843 850 EXPORT_SYMBOL(ishtp_device); 851 + 852 + /** 853 + * ishtp_wait_resume() - Wait for IPC resume 854 + * 855 + * Wait for IPC resume 856 + * 857 + * Return: resume complete or not 858 + */ 859 + bool ishtp_wait_resume(struct ishtp_device *dev) 860 + { 861 + /* 50ms to get resume response */ 862 + #define WAIT_FOR_RESUME_ACK_MS 50 863 + 864 + /* Waiting to get resume response */ 865 + if (dev->resume_flag) 866 + wait_event_interruptible_timeout(dev->resume_wait, 867 + !dev->resume_flag, 868 + msecs_to_jiffies(WAIT_FOR_RESUME_ACK_MS)); 869 + 870 + return (!dev->resume_flag); 871 + } 872 + EXPORT_SYMBOL_GPL(ishtp_wait_resume); 844 873 845 874 /** 846 875 * ishtp_get_pci_device() - Return PCI device dev pointer
+1 -1
drivers/hid/usbhid/Kconfig
··· 38 38 help 39 39 Say Y here if you want to support HID devices (from the USB 40 40 specification standpoint) that aren't strictly user interface 41 - devices, like monitor controls and Uninterruptable Power Supplies. 41 + devices, like monitor controls and Uninterruptible Power Supplies. 42 42 43 43 This module supports these devices separately using a separate 44 44 event interface on /dev/usb/hiddevX (char 180:96 to 180:111).
+4 -1
drivers/hid/wacom_wac.c
··· 2548 2548 int slot; 2549 2549 2550 2550 slot = input_mt_get_slot_by_key(input, hid_data->id); 2551 + if (slot < 0) 2552 + return; 2553 + 2551 2554 input_mt_slot(input, slot); 2552 2555 input_mt_report_slot_state(input, MT_TOOL_FINGER, prox); 2553 2556 } ··· 3834 3831 wacom_wac->shared->touch->product == 0xF6) { 3835 3832 input_dev->evbit[0] |= BIT_MASK(EV_SW); 3836 3833 __set_bit(SW_MUTE_DEVICE, input_dev->swbit); 3837 - wacom_wac->shared->has_mute_touch_switch = true; 3834 + wacom_wac->has_mute_touch_switch = true; 3838 3835 } 3839 3836 fallthrough; 3840 3837
+2
include/linux/intel-ish-client-if.h
··· 81 81 82 82 /* Get the device * from ishtp device instance */ 83 83 struct device *ishtp_device(struct ishtp_cl_device *cl_device); 84 + /* wait for IPC resume */ 85 + bool ishtp_wait_resume(struct ishtp_device *dev); 84 86 /* Trace interface for clients */ 85 87 ishtp_print_log ishtp_trace_callback(struct ishtp_cl_device *cl_device); 86 88 /* Get device pointer of PCI device for DMA acces */