Skip to content

Commit 9b14b06

Browse files
author
Jiri Kosina
committed
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
2 parents 146f9d9 + 505f394 commit 9b14b06

File tree

9 files changed

+46
-16
lines changed

9 files changed

+46
-16
lines changed

drivers/hid/hid-alps.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -526,7 +526,7 @@ static int u1_init(struct hid_device *hdev, struct alps_dev *pri_data)
526526

527527
ret = u1_read_write_register(hdev, ADDRESS_U1_NUM_SENS_Y,
528528
&sen_line_num_y, 0, true);
529-
if (ret < 0) {
529+
if (ret < 0) {
530530
dev_err(&hdev->dev, "failed U1_NUM_SENS_Y (%d)\n", ret);
531531
goto exit;
532532
}

drivers/hid/hid-core.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -927,7 +927,7 @@ static int hid_scan_report(struct hid_device *hid)
927927
/**
928928
* hid_parse_report - parse device report
929929
*
930-
* @device: hid device
930+
* @hid: hid device
931931
* @start: report start
932932
* @size: report size
933933
*
@@ -952,7 +952,7 @@ static const char * const hid_report_names[] = {
952952
/**
953953
* hid_validate_values - validate existing device report's value indexes
954954
*
955-
* @device: hid device
955+
* @hid: hid device
956956
* @type: which report type to examine
957957
* @id: which report ID to examine (0 for first)
958958
* @field_index: which report field to examine
@@ -1451,7 +1451,7 @@ static int search(__s32 *array, __s32 value, unsigned n)
14511451
* hid_match_report - check if driver's raw_event should be called
14521452
*
14531453
* @hid: hid device
1454-
* @report_type: type to match against
1454+
* @report: hid report to match against
14551455
*
14561456
* compare hid->driver->report_table->report_type to report->type
14571457
*/
@@ -2127,7 +2127,7 @@ struct hid_dynid {
21272127

21282128
/**
21292129
* store_new_id - add a new HID device ID to this driver and re-probe devices
2130-
* @driver: target device driver
2130+
* @drv: target device driver
21312131
* @buf: buffer for scanning device ID data
21322132
* @count: input size
21332133
*

drivers/hid/hid-ids.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -727,6 +727,8 @@
727727
#define USB_DEVICE_ID_LENOVO_TP10UBKBD 0x6062
728728
#define USB_DEVICE_ID_LENOVO_TPPRODOCK 0x6067
729729
#define USB_DEVICE_ID_LENOVO_X1_COVER 0x6085
730+
#define USB_DEVICE_ID_LENOVO_X1_TAB 0x60a3
731+
#define USB_DEVICE_ID_LENOVO_X1_TAB3 0x60b5
730732
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D 0x608d
731733
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019 0x6019
732734
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_602E 0x602e
@@ -1123,6 +1125,7 @@
11231125
#define USB_DEVICE_ID_SYNAPTICS_DELL_K12A 0x2819
11241126
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012 0x2968
11251127
#define USB_DEVICE_ID_SYNAPTICS_TP_V103 0x5710
1128+
#define USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003 0x73f5
11261129
#define USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5 0x81a7
11271130

11281131
#define USB_VENDOR_ID_TEXAS_INSTRUMENTS 0x2047

drivers/hid/hid-input.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -797,7 +797,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
797797
case 0x3b: /* Battery Strength */
798798
hidinput_setup_battery(device, HID_INPUT_REPORT, field);
799799
usage->type = EV_PWR;
800-
goto ignore;
800+
return;
801801

802802
case 0x3c: /* Invert */
803803
map_key_clear(BTN_TOOL_RUBBER);
@@ -1059,7 +1059,7 @@ static void hidinput_configure_usage(struct hid_input *hidinput, struct hid_fiel
10591059
case HID_DC_BATTERYSTRENGTH:
10601060
hidinput_setup_battery(device, HID_INPUT_REPORT, field);
10611061
usage->type = EV_PWR;
1062-
goto ignore;
1062+
return;
10631063
}
10641064
goto unknown;
10651065

drivers/hid/hid-ite.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ static const struct hid_device_id ite_devices[] = {
4444
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
4545
USB_VENDOR_ID_SYNAPTICS,
4646
USB_DEVICE_ID_SYNAPTICS_ACER_SWITCH5_012) },
47+
/* ITE8910 USB kbd ctlr, with Synaptics touchpad connected to it. */
48+
{ HID_DEVICE(BUS_USB, HID_GROUP_GENERIC,
49+
USB_VENDOR_ID_SYNAPTICS,
50+
USB_DEVICE_ID_SYNAPTICS_ACER_ONE_S1003) },
4751
{ }
4852
};
4953
MODULE_DEVICE_TABLE(hid, ite_devices);

drivers/hid/hid-multitouch.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1973,6 +1973,18 @@ static const struct hid_device_id mt_devices[] = {
19731973
HID_DEVICE(BUS_I2C, HID_GROUP_GENERIC,
19741974
USB_VENDOR_ID_LG, I2C_DEVICE_ID_LG_7010) },
19751975

1976+
/* Lenovo X1 TAB Gen 2 */
1977+
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
1978+
HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8,
1979+
USB_VENDOR_ID_LENOVO,
1980+
USB_DEVICE_ID_LENOVO_X1_TAB) },
1981+
1982+
/* Lenovo X1 TAB Gen 3 */
1983+
{ .driver_data = MT_CLS_WIN_8_FORCE_MULTI_INPUT,
1984+
HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8,
1985+
USB_VENDOR_ID_LENOVO,
1986+
USB_DEVICE_ID_LENOVO_X1_TAB3) },
1987+
19761988
/* MosArt panels */
19771989
{ .driver_data = MT_CLS_CONFIDENCE_MINUS_ONE,
19781990
MT_USB_DEVICE(USB_VENDOR_ID_ASUS,

drivers/hid/hid-roccat-kone.c

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -294,31 +294,40 @@ static ssize_t kone_sysfs_write_settings(struct file *fp, struct kobject *kobj,
294294
struct kone_device *kone = hid_get_drvdata(dev_get_drvdata(dev));
295295
struct usb_device *usb_dev = interface_to_usbdev(to_usb_interface(dev));
296296
int retval = 0, difference, old_profile;
297+
struct kone_settings *settings = (struct kone_settings *)buf;
297298

298299
/* I need to get my data in one piece */
299300
if (off != 0 || count != sizeof(struct kone_settings))
300301
return -EINVAL;
301302

302303
mutex_lock(&kone->kone_lock);
303-
difference = memcmp(buf, &kone->settings, sizeof(struct kone_settings));
304+
difference = memcmp(settings, &kone->settings,
305+
sizeof(struct kone_settings));
304306
if (difference) {
305-
retval = kone_set_settings(usb_dev,
306-
(struct kone_settings const *)buf);
307-
if (retval) {
308-
mutex_unlock(&kone->kone_lock);
309-
return retval;
307+
if (settings->startup_profile < 1 ||
308+
settings->startup_profile > 5) {
309+
retval = -EINVAL;
310+
goto unlock;
310311
}
311312

313+
retval = kone_set_settings(usb_dev, settings);
314+
if (retval)
315+
goto unlock;
316+
312317
old_profile = kone->settings.startup_profile;
313-
memcpy(&kone->settings, buf, sizeof(struct kone_settings));
318+
memcpy(&kone->settings, settings, sizeof(struct kone_settings));
314319

315320
kone_profile_activated(kone, kone->settings.startup_profile);
316321

317322
if (kone->settings.startup_profile != old_profile)
318323
kone_profile_report(kone, kone->settings.startup_profile);
319324
}
325+
unlock:
320326
mutex_unlock(&kone->kone_lock);
321327

328+
if (retval)
329+
return retval;
330+
322331
return sizeof(struct kone_settings);
323332
}
324333
static BIN_ATTR(settings, 0660, kone_sysfs_read_settings,

drivers/hid/i2c-hid/i2c-hid-core.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,7 +323,7 @@ static int i2c_hid_get_report(struct i2c_client *client, u8 reportType,
323323
* @reportType: 0x03 for HID_FEATURE_REPORT ; 0x02 for HID_OUTPUT_REPORT
324324
* @reportID: the report ID
325325
* @buf: the actual data to transfer, without the report ID
326-
* @len: size of buf
326+
* @data_len: size of buf
327327
* @use_data: true: use SET_REPORT HID command, false: send plain OUTPUT report
328328
*/
329329
static int i2c_hid_set_or_send_report(struct i2c_client *client, u8 reportType,

drivers/hid/wacom_wac.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2773,7 +2773,9 @@ static int wacom_wac_collection(struct hid_device *hdev, struct hid_report *repo
27732773
if (report->type != HID_INPUT_REPORT)
27742774
return -1;
27752775

2776-
if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input)
2776+
if (WACOM_PAD_FIELD(field))
2777+
return 0;
2778+
else if (WACOM_PEN_FIELD(field) && wacom->wacom_wac.pen_input)
27772779
wacom_wac_pen_report(hdev, report);
27782780
else if (WACOM_FINGER_FIELD(field) && wacom->wacom_wac.touch_input)
27792781
wacom_wac_finger_report(hdev, report);

0 commit comments

Comments
 (0)