From 6429037fe7fe346f6a9f640a77094c56a16d5d1c Mon Sep 17 00:00:00 2001 From: Kai Krakow Date: Mon, 30 May 2022 00:13:04 +0200 Subject: [PATCH] xpadneo, fixups: Adapt SDL fixup to fix the Xbox button A new SDL gamecontrollerdb entry allows us to get rid of the Xbox button fixup we are carrying around. While this button is still not exactly a button for games, all software expects it to be part of the gamepad mapping anyways. This leaves only the Share button left in the consumer control bits which doesn't have an jsdev equivalent. Affects: https://github.com/atar-axis/xpadneo/issues/286 Maybe-affects: https://github.com/atar-axis/xpadneo/pull/283 Fixes: https://github.com/atar-axis/xpadneo/issues/362 Fixes: https://github.com/atar-axis/xpadneo/issues/359 Closes: https://github.com/atar-axis/xpadneo/issues/301 Signed-off-by: Kai Krakow --- hid-xpadneo/src/hid-xpadneo.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/hid-xpadneo/src/hid-xpadneo.c b/hid-xpadneo/src/hid-xpadneo.c index 3c095be6..edefba19 100644 --- a/hid-xpadneo/src/hid-xpadneo.c +++ b/hid-xpadneo/src/hid-xpadneo.c @@ -897,8 +897,10 @@ static int xpadneo_input_configured(struct hid_device *hdev, struct hid_input *h /* combine triggers to form a rudder, use ABS_MISC to order after dpad */ input_set_abs_params(xdata->idev, ABS_MISC, -1023, 1023, 3, 63); + /* do not report the consumer control buttons as part of the gamepad */ + __clear_bit(BTN_SHARE, xdata->idev->keybit); + /* add paddles as part of the gamepad */ - __set_bit(BTN_TRIGGER_HAPPY, xdata->idev->keybit); /* workaround for Steam */ __set_bit(BTN_PADDLES(0), xdata->idev->keybit); __set_bit(BTN_PADDLES(1), xdata->idev->keybit); __set_bit(BTN_PADDLES(2), xdata->idev->keybit); @@ -1126,8 +1128,8 @@ static int xpadneo_probe(struct hid_device *hdev, const struct hid_device_id *id */ xdata->original_product = hdev->product; xdata->original_version = hdev->version; - hdev->product = 0x02E0; - hdev->version = 0x00000903; + hdev->product = 0x02FD; + hdev->version = 0x00001130; if (hdev->product != xdata->original_product) hid_info(hdev,