Skip to content

Commit 5af0660

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid
Pull HID updates from Jiri Kosina: - support for Nintendo Switch Pro Controllers and Joy-Cons (Daniel J. Ogorchock) - support for new revision of the NitroKey U2F device firmware (Andrej Shadura) - LED handling improvements for Sony Playstation5 controllers (Roderick Colenbrander) - support for Apple 2021 Magic Keyboard (Alex Henrie) - other assorted code cleanups and new device ID additions * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (41 commits) HID: nintendo: fix -Werror build HID: playstation: require multicolor LED functionality HID: u2fzero: properly handle timeouts in usb_submit_urb HID: u2fzero: clarify error check and length calculations HID: u2fzero: Support NitroKey U2F revision of the device HID: wacom: Make use of the helper function devm_add_action_or_reset() HID: wacom: Shrink critical section in `wacom_add_shared_data` HID: nintendo: prevent needless queueing of the rumble worker HID: nintendo: ratelimit subcommands and rumble HID: nintendo: improve rumble performance and stability HID: nintendo: add IMU support HID: nintendo: add support for reading user calibration HID: nintendo: add support for charging grip HID: nintendo: set controller uniq to MAC HID: nintendo: reduce device removal subcommand errors HID: nintendo: patch hw version for userspace HID mappings HID: nintendo: send subcommands after receiving input report HID: nintendo: improve subcommand reliability HID: nintendo: add rumble support HID: nintendo: add home led support ...
2 parents 5a1bcbd + 5a2506b commit 5af0660

27 files changed

+2788
-81
lines changed

Documentation/leds/well-known-leds.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,20 @@ but then try the legacy ones, too.
1616

1717
Notice there's a list of functions in include/dt-bindings/leds/common.h .
1818

19+
* Gamepads and joysticks
20+
21+
Game controllers may feature LEDs to indicate a player number. This is commonly
22+
used on game consoles in which multiple controllers can be connected to a system.
23+
The "player LEDs" are then programmed with a pattern to indicate a particular
24+
player. For example, a game controller with 4 LEDs, may be programmed with "x---"
25+
to indicate player 1, "-x--" to indicate player 2 etcetera where "x" means on.
26+
Input drivers can utilize the LED class to expose the individual player LEDs
27+
of a game controller using the function "player".
28+
Note: tracking and management of Player IDs is the responsibility of user space,
29+
though drivers may pick a default value.
30+
31+
Good: "input*:*:player-{1,2,3,4,5}
32+
1933
* Keyboards
2034

2135
Good: "input*:*:capslock"

MAINTAINERS

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13434,6 +13434,12 @@ W: http://www.netlab.is.tsukuba.ac.jp/~yokota/izumi/ninja/
1343413434
F: Documentation/scsi/NinjaSCSI.rst
1343513435
F: drivers/scsi/nsp32*
1343613436

13437+
NINTENDO HID DRIVER
13438+
M: Daniel J. Ogorchock <[email protected]>
13439+
13440+
S: Maintained
13441+
F: drivers/hid/hid-nintendo*
13442+
1343713443
NIOS2 ARCHITECTURE
1343813444
M: Dinh Nguyen <[email protected]>
1343913445
S: Maintained

drivers/hid/Kconfig

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -468,6 +468,13 @@ config HID_VIEWSONIC
468468
help
469469
Support for ViewSonic/Signotec PD1011 signature pad.
470470

471+
config HID_XIAOMI
472+
tristate "Xiaomi"
473+
depends on HID
474+
help
475+
Adds support for side buttons of Xiaomi Mi Dual Mode Wireless
476+
Mouse Silent Edition.
477+
471478
config HID_GYRATION
472479
tristate "Gyration remote control"
473480
depends on HID
@@ -731,6 +738,30 @@ config HID_MULTITOUCH
731738
To compile this driver as a module, choose M here: the
732739
module will be called hid-multitouch.
733740

741+
config HID_NINTENDO
742+
tristate "Nintendo Joy-Con and Pro Controller support"
743+
depends on HID
744+
depends on NEW_LEDS
745+
depends on LEDS_CLASS
746+
select POWER_SUPPLY
747+
help
748+
Adds support for the Nintendo Switch Joy-Cons and Pro Controller.
749+
All controllers support bluetooth, and the Pro Controller also supports
750+
its USB mode.
751+
752+
To compile this driver as a module, choose M here: the
753+
module will be called hid-nintendo.
754+
755+
config NINTENDO_FF
756+
bool "Nintendo Switch controller force feedback support"
757+
depends on HID_NINTENDO
758+
select INPUT_FF_MEMLESS
759+
help
760+
Say Y here if you have a Nintendo Switch controller and want to enable
761+
force feedback support for it. This works for both joy-cons and the pro
762+
controller. For the pro controller, both rumble motors can be controlled
763+
individually.
764+
734765
config HID_NTI
735766
tristate "NTI keyboard adapters"
736767
help
@@ -868,6 +899,7 @@ config HID_PLANTRONICS
868899
config HID_PLAYSTATION
869900
tristate "PlayStation HID Driver"
870901
depends on HID
902+
depends on LEDS_CLASS_MULTICOLOR
871903
select CRC32
872904
select POWER_SUPPLY
873905
help

drivers/hid/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ obj-$(CONFIG_HID_MAYFLASH) += hid-mf.o
7878
obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o
7979
obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o
8080
obj-$(CONFIG_HID_MULTITOUCH) += hid-multitouch.o
81+
obj-$(CONFIG_HID_NINTENDO) += hid-nintendo.o
8182
obj-$(CONFIG_HID_NTI) += hid-nti.o
8283
obj-$(CONFIG_HID_NTRIG) += hid-ntrig.o
8384
obj-$(CONFIG_HID_ORTEK) += hid-ortek.o
@@ -125,6 +126,7 @@ hid-uclogic-objs := hid-uclogic-core.o \
125126
obj-$(CONFIG_HID_UCLOGIC) += hid-uclogic.o
126127
obj-$(CONFIG_HID_UDRAW_PS3) += hid-udraw-ps3.o
127128
obj-$(CONFIG_HID_LED) += hid-led.o
129+
obj-$(CONFIG_HID_XIAOMI) += hid-xiaomi.o
128130
obj-$(CONFIG_HID_XINMO) += hid-xinmo.o
129131
obj-$(CONFIG_HID_ZEROPLUS) += hid-zpff.o
130132
obj-$(CONFIG_HID_ZYDACRON) += hid-zydacron.o

drivers/hid/amd-sfh-hid/amd_sfh_client.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
33
* AMD SFH Client Layer
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
* Authors: Nehal Bakulchandra Shah <[email protected]>
66
* Sandeep Singh <[email protected]>
7+
* Basavaraj Natikar <[email protected]>
78
*/
89

910
#include <linux/dma-mapping.h>

drivers/hid/amd-sfh-hid/amd_sfh_hid.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/*
33
* AMD MP2 Sensors transport driver
44
*
5+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
56
* Authors: Nehal Bakulchandra Shah <[email protected]>
67
* Sandeep Singh <[email protected]>
8+
* Basavaraj Natikar <[email protected]>
79
*/
810
#include <linux/hid.h>
911
#include <linux/wait.h>

drivers/hid/amd-sfh-hid/amd_sfh_hid.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
/*
33
* AMD MP2 Sensors transport driver
44
*
5+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
56
* Authors: Nehal Bakulchandra Shah <[email protected]>
67
* Sandeep Singh <[email protected]>
8+
* Basavaraj Natikar <[email protected]>
79
*/
810

911
#ifndef AMDSFH_HID_H

drivers/hid/amd-sfh-hid/amd_sfh_pcie.c

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
33
* AMD MP2 PCIe communication driver
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
*
66
* Authors: Shyam Sundar S K <[email protected]>
77
* Sandeep Singh <[email protected]>
8+
* Basavaraj Natikar <[email protected]>
89
*/
910

1011
#include <linux/bitops.h>
@@ -234,7 +235,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
234235
return -ENOMEM;
235236

236237
privdata->pdev = pdev;
237-
pci_set_drvdata(pdev, privdata);
238+
dev_set_drvdata(&pdev->dev, privdata);
238239
rc = pcim_enable_device(pdev);
239240
if (rc)
240241
return rc;
@@ -245,10 +246,13 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
245246

246247
privdata->mmio = pcim_iomap_table(pdev)[2];
247248
pci_set_master(pdev);
248-
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(64));
249+
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(64));
249250
if (rc) {
250-
rc = pci_set_dma_mask(pdev, DMA_BIT_MASK(32));
251-
return rc;
251+
rc = dma_set_mask_and_coherent(&pdev->dev, DMA_BIT_MASK(32));
252+
if (rc) {
253+
dev_err(&pdev->dev, "failed to set DMA mask\n");
254+
return rc;
255+
}
252256
}
253257

254258
privdata->cl_data = devm_kzalloc(&pdev->dev, sizeof(struct amdtp_cl_data), GFP_KERNEL);
@@ -266,8 +270,7 @@ static int amd_mp2_pci_probe(struct pci_dev *pdev, const struct pci_device_id *i
266270

267271
static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
268272
{
269-
struct pci_dev *pdev = to_pci_dev(dev);
270-
struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev);
273+
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
271274
struct amdtp_cl_data *cl_data = mp2->cl_data;
272275
struct amd_mp2_sensor_info info;
273276
int i, status;
@@ -292,8 +295,7 @@ static int __maybe_unused amd_mp2_pci_resume(struct device *dev)
292295

293296
static int __maybe_unused amd_mp2_pci_suspend(struct device *dev)
294297
{
295-
struct pci_dev *pdev = to_pci_dev(dev);
296-
struct amd_mp2_dev *mp2 = pci_get_drvdata(pdev);
298+
struct amd_mp2_dev *mp2 = dev_get_drvdata(dev);
297299
struct amdtp_cl_data *cl_data = mp2->cl_data;
298300
int i, status;
299301

@@ -334,3 +336,4 @@ MODULE_DESCRIPTION(DRIVER_DESC);
334336
MODULE_LICENSE("Dual BSD/GPL");
335337
MODULE_AUTHOR("Shyam Sundar S K <[email protected]>");
336338
MODULE_AUTHOR("Sandeep Singh <[email protected]>");
339+
MODULE_AUTHOR("Basavaraj Natikar <[email protected]>");

drivers/hid/amd-sfh-hid/amd_sfh_pcie.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
/* SPDX-License-Identifier: GPL-2.0-or-later */
22
/*
33
* AMD MP2 PCIe communication driver
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
* Authors: Shyam Sundar S K <[email protected]>
66
* Sandeep Singh <[email protected]>
7+
* Basavaraj Natikar <[email protected]>
78
*/
89

910
#ifndef PCIE_MP2_AMD_H

drivers/hid/amd-sfh-hid/hid_descriptor/amd_sfh_hid_desc.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
// SPDX-License-Identifier: GPL-2.0-or-later
22
/*
33
* AMD SFH Report Descriptor generator
4-
* Copyright 2020 Advanced Micro Devices, Inc.
4+
* Copyright 2020-2021 Advanced Micro Devices, Inc.
55
* Authors: Nehal Bakulchandra Shah <[email protected]>
66
* Sandeep Singh <[email protected]>
7+
* Basavaraj Natikar <[email protected]>
78
*/
89

910
#include <linux/kernel.h>

0 commit comments

Comments
 (0)