Skip to content

Commit 3aae938

Browse files
committed
Merge tag 'input-for-v7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: - new IDs for BETOP BTP-KP50B/C and Razer Wolverine V3 Pro added to xpad controller driver - another quirk for new TUXEDO InfinityBook added to i8042 - a small fixup for Synaptics RMI4 driver to properly unlock mutex when encountering an error in F54 - an update to bcm5974 touch controller driver to reliably switch into wellspring mode * tag 'input-for-v7.0-rc6' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: xpad - add support for BETOP BTP-KP50B/C controller's wireless mode Input: xpad - add support for Razer Wolverine V3 Pro Input: synaptics-rmi4 - fix a locking bug in an error path Input: i8042 - add TUXEDO InfinityBook Max 16 Gen10 AMD to i8042 quirk table Input: bcm5974 - recover from failed mode switch
2 parents 7ca6d1c + 0d9363a commit 3aae938

4 files changed

Lines changed: 55 additions & 3 deletions

File tree

drivers/input/joystick/xpad.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -313,6 +313,8 @@ static const struct xpad_device {
313313
{ 0x1532, 0x0a00, "Razer Atrox Arcade Stick", MAP_TRIGGERS_TO_BUTTONS, XTYPE_XBOXONE },
314314
{ 0x1532, 0x0a03, "Razer Wildcat", 0, XTYPE_XBOXONE },
315315
{ 0x1532, 0x0a29, "Razer Wolverine V2", 0, XTYPE_XBOXONE },
316+
{ 0x1532, 0x0a57, "Razer Wolverine V3 Pro (Wired)", 0, XTYPE_XBOX360 },
317+
{ 0x1532, 0x0a59, "Razer Wolverine V3 Pro (2.4 GHz Dongle)", 0, XTYPE_XBOX360 },
316318
{ 0x15e4, 0x3f00, "Power A Mini Pro Elite", 0, XTYPE_XBOX360 },
317319
{ 0x15e4, 0x3f0a, "Xbox Airflo wired controller", 0, XTYPE_XBOX360 },
318320
{ 0x15e4, 0x3f10, "Batarang Xbox 360 controller", 0, XTYPE_XBOX360 },
@@ -360,6 +362,8 @@ static const struct xpad_device {
360362
{ 0x1bad, 0xfd00, "Razer Onza TE", 0, XTYPE_XBOX360 },
361363
{ 0x1bad, 0xfd01, "Razer Onza", 0, XTYPE_XBOX360 },
362364
{ 0x1ee9, 0x1590, "ZOTAC Gaming Zone", 0, XTYPE_XBOX360 },
365+
{ 0x20bc, 0x5134, "BETOP BTP-KP50B Xinput Dongle", 0, XTYPE_XBOX360 },
366+
{ 0x20bc, 0x514a, "BETOP BTP-KP50C Xinput Dongle", 0, XTYPE_XBOX360 },
363367
{ 0x20d6, 0x2001, "BDA Xbox Series X Wired Controller", 0, XTYPE_XBOXONE },
364368
{ 0x20d6, 0x2009, "PowerA Enhanced Wired Controller for Xbox Series X|S", 0, XTYPE_XBOXONE },
365369
{ 0x20d6, 0x2064, "PowerA Wired Controller for Xbox", MAP_SHARE_BUTTON, XTYPE_XBOXONE },
@@ -562,6 +566,7 @@ static const struct usb_device_id xpad_table[] = {
562566
XPAD_XBOX360_VENDOR(0x1a86), /* Nanjing Qinheng Microelectronics (WCH) */
563567
XPAD_XBOX360_VENDOR(0x1bad), /* Harmonix Rock Band guitar and drums */
564568
XPAD_XBOX360_VENDOR(0x1ee9), /* ZOTAC Technology Limited */
569+
XPAD_XBOX360_VENDOR(0x20bc), /* BETOP wireless dongles */
565570
XPAD_XBOX360_VENDOR(0x20d6), /* PowerA controllers */
566571
XPAD_XBOXONE_VENDOR(0x20d6), /* PowerA controllers */
567572
XPAD_XBOX360_VENDOR(0x2345), /* Machenike Controllers */

drivers/input/mouse/bcm5974.c

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -286,6 +286,8 @@ struct bcm5974 {
286286
const struct tp_finger *index[MAX_FINGERS]; /* finger index data */
287287
struct input_mt_pos pos[MAX_FINGERS]; /* position array */
288288
int slots[MAX_FINGERS]; /* slot assignments */
289+
struct work_struct mode_reset_work;
290+
unsigned long last_mode_reset;
289291
};
290292

291293
/* trackpad finger block data, le16-aligned */
@@ -696,6 +698,32 @@ static int bcm5974_wellspring_mode(struct bcm5974 *dev, bool on)
696698
return retval;
697699
}
698700

701+
/*
702+
* Mode switches sent before the control response are ignored.
703+
* Fixing this state requires switching to normal mode and waiting
704+
* about 1ms before switching back to wellspring mode.
705+
*/
706+
static void bcm5974_mode_reset_work(struct work_struct *work)
707+
{
708+
struct bcm5974 *dev = container_of(work, struct bcm5974, mode_reset_work);
709+
int error;
710+
711+
guard(mutex)(&dev->pm_mutex);
712+
dev->last_mode_reset = jiffies;
713+
714+
error = bcm5974_wellspring_mode(dev, false);
715+
if (error) {
716+
dev_err(&dev->intf->dev, "reset to normal mode failed\n");
717+
return;
718+
}
719+
720+
fsleep(1000);
721+
722+
error = bcm5974_wellspring_mode(dev, true);
723+
if (error)
724+
dev_err(&dev->intf->dev, "mode switch after reset failed\n");
725+
}
726+
699727
static void bcm5974_irq_button(struct urb *urb)
700728
{
701729
struct bcm5974 *dev = urb->context;
@@ -752,10 +780,20 @@ static void bcm5974_irq_trackpad(struct urb *urb)
752780
if (dev->tp_urb->actual_length == 2)
753781
goto exit;
754782

755-
if (report_tp_state(dev, dev->tp_urb->actual_length))
783+
if (report_tp_state(dev, dev->tp_urb->actual_length)) {
756784
dprintk(1, "bcm5974: bad trackpad package, length: %d\n",
757785
dev->tp_urb->actual_length);
758786

787+
/*
788+
* Receiving a HID packet means we aren't in wellspring mode.
789+
* If we haven't tried a reset in the last second, try now.
790+
*/
791+
if (dev->tp_urb->actual_length == 8 &&
792+
time_after(jiffies, dev->last_mode_reset + msecs_to_jiffies(1000))) {
793+
schedule_work(&dev->mode_reset_work);
794+
}
795+
}
796+
759797
exit:
760798
error = usb_submit_urb(dev->tp_urb, GFP_ATOMIC);
761799
if (error)
@@ -906,6 +944,7 @@ static int bcm5974_probe(struct usb_interface *iface,
906944
dev->intf = iface;
907945
dev->input = input_dev;
908946
dev->cfg = *cfg;
947+
INIT_WORK(&dev->mode_reset_work, bcm5974_mode_reset_work);
909948
mutex_init(&dev->pm_mutex);
910949

911950
/* setup urbs */
@@ -998,6 +1037,7 @@ static void bcm5974_disconnect(struct usb_interface *iface)
9981037
{
9991038
struct bcm5974 *dev = usb_get_intfdata(iface);
10001039

1040+
disable_work_sync(&dev->mode_reset_work);
10011041
usb_set_intfdata(iface, NULL);
10021042

10031043
input_unregister_device(dev->input);

drivers/input/rmi4/rmi_f54.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -538,6 +538,8 @@ static void rmi_f54_work(struct work_struct *work)
538538
int error;
539539
int i;
540540

541+
mutex_lock(&f54->data_mutex);
542+
541543
report_size = rmi_f54_get_report_size(f54);
542544
if (report_size == 0) {
543545
dev_err(&fn->dev, "Bad report size, report type=%d\n",
@@ -546,8 +548,6 @@ static void rmi_f54_work(struct work_struct *work)
546548
goto error; /* retry won't help */
547549
}
548550

549-
mutex_lock(&f54->data_mutex);
550-
551551
/*
552552
* Need to check if command has completed.
553553
* If not try again later.

drivers/input/serio/i8042-acpipnpio.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1187,6 +1187,13 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
11871187
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
11881188
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
11891189
},
1190+
{
1191+
.matches = {
1192+
DMI_MATCH(DMI_BOARD_NAME, "X6KK45xU_X6SP45xU"),
1193+
},
1194+
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1195+
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1196+
},
11901197
{
11911198
.matches = {
11921199
DMI_MATCH(DMI_BOARD_NAME, "WUJIE Series-X5SP4NAG"),

0 commit comments

Comments
 (0)