Commit eab5c86d authored by Linus Torvalds's avatar Linus Torvalds

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
parents 01370ceb 4255447a
...@@ -294,6 +294,7 @@ static const struct xpad_device { ...@@ -294,6 +294,7 @@ static const struct xpad_device {
{ 0x1689, 0xfd00, "Razer Onza Tournament Edition", 0, XTYPE_XBOX360 }, { 0x1689, 0xfd00, "Razer Onza Tournament Edition", 0, XTYPE_XBOX360 },
{ 0x1689, 0xfd01, "Razer Onza Classic Edition", 0, XTYPE_XBOX360 }, { 0x1689, 0xfd01, "Razer Onza Classic Edition", 0, XTYPE_XBOX360 },
{ 0x1689, 0xfe00, "Razer Sabertooth", 0, XTYPE_XBOX360 }, { 0x1689, 0xfe00, "Razer Sabertooth", 0, XTYPE_XBOX360 },
{ 0x17ef, 0x6182, "Lenovo Legion Controller for Windows", 0, XTYPE_XBOX360 },
{ 0x1949, 0x041a, "Amazon Game Controller", 0, XTYPE_XBOX360 }, { 0x1949, 0x041a, "Amazon Game Controller", 0, XTYPE_XBOX360 },
{ 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 }, { 0x1bad, 0x0002, "Harmonix Rock Band Guitar", 0, XTYPE_XBOX360 },
{ 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 }, { 0x1bad, 0x0003, "Harmonix Rock Band Drumkit", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
...@@ -491,6 +492,7 @@ static const struct usb_device_id xpad_table[] = { ...@@ -491,6 +492,7 @@ static const struct usb_device_id xpad_table[] = {
XPAD_XBOX360_VENDOR(0x15e4), /* Numark Xbox 360 controllers */ XPAD_XBOX360_VENDOR(0x15e4), /* Numark Xbox 360 controllers */
XPAD_XBOX360_VENDOR(0x162e), /* Joytech Xbox 360 controllers */ XPAD_XBOX360_VENDOR(0x162e), /* Joytech Xbox 360 controllers */
XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */ XPAD_XBOX360_VENDOR(0x1689), /* Razer Onza */
XPAD_XBOX360_VENDOR(0x17ef), /* Lenovo */
XPAD_XBOX360_VENDOR(0x1949), /* Amazon controllers */ XPAD_XBOX360_VENDOR(0x1949), /* Amazon controllers */
XPAD_XBOX360_VENDOR(0x1bad), /* Harmonix Rock Band guitar and drums */ XPAD_XBOX360_VENDOR(0x1bad), /* Harmonix Rock Band guitar and drums */
XPAD_XBOX360_VENDOR(0x20d6), /* PowerA controllers */ XPAD_XBOX360_VENDOR(0x20d6), /* PowerA controllers */
......
...@@ -811,7 +811,6 @@ static int atkbd_probe(struct atkbd *atkbd) ...@@ -811,7 +811,6 @@ static int atkbd_probe(struct atkbd *atkbd)
{ {
struct ps2dev *ps2dev = &atkbd->ps2dev; struct ps2dev *ps2dev = &atkbd->ps2dev;
unsigned char param[2]; unsigned char param[2];
bool skip_getid;
/* /*
* Some systems, where the bit-twiddling when testing the io-lines of the * Some systems, where the bit-twiddling when testing the io-lines of the
...@@ -825,6 +824,11 @@ static int atkbd_probe(struct atkbd *atkbd) ...@@ -825,6 +824,11 @@ static int atkbd_probe(struct atkbd *atkbd)
"keyboard reset failed on %s\n", "keyboard reset failed on %s\n",
ps2dev->serio->phys); ps2dev->serio->phys);
if (atkbd_skip_getid(atkbd)) {
atkbd->id = 0xab83;
goto deactivate_kbd;
}
/* /*
* Then we check the keyboard ID. We should get 0xab83 under normal conditions. * Then we check the keyboard ID. We should get 0xab83 under normal conditions.
* Some keyboards report different values, but the first byte is always 0xab or * Some keyboards report different values, but the first byte is always 0xab or
...@@ -833,18 +837,17 @@ static int atkbd_probe(struct atkbd *atkbd) ...@@ -833,18 +837,17 @@ static int atkbd_probe(struct atkbd *atkbd)
*/ */
param[0] = param[1] = 0xa5; /* initialize with invalid values */ param[0] = param[1] = 0xa5; /* initialize with invalid values */
skip_getid = atkbd_skip_getid(atkbd); if (ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
if (skip_getid || ps2_command(ps2dev, param, ATKBD_CMD_GETID)) {
/* /*
* If the get ID command was skipped or failed, we check if we can at least set * If the get ID command failed, we check if we can at least set
* the LEDs on the keyboard. This should work on every keyboard out there. * the LEDs on the keyboard. This should work on every keyboard out there.
* It also turns the LEDs off, which we want anyway. * It also turns the LEDs off, which we want anyway.
*/ */
param[0] = 0; param[0] = 0;
if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS)) if (ps2_command(ps2dev, param, ATKBD_CMD_SETLEDS))
return -1; return -1;
atkbd->id = skip_getid ? 0xab83 : 0xabba; atkbd->id = 0xabba;
return 0; return 0;
} }
...@@ -860,6 +863,7 @@ static int atkbd_probe(struct atkbd *atkbd) ...@@ -860,6 +863,7 @@ static int atkbd_probe(struct atkbd *atkbd)
return -1; return -1;
} }
deactivate_kbd:
/* /*
* Make sure nothing is coming from the keyboard and disturbs our * Make sure nothing is coming from the keyboard and disturbs our
* internal state. * internal state.
......
...@@ -19,6 +19,7 @@ ...@@ -19,6 +19,7 @@
* Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch) * Copyright (C) 2006 Nicolas Boichat (nicolas@boichat.ch)
*/ */
#include "linux/usb.h"
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/errno.h> #include <linux/errno.h>
#include <linux/slab.h> #include <linux/slab.h>
...@@ -193,6 +194,8 @@ enum tp_type { ...@@ -193,6 +194,8 @@ enum tp_type {
/* list of device capability bits */ /* list of device capability bits */
#define HAS_INTEGRATED_BUTTON 1 #define HAS_INTEGRATED_BUTTON 1
/* maximum number of supported endpoints (currently trackpad and button) */
#define MAX_ENDPOINTS 2
/* trackpad finger data block size */ /* trackpad finger data block size */
#define FSIZE_TYPE1 (14 * sizeof(__le16)) #define FSIZE_TYPE1 (14 * sizeof(__le16))
...@@ -891,6 +894,18 @@ static int bcm5974_resume(struct usb_interface *iface) ...@@ -891,6 +894,18 @@ static int bcm5974_resume(struct usb_interface *iface)
return error; return error;
} }
static bool bcm5974_check_endpoints(struct usb_interface *iface,
const struct bcm5974_config *cfg)
{
u8 ep_addr[MAX_ENDPOINTS + 1] = {0};
ep_addr[0] = cfg->tp_ep;
if (cfg->tp_type == TYPE1)
ep_addr[1] = cfg->bt_ep;
return usb_check_int_endpoints(iface, ep_addr);
}
static int bcm5974_probe(struct usb_interface *iface, static int bcm5974_probe(struct usb_interface *iface,
const struct usb_device_id *id) const struct usb_device_id *id)
{ {
...@@ -903,6 +918,11 @@ static int bcm5974_probe(struct usb_interface *iface, ...@@ -903,6 +918,11 @@ static int bcm5974_probe(struct usb_interface *iface,
/* find the product index */ /* find the product index */
cfg = bcm5974_get_config(udev); cfg = bcm5974_get_config(udev);
if (!bcm5974_check_endpoints(iface, cfg)) {
dev_err(&iface->dev, "Unexpected non-int endpoint\n");
return -ENODEV;
}
/* allocate memory for our device state and initialize it */ /* allocate memory for our device state and initialize it */
dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL); dev = kzalloc(sizeof(struct bcm5974), GFP_KERNEL);
input_dev = input_allocate_device(); input_dev = input_allocate_device();
......
...@@ -634,6 +634,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { ...@@ -634,6 +634,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
}, },
.driver_data = (void *)(SERIO_QUIRK_NOAUX) .driver_data = (void *)(SERIO_QUIRK_NOAUX)
}, },
{
/* Fujitsu Lifebook U728 */
.matches = {
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK U728"),
},
.driver_data = (void *)(SERIO_QUIRK_NOAUX)
},
{ {
/* Gigabyte M912 */ /* Gigabyte M912 */
.matches = { .matches = {
...@@ -1208,6 +1216,12 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = { ...@@ -1208,6 +1216,12 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP | SERIO_QUIRK_RESET_ALWAYS | SERIO_QUIRK_NOLOOP |
SERIO_QUIRK_NOPNP) SERIO_QUIRK_NOPNP)
}, },
{
.matches = {
DMI_MATCH(DMI_BOARD_NAME, "NS5x_7xPU"),
},
.driver_data = (void *)(SERIO_QUIRK_NOAUX)
},
{ {
.matches = { .matches = {
DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"), DMI_MATCH(DMI_BOARD_NAME, "NJ50_70CU"),
......
...@@ -884,7 +884,8 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts) ...@@ -884,7 +884,8 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
} }
} }
if (ts->gpio_count == 2 && ts->gpio_int_idx == 0) { /* Some devices with gpio_int_idx 0 list a third unused GPIO */
if ((ts->gpio_count == 2 || ts->gpio_count == 3) && ts->gpio_int_idx == 0) {
ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO; ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO;
gpio_mapping = acpi_goodix_int_first_gpios; gpio_mapping = acpi_goodix_int_first_gpios;
} else if (ts->gpio_count == 2 && ts->gpio_int_idx == 1) { } else if (ts->gpio_count == 2 && ts->gpio_int_idx == 1) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment