Skip to content

Commit

Permalink
FROMLIST: HID: nintendo: add nintendo switch controller driver
Browse files Browse the repository at this point in the history
The hid-nintendo driver supports the Nintendo Switch Pro Controllers and
the Joy-Cons. The Pro Controllers can be used over USB or Bluetooth.

The Joy-Cons each create their own, independent input devices, so it is
up to userspace to combine them if desired.

Signed-off-by: Daniel J. Ogorchock <[email protected]>

Test: tested via custom test app
Test: atest NintendoSwitchProTest

Bug: 135136477
Link: https://patchwork.kernel.org/patch/11312547/
Link: https://lore.kernel.org/linux-input/[email protected]/
Change-Id: I179da1092faedc2ad25336224cf5ec8ff00e0d3f
Signed-off-by: Siarhei Vishniakou <[email protected]>
(cherry picked from commit 8b094ebb4fc40c3381be4c495eea161add5d105b)
(cherry picked from commit 961f850fe8d417ce9037aa29271572fd924c049d)
(cherry picked from commit c055cb8584c05fae2d5d293dd2d0a868bb098551)
(cherry picked from commit b40ee0f11a53527058f89103ec9109de6445c864)
(cherry picked from commit 98b27ddda96e94b8dfdf169cf6a24fcc7f9515d0)
Signed-off-by: engstk <[email protected]>
  • Loading branch information
DanielOgorchock authored and engstk committed Jun 26, 2020
1 parent e1718a4 commit 399b618
Show file tree
Hide file tree
Showing 5 changed files with 841 additions and 0 deletions.
6 changes: 6 additions & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -9562,6 +9562,12 @@ S: Maintained
F: Documentation/scsi/NinjaSCSI.txt
F: drivers/scsi/nsp32*

NINTENDO HID DRIVER
M: Daniel J. Ogorchock <[email protected]>
L: [email protected]
S: Maintained
F: drivers/hid/hid-nintendo*

NIOS2 ARCHITECTURE
M: Ley Foon Tan <[email protected]>
L: [email protected] (moderated for non-subscribers)
Expand Down
11 changes: 11 additions & 0 deletions drivers/hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -609,6 +609,17 @@ config HID_MULTITOUCH
To compile this driver as a module, choose M here: the
module will be called hid-multitouch.

config HID_NINTENDO
tristate "Nintendo Joy-Con and Pro Controller support"
depends on HID
help
Adds support for the Nintendo Switch Joy-Cons and Pro Controller.
All controllers support bluetooth, and the Pro Controller also supports
its USB mode.

To compile this driver as a module, choose M here: the
module will be called hid-nintendo.

config HID_NTI
tristate "NTI keyboard adapters"
---help---
Expand Down
1 change: 1 addition & 0 deletions drivers/hid/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ obj-$(CONFIG_HID_MAYFLASH) += hid-mf.o
obj-$(CONFIG_HID_MICROSOFT) += hid-microsoft.o
obj-$(CONFIG_HID_MONTEREY) += hid-monterey.o
obj-$(CONFIG_HID_MULTITOUCH) += hid-multitouch.o
obj-$(CONFIG_HID_NINTENDO) += hid-nintendo.o
obj-$(CONFIG_HID_NTI) += hid-nti.o
obj-$(CONFIG_HID_NTRIG) += hid-ntrig.o
obj-$(CONFIG_HID_ORTEK) += hid-ortek.o
Expand Down
3 changes: 3 additions & 0 deletions drivers/hid/hid-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -815,6 +815,9 @@
#define USB_VENDOR_ID_NINTENDO 0x057e
#define USB_DEVICE_ID_NINTENDO_WIIMOTE 0x0306
#define USB_DEVICE_ID_NINTENDO_WIIMOTE2 0x0330
#define USB_DEVICE_ID_NINTENDO_JOYCONL 0x2006
#define USB_DEVICE_ID_NINTENDO_JOYCONR 0x2007
#define USB_DEVICE_ID_NINTENDO_PROCON 0x2009

#define USB_VENDOR_ID_NOVATEK 0x0603
#define USB_DEVICE_ID_NOVATEK_PCT 0x0600
Expand Down
Loading

0 comments on commit 399b618

Please sign in to comment.