Skip to contentSkip to conversation

HID: shield

PATCH Superseded Rahul Rameshbabu 2 participants 4 messages Apr 17, 2023

Subsystems (2)

v3 of 4 Superseded Latest is v4 →

lore
Share & tools
lore

Rahul Rameshbabu

author maintainer
#0 lore raw

v3 cover HID: shield

Hi.

This is an initial driver implementation for supporting NVIDIA SHIELD peripherals. Currently supports the following functionality for the THUNDERSTRIKE (SHIELD 2017) controller.

- Haptics (ff_memless)
- Serial number query (sysfs)
- Hardware information query (sysfs)
- Firmware version query (sysfs)

Changes:
v2 -> v3:
* Renamed drivers/hid/hid-shield.c -> drivers/hid/hid-nvidia-shield.c.
* Added space between braces for terminating element in shield_devices array.
v1 -> v2:
* Declared thunderstrike_hostcmd_req_work_handler as static.

Rahul Rameshbabu (1):
HID: shield: Initial driver implementation with Thunderstrike support

 MAINTAINERS                     |   6 +
 drivers/hid/Kconfig             |  18 +
 drivers/hid/Makefile            |   1 +
 drivers/hid/hid-ids.h           |   3 +
 drivers/hid/hid-nvidia-shield.c | 587 ++++++++++++++++++++++++++++++++
 5 files changed, 615 insertions(+)
 create mode 100644 drivers/hid/hid-nvidia-shield.c
Signature · 1 line
2.38.4
author maintainer
#1 lore raw

PATCH v3 1/1 HID: shield: Initial driver implementation with Thunderstrike support

Supports the Thunderstrike (SHIELD 2017) controller. Implements support for the Thunderstrike HOSTCMD firmware interface. Adds sysfs attributes about a SHIELD device and introduces haptics support for controllers.

---
 MAINTAINERS                     |   6 +
 drivers/hid/Kconfig             |  18 +
 drivers/hid/Makefile            |   1 +
 drivers/hid/hid-ids.h           |   3 +
 drivers/hid/hid-nvidia-shield.c | 587 ++++++++++++++++++++++++++++++++
 5 files changed, 615 insertions(+)
 create mode 100644 drivers/hid/hid-nvidia-shield.c
MAINTAINERS +6 -0
index 2b073facf399..2390b6427e07 100644
@@ -9122,6 +9122,12 @@ F:	drivers/hid/hid-sensor-*
 F:	drivers/iio/*/hid-*
 F:	include/linux/hid-sensor-*
 
+HID SHIELD DRIVER
+M:	Rahul Rameshbabu <[email protected]>
+L:	[email protected]
+S:	Maintained
+F:	drivers/hid/hid-nvidia-shield.c
+
 HID VRC-2 CAR CONTROLLER DRIVER
 M:	Marcus Folkesson <[email protected]>
 L:	[email protected]
drivers/hid/Kconfig +18 -0
index 82f64fb31fda..eb19debaa1f5 100644
@@ -990,6 +990,24 @@ config HID_SEMITEK
 	- Woo-dy
 	- X-Bows Nature/Knight
 
+config HID_SHIELD
+	tristate "SHIELD HID Driver"
+	depends on USB_HID
+	depends on BT_HIDP
+	help
+	Support for NVIDIA SHIELD accessories.
+
+	Supported devices:
+	- Thunderstrike (NVIDIA SHIELD Controller 2017)
+
+config SHIELD_FF
+	bool "SHIELD force feedback support"
+	depends on HID_SHIELD
+	select INPUT_FF_MEMLESS
+	help
+	Say Y here if you would like to enable force feedback support for
+	NVIDIA SHIELD accessories with haptics capabilities.
+
 config HID_SIGMAMICRO
 	tristate "SiGma Micro-based keyboards"
 	depends on USB_HID
drivers/hid/Makefile +1 -0
index 5d37cacbde33..a37487b470c8 100644
@@ -116,6 +116,7 @@ obj-$(CONFIG_HID_RMI)		+= hid-rmi.o
 obj-$(CONFIG_HID_SAITEK)	+= hid-saitek.o
 obj-$(CONFIG_HID_SAMSUNG)	+= hid-samsung.o
 obj-$(CONFIG_HID_SEMITEK)	+= hid-semitek.o
+obj-$(CONFIG_HID_SHIELD)	+= hid-nvidia-shield.o
 obj-$(CONFIG_HID_SIGMAMICRO)	+= hid-sigmamicro.o
 obj-$(CONFIG_HID_SMARTJOYPLUS)	+= hid-sjoy.o
 obj-$(CONFIG_HID_SONY)		+= hid-sony.o
drivers/hid/hid-ids.h +3 -0
index 63545cd307e5..4000d53b1bac 100644
@@ -993,6 +993,9 @@
 #define USB_DEVICE_ID_NTRIG_TOUCH_SCREEN_18   0x0014
 #define USB_DEVICE_ID_NTRIG_DUOSENSE 0x1500
 
+#define USB_VENDOR_ID_NVIDIA				0x0955
+#define USB_DEVICE_ID_NVIDIA_THUNDERSTRIKE_CONTROLLER	0x7214
+
 #define USB_VENDOR_ID_ONTRAK		0x0a07
 #define USB_DEVICE_ID_ONTRAK_ADU100	0x0064
 
drivers/hid/hid-nvidia-shield.c new file +587 -0

587 lines not on this page · raw message

Signature · 1 line
2.38.4
#2 lore raw

Re: [PATCH v3 1/1] HID: shield: Initial driver implementation with Thunderstrike support

Hi,

Quoted 15 lines · Rahul Rameshbabu
drivers/hid/Kconfig +7 -0
index 82f64fb31fda..eb19debaa1f5 100644
@@ -990,6 +990,24 @@ config HID_SEMITEK
 	- Woo-dy
 	- X-Bows Nature/Knight
 
+config HID_SHIELD
+	tristate "SHIELD HID Driver"
+	depends on USB_HID
+	depends on BT_HIDP
+	help
+	Support for NVIDIA SHIELD accessories.
+

drivers/hid/Kconfig config HID_SEMITEK · line 1009

Quoted 10 lines
drivers/hid/Kconfig +10 -0
+	Supported devices:
+	- Thunderstrike (NVIDIA SHIELD Controller 2017)
+
+config SHIELD_FF
+	bool "SHIELD force feedback support"
+	depends on HID_SHIELD
+	select INPUT_FF_MEMLESS
+	help
+	Say Y here if you would like to enable force feedback support for
+	NVIDIA SHIELD accessories with haptics capabilities.

According to Documentation/process/coding-style.rst, Kconfig help text should be indented by 2 spaces after the "help" line:

10) Kconfig configuration files
-------------------------------

For all of the Kconfig* configuration files throughout the source tree, the indentation is somewhat different. Lines under a ``config`` definition are indented with one tab, while help text is indented an additional two spaces. Example::

config AUDIT
bool "Auditing support"
depends on NET
help
Enable auditing infrastructure that can be used with another kernel subsystem, such as SELinux (which requires this for logging of avc messages output). Does not do system-call auditing without CONFIG_AUDITSYSCALL.

Signature · 1 line
~Randy
author maintainer
#3 lore raw

Re: [PATCH v3 1/1] HID: shield: Initial driver implementation with Thunderstrike support

Hi Randy,

Thanks for the feedback. You are correct about the styling issue in my patch. I will fix this. I do want to bring to attention that there seem to be a couple of kernel config options in the Kconfig file for the hid subsystem that currently violate the styling rules.

It probably would make sense to have a clean-up patch for this issue overall (separate from this patch, which I will correct in my next version).

-- Rahul Rameshbabu

Quoted 19 lines · On Mon, 17 Apr, 2023 12:20:51 -0700 Randy Dunlap <[email protected]> wrote:

According to Documentation/process/coding-style.rst, Kconfig help text should be indented by 2 spaces after the "help" line:

10) Kconfig configuration files
-------------------------------

For all of the Kconfig* configuration files throughout the source tree, the indentation is somewhat different. Lines under a ``config`` definition are indented with one tab, while help text is indented an additional two spaces. Example::

config AUDIT
bool "Auditing support"
depends on NET
help
Enable auditing infrastructure that can be used with another kernel subsystem, such as SELinux (which requires this for logging of avc messages output). Does not do system-call auditing without CONFIG_AUDITSYSCALL.