lkml.org 
[lkml]   [2025]   [May]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/1] Input: xpad - add disable_xboxone module parameter
Date
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(+)

diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c
index 57a5ff3d1992..5bab5c2250d2 100644
--- a/drivers/input/joystick/xpad.c
+++ b/drivers/input/joystick/xpad.c
@@ -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) {
/*
--
2.48.1

\
 
 \ /
  Last update: 2025-05-17 12:52    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog