Skip to content

Commit

Permalink
HID: nintendo: add support for nso controllers
Browse files Browse the repository at this point in the history
This adds support for the nintendo switch online controllers which
include the SNES, Genesis, and N64 Controllers.

As each nso controller only implements a subset of what a pro
controller can do. Each of these 'features' were broken up in to
seperate functions which include right stick, left stick, imu, and
dpad and depending on the controller type that it is, it will call
the supported functions appropriately.

Each controller now has a struct which maps the bit within the hid
in report to a button.

The name given to the device now comes directly from the hid
device name rather than looking up a predefined string.

Signed-off-by: Ryan McClelland <rymcclel@gmail.com>
Reviewed-by: Daniel J. Ogorchock <djogorchock@gmail.com>
Tested-by: Daniel J. Ogorchock <djogorchock@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
  • Loading branch information
Ryan McClelland authored and Jiri Kosina committed Dec 12, 2023
1 parent 1f34279 commit 94f18bb
Show file tree
Hide file tree
Showing 3 changed files with 649 additions and 266 deletions.
13 changes: 7 additions & 6 deletions drivers/hid/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -761,14 +761,15 @@ config HID_MULTITOUCH
module will be called hid-multitouch.

config HID_NINTENDO
tristate "Nintendo Joy-Con and Pro Controller support"
tristate "Nintendo Joy-Con, NSO, and Pro Controller support"
depends on NEW_LEDS
depends on LEDS_CLASS
select POWER_SUPPLY
help
Adds support for the Nintendo Switch Joy-Cons and Pro Controller.
Adds support for the Nintendo Switch Joy-Cons, NSO, Pro Controller.
All controllers support bluetooth, and the Pro Controller also supports
its USB mode.
its USB mode. This also includes support for the Nintendo Switch Online
Controllers which include the Genesis, SNES, and N64 controllers.

To compile this driver as a module, choose M here: the
module will be called hid-nintendo.
Expand All @@ -779,9 +780,9 @@ config NINTENDO_FF
select INPUT_FF_MEMLESS
help
Say Y here if you have a Nintendo Switch controller and want to enable
force feedback support for it. This works for both joy-cons and the pro
controller. For the pro controller, both rumble motors can be controlled
individually.
force feedback support for it. This works for both joy-cons, the pro
controller, and the NSO N64 controller. For the pro controller, both
rumble motors can be controlled individually.

config HID_NTI
tristate "NTI keyboard adapters"
Expand Down
5 changes: 4 additions & 1 deletion drivers/hid/hid-ids.h
Original file line number Diff line number Diff line change
Expand Up @@ -986,7 +986,10 @@
#define USB_DEVICE_ID_NINTENDO_JOYCONL 0x2006
#define USB_DEVICE_ID_NINTENDO_JOYCONR 0x2007
#define USB_DEVICE_ID_NINTENDO_PROCON 0x2009
#define USB_DEVICE_ID_NINTENDO_CHRGGRIP 0x200E
#define USB_DEVICE_ID_NINTENDO_CHRGGRIP 0x200e
#define USB_DEVICE_ID_NINTENDO_SNESCON 0x2017
#define USB_DEVICE_ID_NINTENDO_GENCON 0x201e
#define USB_DEVICE_ID_NINTENDO_N64CON 0x2019

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

0 comments on commit 94f18bb

Please sign in to comment.