Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c5ac9d4 authored by Rodrigo Rivas Costa's avatar Rodrigo Rivas Costa Committed by Siarhei Vishniakou
Browse files

UPSTREAM: HID: add driver for Valve Steam Controller

There are two ways to connect the Steam Controller: directly to the USB
or with the USB wireless adapter.  Both methods are similar, but the
wireless adapter can connect up to 4 devices at the same time.

The wired device will appear as 3 interfaces: a virtual mouse, a virtual
keyboard and a custom HID device.

The wireless device will appear as 5 interfaces: a virtual keyboard and
4 custom HID devices, that will remain silent until a device is actually
connected.

The custom HID device has a report descriptor with all vendor specific
usages, so the hid-generic is not very useful. In a PC/SteamBox Valve
Steam Client provices a software translation by using hidraw and a
creates a uinput virtual gamepad and XTest keyboard/mouse.

This driver intercepts the hidraw usage, so it can get out of the way
when the Steam Client is in use.

(cherry picked from commit c164d6abf3841ffacfdb757c10616f9cb1f67276
("HID: add driver for Valve Steam Controller"))
https://github.com/torvalds/linux/commit/c164d6abf3841ffacfdb757c10616f9cb1f67276



Signed-off-by: default avatarRodrigo Rivas Costa <rodrigorivascosta@gmail.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>

Change-Id: Ic435163998560885afb2a6d71b1604de21fb8b11
Signed-Off-By: default avatarSiarhei Vishniakou <svv@google.com>
Bug: 136263708
Test: connected steam controller to Android
parent 56cfa64b
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -763,6 +763,14 @@ config HID_SPEEDLINK
	---help---
	Support for Speedlink Vicious and Divine Cezanne mouse.

config HID_STEAM
	tristate "Steam Controller support"
	depends on HID
	---help---
	Say Y here if you have a Steam Controller if you want to use it
	without running the Steam Client. It supports both the wired and
	the wireless adaptor.

config HID_STEELSERIES
	tristate "Steelseries SRW-S1 steering wheel support"
	depends on HID
+1 −0
Original line number Diff line number Diff line
@@ -88,6 +88,7 @@ obj-$(CONFIG_HID_SAMSUNG) += hid-samsung.o
obj-$(CONFIG_HID_SMARTJOYPLUS)	+= hid-sjoy.o
obj-$(CONFIG_HID_SONY)		+= hid-sony.o
obj-$(CONFIG_HID_SPEEDLINK)	+= hid-speedlink.o
obj-$(CONFIG_HID_STEAM)		+= hid-steam.o
obj-$(CONFIG_HID_STEELSERIES)	+= hid-steelseries.o
obj-$(CONFIG_HID_SUNPLUS)	+= hid-sunplus.o
obj-$(CONFIG_HID_GREENASIA)	+= hid-gaff.o
+3 −0
Original line number Diff line number Diff line
@@ -2112,6 +2112,9 @@ static const struct hid_device_id hid_have_special_driver[] = {
	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UGEE_TABLET_45) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_UCLOGIC, USB_DEVICE_ID_UCLOGIC_DRAWIMAGE_G3) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_UGTIZER, USB_DEVICE_ID_UGTIZER_TABLET_GP0610) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_VALVE, USB_DEVICE_ID_STEAM_CONTROLLER) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_VALVE, USB_DEVICE_ID_STEAM_CONTROLLER_WIRELESS) },
	{ HID_BLUETOOTH_DEVICE(USB_VENDOR_ID_VALVE, USB_DEVICE_ID_STEAM_CONTROLLER_BT) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SMARTJOY_PLUS) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_SUPER_JOY_BOX_3) },
	{ HID_USB_DEVICE(USB_VENDOR_ID_WISEGROUP, USB_DEVICE_ID_DUAL_USB_JOYPAD) },
+5 −0
Original line number Diff line number Diff line
@@ -954,6 +954,11 @@
#define USB_VENDOR_ID_STANTUM_SITRONIX		0x1403
#define USB_DEVICE_ID_MTP_SITRONIX		0x5001

#define USB_VENDOR_ID_VALVE			0x28de
#define USB_DEVICE_ID_STEAM_CONTROLLER		0x1102
#define USB_DEVICE_ID_STEAM_CONTROLLER_WIRELESS	0x1142
#define USB_DEVICE_ID_STEAM_CONTROLLER_BT	0x1106

#define USB_VENDOR_ID_STEELSERIES	0x1038
#define USB_DEVICE_ID_STEELSERIES_SRWS1	0x1410

+973 −0

File added.

Preview size limit exceeded, changes collapsed.

Loading