Skip to content

Commit 7eb61cc

Browse files
committed
Merge tag 'input-for-v6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov: - a tweak to uinput interface to reject requests with abnormally large number of slots. 100 slots/contacts should be enough for real devices - support for FocalTech FT8201 added to the edt-ft5x06 driver - tweaks to i8042 to handle more devices that have issue with its emulation - Synaptics touchpad switched to native SMbus/RMI mode on HP Elitebook 840 G2 - other minor fixes * tag 'input-for-v6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: himax_hx83112b - fix incorrect size when reading product ID Input: i8042 - use new forcenorestore quirk to replace old buggy quirk combination Input: i8042 - add forcenorestore quirk to leave controller untouched even on s3 Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table Input: uinput - reject requests with unreasonable number of slots Input: edt-ft5x06 - add support for FocalTech FT8201 dt-bindings: input: touchscreen: edt-ft5x06: Document FT8201 support Input: adc-joystick - fix optional value handling Input: synaptics - enable SMBus for HP Elitebook 840 G2 Input: ads7846 - ratelimit the spi_sync error message
2 parents 79a899e + 4e870e6 commit 7eb61cc

File tree

9 files changed

+54
-30
lines changed

9 files changed

+54
-30
lines changed

Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ properties:
4242
- focaltech,ft5426
4343
- focaltech,ft5452
4444
- focaltech,ft6236
45+
- focaltech,ft8201
4546
- focaltech,ft8719
4647

4748
reg:

drivers/input/joystick/adc-joystick.c

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,11 @@ static int adc_joystick_set_axes(struct device *dev, struct adc_joystick *joy)
182182
swap(range[0], range[1]);
183183
}
184184

185-
fwnode_property_read_u32(child, "abs-fuzz", &fuzz);
186-
fwnode_property_read_u32(child, "abs-flat", &flat);
185+
if (fwnode_property_read_u32(child, "abs-fuzz", &fuzz))
186+
fuzz = 0;
187+
188+
if (fwnode_property_read_u32(child, "abs-flat", &flat))
189+
flat = 0;
187190

188191
input_set_abs_params(joy->input, axes[i].code,
189192
range[0], range[1], fuzz, flat);

drivers/input/misc/uinput.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -417,6 +417,20 @@ static int uinput_validate_absinfo(struct input_dev *dev, unsigned int code,
417417
return -EINVAL;
418418
}
419419

420+
/*
421+
* Limit number of contacts to a reasonable value (100). This
422+
* ensures that we need less than 2 pages for struct input_mt
423+
* (we are not using in-kernel slot assignment so not going to
424+
* allocate memory for the "red" table), and we should have no
425+
* trouble getting this much memory.
426+
*/
427+
if (code == ABS_MT_SLOT && max > 99) {
428+
printk(KERN_DEBUG
429+
"%s: unreasonably large number of slots requested: %d\n",
430+
UINPUT_NAME, max);
431+
return -EINVAL;
432+
}
433+
420434
return 0;
421435
}
422436

drivers/input/mouse/synaptics.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ static const char * const smbus_pnp_ids[] = {
189189
"LEN2054", /* E480 */
190190
"LEN2055", /* E580 */
191191
"LEN2068", /* T14 Gen 1 */
192+
"SYN3015", /* HP EliteBook 840 G2 */
192193
"SYN3052", /* HP EliteBook 840 G4 */
193194
"SYN3221", /* HP 15-ay000 */
194195
"SYN323d", /* HP Spectre X360 13-w013dx */

drivers/input/serio/i8042-acpipnpio.h

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,7 @@ static inline void i8042_write_command(int val)
8383
#define SERIO_QUIRK_KBDRESET BIT(12)
8484
#define SERIO_QUIRK_DRITEK BIT(13)
8585
#define SERIO_QUIRK_NOPNP BIT(14)
86+
#define SERIO_QUIRK_FORCENORESTORE BIT(15)
8687

8788
/* Quirk table for different mainboards. Options similar or identical to i8042
8889
* module parameters.
@@ -626,6 +627,15 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
626627
},
627628
.driver_data = (void *)(SERIO_QUIRK_NOMUX)
628629
},
630+
{
631+
/* Fujitsu Lifebook E756 */
632+
/* https://bugzilla.suse.com/show_bug.cgi?id=1229056 */
633+
.matches = {
634+
DMI_MATCH(DMI_SYS_VENDOR, "FUJITSU"),
635+
DMI_MATCH(DMI_PRODUCT_NAME, "LIFEBOOK E756"),
636+
},
637+
.driver_data = (void *)(SERIO_QUIRK_NOMUX)
638+
},
629639
{
630640
/* Fujitsu Lifebook E5411 */
631641
.matches = {
@@ -1149,18 +1159,10 @@ static const struct dmi_system_id i8042_dmi_quirk_table[] __initconst = {
11491159
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
11501160
},
11511161
{
1152-
/*
1153-
* Setting SERIO_QUIRK_NOMUX or SERIO_QUIRK_RESET_ALWAYS makes
1154-
* the keyboard very laggy for ~5 seconds after boot and
1155-
* sometimes also after resume.
1156-
* However both are required for the keyboard to not fail
1157-
* completely sometimes after boot or resume.
1158-
*/
11591162
.matches = {
11601163
DMI_MATCH(DMI_BOARD_NAME, "N150CU"),
11611164
},
1162-
.driver_data = (void *)(SERIO_QUIRK_NOMUX | SERIO_QUIRK_RESET_ALWAYS |
1163-
SERIO_QUIRK_NOLOOP | SERIO_QUIRK_NOPNP)
1165+
.driver_data = (void *)(SERIO_QUIRK_FORCENORESTORE)
11641166
},
11651167
{
11661168
.matches = {
@@ -1685,6 +1687,8 @@ static void __init i8042_check_quirks(void)
16851687
if (quirks & SERIO_QUIRK_NOPNP)
16861688
i8042_nopnp = true;
16871689
#endif
1690+
if (quirks & SERIO_QUIRK_FORCENORESTORE)
1691+
i8042_forcenorestore = true;
16881692
}
16891693
#else
16901694
static inline void i8042_check_quirks(void) {}
@@ -1718,7 +1722,7 @@ static int __init i8042_platform_init(void)
17181722

17191723
i8042_check_quirks();
17201724

1721-
pr_debug("Active quirks (empty means none):%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
1725+
pr_debug("Active quirks (empty means none):%s%s%s%s%s%s%s%s%s%s%s%s%s%s\n",
17221726
i8042_nokbd ? " nokbd" : "",
17231727
i8042_noaux ? " noaux" : "",
17241728
i8042_nomux ? " nomux" : "",
@@ -1738,10 +1742,11 @@ static int __init i8042_platform_init(void)
17381742
"",
17391743
#endif
17401744
#ifdef CONFIG_PNP
1741-
i8042_nopnp ? " nopnp" : "");
1745+
i8042_nopnp ? " nopnp" : "",
17421746
#else
1743-
"");
1747+
"",
17441748
#endif
1749+
i8042_forcenorestore ? " forcenorestore" : "");
17451750

17461751
retval = i8042_pnp_init();
17471752
if (retval)

drivers/input/serio/i8042.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,10 @@ module_param_named(nopnp, i8042_nopnp, bool, 0);
115115
MODULE_PARM_DESC(nopnp, "Do not use PNP to detect controller settings");
116116
#endif
117117

118+
static bool i8042_forcenorestore;
119+
module_param_named(forcenorestore, i8042_forcenorestore, bool, 0);
120+
MODULE_PARM_DESC(forcenorestore, "Force no restore on s3 resume, copying s2idle behaviour");
121+
118122
#define DEBUG
119123
#ifdef DEBUG
120124
static bool i8042_debug;
@@ -1232,7 +1236,7 @@ static int i8042_pm_suspend(struct device *dev)
12321236
{
12331237
int i;
12341238

1235-
if (pm_suspend_via_firmware())
1239+
if (!i8042_forcenorestore && pm_suspend_via_firmware())
12361240
i8042_controller_reset(true);
12371241

12381242
/* Set up serio interrupts for system wakeup. */
@@ -1248,7 +1252,7 @@ static int i8042_pm_suspend(struct device *dev)
12481252

12491253
static int i8042_pm_resume_noirq(struct device *dev)
12501254
{
1251-
if (!pm_resume_via_firmware())
1255+
if (i8042_forcenorestore || !pm_resume_via_firmware())
12521256
i8042_interrupt(0, NULL);
12531257

12541258
return 0;
@@ -1271,7 +1275,7 @@ static int i8042_pm_resume(struct device *dev)
12711275
* not restore the controller state to whatever it had been at boot
12721276
* time, so we do not need to do anything.
12731277
*/
1274-
if (!pm_suspend_via_firmware())
1278+
if (i8042_forcenorestore || !pm_suspend_via_firmware())
12751279
return 0;
12761280

12771281
/*

drivers/input/touchscreen/ads7846.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -824,7 +824,7 @@ static void ads7846_read_state(struct ads7846 *ts)
824824
m = &ts->msg[msg_idx];
825825
error = spi_sync(ts->spi, m);
826826
if (error) {
827-
dev_err(&ts->spi->dev, "spi_sync --> %d\n", error);
827+
dev_err_ratelimited(&ts->spi->dev, "spi_sync --> %d\n", error);
828828
packet->ignore = true;
829829
return;
830830
}

drivers/input/touchscreen/edt-ft5x06.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1474,6 +1474,10 @@ static const struct edt_i2c_chip_data edt_ft6236_data = {
14741474
.max_support_points = 2,
14751475
};
14761476

1477+
static const struct edt_i2c_chip_data edt_ft8201_data = {
1478+
.max_support_points = 10,
1479+
};
1480+
14771481
static const struct edt_i2c_chip_data edt_ft8719_data = {
14781482
.max_support_points = 10,
14791483
};
@@ -1485,6 +1489,7 @@ static const struct i2c_device_id edt_ft5x06_ts_id[] = {
14851489
{ .name = "ft5452", .driver_data = (long)&edt_ft5452_data },
14861490
/* Note no edt- prefix for compatibility with the ft6236.c driver */
14871491
{ .name = "ft6236", .driver_data = (long)&edt_ft6236_data },
1492+
{ .name = "ft8201", .driver_data = (long)&edt_ft8201_data },
14881493
{ .name = "ft8719", .driver_data = (long)&edt_ft8719_data },
14891494
{ /* sentinel */ }
14901495
};
@@ -1500,6 +1505,7 @@ static const struct of_device_id edt_ft5x06_of_match[] = {
15001505
{ .compatible = "focaltech,ft5452", .data = &edt_ft5452_data },
15011506
/* Note focaltech vendor prefix for compatibility with ft6236.c */
15021507
{ .compatible = "focaltech,ft6236", .data = &edt_ft6236_data },
1508+
{ .compatible = "focaltech,ft8201", .data = &edt_ft8201_data },
15031509
{ .compatible = "focaltech,ft8719", .data = &edt_ft8719_data },
15041510
{ /* sentinel */ }
15051511
};

drivers/input/touchscreen/himax_hx83112b.c

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -130,17 +130,6 @@ static int himax_bus_read(struct himax_ts_data *ts, u32 address, void *dst,
130130
return 0;
131131
}
132132

133-
static int himax_read_mcu(struct himax_ts_data *ts, u32 address, u32 *dst)
134-
{
135-
int error;
136-
137-
error = himax_bus_read(ts, address, dst, sizeof(dst));
138-
if (error)
139-
return error;
140-
141-
return 0;
142-
}
143-
144133
static void himax_reset(struct himax_ts_data *ts)
145134
{
146135
gpiod_set_value_cansleep(ts->gpiod_rst, 1);
@@ -160,7 +149,8 @@ static int himax_read_product_id(struct himax_ts_data *ts, u32 *product_id)
160149
{
161150
int error;
162151

163-
error = himax_read_mcu(ts, HIMAX_REG_ADDR_ICID, product_id);
152+
error = himax_bus_read(ts, HIMAX_REG_ADDR_ICID, product_id,
153+
sizeof(*product_id));
164154
if (error)
165155
return error;
166156

0 commit comments

Comments
 (0)