aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-logitech-hidpp19
-rw-r--r--Documentation/ABI/testing/sysfs-driver-hid-ntrig70
-rw-r--r--drivers/hid/hid-core.c10
-rw-r--r--drivers/hid/hid-corsair.c24
-rw-r--r--drivers/hid/hid-ids.h1
-rw-r--r--drivers/hid/hid-input.c3
-rw-r--r--drivers/hid/hid-multitouch.c5
-rw-r--r--drivers/hid/hid-quirks.c2
-rw-r--r--drivers/hid/hid-rmi.c4
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c13
-rw-r--r--drivers/hid/wacom_sys.c4
-rw-r--r--include/linux/hid.h6
12 files changed, 134 insertions, 27 deletions
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-logitech-hidpp b/Documentation/ABI/testing/sysfs-driver-hid-logitech-hidpp
new file mode 100644
index 000000000000..d8f831f2d6b5
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-hid-logitech-hidpp
@@ -0,0 +1,19 @@
1What: /sys/bus/hid/drivers/logitech-hidpp-device/<dev>/range
2Date: Jan, 2016
3KernelVersion: 4.6
4Contact: linux-input@vger.kernel.org
5Description:
6 (RW) This attribute controls the amount of 'turn' permitted in
7 Logitech G920 wheel. Reading from the file shows the current
8 range of the steering wheel. Writing a value within the min and
9 max boundary sets the range of the wheel.
10
11What: /sys/bus/hid/drivers/logitech-hidpp-device/<dev>/builtin_power_supply
12Date: Apr, 2017
13KernelVersion: 4.12
14Contact: linux-input@vger.kernel.org
15Description:
16 Presence of this file indicates that HID++ driver is capable of
17 handling battery properties in the kernel. This way, upower can
18 add a udev rule to decide whether or not it should use the
19 internal unifying support or the generic kernel one.
diff --git a/Documentation/ABI/testing/sysfs-driver-hid-ntrig b/Documentation/ABI/testing/sysfs-driver-hid-ntrig
new file mode 100644
index 000000000000..e574a5625efe
--- /dev/null
+++ b/Documentation/ABI/testing/sysfs-driver-hid-ntrig
@@ -0,0 +1,70 @@
1What: /sys/bus/hid/drivers/ntrig/<dev>/activate_slack
2Date: May, 2010
3KernelVersion: 2.6.35
4Contact: linux-input@vger.kernel.org
5Description:
6 (RW) Number of contact frames ignored before acknowledging the
7 start of activity (activating touch).
8
9
10What: /sys/bus/hid/drivers/ntrig/<dev>/decativate_slack
11Date: May, 2010
12KernelVersion: 2.6.35
13Contact: linux-input@vger.kernel.org
14Description:
15 (RW) Number of empty (no contact) frames ignored before
16 acknowledging the end of activity (deactivating touch).
17
18 When the last finger is removed from the device, it sends a
19 number of empty frames. By holding off on deactivation for a few
20 frames false erroneous disconnects can be tolerated, where the
21 sensor may mistakenly not detect a finger that is still present.
22
23
24What: /sys/bus/hid/drivers/ntrig/<dev>/activation_width
25What: /sys/bus/hid/drivers/ntrig/<dev>/activation_height
26Date: May, 2010
27KernelVersion: 2.6.35
28Contact: linux-input@vger.kernel.org
29Description:
30 Threholds to override activation slack.
31
32 activation_width: (RW) Width threshold to immediately
33 start processing touch events.
34
35 activation_height: (RW) Height threshold to immediately
36 start processing touch events.
37
38
39What: /sys/bus/hid/drivers/ntrig/<dev>/min_width
40What: /sys/bus/hid/drivers/ntrig/<dev>/min_height
41Date: May, 2010
42KernelVersion: 2.6.35
43Contact: linux-input@vger.kernel.org
44Description:
45 Minimum size contact accepted.
46
47 min_width: (RW) Minimum touch contact width to decide
48 activation and activity.
49
50 min_height: (RW) Minimum touch contact height to decide
51 activation and activity.
52
53
54What: /sys/bus/hid/drivers/ntrig/<dev>/sensor_physical_width
55What: /sys/bus/hid/drivers/ntrig/<dev>/sensor_physical_height
56Date: May, 2010
57KernelVersion: 2.6.35
58Contact: linux-input@vger.kernel.org
59Description:
60 (RO) These are internal ranges not used for normal events but
61 useful for tuning.
62
63
64What: /sys/bus/hid/drivers/ntrig/<dev>/sensor_logical_width
65What: /sys/bus/hid/drivers/ntrig/<dev>/sensor_logical_height
66Date: May, 2010
67KernelVersion: 2.6.35
68Contact: linux-input@vger.kernel.org
69Description:
70 (RO) The range for positions reported during activity.
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index c2560aae5542..4fc08c38bc0e 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -1365,7 +1365,7 @@ u8 *hid_alloc_report_buf(struct hid_report *report, gfp_t flags)
1365 * of implement() working on 8 byte chunks 1365 * of implement() working on 8 byte chunks
1366 */ 1366 */
1367 1367
1368 int len = hid_report_len(report) + 7; 1368 u32 len = hid_report_len(report) + 7;
1369 1369
1370 return kmalloc(len, flags); 1370 return kmalloc(len, flags);
1371} 1371}
@@ -1430,7 +1430,7 @@ void __hid_request(struct hid_device *hid, struct hid_report *report,
1430{ 1430{
1431 char *buf; 1431 char *buf;
1432 int ret; 1432 int ret;
1433 int len; 1433 u32 len;
1434 1434
1435 buf = hid_alloc_report_buf(report, GFP_KERNEL); 1435 buf = hid_alloc_report_buf(report, GFP_KERNEL);
1436 if (!buf) 1436 if (!buf)
@@ -1456,14 +1456,14 @@ out:
1456} 1456}
1457EXPORT_SYMBOL_GPL(__hid_request); 1457EXPORT_SYMBOL_GPL(__hid_request);
1458 1458
1459int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, 1459int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
1460 int interrupt) 1460 int interrupt)
1461{ 1461{
1462 struct hid_report_enum *report_enum = hid->report_enum + type; 1462 struct hid_report_enum *report_enum = hid->report_enum + type;
1463 struct hid_report *report; 1463 struct hid_report *report;
1464 struct hid_driver *hdrv; 1464 struct hid_driver *hdrv;
1465 unsigned int a; 1465 unsigned int a;
1466 int rsize, csize = size; 1466 u32 rsize, csize = size;
1467 u8 *cdata = data; 1467 u8 *cdata = data;
1468 int ret = 0; 1468 int ret = 0;
1469 1469
@@ -1521,7 +1521,7 @@ EXPORT_SYMBOL_GPL(hid_report_raw_event);
1521 * 1521 *
1522 * This is data entry for lower layers. 1522 * This is data entry for lower layers.
1523 */ 1523 */
1524int hid_input_report(struct hid_device *hid, int type, u8 *data, int size, int interrupt) 1524int hid_input_report(struct hid_device *hid, int type, u8 *data, u32 size, int interrupt)
1525{ 1525{
1526 struct hid_report_enum *report_enum; 1526 struct hid_report_enum *report_enum;
1527 struct hid_driver *hdrv; 1527 struct hid_driver *hdrv;
diff --git a/drivers/hid/hid-corsair.c b/drivers/hid/hid-corsair.c
index 9ba5d98a1180..ec9e060ec46c 100644
--- a/drivers/hid/hid-corsair.c
+++ b/drivers/hid/hid-corsair.c
@@ -2,11 +2,14 @@
2 * HID driver for Corsair devices 2 * HID driver for Corsair devices
3 * 3 *
4 * Supported devices: 4 * Supported devices:
5 * - Vengeance K70 Keyboard
6 * - K70 RAPIDFIRE Keyboard
5 * - Vengeance K90 Keyboard 7 * - Vengeance K90 Keyboard
6 * - Scimitar PRO RGB Gaming Mouse 8 * - Scimitar PRO RGB Gaming Mouse
7 * 9 *
8 * Copyright (c) 2015 Clement Vuchener 10 * Copyright (c) 2015 Clement Vuchener
9 * Copyright (c) 2017 Oscar Campos 11 * Copyright (c) 2017 Oscar Campos
12 * Copyright (c) 2017 Aaron Bottegal
10 */ 13 */
11 14
12/* 15/*
@@ -673,7 +676,7 @@ static int corsair_input_mapping(struct hid_device *dev,
673} 676}
674 677
675/* 678/*
676 * The report descriptor of Corsair Scimitar RGB Pro gaming mouse is 679 * The report descriptor of some of the Corsair gaming mice is
677 * non parseable as they define two consecutive Logical Minimum for 680 * non parseable as they define two consecutive Logical Minimum for
678 * the Usage Page (Consumer) in rdescs bytes 75 and 77 being 77 0x16 681 * the Usage Page (Consumer) in rdescs bytes 75 and 77 being 77 0x16
679 * that should be obviousy 0x26 for Logical Magimum of 16 bits. This 682 * that should be obviousy 0x26 for Logical Magimum of 16 bits. This
@@ -681,7 +684,8 @@ static int corsair_input_mapping(struct hid_device *dev,
681 * Minimum being larger than Logical Maximum. 684 * Minimum being larger than Logical Maximum.
682 * 685 *
683 * This driver fixes the report descriptor for: 686 * This driver fixes the report descriptor for:
684 * - USB ID b1c:1b3e, sold as Scimitar RGB Pro Gaming mouse 687 * - USB ID 1b1c:1b34, sold as GLAIVE RGB Gaming mouse
688 * - USB ID 1b1c:1b3e, sold as Scimitar RGB Pro Gaming mouse
685 */ 689 */
686 690
687static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc, 691static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
@@ -691,13 +695,14 @@ static __u8 *corsair_mouse_report_fixup(struct hid_device *hdev, __u8 *rdesc,
691 695
692 if (intf->cur_altsetting->desc.bInterfaceNumber == 1) { 696 if (intf->cur_altsetting->desc.bInterfaceNumber == 1) {
693 /* 697 /*
694 * Corsair Scimitar RGB Pro report descriptor is broken and 698 * Corsair GLAIVE RGB and Scimitar RGB Pro report descriptor is
695 * defines two different Logical Minimum for the Consumer 699 * broken and defines two different Logical Minimum for the
696 * Application. The byte 77 should be a 0x26 defining a 16 700 * Consumer Application. The byte 77 should be a 0x26 defining
697 * bits integer for the Logical Maximum but it is a 0x16 701 * a 16 bits integer for the Logical Maximum but it is a 0x16
698 * instead (Logical Minimum) 702 * instead (Logical Minimum)
699 */ 703 */
700 switch (hdev->product) { 704 switch (hdev->product) {
705 case USB_DEVICE_ID_CORSAIR_GLAIVE_RGB:
701 case USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB: 706 case USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB:
702 if (*rsize >= 172 && rdesc[75] == 0x15 && rdesc[77] == 0x16 707 if (*rsize >= 172 && rdesc[75] == 0x15 && rdesc[77] == 0x16
703 && rdesc[78] == 0xff && rdesc[79] == 0x0f) { 708 && rdesc[78] == 0xff && rdesc[79] == 0x0f) {
@@ -716,7 +721,14 @@ static const struct hid_device_id corsair_devices[] = {
716 .driver_data = CORSAIR_USE_K90_MACRO | 721 .driver_data = CORSAIR_USE_K90_MACRO |
717 CORSAIR_USE_K90_BACKLIGHT }, 722 CORSAIR_USE_K90_BACKLIGHT },
718 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, 723 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR,
724 USB_DEVICE_ID_CORSAIR_GLAIVE_RGB) },
725 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR,
719 USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) }, 726 USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
727 /*
728 * Vengeance K70 and K70 RAPIDFIRE share product IDs.
729 */
730 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR,
731 USB_DEVICE_ID_CORSAIR_K70R) },
720 {} 732 {}
721}; 733};
722 734
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index c8902f2f0e23..3fdd101119ec 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -291,6 +291,7 @@
291#define USB_DEVICE_ID_CORSAIR_K70RGB 0x1b13 291#define USB_DEVICE_ID_CORSAIR_K70RGB 0x1b13
292#define USB_DEVICE_ID_CORSAIR_STRAFE 0x1b15 292#define USB_DEVICE_ID_CORSAIR_STRAFE 0x1b15
293#define USB_DEVICE_ID_CORSAIR_K65RGB 0x1b17 293#define USB_DEVICE_ID_CORSAIR_K65RGB 0x1b17
294#define USB_DEVICE_ID_CORSAIR_GLAIVE_RGB 0x1b34
294#define USB_DEVICE_ID_CORSAIR_K70RGB_RAPIDFIRE 0x1b38 295#define USB_DEVICE_ID_CORSAIR_K70RGB_RAPIDFIRE 0x1b38
295#define USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE 0x1b39 296#define USB_DEVICE_ID_CORSAIR_K65RGB_RAPIDFIRE 0x1b39
296#define USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB 0x1b3e 297#define USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB 0x1b3e
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 04d01b57d94c..d86398755b0d 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1368,7 +1368,8 @@ static void hidinput_led_worker(struct work_struct *work)
1368 led_work); 1368 led_work);
1369 struct hid_field *field; 1369 struct hid_field *field;
1370 struct hid_report *report; 1370 struct hid_report *report;
1371 int len, ret; 1371 int ret;
1372 u32 len;
1372 __u8 *buf; 1373 __u8 *buf;
1373 1374
1374 field = hidinput_get_led_field(hid); 1375 field = hidinput_get_led_field(hid);
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 3b4739bde05d..2e1736ba2444 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -370,7 +370,8 @@ static const struct attribute_group mt_attribute_group = {
370static void mt_get_feature(struct hid_device *hdev, struct hid_report *report) 370static void mt_get_feature(struct hid_device *hdev, struct hid_report *report)
371{ 371{
372 struct mt_device *td = hid_get_drvdata(hdev); 372 struct mt_device *td = hid_get_drvdata(hdev);
373 int ret, size = hid_report_len(report); 373 int ret;
374 u32 size = hid_report_len(report);
374 u8 *buf; 375 u8 *buf;
375 376
376 /* 377 /*
@@ -1183,7 +1184,7 @@ static void mt_set_input_mode(struct hid_device *hdev)
1183 struct hid_report_enum *re; 1184 struct hid_report_enum *re;
1184 struct mt_class *cls = &td->mtclass; 1185 struct mt_class *cls = &td->mtclass;
1185 char *buf; 1186 char *buf;
1186 int report_len; 1187 u32 report_len;
1187 1188
1188 if (td->inputmode < 0) 1189 if (td->inputmode < 0)
1189 return; 1190 return;
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index 91049dff301f..a67c599fa151 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -62,6 +62,7 @@ static const struct hid_device_id hid_quirks[] = {
62 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70R), HID_QUIRK_NO_INIT_REPORTS }, 62 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K70R), HID_QUIRK_NO_INIT_REPORTS },
63 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K95RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, 63 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K95RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
64 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_M65RGB), HID_QUIRK_NO_INIT_REPORTS }, 64 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_M65RGB), HID_QUIRK_NO_INIT_REPORTS },
65 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_GLAIVE_RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
65 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, 66 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
66 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_STRAFE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL }, 67 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_STRAFE), HID_QUIRK_NO_INIT_REPORTS | HID_QUIRK_ALWAYS_POLL },
67 { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51), HID_QUIRK_NOGET }, 68 { HID_USB_DEVICE(USB_VENDOR_ID_CREATIVELABS, USB_DEVICE_ID_CREATIVE_SB_OMNI_SURROUND_51), HID_QUIRK_NOGET },
@@ -317,6 +318,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
317#endif 318#endif
318#if IS_ENABLED(CONFIG_HID_CORSAIR) 319#if IS_ENABLED(CONFIG_HID_CORSAIR)
319 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90) }, 320 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_K90) },
321 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_GLAIVE_RGB) },
320 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) }, 322 { HID_USB_DEVICE(USB_VENDOR_ID_CORSAIR, USB_DEVICE_ID_CORSAIR_SCIMITAR_PRO_RGB) },
321#endif 323#endif
322#if IS_ENABLED(CONFIG_HID_CP2112) 324#if IS_ENABLED(CONFIG_HID_CP2112)
diff --git a/drivers/hid/hid-rmi.c b/drivers/hid/hid-rmi.c
index c6c05df3e8d2..9c9362149641 100644
--- a/drivers/hid/hid-rmi.c
+++ b/drivers/hid/hid-rmi.c
@@ -89,8 +89,8 @@ struct rmi_data {
89 u8 *writeReport; 89 u8 *writeReport;
90 u8 *readReport; 90 u8 *readReport;
91 91
92 int input_report_size; 92 u32 input_report_size;
93 int output_report_size; 93 u32 output_report_size;
94 94
95 unsigned long flags; 95 unsigned long flags;
96 96
diff --git a/drivers/hid/i2c-hid/i2c-hid.c b/drivers/hid/i2c-hid/i2c-hid.c
index 7230243b94d3..e6f413a2b1e9 100644
--- a/drivers/hid/i2c-hid/i2c-hid.c
+++ b/drivers/hid/i2c-hid/i2c-hid.c
@@ -144,10 +144,10 @@ struct i2c_hid {
144 * register of the HID 144 * register of the HID
145 * descriptor. */ 145 * descriptor. */
146 unsigned int bufsize; /* i2c buffer size */ 146 unsigned int bufsize; /* i2c buffer size */
147 char *inbuf; /* Input buffer */ 147 u8 *inbuf; /* Input buffer */
148 char *rawbuf; /* Raw Input buffer */ 148 u8 *rawbuf; /* Raw Input buffer */
149 char *cmdbuf; /* Command buffer */ 149 u8 *cmdbuf; /* Command buffer */
150 char *argsbuf; /* Command arguments buffer */ 150 u8 *argsbuf; /* Command arguments buffer */
151 151
152 unsigned long flags; /* device flags */ 152 unsigned long flags; /* device flags */
153 unsigned long quirks; /* Various quirks */ 153 unsigned long quirks; /* Various quirks */
@@ -455,7 +455,8 @@ out_unlock:
455 455
456static void i2c_hid_get_input(struct i2c_hid *ihid) 456static void i2c_hid_get_input(struct i2c_hid *ihid)
457{ 457{
458 int ret, ret_size; 458 int ret;
459 u32 ret_size;
459 int size = le16_to_cpu(ihid->hdesc.wMaxInputLength); 460 int size = le16_to_cpu(ihid->hdesc.wMaxInputLength);
460 461
461 if (size > ihid->bufsize) 462 if (size > ihid->bufsize)
@@ -480,7 +481,7 @@ static void i2c_hid_get_input(struct i2c_hid *ihid)
480 return; 481 return;
481 } 482 }
482 483
483 if (ret_size > size) { 484 if ((ret_size > size) || (ret_size <= 2)) {
484 dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n", 485 dev_err(&ihid->client->dev, "%s: incomplete report (%d/%d)\n",
485 __func__, size, ret_size); 486 __func__, size, ret_size);
486 return; 487 return;
diff --git a/drivers/hid/wacom_sys.c b/drivers/hid/wacom_sys.c
index 409543160af7..b54ef1ffcbec 100644
--- a/drivers/hid/wacom_sys.c
+++ b/drivers/hid/wacom_sys.c
@@ -219,7 +219,7 @@ static void wacom_feature_mapping(struct hid_device *hdev,
219 unsigned int equivalent_usage = wacom_equivalent_usage(usage->hid); 219 unsigned int equivalent_usage = wacom_equivalent_usage(usage->hid);
220 u8 *data; 220 u8 *data;
221 int ret; 221 int ret;
222 int n; 222 u32 n;
223 223
224 switch (equivalent_usage) { 224 switch (equivalent_usage) {
225 case HID_DG_CONTACTMAX: 225 case HID_DG_CONTACTMAX:
@@ -519,7 +519,7 @@ static int wacom_set_device_mode(struct hid_device *hdev,
519 u8 *rep_data; 519 u8 *rep_data;
520 struct hid_report *r; 520 struct hid_report *r;
521 struct hid_report_enum *re; 521 struct hid_report_enum *re;
522 int length; 522 u32 length;
523 int error = -ENOMEM, limit = 0; 523 int error = -ENOMEM, limit = 0;
524 524
525 if (wacom_wac->mode_report < 0) 525 if (wacom_wac->mode_report < 0)
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 091a81cf330f..0efe80b59156 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -851,7 +851,7 @@ extern int hidinput_connect(struct hid_device *hid, unsigned int force);
851extern void hidinput_disconnect(struct hid_device *); 851extern void hidinput_disconnect(struct hid_device *);
852 852
853int hid_set_field(struct hid_field *, unsigned, __s32); 853int hid_set_field(struct hid_field *, unsigned, __s32);
854int hid_input_report(struct hid_device *, int type, u8 *, int, int); 854int hid_input_report(struct hid_device *, int type, u8 *, u32, int);
855int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field); 855int hidinput_find_field(struct hid_device *hid, unsigned int type, unsigned int code, struct hid_field **field);
856struct hid_field *hidinput_get_led_field(struct hid_device *hid); 856struct hid_field *hidinput_get_led_field(struct hid_device *hid);
857unsigned int hidinput_count_leds(struct hid_device *hid); 857unsigned int hidinput_count_leds(struct hid_device *hid);
@@ -1102,13 +1102,13 @@ static inline void hid_hw_wait(struct hid_device *hdev)
1102 * 1102 *
1103 * @report: the report we want to know the length 1103 * @report: the report we want to know the length
1104 */ 1104 */
1105static inline int hid_report_len(struct hid_report *report) 1105static inline u32 hid_report_len(struct hid_report *report)
1106{ 1106{
1107 /* equivalent to DIV_ROUND_UP(report->size, 8) + !!(report->id > 0) */ 1107 /* equivalent to DIV_ROUND_UP(report->size, 8) + !!(report->id > 0) */
1108 return ((report->size - 1) >> 3) + 1 + (report->id > 0); 1108 return ((report->size - 1) >> 3) + 1 + (report->id > 0);
1109} 1109}
1110 1110
1111int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, int size, 1111int hid_report_raw_event(struct hid_device *hid, int type, u8 *data, u32 size,
1112 int interrupt); 1112 int interrupt);
1113 1113
1114/* HID quirks API */ 1114/* HID quirks API */