Skip to content

Commit 727fb83

Browse files
committed
Merge tag 'input-for-v6.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: - a reworked way for handling reset delay on SMBus-connected Synaptics touchpads (the original one, while being correct, uncovered an old bug in fallback to PS/2 code that was fixed separately; the new one however avoids having delay in serio port "fast" resume, and instead has the wait in the RMI4 code) - a fix for potential crashes when devices with Elan controllers (and Synaptics) fall back to PS/2 code. Can't be hit without the original patch above, but still good to have it fixed - a couple new device IDs in xpad Xbox driver - another quirk for Goodix driver to deal with stuff vendors put in ACPI tables - a fix for use-after-free on disconnect for powermate driver - a quirk to not initialize PS/2 mouse port on Fujitsu Lifebook E5411 laptop as it makes keyboard not usable and the device uses hid-over-i2c touchpad anyways * tag 'input-for-v6.6-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: powermate - fix use-after-free in powermate_config_complete Input: xpad - add PXN V900 support Input: synaptics-rmi4 - handle reset delay when using SMBus trsnsport Input: psmouse - fix fast_reconnect function for PS/2 mode Revert "Input: psmouse - add delay when deactivating for SMBus mode" Input: goodix - ensure int GPIO is in input for gpio_count == 1 && gpio_int_idx == 0 case Input: i8042 - add Fujitsu Lifebook E5411 to i8042 quirk table Input: xpad - add HyperX Clutch Gladiate Support
2 parents 8cb1f10 + 5c15c60 commit 727fb83

File tree

8 files changed

+70
-34
lines changed

8 files changed

+70
-34
lines changed

drivers/input/joystick/xpad.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ static const struct xpad_device {
130130
{ 0x0079, 0x18d4, "GPD Win 2 X-Box Controller", 0, XTYPE_XBOX360 },
131131
{ 0x03eb, 0xff01, "Wooting One (Legacy)", 0, XTYPE_XBOX360 },
132132
{ 0x03eb, 0xff02, "Wooting Two (Legacy)", 0, XTYPE_XBOX360 },
133+
{ 0x03f0, 0x0495, "HyperX Clutch Gladiate", 0, XTYPE_XBOXONE },
133134
{ 0x044f, 0x0f00, "Thrustmaster Wheel", 0, XTYPE_XBOX },
134135
{ 0x044f, 0x0f03, "Thrustmaster Wheel", 0, XTYPE_XBOX },
135136
{ 0x044f, 0x0f07, "Thrustmaster, Inc. Controller", 0, XTYPE_XBOX },
@@ -272,6 +273,7 @@ static const struct xpad_device {
272273
{ 0x1038, 0x1430, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
273274
{ 0x1038, 0x1431, "SteelSeries Stratus Duo", 0, XTYPE_XBOX360 },
274275
{ 0x11c9, 0x55f0, "Nacon GC-100XF", 0, XTYPE_XBOX360 },
276+
{ 0x11ff, 0x0511, "PXN V900", 0, XTYPE_XBOX360 },
275277
{ 0x1209, 0x2882, "Ardwiino Controller", 0, XTYPE_XBOX360 },
276278
{ 0x12ab, 0x0004, "Honey Bee Xbox360 dancepad", MAP_DPAD_TO_BUTTONS, XTYPE_XBOX360 },
277279
{ 0x12ab, 0x0301, "PDP AFTERGLOW AX.1", 0, XTYPE_XBOX360 },
@@ -459,6 +461,7 @@ static const struct usb_device_id xpad_table[] = {
459461
{ USB_INTERFACE_INFO('X', 'B', 0) }, /* Xbox USB-IF not-approved class */
460462
XPAD_XBOX360_VENDOR(0x0079), /* GPD Win 2 controller */
461463
XPAD_XBOX360_VENDOR(0x03eb), /* Wooting Keyboards (Legacy) */
464+
XPAD_XBOXONE_VENDOR(0x03f0), /* HP HyperX Xbox One controllers */
462465
XPAD_XBOX360_VENDOR(0x044f), /* Thrustmaster Xbox 360 controllers */
463466
XPAD_XBOX360_VENDOR(0x045e), /* Microsoft Xbox 360 controllers */
464467
XPAD_XBOXONE_VENDOR(0x045e), /* Microsoft Xbox One controllers */
@@ -477,6 +480,7 @@ static const struct usb_device_id xpad_table[] = {
477480
XPAD_XBOX360_VENDOR(0x1038), /* SteelSeries controllers */
478481
XPAD_XBOXONE_VENDOR(0x10f5), /* Turtle Beach Controllers */
479482
XPAD_XBOX360_VENDOR(0x11c9), /* Nacon GC100XF */
483+
XPAD_XBOX360_VENDOR(0x11ff), /* PXN V900 */
480484
XPAD_XBOX360_VENDOR(0x1209), /* Ardwiino Controllers */
481485
XPAD_XBOX360_VENDOR(0x12ab), /* Xbox 360 dance pads */
482486
XPAD_XBOX360_VENDOR(0x1430), /* RedOctane Xbox 360 controllers */

drivers/input/misc/powermate.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -425,6 +425,7 @@ static void powermate_disconnect(struct usb_interface *intf)
425425
pm->requires_update = 0;
426426
usb_kill_urb(pm->irq);
427427
input_unregister_device(pm->input);
428+
usb_kill_urb(pm->config);
428429
usb_free_urb(pm->irq);
429430
usb_free_urb(pm->config);
430431
powermate_free_buffers(interface_to_usbdev(intf), pm);

drivers/input/mouse/elantech.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2114,6 +2114,7 @@ static int elantech_setup_ps2(struct psmouse *psmouse,
21142114
psmouse->protocol_handler = elantech_process_byte;
21152115
psmouse->disconnect = elantech_disconnect;
21162116
psmouse->reconnect = elantech_reconnect;
2117+
psmouse->fast_reconnect = NULL;
21172118
psmouse->pktsize = info->hw_version > 1 ? 6 : 4;
21182119

21192120
return 0;

drivers/input/mouse/psmouse-smbus.c

Lines changed: 7 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55

66
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
77

8-
#include <linux/delay.h>
98
#include <linux/kernel.h>
109
#include <linux/module.h>
1110
#include <linux/libps2.h>
@@ -119,18 +118,13 @@ static psmouse_ret_t psmouse_smbus_process_byte(struct psmouse *psmouse)
119118
return PSMOUSE_FULL_PACKET;
120119
}
121120

122-
static void psmouse_activate_smbus_mode(struct psmouse_smbus_dev *smbdev)
123-
{
124-
if (smbdev->need_deactivate) {
125-
psmouse_deactivate(smbdev->psmouse);
126-
/* Give the device time to switch into SMBus mode */
127-
msleep(30);
128-
}
129-
}
130-
131121
static int psmouse_smbus_reconnect(struct psmouse *psmouse)
132122
{
133-
psmouse_activate_smbus_mode(psmouse->private);
123+
struct psmouse_smbus_dev *smbdev = psmouse->private;
124+
125+
if (smbdev->need_deactivate)
126+
psmouse_deactivate(psmouse);
127+
134128
return 0;
135129
}
136130

@@ -263,7 +257,8 @@ int psmouse_smbus_init(struct psmouse *psmouse,
263257
}
264258
}
265259

266-
psmouse_activate_smbus_mode(smbdev);
260+
if (need_deactivate)
261+
psmouse_deactivate(psmouse);
267262

268263
psmouse->private = smbdev;
269264
psmouse->protocol_handler = psmouse_smbus_process_byte;

drivers/input/mouse/synaptics.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1623,6 +1623,7 @@ static int synaptics_init_ps2(struct psmouse *psmouse,
16231623
psmouse->set_rate = synaptics_set_rate;
16241624
psmouse->disconnect = synaptics_disconnect;
16251625
psmouse->reconnect = synaptics_reconnect;
1626+
psmouse->fast_reconnect = NULL;
16261627
psmouse->cleanup = synaptics_reset;
16271628
/* Synaptics can usually stay in sync without extra help */
16281629
psmouse->resync_time = 0;
@@ -1752,6 +1753,7 @@ static int synaptics_create_intertouch(struct psmouse *psmouse,
17521753
psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) &&
17531754
!SYN_CAP_EXT_BUTTONS_STICK(info->ext_cap_10);
17541755
const struct rmi_device_platform_data pdata = {
1756+
.reset_delay_ms = 30,
17551757
.sensor_pdata = {
17561758
.sensor_type = rmi_sensor_touchpad,
17571759
.axis_align.flip_y = true,

drivers/input/rmi4/rmi_smbus.c

Lines changed: 28 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -235,12 +235,29 @@ static void rmi_smb_clear_state(struct rmi_smb_xport *rmi_smb)
235235

236236
static int rmi_smb_enable_smbus_mode(struct rmi_smb_xport *rmi_smb)
237237
{
238-
int retval;
238+
struct i2c_client *client = rmi_smb->client;
239+
int smbus_version;
240+
241+
/*
242+
* psmouse driver resets the controller, we only need to wait
243+
* to give the firmware chance to fully reinitialize.
244+
*/
245+
if (rmi_smb->xport.pdata.reset_delay_ms)
246+
msleep(rmi_smb->xport.pdata.reset_delay_ms);
239247

240248
/* we need to get the smbus version to activate the touchpad */
241-
retval = rmi_smb_get_version(rmi_smb);
242-
if (retval < 0)
243-
return retval;
249+
smbus_version = rmi_smb_get_version(rmi_smb);
250+
if (smbus_version < 0)
251+
return smbus_version;
252+
253+
rmi_dbg(RMI_DEBUG_XPORT, &client->dev, "Smbus version is %d",
254+
smbus_version);
255+
256+
if (smbus_version != 2 && smbus_version != 3) {
257+
dev_err(&client->dev, "Unrecognized SMB version %d\n",
258+
smbus_version);
259+
return -ENODEV;
260+
}
244261

245262
return 0;
246263
}
@@ -253,11 +270,10 @@ static int rmi_smb_reset(struct rmi_transport_dev *xport, u16 reset_addr)
253270
rmi_smb_clear_state(rmi_smb);
254271

255272
/*
256-
* we do not call the actual reset command, it has to be handled in
257-
* PS/2 or there will be races between PS/2 and SMBus.
258-
* PS/2 should ensure that a psmouse_reset is called before
259-
* intializing the device and after it has been removed to be in a known
260-
* state.
273+
* We do not call the actual reset command, it has to be handled in
274+
* PS/2 or there will be races between PS/2 and SMBus. PS/2 should
275+
* ensure that a psmouse_reset is called before initializing the
276+
* device and after it has been removed to be in a known state.
261277
*/
262278
return rmi_smb_enable_smbus_mode(rmi_smb);
263279
}
@@ -272,7 +288,6 @@ static int rmi_smb_probe(struct i2c_client *client)
272288
{
273289
struct rmi_device_platform_data *pdata = dev_get_platdata(&client->dev);
274290
struct rmi_smb_xport *rmi_smb;
275-
int smbus_version;
276291
int error;
277292

278293
if (!pdata) {
@@ -311,18 +326,9 @@ static int rmi_smb_probe(struct i2c_client *client)
311326
rmi_smb->xport.proto_name = "smb";
312327
rmi_smb->xport.ops = &rmi_smb_ops;
313328

314-
smbus_version = rmi_smb_get_version(rmi_smb);
315-
if (smbus_version < 0)
316-
return smbus_version;
317-
318-
rmi_dbg(RMI_DEBUG_XPORT, &client->dev, "Smbus version is %d",
319-
smbus_version);
320-
321-
if (smbus_version != 2 && smbus_version != 3) {
322-
dev_err(&client->dev, "Unrecognized SMB version %d\n",
323-
smbus_version);
324-
return -ENODEV;
325-
}
329+
error = rmi_smb_enable_smbus_mode(rmi_smb);
330+
if (error)
331+
return error;
326332

327333
i2c_set_clientdata(client, rmi_smb);
328334

drivers/input/serio/i8042-acpipnpio.h

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -618,6 +618,14 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
618618
},
619619
.driver_data = (void *)(SERIO_QUIRK_NOMUX)
620620
},
621+
{
622+
/* Fujitsu Lifebook E5411 */
623+
.matches = {
624+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU CLIENT COMPUTING LIMITED"),
625+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E5411"),
626+
},
627+
.driver_data = (void *)(SERIO_QUIRK_NOAUX)
628+
},
621629
{
622630
/* Gigabyte M912 */
623631
.matches = {

drivers/input/touchscreen/goodix.c

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -900,6 +900,25 @@ static int goodix_add_acpi_gpio_mappings(struct goodix_ts_data *ts)
900900
dev_info(dev, "No ACPI GpioInt resource, assuming that the GPIO order is reset, int\n");
901901
ts->irq_pin_access_method = IRQ_PIN_ACCESS_ACPI_GPIO;
902902
gpio_mapping = acpi_goodix_int_last_gpios;
903+
} else if (ts->gpio_count == 1 && ts->gpio_int_idx == 0) {
904+
/*
905+
* On newer devices there is only 1 GpioInt resource and _PS0
906+
* does the whole reset sequence for us.
907+
*/
908+
acpi_device_fix_up_power(ACPI_COMPANION(dev));
909+
910+
/*
911+
* Before the _PS0 call the int GPIO may have been in output
912+
* mode and the call should have put the int GPIO in input mode,
913+
* but the GPIO subsys cached state may still think it is
914+
* in output mode, causing gpiochip_lock_as_irq() failure.
915+
*
916+
* Add a mapping for the int GPIO to make the
917+
* gpiod_int = gpiod_get(..., GPIOD_IN) call succeed,
918+
* which will explicitly set the direction to input.
919+
*/
920+
ts->irq_pin_access_method = IRQ_PIN_ACCESS_NONE;
921+
gpio_mapping = acpi_goodix_int_first_gpios;
903922
} else {
904923
dev_warn(dev, "Unexpected ACPI resources: gpio_count %d, gpio_int_idx %d\n",
905924
ts->gpio_count, ts->gpio_int_idx);

0 commit comments

Comments
 (0)