--- v5
+++ v4
@@ -13,27 +13,26 @@
Signed-off-by: Ash Logan <ash@heyquark.com>
Signed-off-by: Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
---
- drivers/hid/Kconfig | 8 +
+ drivers/hid/Kconfig | 7 +
drivers/hid/Makefile | 1 +
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-nintendo-wiiu.c | 267 ++++++++++++++++++++++++++++++++
- drivers/hid/hid-nintendo.c | 21 ++-
+ drivers/hid/hid-nintendo.c | 17 +-
drivers/hid/hid-nintendo.h | 6 +
drivers/hid/hid-quirks.c | 3 +
- 7 files changed, 304 insertions(+), 3 deletions(-)
+ 7 files changed, 300 insertions(+), 2 deletions(-)
create mode 100644 drivers/hid/hid-nintendo-wiiu.c
diff --git a/drivers/hid/Kconfig b/drivers/hid/Kconfig
-index 17ed06f5a23c..6bcc0d181cc4 100644
+index 79beccefd431..9e75593e19cd 100644
--- a/drivers/hid/Kconfig
+++ b/drivers/hid/Kconfig
-@@ -749,6 +749,14 @@ config NINTENDO_FF
+@@ -749,6 +749,13 @@ config NINTENDO_FF
controller. For the pro controller, both rumble motors can be controlled
individually.
+config HID_NINTENDO_WIIU
+ tristate "Nintendo Wii U gamepad (DRC) over internal DRH"
-+ default n
+ depends on HID_NINTENDO
+ help
+ Support for the Wii U gamepad, when connected with the Wii U’s
@@ -41,7 +40,7 @@
+
config HID_NINTENDO_SWITCH
tristate "Nintendo Wii U gamepad (DRC) over internal DRH"
- default y
+ depends on HID_NINTENDO
diff --git a/drivers/hid/Makefile b/drivers/hid/Makefile
index a0a9ee182ef2..f9851a7acea9 100644
--- a/drivers/hid/Makefile
@@ -340,29 +339,23 @@
+ return 0;
+}
diff --git a/drivers/hid/hid-nintendo.c b/drivers/hid/hid-nintendo.c
-index f16d8d94b1da..0b0588f5bb8a 100644
+index 9d67c7b2ac75..83397e387310 100644
--- a/drivers/hid/hid-nintendo.c
+++ b/drivers/hid/hid-nintendo.c
-@@ -16,9 +16,15 @@
- static int nintendo_hid_event(struct hid_device *hdev,
- struct hid_report *report, u8 *raw_data, int size)
+@@ -18,6 +18,10 @@ static int nintendo_hid_event(struct hid_device *hdev,
{
--#ifdef CONFIG_HID_NINTENDO_SWITCH
-+#if defined(CONFIG_HID_NINTENDO_SWITCH) || defined(CONFIG_HID_NINTENDO_WIIU)
enum nintendo_driver *driver = hid_get_drvdata(hdev);
-+#endif
+#ifdef CONFIG_HID_NINTENDO_WIIU
+ if (*driver == NINTENDO_WIIU)
+ return wiiu_hid_event(hdev, report, raw_data, size);
+#endif
-+#ifdef CONFIG_HID_NINTENDO_SWITCH
+ #ifdef CONFIG_HID_NINTENDO_SWITCH
if (*driver == NINTENDO_SWITCH)
return switch_hid_event(hdev, report, raw_data, size);
- #endif
-@@ -30,10 +36,14 @@ static int nintendo_hid_probe(struct hid_device *hdev,
+@@ -30,10 +34,14 @@ static int nintendo_hid_probe(struct hid_device *hdev,
{
- int ret = 0;
+ int ret;
+#ifdef CONFIG_HID_NINTENDO_WIIU
+ if (id->product == USB_DEVICE_ID_NINTENDO_WIIU_DRH)
@@ -377,7 +370,7 @@
return ret;
}
-@@ -48,6 +58,11 @@ static void nintendo_hid_remove(struct hid_device *hdev)
+@@ -48,6 +56,11 @@ static void nintendo_hid_remove(struct hid_device *hdev)
}
static const struct hid_device_id nintendo_hid_devices[] = {