The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Apoorv Parle <apparle@gmail.com>
To: dmitry.torokhov@gmail.com
Cc: linux-input@vger.kernel.org, linux-kernel@vger.kernel.org,
	Apoorv Parle <apparle@gmail.com>
Subject: [PATCH 1/1] Input: xpad - add disable_xboxone module parameter
Date: Sat, 17 May 2025 03:50:45 -0700	[thread overview]
Message-ID: <20250517105045.70998-2-apparle@gmail.com> (raw)
In-Reply-To: <20250517105045.70998-1-apparle@gmail.com>

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


  reply	other threads:[~2025-05-17 10:51 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-17 10:50 [PATCH 0/1] Input: xpad - add disable_xboxone module parameter Apoorv Parle
2025-05-17 10:50 ` Apoorv Parle [this message]
2025-05-19 16:32 ` Dmitry Torokhov
2025-05-19 20:51   ` Apoorv Parle
     [not found]   ` <CAB7A79ysZ2-kxKPyiM1+5keSrsbVwNZti4FzXGUbjx4OONzrDw@mail.gmail.com>
2025-05-19 21:36     ` Dmitry Torokhov
2025-05-20  4:04       ` Apoorv Parle
     [not found]         ` <65636077-FB55-4E20-80CA-419EF9A071B8@progandy.de>
2025-05-21 21:45           ` Apoorv Parle
2025-05-25 10:41             ` Apoorv Parle

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250517105045.70998-2-apparle@gmail.com \
    --to=apparle@gmail.com \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox