Skip to content

Commit eab5c86

Browse files
committed
Merge tag 'input-for-v6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: - a fix for the fix to deal with newer laptops which get confused by the "GET ID" command when probing for PS/2 keyboards - a couple of tweaks to i8042 to handle Clevo NS70PU and Lifebook U728 laptops - a change to bcm5974 to validate that the device has appropriate endpoints - an addition of new product ID to xpad driver to recognize Lenovo Legion Go controllers - a quirk to Goodix controller to deal with extra GPIO described in ACPI tables on some devices. * tag 'input-for-v6.8-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: i8042 - add Fujitsu Lifebook U728 to i8042 quirk table Input: i8042 - fix strange behavior of touchpad on Clevo NS70PU Input: atkbd - do not skip atkbd_deactivate() when skipping ATKBD_CMD_GETID Input: atkbd - skip ATKBD_CMD_SETLEDS when skipping ATKBD_CMD_GETID Input: bcm5974 - check endpoint type before starting traffic Input: xpad - add Lenovo Legion Go controllers Input: goodix - accept ACPI resources with gpio_count == 3 && gpio_int_idx == 0
2 parents 01370ce + 4255447 commit eab5c86

File tree

5 files changed

+47
-6
lines changed

5 files changed

+47
-6
lines changed

drivers/input/joystick/xpad.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -294,6 +294,7 @@ static const struct xpad_device {
294294
{ 0x1689, 0xfd00, "Razer Onza Tournament Edition", 0, XTYPE_XBOX360 },
295295
{ 0x1689, 0xfd01, "Razer Onza Classic Edition", 0, XTYPE_XBOX360 },
296296
{ 0x1689, 0xfe00, "Razer Sabertooth", 0, XTYPE_XBOX360 },
297+
{ 0x17ef, 0x6182, "Lenovo Legion Controller for Windows", 0, XTYPE_XBOX360 },
297298
{ 0x1949, 0x041a, "Amazon Game Controller", 0, XTYPE_XBOX360 },
298299
{ 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
299300
{ 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
@@ -491,6 +492,7 @@ static const struct usb_device_id xpad_table[] = {
491492
XPAD_XBOX360_VENDOR(0x15e4), /* Numark Xbox 360 controllers */
492493
XPAD_XBOX360_VENDOR(0x162e), /* Joytech Xbox 360 controllers */
493494
XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */
495+
XPAD_XBOX360_VENDOR(0x17ef), /* Lenovo */
494496
XPAD_XBOX360_VENDOR(0x1949), /* Amazon controllers */
495497
XPAD_XBOX360_VENDOR(0x1bad), /* Harmonix Rock Band guitar and drums */
496498
XPAD_XBOX360_VENDOR(0x20d6), /* PowerA controllers */

drivers/input/keyboard/atkbd.c

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -811,7 +811,6 @@ static int atkbd_probe(struct atkbd *atkbd)
811811
{
812812
struct ps2dev *ps2dev = &atkbd->ps2dev;
813813
unsigned char param[2];
814-
bool skip_getid;
815814

816815
/*
817816
* Some systems, where the bit-twiddling when testing the io-lines of the
@@ -825,6 +824,11 @@ static int atkbd_probe(struct atkbd *atkbd)
825824
"keyboard reset failed on %s\n",
826825
ps2dev->serio->phys);
827826

827+
if (atkbd_skip_getid(atkbd)) {
828+
atkbd->id = 0xab83;
829+
goto deactivate_kbd;
830+
}
831+
828832
/*
829833
* Then we check the keyboard ID. We should get 0xab83 under normal conditions.
830834
* Some keyboards report different values, but the first byte is always 0xab or
@@ -833,18 +837,17 @@ static int atkbd_probe(struct atkbd *atkbd)
833837
*/
834838

835839
param[0] = param[1] = 0xa5; /* initialize with invalid values */
836-
skip_getid = atkbd_skip_getid(atkbd);
837-
if (skip_getid || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
840+
if (ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
838841

839842
/*
840-
* If the get ID command was skipped or failed, we check if we can at least set
843+
* If the get ID command failed, we check if we can at least set
841844
* the LEDs on the keyboard. This should work on every keyboard out there.
842845
* It also turns the LEDs off, which we want anyway.
843846
*/
844847
param[0] = 0;
845848
if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
846849
return -1;
847-
atkbd->id = skip_getid ? 0xab83 : 0xabba;
850+
atkbd->id = 0xabba;
848851
return 0;
849852
}
850853

@@ -860,6 +863,7 @@ static int atkbd_probe(struct atkbd *atkbd)
860863
return -1;
861864
}
862865

866+
deactivate_kbd:
863867
/*
864868
* Make sure nothing is coming from the keyboard and disturbs our
865869
* internal state.

drivers/input/mouse/bcm5974.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
* Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch)
2020
*/
2121

22+
#include "linux/usb.h"
2223
#include <linux/kernel.h>
2324
#include <linux/errno.h>
2425
#include <linux/slab.h>
@@ -193,6 +194,8 @@ enum tp_type {
193194

194195
/* list of device capability bits */
195196
#define HAS_INTEGRATED_BUTTON 1
197+
/* maximum number of supported endpoints (currently trackpad and button) */
198+
#define MAX_ENDPOINTS 2
196199

197200
/* trackpad finger data block size */
198201
#define FSIZE_TYPE1 (14 * sizeof(__le16))
@@ -891,6 +894,18 @@ static int bcm5974_resume(struct usb_interface *iface)
891894
return error;
892895
}
893896

897+
static bool bcm5974_check_endpoints(struct usb_interface *iface,
898+
const struct bcm5974_config *cfg)
899+
{
900+
u8 ep_addr[MAX_ENDPOINTS + 1] = {0};
901+
902+
ep_addr[0] = cfg->tp_ep;
903+
if (cfg->tp_type == TYPE1)
904+
ep_addr[1] = cfg->bt_ep;
905+
906+
return usb_check_int_endpoints(iface, ep_addr);
907+
}
908+
894909
static int bcm5974_probe(struct usb_interface *iface,
895910
const struct usb_device_id *id)
896911
{
@@ -903,6 +918,11 @@ static int bcm5974_probe(struct usb_interface *iface,
903918
/* find the product index */
904919
cfg = bcm5974_get_config(udev);
905920

921+
if (!bcm5974_check_endpoints(iface, cfg)) {
922+
dev_err(&iface->dev, "Unexpected non-int endpoint\n");
923+
return -ENODEV;
924+
}
925+
906926
/* allocate memory for our device state and initialize it */
907927
dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL);
908928
input_dev = input_allocate_device();

drivers/input/serio/i8042-acpipnpio.h

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -634,6 +634,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
634634
},
635635
.driver_data = (void *)(SERIO_QUIRK_NOAUX)
636636
},
637+
{
638+
/* Fujitsu Lifebook U728 */
639+
.matches = {
640+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
641+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U728"),
642+
},
643+
.driver_data = (void *)(SERIO_QUIRK_NOAUX)
644+
},
637645
{
638646
/* Gigabyte M912 */
639647
.matches = {
@@ -1208,6 +1216,12 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
12081216
SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
12091217
SERIO_QUIRK_NOPNP)
12101218
},
1219+
{
1220+
.matches = {
1221+
DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"),
1222+
},
1223+
.driver_data = (void *)(SERIO_QUIRK_NOAUX)
1224+
},
12111225
{
12121226
.matches = {
12131227
DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),

drivers/input/touchscreen/goodix.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -884,7 +884,8 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
884884
}
885885
}
886886

887-
if (ts->gpio_count == 2 && ts->gpio_int_idx == 0) {
887+
/* Some devices with gpio_int_idx 0 list a third unused GPIO */
888+
if ((ts->gpio_count == 2 || ts->gpio_count == 3) && ts->gpio_int_idx == 0) {
888889
ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO;
889890
gpio_mapping = acpi_goodix_int_first_gpios;
890891
} else if (ts->gpio_count == 2 && ts->gpio_int_idx == 1) {

0 commit comments

Comments
 (0)