Skip to content

Commit e00811b

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem fixes from Dmitry Torokhov: - a couple of regression fixes in synaptics and axp20x-pek drivers - try to ease transition from PS/2 to RMI for Synaptics touchpad users by ensuring we do not try to activate RMI mode when RMI SMBus support is not enabled, and nag users a bit to enable it - plus a couple of other changes that seemed worthwhile for this release * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: Input: axp20x-pek - switch to acpi_dev_present and check for ACPI0011 too Input: axp20x-pek - only check for "INTCFD9" ACPI device on Cherry Trail Input: tm2-touchkey - use LEN_ON as boolean value instead of LED_FULL Input: synaptics - tell users to report when they should be using rmi-smbus Input: synaptics - warn the users when there is a better mode Input: synaptics - keep PS/2 around when RMI4_SMB is not enabled Input: synaptics - clear device info before filling in Input: silead - disable interrupt during suspend
2 parents 9f03b2c + 0fd5f22 commit e00811b

File tree

4 files changed

+69
-17
lines changed

4 files changed

+69
-17
lines changed

drivers/input/keyboard/tm2-touchkey.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@ static int tm2_touchkey_probe(struct i2c_client *client,
213213
/* led device */
214214
touchkey->led_dev.name = TM2_TOUCHKEY_DEV_NAME;
215215
touchkey->led_dev.brightness = LED_FULL;
216-
touchkey->led_dev.max_brightness = LED_FULL;
216+
touchkey->led_dev.max_brightness = LED_ON;
217217
touchkey->led_dev.brightness_set = tm2_touchkey_led_brightness_set;
218218

219219
error = devm_led_classdev_register(&client->dev, &touchkey->led_dev);

drivers/input/misc/axp20x-pek.c

Lines changed: 37 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,42 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek,
256256
return 0;
257257
}
258258

259+
#ifdef CONFIG_ACPI
260+
static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek,
261+
struct platform_device *pdev)
262+
{
263+
unsigned long long hrv = 0;
264+
acpi_status status;
265+
266+
if (IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY) &&
267+
axp20x_pek->axp20x->variant == AXP288_ID) {
268+
status = acpi_evaluate_integer(ACPI_HANDLE(pdev->dev.parent),
269+
"_HRV", NULL, &hrv);
270+
if (ACPI_FAILURE(status))
271+
dev_err(&pdev->dev, "Failed to get PMIC hardware revision\n");
272+
273+
/*
274+
* On Cherry Trail platforms (hrv == 3), do not register the
275+
* input device if there is an "INTCFD9" or "ACPI0011" gpio
276+
* button ACPI device, as that handles the power button too,
277+
* and otherwise we end up reporting all presses twice.
278+
*/
279+
if (hrv == 3 && (acpi_dev_present("INTCFD9", NULL, -1) ||
280+
acpi_dev_present("ACPI0011", NULL, -1)))
281+
return false;
282+
283+
}
284+
285+
return true;
286+
}
287+
#else
288+
static bool axp20x_pek_should_register_input(struct axp20x_pek *axp20x_pek,
289+
struct platform_device *pdev)
290+
{
291+
return true;
292+
}
293+
#endif
294+
259295
static int axp20x_pek_probe(struct platform_device *pdev)
260296
{
261297
struct axp20x_pek *axp20x_pek;
@@ -268,13 +304,7 @@ static int axp20x_pek_probe(struct platform_device *pdev)
268304

269305
axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent);
270306

271-
/*
272-
* Do not register the input device if there is an "INTCFD9"
273-
* gpio button ACPI device, that handles the power button too,
274-
* and otherwise we end up reporting all presses twice.
275-
*/
276-
if (!acpi_dev_found("INTCFD9") ||
277-
!IS_ENABLED(CONFIG_INPUT_SOC_BUTTON_ARRAY)) {
307+
if (axp20x_pek_should_register_input(axp20x_pek, pdev)) {
278308
error = axp20x_pek_probe_input_device(axp20x_pek, pdev);
279309
if (error)
280310
return error;

drivers/input/mouse/synaptics.c

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,12 @@ static const char * const smbus_pnp_ids[] = {
176176
NULL
177177
};
178178

179+
static const char * const forcepad_pnp_ids[] = {
180+
"SYN300D",
181+
"SYN3014",
182+
NULL
183+
};
184+
179185
/*
180186
* Send a command to the synpatics touchpad by special commands
181187
*/
@@ -397,6 +403,8 @@ static int synaptics_query_hardware(struct psmouse *psmouse,
397403
{
398404
int error;
399405

406+
memset(info, 0, sizeof(*info));
407+
400408
error = synaptics_identify(psmouse, info);
401409
if (error)
402410
return error;
@@ -480,13 +488,6 @@ static const struct min_max_quirk min_max_pnpid_table[] = {
480488
{ }
481489
};
482490

483-
/* This list has been kindly provided by Synaptics. */
484-
static const char * const forcepad_pnp_ids[] = {
485-
"SYN300D",
486-
"SYN3014",
487-
NULL
488-
};
489-
490491
/*****************************************************************************
491492
* Synaptics communications functions
492493
****************************************************************************/
@@ -1687,7 +1688,8 @@ enum {
16871688
SYNAPTICS_INTERTOUCH_ON,
16881689
};
16891690

1690-
static int synaptics_intertouch = SYNAPTICS_INTERTOUCH_NOT_SET;
1691+
static int synaptics_intertouch = IS_ENABLED(CONFIG_RMI4_SMB) ?
1692+
SYNAPTICS_INTERTOUCH_NOT_SET : SYNAPTICS_INTERTOUCH_OFF;
16911693
module_param_named(synaptics_intertouch, synaptics_intertouch, int, 0644);
16921694
MODULE_PARM_DESC(synaptics_intertouch, "Use a secondary bus for the Synaptics device.");
16931695

@@ -1737,8 +1739,16 @@ static int synaptics_setup_intertouch(struct psmouse *psmouse,
17371739

17381740
if (synaptics_intertouch == SYNAPTICS_INTERTOUCH_NOT_SET) {
17391741
if (!psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) &&
1740-
!psmouse_matches_pnp_id(psmouse, smbus_pnp_ids))
1742+
!psmouse_matches_pnp_id(psmouse, smbus_pnp_ids)) {
1743+
1744+
if (!psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids))
1745+
psmouse_info(psmouse,
1746+
"Your touchpad (%s) says it can support a different bus. "
1747+
"If i2c-hid and hid-rmi are not used, you might want to try setting psmouse.synaptics_intertouch to 1 and report this to linux-input@vger.kernel.org.\n",
1748+
psmouse->ps2dev.serio->firmware_id);
1749+
17411750
return -ENXIO;
1751+
}
17421752
}
17431753

17441754
psmouse_info(psmouse, "Trying to set up SMBus access\n");
@@ -1810,6 +1820,15 @@ int synaptics_init(struct psmouse *psmouse)
18101820
}
18111821

18121822
if (SYN_CAP_INTERTOUCH(info.ext_cap_0c)) {
1823+
if ((!IS_ENABLED(CONFIG_RMI4_SMB) ||
1824+
!IS_ENABLED(CONFIG_MOUSE_PS2_SYNAPTICS_SMBUS)) &&
1825+
/* Forcepads need F21, which is not ready */
1826+
!psmouse_matches_pnp_id(psmouse, forcepad_pnp_ids)) {
1827+
psmouse_warn(psmouse,
1828+
"The touchpad can support a better bus than the too old PS/2 protocol. "
1829+
"Make sure MOUSE_PS2_SYNAPTICS_SMBUS and RMI4_SMB are enabled to get a better touchpad experience.\n");
1830+
}
1831+
18131832
error = synaptics_setup_intertouch(psmouse, &info, true);
18141833
if (!error)
18151834
return PSMOUSE_SYNAPTICS_SMBUS;

drivers/input/touchscreen/silead.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -526,6 +526,7 @@ static int __maybe_unused silead_ts_suspend(struct device *dev)
526526
{
527527
struct i2c_client *client = to_i2c_client(dev);
528528

529+
disable_irq(client->irq);
529530
silead_ts_set_power(client, SILEAD_POWER_OFF);
530531
return 0;
531532
}
@@ -551,6 +552,8 @@ static int __maybe_unused silead_ts_resume(struct device *dev)
551552
return -ENODEV;
552553
}
553554

555+
enable_irq(client->irq);
556+
554557
return 0;
555558
}
556559

0 commit comments

Comments
 (0)