Commit 9b14b066 authored by Jiri Kosina's avatar Jiri Kosina

Merge branch 'for-5.9/upstream-fixes' into for-linus

- "heartbeat" report fix for several Wacom devices
- Lenovo X1 Tablet support improvements
- new device IDs
- bounds checking fix in hid-roccat
- stylus battery reporting fix
parents 146f9d91 505f394f
...@@ -927,7 +927,7 @@ static int hid_scan_report(struct hid_device *hid) ...@@ -927,7 +927,7 @@ static int hid_scan_report(struct hid_device *hid)
/** /**
* hid_parse_report - parse device report * hid_parse_report - parse device report
* *
* @device: hid device * @hid: hid device
* @start: report start * @start: report start
* @size: report size * @size: report size
* *
...@@ -952,7 +952,7 @@ static const char * const hid_report_names[] = { ...@@ -952,7 +952,7 @@ static const char * const hid_report_names[] = {
/** /**
* hid_validate_values - validate existing device report's value indexes * hid_validate_values - validate existing device report's value indexes
* *
* @device: hid device * @hid: hid device
* @type: which report type to examine * @type: which report type to examine
* @id: which report ID to examine (0 for first) * @id: which report ID to examine (0 for first)
* @field_index: which report field to examine * @field_index: which report field to examine
...@@ -1451,7 +1451,7 @@ static int search(__s32 *array, __s32 value, unsigned n) ...@@ -1451,7 +1451,7 @@ static int search(__s32 *array, __s32 value, unsigned n)
* hid_match_report - check if driver's raw_event should be called * hid_match_report - check if driver's raw_event should be called
* *
* @hid: hid device * @hid: hid device
* @report_type: type to match against * @report: hid report to match against
* *
* compare hid->driver->report_table->report_type to report->type * compare hid->driver->report_table->report_type to report->type
*/ */
...@@ -2127,7 +2127,7 @@ struct hid_dynid { ...@@ -2127,7 +2127,7 @@ struct hid_dynid {
/** /**
* store_new_id - add a new HID device ID to this driver and re-probe devices * store_new_id - add a new HID device ID to this driver and re-probe devices
* @driver: target device driver * @drv: target device driver
* @buf: buffer for scanning device ID data * @buf: buffer for scanning device ID data
* @count: input size * @count: input size
* *
......
...@@ -727,6 +727,8 @@ ...@@ -727,6 +727,8 @@
#define USB_DEVICE_ID_LENOVO_TP10UBKBD 0x6062 #define USB_DEVICE_ID_LENOVO_TP10UBKBD 0x6062
#define USB_DEVICE_ID_LENOVO_TPPRODOCK 0x6067 #define USB_DEVICE_ID_LENOVO_TPPRODOCK 0x6067
#define USB_DEVICE_ID_LENOVO_X1_COVER 0x6085 #define USB_DEVICE_ID_LENOVO_X1_COVER 0x6085
#define USB_DEVICE_ID_LENOVO_X1_TAB 0x60a3
#define USB_DEVICE_ID_LENOVO_X1_TAB3 0x60b5
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D 0x608d #define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D 0x608d
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019 0x6019 #define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019 0x6019
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_602E 0x602e #define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_602E 0x602e
...@@ -1123,6 +1125,7 @@ ...@@ -1123,6 +1125,7 @@
#define USB_DEVICE_ID_SYNAPTICS_DELL_K12A 0x2819 #define USB_DEVICE_ID_SYNAPTICS_DELL_K12A 0x2819
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012 0x2968 #define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012 0x2968
#define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710 #define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710
#define USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003 0x73f5
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5 0x81a7 #define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5 0x81a7
#define USB_VENDOR_ID_TEXAS_INSTRUMENTS 0x2047 #define USB_VENDOR_ID_TEXAS_INSTRUMENTS 0x2047
......
...@@ -797,7 +797,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel ...@@ -797,7 +797,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case 0x3b: /* Battery Strength */ case 0x3b: /* Battery Strength */
hidinput_setup_battery(device, HID_INPUT_REPORT, field); hidinput_setup_battery(device, HID_INPUT_REPORT, field);
usage->type = EV_PWR; usage->type = EV_PWR;
goto ignore; return;
case 0x3c: /* Invert */ case 0x3c: /* Invert */
map_key_clear(BTN_TOOL_RUBBER); map_key_clear(BTN_TOOL_RUBBER);
...@@ -1059,7 +1059,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel ...@@ -1059,7 +1059,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
case HID_DC_BATTERYSTRENGTH: case HID_DC_BATTERYSTRENGTH:
hidinput_setup_battery(device, HID_INPUT_REPORT, field); hidinput_setup_battery(device, HID_INPUT_REPORT, field);
usage->type = EV_PWR; usage->type = EV_PWR;
goto ignore; return;
} }
goto unknown; goto unknown;
......
...@@ -44,6 +44,10 @@ static const struct hid_device_id ite_devices[] = { ...@@ -44,6 +44,10 @@ static const struct hid_device_id ite_devices[] = {
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, { HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
USB_VENDOR_ID_SYNAPTICS, USB_VENDOR_ID_SYNAPTICS,
USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012) }, USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012) },
/* ITE8910 USB kbd ctlr, with Synaptics touchpad connected to it. */
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
USB_VENDOR_ID_SYNAPTICS,
USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003) },
{ } { }
}; };
MODULE_DEVICE_TABLE(hid, ite_devices); MODULE_DEVICE_TABLE(hid, ite_devices);
......
...@@ -1973,6 +1973,18 @@ static const struct hid_device_id mt_devices[] = { ...@@ -1973,6 +1973,18 @@ static const struct hid_device_id mt_devices[] = {
HID_DEVICE(BUS_I2C, HID_GROUP_GENERIC, HID_DEVICE(BUS_I2C, HID_GROUP_GENERIC,
USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_7010) }, USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_7010) },
/* Lenovo X1 TAB Gen 2 */
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8,
USB_VENDOR_ID_LENOVO,
USB_DEVICE_ID_LENOVO_X1_TAB) },
/* Lenovo X1 TAB Gen 3 */
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8,
USB_VENDOR_ID_LENOVO,
USB_DEVICE_ID_LENOVO_X1_TAB3) },
/* MosArt panels */ /* MosArt panels */
{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE, { .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
MT_USB_DEVICE(USB_VENDOR_ID_ASUS, MT_USB_DEVICE(USB_VENDOR_ID_ASUS,
......
...@@ -294,31 +294,40 @@ static ssize_t kone_sysfs_write_settings(struct file *fp, struct kobject *kobj, ...@@ -294,31 +294,40 @@ static ssize_t kone_sysfs_write_settings(struct file *fp, struct kobject *kobj,
struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev)); struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev)); struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
int retval = 0, difference, old_profile; int retval = 0, difference, old_profile;
struct kone_settings *settings = (struct kone_settings *)buf;
/* I need to get my data in one piece */ /* I need to get my data in one piece */
if (off != 0 || count != sizeof(struct kone_settings)) if (off != 0 || count != sizeof(struct kone_settings))
return -EINVAL; return -EINVAL;
mutex_lock(&kone->kone_lock); mutex_lock(&kone->kone_lock);
difference = memcmp(buf, &kone->settings, sizeof(struct kone_settings)); difference = memcmp(settings, &kone->settings,
sizeof(struct kone_settings));
if (difference) { if (difference) {
retval = kone_set_settings(usb_dev, if (settings->startup_profile < 1 ||
(struct kone_settings const *)buf); settings->startup_profile > 5) {
if (retval) { retval = -EINVAL;
mutex_unlock(&kone->kone_lock); goto unlock;
return retval;
} }
retval = kone_set_settings(usb_dev, settings);
if (retval)
goto unlock;
old_profile = kone->settings.startup_profile; old_profile = kone->settings.startup_profile;
memcpy(&kone->settings, buf, sizeof(struct kone_settings)); memcpy(&kone->settings, settings, sizeof(struct kone_settings));
kone_profile_activated(kone, kone->settings.startup_profile); kone_profile_activated(kone, kone->settings.startup_profile);
if (kone->settings.startup_profile != old_profile) if (kone->settings.startup_profile != old_profile)
kone_profile_report(kone, kone->settings.startup_profile); kone_profile_report(kone, kone->settings.startup_profile);
} }
unlock:
mutex_unlock(&kone->kone_lock); mutex_unlock(&kone->kone_lock);
if (retval)
return retval;
return sizeof(struct kone_settings); return sizeof(struct kone_settings);
} }
static BIN_ATTR(settings, 0660, kone_sysfs_read_settings, static BIN_ATTR(settings, 0660, kone_sysfs_read_settings,
......
...@@ -323,7 +323,7 @@ static int i2c_hid_get_report(struct i2c_client *client, u8 reportType, ...@@ -323,7 +323,7 @@ static int i2c_hid_get_report(struct i2c_client *client, u8 reportType,
* @reportType: 0x03 for HID_FEATURE_REPORT ; 0x02 for HID_OUTPUT_REPORT * @reportType: 0x03 for HID_FEATURE_REPORT ; 0x02 for HID_OUTPUT_REPORT
* @reportID: the report ID * @reportID: the report ID
* @buf: the actual data to transfer, without the report ID * @buf: the actual data to transfer, without the report ID
* @len: size of buf * @data_len: size of buf
* @use_data: true: use SET_REPORT HID command, false: send plain OUTPUT report * @use_data: true: use SET_REPORT HID command, false: send plain OUTPUT report
*/ */
static int i2c_hid_set_or_send_report(struct i2c_client *client, u8 reportType, static int i2c_hid_set_or_send_report(struct i2c_client *client, u8 reportType,
......
...@@ -2773,7 +2773,9 @@ static int wacom_wac_collection(struct hid_device *hdev, struct hid_report *repo ...@@ -2773,7 +2773,9 @@ static int wacom_wac_collection(struct hid_device *hdev, struct hid_report *repo
if (report->type != HID_INPUT_REPORT) if (report->type != HID_INPUT_REPORT)
return -1; return -1;
if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input) if (WACOM_PAD_FIELD(field))
return 0;
else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input)
wacom_wac_pen_report(hdev, report); wacom_wac_pen_report(hdev, report);
else if (WACOM_FINGER_FIELD(field) && wacom->wacom_wac.touch_input) else if (WACOM_FINGER_FIELD(field) && wacom->wacom_wac.touch_input)
wacom_wac_finger_report(hdev, report); wacom_wac_finger_report(hdev, report);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment