diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-04 14:37:42 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2017-06-04 14:37:42 -0400 |
commit | e00811b4ca520e5a876baf41c6831de4bc276d3e (patch) | |
tree | 94318a04adb05210f0bb076f765611db8c17a512 | |
parent | 9f03b2c7c576bbc427b4c214b2c548f3539b17a2 (diff) | |
parent | 0fd5f221093870d93edb696f6903b058c4d75411 (diff) |
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
-rw-r--r-- | drivers/input/keyboard/tm2-touchkey.c | 2 | ||||
-rw-r--r-- | drivers/input/misc/axp20x-pek.c | 44 | ||||
-rw-r--r-- | drivers/input/mouse/synaptics.c | 37 | ||||
-rw-r--r-- | drivers/input/touchscreen/silead.c | 3 |
4 files changed, 69 insertions, 17 deletions
diff --git a/drivers/input/keyboard/tm2-touchkey.c b/drivers/input/keyboard/tm2-touchkey.c index 485900f953e0..abc266e40e17 100644 --- a/drivers/input/keyboard/tm2-touchkey.c +++ b/drivers/input/keyboard/tm2-touchkey.c | |||
@@ -213,7 +213,7 @@ static int tm2_touchkey_probe(struct i2c_client *client, | |||
213 | /* led device */ | 213 | /* led device */ |
214 | touchkey->led_dev.name = TM2_TOUCHKEY_DEV_NAME; | 214 | touchkey->led_dev.name = TM2_TOUCHKEY_DEV_NAME; |
215 | touchkey->led_dev.brightness = LED_FULL; | 215 | touchkey->led_dev.brightness = LED_FULL; |
216 | touchkey->led_dev.max_brightness = LED_FULL; | 216 | touchkey->led_dev.max_brightness = LED_ON; |
217 | touchkey->led_dev.brightness_set = tm2_touchkey_led_brightness_set; | 217 | touchkey->led_dev.brightness_set = tm2_touchkey_led_brightness_set; |
218 | 218 | ||
219 | error = devm_led_classdev_register(&client->dev, &touchkey->led_dev); | 219 | error = devm_led_classdev_register(&client->dev, &touchkey->led_dev); |
diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c index f11807db6979..400869e61a06 100644 --- a/drivers/input/misc/axp20x-pek.c +++ b/drivers/input/misc/axp20x-pek.c | |||
@@ -256,6 +256,42 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek, | |||
256 | return 0; | 256 | return 0; |
257 | } | 257 | } |
258 | 258 | ||
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 | |||
259 | static int axp20x_pek_probe(struct platform_device *pdev) | 295 | static int axp20x_pek_probe(struct platform_device *pdev) |
260 | { | 296 | { |
261 | struct axp20x_pek *axp20x_pek; | 297 | struct axp20x_pek *axp20x_pek; |
@@ -268,13 +304,7 @@ static int axp20x_pek_probe(struct platform_device *pdev) | |||
268 | 304 | ||
269 | axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent); | 305 | axp20x_pek->axp20x = dev_get_drvdata(pdev->dev.parent); |
270 | 306 | ||
271 | /* | 307 | if (axp20x_pek_should_register_input(axp20x_pek, pdev)) { |
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)) { | ||
278 | error = axp20x_pek_probe_input_device(axp20x_pek, pdev); | 308 | error = axp20x_pek_probe_input_device(axp20x_pek, pdev); |
279 | if (error) | 309 | if (error) |
280 | return error; | 310 | return error; |
diff --git a/drivers/input/mouse/synaptics.c b/drivers/input/mouse/synaptics.c index 131df9d3660f..16c30460ef04 100644 --- a/drivers/input/mouse/synaptics.c +++ b/drivers/input/mouse/synaptics.c | |||
@@ -176,6 +176,12 @@ static const char * const smbus_pnp_ids[] = { | |||
176 | NULL | 176 | NULL |
177 | }; | 177 | }; |
178 | 178 | ||
179 | static const char * const forcepad_pnp_ids[] = { | ||
180 | "SYN300D", | ||
181 | "SYN3014", | ||
182 | NULL | ||
183 | }; | ||
184 | |||
179 | /* | 185 | /* |
180 | * Send a command to the synpatics touchpad by special commands | 186 | * Send a command to the synpatics touchpad by special commands |
181 | */ | 187 | */ |
@@ -397,6 +403,8 @@ static int synaptics_query_hardware(struct psmouse *psmouse, | |||
397 | { | 403 | { |
398 | int error; | 404 | int error; |
399 | 405 | ||
406 | memset(info, 0, sizeof(*info)); | ||
407 | |||
400 | error = synaptics_identify(psmouse, info); | 408 | error = synaptics_identify(psmouse, info); |
401 | if (error) | 409 | if (error) |
402 | return error; | 410 | return error; |
@@ -480,13 +488,6 @@ static const struct min_max_quirk min_max_pnpid_table[] = { | |||
480 | { } | 488 | { } |
481 | }; | 489 | }; |
482 | 490 | ||
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 | |||
490 | /***************************************************************************** | 491 | /***************************************************************************** |
491 | * Synaptics communications functions | 492 | * Synaptics communications functions |
492 | ****************************************************************************/ | 493 | ****************************************************************************/ |
@@ -1687,7 +1688,8 @@ enum { | |||
1687 | SYNAPTICS_INTERTOUCH_ON, | 1688 | SYNAPTICS_INTERTOUCH_ON, |
1688 | }; | 1689 | }; |
1689 | 1690 | ||
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; | ||
1691 | module_param_named(synaptics_intertouch, synaptics_intertouch, int, 0644); | 1693 | module_param_named(synaptics_intertouch, synaptics_intertouch, int, 0644); |
1692 | MODULE_PARM_DESC(synaptics_intertouch, "Use a secondary bus for the Synaptics device."); | 1694 | MODULE_PARM_DESC(synaptics_intertouch, "Use a secondary bus for the Synaptics device."); |
1693 | 1695 | ||
@@ -1737,8 +1739,16 @@ static int synaptics_setup_intertouch(struct psmouse *psmouse, | |||
1737 | 1739 | ||
1738 | if (synaptics_intertouch == SYNAPTICS_INTERTOUCH_NOT_SET) { | 1740 | if (synaptics_intertouch == SYNAPTICS_INTERTOUCH_NOT_SET) { |
1739 | if (!psmouse_matches_pnp_id(psmouse, topbuttonpad_pnp_ids) && | 1741 | 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 | |||
1741 | return -ENXIO; | 1750 | return -ENXIO; |
1751 | } | ||
1742 | } | 1752 | } |
1743 | 1753 | ||
1744 | psmouse_info(psmouse, "Trying to set up SMBus access\n"); | 1754 | psmouse_info(psmouse, "Trying to set up SMBus access\n"); |
@@ -1810,6 +1820,15 @@ int synaptics_init(struct psmouse *psmouse) | |||
1810 | } | 1820 | } |
1811 | 1821 | ||
1812 | if (SYN_CAP_INTERTOUCH(info.ext_cap_0c)) { | 1822 | 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 | |||
1813 | error = synaptics_setup_intertouch(psmouse, &info, true); | 1832 | error = synaptics_setup_intertouch(psmouse, &info, true); |
1814 | if (!error) | 1833 | if (!error) |
1815 | return PSMOUSE_SYNAPTICS_SMBUS; | 1834 | return PSMOUSE_SYNAPTICS_SMBUS; |
diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c index 813dd68a5c82..0dbcf105f7db 100644 --- a/drivers/input/touchscreen/silead.c +++ b/drivers/input/touchscreen/silead.c | |||
@@ -526,6 +526,7 @@ static int __maybe_unused silead_ts_suspend(struct device *dev) | |||
526 | { | 526 | { |
527 | struct i2c_client *client = to_i2c_client(dev); | 527 | struct i2c_client *client = to_i2c_client(dev); |
528 | 528 | ||
529 | disable_irq(client->irq); | ||
529 | silead_ts_set_power(client, SILEAD_POWER_OFF); | 530 | silead_ts_set_power(client, SILEAD_POWER_OFF); |
530 | return 0; | 531 | return 0; |
531 | } | 532 | } |
@@ -551,6 +552,8 @@ static int __maybe_unused silead_ts_resume(struct device *dev) | |||
551 | return -ENODEV; | 552 | return -ENODEV; |
552 | } | 553 | } |
553 | 554 | ||
555 | enable_irq(client->irq); | ||
556 | |||
554 | return 0; | 557 | return 0; |
555 | } | 558 | } |
556 | 559 | ||