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

Merge branch 'for-4.15/upstream' into for-linus

- cp2112: GPIO error handling and Kconfig fixes from Sébastien Szymanski
- i2c-hid: fixup / quirk for Apollo-Lake based laptops, from Hans de Goede
- Input/Core: add eraser tool support, from Ping Cheng
- small assorted code fixes

Signed-off-by: Jiri Kosina <jkosina@suse.cz>

+29 -8
+2 -3
drivers/hid/Kconfig
··· 230 230 231 231 config HID_CP2112 232 232 tristate "Silicon Labs CP2112 HID USB-to-SMBus Bridge support" 233 - depends on USB_HID && I2C && GPIOLIB 233 + depends on USB_HID && HIDRAW && I2C && GPIOLIB 234 234 select GPIOLIB_IRQCHIP 235 235 ---help--- 236 236 Support for Silicon Labs CP2112 HID USB to SMBus Master Bridge. ··· 750 750 HID standard. 751 751 752 752 config HID_RETRODE 753 - tristate "Retrode" 753 + tristate "Retrode 2 USB adapter for vintage video games" 754 754 depends on USB_HID 755 755 ---help--- 756 756 Support for 757 - 758 757 * Retrode 2 cartridge and controller adapter 759 758 760 759 config HID_ROCCAT
+1 -1
drivers/hid/hid-core.c
··· 1662 1662 .size = HID_MAX_DESCRIPTOR_SIZE, 1663 1663 }; 1664 1664 1665 - static struct device_attribute dev_attr_country = { 1665 + static const struct device_attribute dev_attr_country = { 1666 1666 .attr = { .name = "country", .mode = 0444 }, 1667 1667 .show = show_country, 1668 1668 };
+7 -3
drivers/hid/hid-cp2112.c
··· 21 21 * Data Sheet: 22 22 * http://www.silabs.com/Support%20Documents/TechnicalDocs/CP2112.pdf 23 23 * Programming Interface Specification: 24 - * http://www.silabs.com/Support%20Documents/TechnicalDocs/AN495.pdf 24 + * https://www.silabs.com/documents/public/application-notes/an495-cp2112-interface-specification.pdf 25 25 */ 26 26 27 27 #include <linux/gpio.h> ··· 196 196 HID_REQ_GET_REPORT); 197 197 if (ret != CP2112_GPIO_CONFIG_LENGTH) { 198 198 hid_err(hdev, "error requesting GPIO config: %d\n", ret); 199 + if (ret >= 0) 200 + ret = -EIO; 199 201 goto exit; 200 202 } 201 203 ··· 207 205 ret = hid_hw_raw_request(hdev, CP2112_GPIO_CONFIG, buf, 208 206 CP2112_GPIO_CONFIG_LENGTH, HID_FEATURE_REPORT, 209 207 HID_REQ_SET_REPORT); 210 - if (ret < 0) { 208 + if (ret != CP2112_GPIO_CONFIG_LENGTH) { 211 209 hid_err(hdev, "error setting GPIO config: %d\n", ret); 210 + if (ret >= 0) 211 + ret = -EIO; 212 212 goto exit; 213 213 } 214 214 ··· 218 214 219 215 exit: 220 216 mutex_unlock(&dev->lock); 221 - return ret < 0 ? ret : -EIO; 217 + return ret; 222 218 } 223 219 224 220 static void cp2112_gpio_set(struct gpio_chip *chip, unsigned offset, int value)
+3
drivers/hid/hid-ids.h
··· 513 513 #define USB_DEVICE_ID_GYRATION_REMOTE_2 0x0003 514 514 #define USB_DEVICE_ID_GYRATION_REMOTE_3 0x0008 515 515 516 + #define I2C_VENDOR_ID_HANTICK 0x0911 517 + #define I2C_PRODUCT_ID_HANTICK_5288 0x5288 518 + 516 519 #define USB_VENDOR_ID_HANWANG 0x0b57 517 520 #define USB_DEVICE_ID_HANWANG_TABLET_FIRST 0x5000 518 521 #define USB_DEVICE_ID_HANWANG_TABLET_LAST 0x8fff
+9
drivers/hid/hid-input.c
··· 797 797 map_key_clear(BTN_STYLUS); 798 798 break; 799 799 800 + case 0x45: /* ERASER */ 801 + /* 802 + * This event is reported when eraser tip touches the surface. 803 + * Actual eraser (BTN_TOOL_RUBBER) is set by Invert usage when 804 + * tool gets in proximity. 805 + */ 806 + map_key_clear(BTN_TOUCH); 807 + break; 808 + 800 809 case 0x46: /* TabletPick */ 801 810 case 0x5a: /* SecondaryBarrelSwitch */ 802 811 map_key_clear(BTN_STYLUS2);
+6 -1
drivers/hid/i2c-hid/i2c-hid.c
··· 46 46 47 47 /* quirks to control the device */ 48 48 #define I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV BIT(0) 49 + #define I2C_HID_QUIRK_NO_IRQ_AFTER_RESET BIT(1) 49 50 50 51 /* flags */ 51 52 #define I2C_HID_STARTED 0 ··· 169 168 I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV }, 170 169 { USB_VENDOR_ID_WEIDA, USB_DEVICE_ID_WEIDA_8755, 171 170 I2C_HID_QUIRK_SET_PWR_WAKEUP_DEV }, 171 + { I2C_VENDOR_ID_HANTICK, I2C_PRODUCT_ID_HANTICK_5288, 172 + I2C_HID_QUIRK_NO_IRQ_AFTER_RESET }, 172 173 { 0, 0 } 173 174 }; 174 175 ··· 255 252 256 253 ret = 0; 257 254 258 - if (wait) { 255 + if (wait && (ihid->quirks & I2C_HID_QUIRK_NO_IRQ_AFTER_RESET)) { 256 + msleep(100); 257 + } else if (wait) { 259 258 i2c_hid_dbg(ihid, "%s: waiting...\n", __func__); 260 259 if (!wait_event_timeout(ihid->wait, 261 260 !test_bit(I2C_HID_RESET_PENDING, &ihid->flags),
+1
include/linux/hid.h
··· 754 754 * @stop: called on remove 755 755 * @open: called by input layer on open 756 756 * @close: called by input layer on close 757 + * @power: request underlying hardware to enter requested power mode 757 758 * @parse: this method is called only once to parse the device data, 758 759 * shouldn't allocate anything to not leak memory 759 760 * @request: send report request to device (e.g. feature report)