aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2018-06-08 13:29:26 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2018-06-08 13:29:26 -0400
commitfdea70d26a471e002f2afc3a48821323b699f1e6 (patch)
tree47d9697bafcb4d2854671110758b2570b5bce3a3
parent9eb86c75494ee6a5f789bc6c11b43feff2ccfeb6 (diff)
parent06d8b9067c9bb9d65c7479506e682b211735fa1a (diff)
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid
Pull HID updates from Jiri Kosina: - Valve Steam Controller support from Rodrigo Rivas Costa - Redragon Asura support from Robert Munteanu - improvement of duplicate usage handling in generic hid-input from Benjamin Tissoires - Win 8.1 precisioun touchpad spec implementation from Benjamin Tissoires - Support for "In Range" flag for Wacom Intuos/Bamboo devices from Jason Gerecke - other various assorted smaller fixes and improvements * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/hid: (27 commits) HID: rmi: use HID_QUIRK_NO_INPUT_SYNC HID: multitouch: fix calculation of last slot field in multi-touch reports HID: quirks: remove Delcom Visual Signal Indicator from hid_have_special_driver[] HID: steam: select CONFIG_POWER_SUPPLY HID: i2c-hid: remove i2c_hid_open_mut HID: wacom: Support "in range" for Intuos/Bamboo tablets where possible HID: core: fix hid_hw_open() comment HID: hid-plantronics: Re-resend Update to map button for PTT products HID: multitouch: fix types returned from mt_need_to_apply_feature() HID: i2c-hid: check if device is there before really probing HID: steam: add missing fields in client initialization HID: steam: add battery device. HID: add driver for Valve Steam Controller HID: alps: Fix some style in 't4_read_write_register()' HID: alps: Check errors returned by 't4_read_write_register()' HID: alps: Save a memory allocation in 't4_read_write_register()' when writing data HID: alps: Report an error if we receive invalid data in 't4_read_write_register()' HID: multitouch: implement precision touchpad latency and switches HID: multitouch: simplify the settings of the various features HID: multitouch: make use of HID_QUIRK_INPUT_PER_APP ...
-rw-r--r--drivers/hid/Kconfig16
-rw-r--r--drivers/hid/Makefile2
-rw-r--r--drivers/hid/hid-alps.c30
-rw-r--r--drivers/hid/hid-core.c21
-rw-r--r--drivers/hid/hid-generic.c15
-rw-r--r--drivers/hid/hid-gfrm.c2
-rw-r--r--drivers/hid/hid-ids.h5
-rw-r--r--drivers/hid/hid-input.c123
-rw-r--r--drivers/hid/hid-magicmouse.c6
-rw-r--r--drivers/hid/hid-multitouch.c232
-rw-r--r--drivers/hid/hid-plantronics.c6
-rw-r--r--drivers/hid/hid-quirks.c1
-rw-r--r--drivers/hid/hid-redragon.c86
-rw-r--r--drivers/hid/hid-rmi.c20
-rw-r--r--drivers/hid/hid-steam.c1115
-rw-r--r--drivers/hid/i2c-hid/i2c-hid.c33
-rw-r--r--drivers/hid/wacom_wac.c74
-rw-r--r--include/linux/hid.h19
18 files changed, 1621 insertions, 185 deletions
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
index 0000434a1fbd..a49a10437c40 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
@@ -575,6 +575,13 @@ config HID_MAYFLASH
575 Say Y here if you have HJZ Mayflash PS3 game controller adapters 575 Say Y here if you have HJZ Mayflash PS3 game controller adapters
576 and want to enable force feedback support. 576 and want to enable force feedback support.
577 577
578config HID_REDRAGON
579 tristate "Redragon keyboards"
580 depends on HID
581 default !EXPERT
582 ---help---
583 Support for Redragon keyboards that need fix-ups to work properly.
584
578config HID_MICROSOFT 585config HID_MICROSOFT
579 tristate "Microsoft non-fully HID-compliant devices" 586 tristate "Microsoft non-fully HID-compliant devices"
580 depends on HID 587 depends on HID
@@ -838,6 +845,15 @@ config HID_SPEEDLINK
838 ---help--- 845 ---help---
839 Support for Speedlink Vicious and Divine Cezanne mouse. 846 Support for Speedlink Vicious and Divine Cezanne mouse.
840 847
848config HID_STEAM
849 tristate "Steam Controller support"
850 depends on HID
851 select POWER_SUPPLY
852 ---help---
853 Say Y here if you have a Steam Controller if you want to use it
854 without running the Steam Client. It supports both the wired and
855 the wireless adaptor.
856
841config HID_STEELSERIES 857config HID_STEELSERIES
842 tristate "Steelseries SRW-S1 steering wheel support" 858 tristate "Steelseries SRW-S1 steering wheel support"
843 depends on HID 859 depends on HID
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index 17a8bd97da9d..511e1cbff768 100644
--- a/drivers/hid/Makefile
+++ b/drivers/hid/Makefile
@@ -86,6 +86,7 @@ hid-picolcd-$(CONFIG_DEBUG_FS) += hid-picolcd_debugfs.o
86 86
87obj-$(CONFIG_HID_PLANTRONICS) += hid-plantronics.o 87obj-$(CONFIG_HID_PLANTRONICS) += hid-plantronics.o
88obj-$(CONFIG_HID_PRIMAX) += hid-primax.o 88obj-$(CONFIG_HID_PRIMAX) += hid-primax.o
89obj-$(CONFIG_HID_REDRAGON) += hid-redragon.o
89obj-$(CONFIG_HID_RETRODE) += hid-retrode.o 90obj-$(CONFIG_HID_RETRODE) += hid-retrode.o
90obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \ 91obj-$(CONFIG_HID_ROCCAT) += hid-roccat.o hid-roccat-common.o \
91 hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \ 92 hid-roccat-arvo.o hid-roccat-isku.o hid-roccat-kone.o \
@@ -97,6 +98,7 @@ obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
97obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o 98obj-$(CONFIG_HID_SMARTJOYPLUS) += hid-sjoy.o
98obj-$(CONFIG_HID_SONY) += hid-sony.o 99obj-$(CONFIG_HID_SONY) += hid-sony.o
99obj-$(CONFIG_HID_SPEEDLINK) += hid-speedlink.o 100obj-$(CONFIG_HID_SPEEDLINK) += hid-speedlink.o
101obj-$(CONFIG_HID_STEAM) += hid-steam.o
100obj-$(CONFIG_HID_STEELSERIES) += hid-steelseries.o 102obj-$(CONFIG_HID_STEELSERIES) += hid-steelseries.o
101obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o 103obj-$(CONFIG_HID_SUNPLUS) += hid-sunplus.o
102obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o 104obj-$(CONFIG_HID_GREENASIA) += hid-gaff.o
diff --git a/drivers/hid/hid-alps.c b/drivers/hid/hid-alps.c
index b1eeb4839bfc..aec253b44156 100644
--- a/drivers/hid/hid-alps.c
+++ b/drivers/hid/hid-alps.c
@@ -171,7 +171,7 @@ static int t4_read_write_register(struct hid_device *hdev, u32 address,
171 int ret; 171 int ret;
172 u16 check_sum; 172 u16 check_sum;
173 u8 *input; 173 u8 *input;
174 u8 *readbuf; 174 u8 *readbuf = NULL;
175 175
176 input = kzalloc(T4_FEATURE_REPORT_LEN, GFP_KERNEL); 176 input = kzalloc(T4_FEATURE_REPORT_LEN, GFP_KERNEL);
177 if (!input) 177 if (!input)
@@ -204,8 +204,8 @@ static int t4_read_write_register(struct hid_device *hdev, u32 address,
204 goto exit; 204 goto exit;
205 } 205 }
206 206
207 readbuf = kzalloc(T4_FEATURE_REPORT_LEN, GFP_KERNEL);
208 if (read_flag) { 207 if (read_flag) {
208 readbuf = kzalloc(T4_FEATURE_REPORT_LEN, GFP_KERNEL);
209 if (!readbuf) { 209 if (!readbuf) {
210 ret = -ENOMEM; 210 ret = -ENOMEM;
211 goto exit; 211 goto exit;
@@ -219,22 +219,24 @@ static int t4_read_write_register(struct hid_device *hdev, u32 address,
219 goto exit_readbuf; 219 goto exit_readbuf;
220 } 220 }
221 221
222 ret = -EINVAL;
223
222 if (*(u32 *)&readbuf[6] != address) { 224 if (*(u32 *)&readbuf[6] != address) {
223 dev_err(&hdev->dev, "read register address error (%x,%x)\n", 225 dev_err(&hdev->dev, "read register address error (%x,%x)\n",
224 *(u32 *)&readbuf[6], address); 226 *(u32 *)&readbuf[6], address);
225 goto exit_readbuf; 227 goto exit_readbuf;
226 } 228 }
227 229
228 if (*(u16 *)&readbuf[10] != 1) { 230 if (*(u16 *)&readbuf[10] != 1) {
229 dev_err(&hdev->dev, "read register size error (%x)\n", 231 dev_err(&hdev->dev, "read register size error (%x)\n",
230 *(u16 *)&readbuf[10]); 232 *(u16 *)&readbuf[10]);
231 goto exit_readbuf; 233 goto exit_readbuf;
232 } 234 }
233 235
234 check_sum = t4_calc_check_sum(readbuf, 6, 7); 236 check_sum = t4_calc_check_sum(readbuf, 6, 7);
235 if (*(u16 *)&readbuf[13] != check_sum) { 237 if (*(u16 *)&readbuf[13] != check_sum) {
236 dev_err(&hdev->dev, "read register checksum error (%x,%x)\n", 238 dev_err(&hdev->dev, "read register checksum error (%x,%x)\n",
237 *(u16 *)&readbuf[13], check_sum); 239 *(u16 *)&readbuf[13], check_sum);
238 goto exit_readbuf; 240 goto exit_readbuf;
239 } 241 }
240 242
@@ -458,17 +460,35 @@ static int __maybe_unused alps_post_reset(struct hid_device *hdev)
458 case T4: 460 case T4:
459 ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_1, 461 ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_1,
460 NULL, T4_I2C_ABS, false); 462 NULL, T4_I2C_ABS, false);
463 if (ret < 0) {
464 dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_1 (%d)\n",
465 ret);
466 goto exit;
467 }
468
461 ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_4, 469 ret = t4_read_write_register(hdev, T4_PRM_FEED_CONFIG_4,
462 NULL, T4_FEEDCFG4_ADVANCED_ABS_ENABLE, false); 470 NULL, T4_FEEDCFG4_ADVANCED_ABS_ENABLE, false);
471 if (ret < 0) {
472 dev_err(&hdev->dev, "failed T4_PRM_FEED_CONFIG_4 (%d)\n",
473 ret);
474 goto exit;
475 }
463 break; 476 break;
464 case U1: 477 case U1:
465 ret = u1_read_write_register(hdev, 478 ret = u1_read_write_register(hdev,
466 ADDRESS_U1_DEV_CTRL_1, NULL, 479 ADDRESS_U1_DEV_CTRL_1, NULL,
467 U1_TP_ABS_MODE | U1_SP_ABS_MODE, false); 480 U1_TP_ABS_MODE | U1_SP_ABS_MODE, false);
481 if (ret < 0) {
482 dev_err(&hdev->dev, "failed to change TP mode (%d)\n",
483 ret);
484 goto exit;
485 }
468 break; 486 break;
469 default: 487 default:
470 break; 488 break;
471 } 489 }
490
491exit:
472 return ret; 492 return ret;
473} 493}
474 494
diff --git a/drivers/hid/hid-core.c b/drivers/hid/hid-core.c
index 5d7cc6bbbac6..355dc7e49562 100644
--- a/drivers/hid/hid-core.c
+++ b/drivers/hid/hid-core.c
@@ -57,7 +57,9 @@ MODULE_PARM_DESC(ignore_special_drivers, "Ignore any special drivers and handle
57 * Register a new report for a device. 57 * Register a new report for a device.
58 */ 58 */
59 59
60struct hid_report *hid_register_report(struct hid_device *device, unsigned type, unsigned id) 60st