@@ -121,6 +121,10 @@ static bool auto_poweroff = true;
module_param(auto_poweroff, bool, S_IWUSR | S_IRUGO);
MODULE_PARM_DESC(auto_poweroff, "Power off wireless controllers on suspend");
+static bool disable_xboxone;
+module_param(disable_xboxone, bool, 0644);
+MODULE_PARM_DESC(disable_xboxone, "Disable all Xbox One devices (XTYPE_XBOXONE)");
+
static const struct xpad_device {
u16 idVendor;
u16 idProduct;
@@ -2089,6 +2093,14 @@ static int xpad_probe(struct usb_interface *intf, const struct usb_device_id *id
xpad->mapping |= MAP_STICKS_TO_NULL;
}
+ if (xpad->xtype == XTYPE_XBOXONE && disable_xboxone) {
+ /*
+ * Disable XTYPE_XBOXONE based on module parameter.
+ */
+ error = -ENODEV;
+ goto err_free_in_urb;
+ }
+
if (xpad->xtype == XTYPE_XBOXONE &&
intf->cur_altsetting->desc.bInterfaceNumber != GIP_WIRED_INTF_DATA) {
/*
This parameter skips probing for XTYPE_XBOXONE devices, allowing out-of-tree drivers like xone to handle newer Xbox controllers without conflicts. Signed-off-by: Apoorv Parle <apparle@gmail.com> --- drivers/input/joystick/xpad.c | 12 ++++++++++++ 1 file changed, 12 insertions(+)