Commit graph

158 commits

Author SHA1 Message Date
Edvard Holst 15e2cffec3 Input: synaptics - Lenovo Thinkpad X1 Carbon G5 (2017) with Elantech trackpoints should use RMI
Lenovo use two different trackpoints in the fifth generation Thinkpad X1
Carbon. Both are accessible over SMBUS/RMI but the pnpIDs are missing.
This patch is for the Elantech trackpoint specifically which also
reports SMB version 3 so rmi_smbus needs to be updated in order to
handle it.

For the record, I was not the first one to come up with this patch as it
has been floating around the internet for a while now. However, I have
spent significant time with testing and my efforts to find the original
author of the patch have been unsuccessful.

Signed-off-by: Edvard Holst <edvard.holst@gmail.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-05-23 11:45:50 -07:00
Dmitry Torokhov 9b2071028f Input: synaptics - Lenovo Carbon X1 Gen5 (2017) devices should use RMI
The touchpad on Lenovo Carbon X1 Gen 5 (2017 - Kabylake) is accessible over
SMBUS/RMI, so let's activate it by default.

Cc: stable@vger.kernel.org
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-05-23 11:44:35 -07:00
Dmitry Torokhov 664b0bae0b Merge branch 'next' into for-linus
Prepare input updates for 4.17 merge window.
2018-04-04 16:11:49 -07:00
Dmitry Torokhov ba521f1bd2 Merge branch 'psmouse' into next
Merge various PS/2 handling improvements.
2018-03-17 10:58:05 -07:00
Arkadiusz Hiler 5444a992b4 Revert "Input: synaptics - Lenovo Thinkpad T460p devices should use RMI"
This reverts commit 4828296982 which
caused the following issues:

1. On T460p with BIOS version 2.22 touchpad and trackpoint stop working
after suspend-resume cycle. Due to strange state of the device another
suspend is impossible.

The following dmesg errors can be observed:
thinkpad_acpi: EC reports that Thermal Table has changed
rmi4_smbus 7-002c: failed to get SMBus version number!
rmi4_physical rmi4-00: rmi_driver_reset_handler: Failed to read current IRQ mask.
rmi4_f01 rmi4-00.fn01: Failed to restore normal operation: -16.
rmi4_f01 rmi4-00.fn01: Resume failed with code -16.
rmi4_physical rmi4-00: Failed to suspend functions: -16
rmi4_smbus 7-002c: Failed to resume device: -16
PM: resume devices took 0.640 seconds
rmi4_f03 rmi4-00.fn03: rmi_f03_pt_write: Failed to write to F03 TX register (-16).
rmi4_physical rmi4-00: rmi_driver_clear_irq_bits: Failed to change enabled interrupts!
rmi4_physical rmi4-00: rmi_driver_set_irq_bits: Failed to change enabled interrupts!
psmouse: probe of serio3 failed with error -1

2. On another T460p with BIOS version 2.15 two finger scrolling gesture
on the touchpad stops working after suspend-resume cycle (about 75%
reproducibility, when it still works, the scrolling gesture becomes
laggy). Nothing suspicious appears in the dmesg.

Analysis form Richard Schütz:

"RMI is unreliable on the ThinkPad T460p because the device is affected
by the firmware behavior addressed in a7ae81952c ("i2c: i801: Allow
ACPI SystemIO OpRegion to conflict with PCI BAR")."

The affected devices often show:

i801_smbus 0000:00:1f.4: BIOS is accessing SMBus registers
i801_smbus 0000:00:1f.4: Driver SMBus register access inhibited

Reported-by: Richard Schütz <rschuetz@uni-koblenz.de>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Tested-by: Martin Peres <martin.peres@linux.intel.com>
Tested-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-03-07 15:50:29 -08:00
Dmitry Torokhov cdc2466df4 Input: synaptics - handle errors from input_mt_init_slots()
input_mt_init_slots() may fail, we need to handle this condition.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-02-02 17:04:08 -08:00
Dmitry Torokhov 29aa619408 Input: synaptics - switch to using input_set_capability
Instead of manipulating capability bits directly, use
input_set_capability().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-02-02 17:04:08 -08:00
Dmitry Torokhov 08be954b7a Input: psmouse - move sliced command implementation to libps2
In preparation to adding some debugging statements to PS/2 control
sequences let's move psmouse_sliced_command() into libps2 and rename it
to ps2_sliced_command().

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-02-02 16:50:24 -08:00
Dmitry Torokhov 10a558374f Linux 4.15
-----BEGIN PGP SIGNATURE-----
 
 iQEcBAABAgAGBQJabj6pAAoJEHm+PkMAQRiGs8cIAJQFkCWnbz86e3vG4DuWhyA8
 CMGHCQdUOxxFGa/ixhIiuetbC0x+JVHAjV2FwVYbAQfaZB3pfw2iR1ncQxpAP1AI
 oLU9vBEqTmwKMPc9CM5rRfnLFWpGcGwUNzgPdxD5yYqGDtcM8K840mF6NdkYe5AN
 xU8rv1wlcFPF4A5pvHCH0pvVmK4VxlVFk/2H67TFdxBs4PyJOnSBnf+bcGWgsKO6
 hC8XIVtcKCH2GfFxt5d0Vgc5QXJEpX1zn2mtCa1MwYRjN2plgYfD84ha0xE7J0B0
 oqV/wnjKXDsmrgVpncr3txd4+zKJFNkdNRE4eLAIupHo2XHTG4HvDJ5dBY2NhGU=
 =sOml
 -----END PGP SIGNATURE-----

Merge tag 'v4.15' into next

Sync with mainline to get in trackpoint updates and other changes.
2018-02-01 00:41:33 -08:00
Dmitry Torokhov d67ad78e09 Merge branch 'next' into for-linus
Prepare input updates for 4.16 merge window.
2018-02-01 00:37:30 -08:00
Peter Hutterer 19eb4ed114 Input: synaptics - reset the ABS_X/Y fuzz after initializing MT axes
input_mt_init_slots() resets the ABS_X/Y fuzz to 0 and expects the driver
to call input_mt_report_pointer_emulation(). That is based on the MT
position bits which are already defuzzed - hence a fuzz of 0.

In the case of synaptics semi-mt devices, we report the ABS_X/Y axes
manually.  This results in the MT position being defuzzed but the
single-touch emulation missing that defuzzing.

Work around this by re-initializing the ABS_X/Y axes after the MT axis to
get the same fuzz value back.

https://bugs.freedesktop.org/show_bug.cgi?id=104533

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-01-16 16:26:25 -08:00
王振杰 4828296982 Input: synaptics - Lenovo Thinkpad T460p devices should use RMI
The tpouchpad/trackpoint on Lenovo Thinkpad T460p work with smbus/RMI.

Signed-off-by: Zhenjie Wang <zhenjie.wang@sjtu.edu.cn>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2018-01-10 16:38:41 -08:00
Andrew Duggan 2b30297d48 Input: synaptics - disable kernel tracking on SMBus devices
In certain situations kernel tracking seems to be getting confused
and incorrectly reporting the slot of a contact. On example is when
the user does a three finger click or tap and then places two fingers
on the touchpad in the same area. The kernel tracking code seems to
continue to think that there are three contacts on the touchpad and
incorrectly alternates the slot of one of the contacts. The result that
is the input subsystem reports a stream of button press and release
events as the reported slot changes.

Kernel tracking was originally enabled to prevent cursor jumps, but it
is unclear how much of an issue kernel jumps actually are. This patch
simply disabled kernel tracking for now.

Fixes: https://bugzilla.redhat.com/show_bug.cgi?id=1482640

Signed-off-by: Andrew Duggan <aduggan@synaptics.com>
Tested-by: Kamil Páral <kparal@redhat.com>
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-10-09 20:52:39 -07:00
Anthony Martin 3f9db52dc8 Input: synaptics - fix device info appearing different on reconnect
User-modified input settings no longer survive a suspend/resume cycle.
Starting with 4.12, the touchpad is reinitialized on every reconnect
because the hardware appears to be different. This can be reproduced
by running the following as root:

    echo -n reconnect >/sys/devices/platform/i8042/serio1/drvctl

A line like the following will show up in dmesg:

    [30378.295794] psmouse serio1: synaptics: hardware appears to be
                   different: id(149271-149271), model(114865-114865),
                   caps(d047b3-d047b1), ext(b40000-b40000).

Note the single bit difference in caps: bit 1 (SYN_CAP_MULTIFINGER).

This happens because we modify our stored copy of the device info
capabilities when we enable advanced gesture mode but this change is
not reflected in the actual hardware capabilities.

It worked in the past because synaptics_query_hardware used to modify
the stored synaptics_device_info struct instead of filling in a new
one, as it does now.

Fix it by no longer faking the SYN_CAP_MULTIFINGER bit when setting
advanced gesture mode. This necessitated a small refactoring.

Fixes: 6c53694fb2 ("Input: synaptics - split device info into a separate structure")
Signed-off-by: Anthony Martin <ality@pbrane.org>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-08-28 10:36:46 -07:00
Benjamin Tissoires 2fef826e45 Input: synaptics - tell users to report when they should be using rmi-smbus
Users should really consider switching to rmi-smbus instead of plain PS/2.
Notify them that they should report a missing pnpID in the file.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-05-29 20:00:26 -07:00
Benjamin Tissoires f4101ff87d Input: synaptics - warn the users when there is a better mode
The Synaptics touchpads are now either using i2c-hid or rmi-smbus.
Warn the users if they are missing the rmi-smbus modules and have no
chance of reporting correct data.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-05-29 20:00:25 -07:00
Benjamin Tissoires f4947d79a7 Input: synaptics - keep PS/2 around when RMI4_SMB is not enabled
Or the user might have the touchpad unbound from PS/2 but never picked
up by rmi-smbus.ko

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-05-29 20:00:24 -07:00
Eric Biggers 2755551188 Input: synaptics - clear device info before filling in
synaptics_query_hardware() was being passed a 'struct synaptics_device_info'
in uninitialized stack memory, then not always initializing all fields.
This caused garbage to show up in certain fields, making the touchpad
unusable.

Fix by zeroing the device info, so all fields default to 0.

Fixes: 6c53694fb2 ("Input: synaptics - split device info into a separate structure")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-05-29 20:00:10 -07:00
Dmitry Torokhov f6c4442bfa Input: synaptics - use u8 instead of unsigned char
The rest of the kernel uses u8, u16, etc for data coming form hardware,
let's switch ti using u8 here as well.

Also turn pkt_type into an enum.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03 16:23:58 -07:00
Dmitry Torokhov 212baf03a3 Input: synaptics - do not abuse -1 as return value
Let's stop using -1 as a universal return value and instead propagate
errors from underlying calls up the stack.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03 16:23:58 -07:00
Dmitry Torokhov 991d29fe02 Input: synaptics - use BIT() and GENMASK() macros
Use standard infrastructure, such as BIT and GENMASK, instead of rolling
bitmasks by hand.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03 16:23:57 -07:00
Dmitry Torokhov 2c6ecbba90 Input: synaptics - add synaptics_query_int()
Factor out querying and parsing 3-byte response into an integer value.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-04-03 16:23:57 -07:00
Benjamin Tissoires e839ffab02 Input: synaptics - add support for Intertouch devices
Most of the Synaptics devices are connected through PS/2 and a different
bus (SMBus or HID over I2C). The secondary bus capability is indicated by
the InterTouch bit in extended capability 0x0C.

We only enable the InterTouch device to be created for the laptops
registered with the top software button property or those we know that are
functional. In the future, we might change the default to always rely on
the InterTouch bus. Currently, users can enable/disable the feature with
the psmouse parameter synaptics_intertouch.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25 10:37:30 -07:00
Dmitry Torokhov 6c53694fb2 Input: synaptics - split device info into a separate structure
In preparation for SMBus/Intertouch device support, move static device
information that we query form the touchpad upon initialization into
separate structure. This will allow us to query the device without
allocating memory first.

Also stop using "unsigned long", everything fits into 32 bit chunks.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-25 10:37:29 -07:00
Dmitry Torokhov 996b9eedd0 Input: synaptics - do not mix logical and bitwise operations
Let's stop using !!x to reduce value of trackstick button expression to 0/1
and use shift instead. This removes the following sparse warning:

  CHECK   drivers/input/mouse/synaptics.c
drivers/input/mouse/synaptics.c:943:79: warning: dubious: !x | y

Also, the bits we are testing are not capabilities, so lets drop "_CAP"
suffix from macro names.

Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-03-23 14:49:37 -07:00
Dmitry Torokhov bf23cfc343 Input: synaptics - use SERIO_OOB_DATA to handle trackstick buttons
Instead of using custom method of "passing" extended buttons from the
touchpad to trackstick, let's switch to the newly introduced SERIO_OOB_DATA
channel.

Tested-By: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2017-02-09 13:01:32 -08:00
Benjamin Tissoires 82be788c96 Input: synaptics - handle spurious release of trackstick buttons, again
Looks like the fimware 8.2 still has the extra buttons spurious release
bug.

Link: https://bugzilla.kernel.org/show_bug.cgi?id=114321
Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2016-03-17 17:15:57 -07:00
Dmitry Torokhov 62d7846144 Revert "Input: synaptics - fix handling of disabling gesture mode"
This reverts commit e51e38494a: we
actually do want the device to work in extended W mode, as this is the
mode that allows us receiving multiple contact information.

Cc: stable@vger.kernel.org
2015-10-02 10:31:32 -07:00
Dmitry Torokhov e51e38494a Input: synaptics - fix handling of disabling gesture mode
Bit 2 of the mode byte has dual meaning: it can disable reporting of
gestures when touchpad works in Relative mode or normal Absolute mode,
or it can enable so called Extended W-Mode when touchpad uses enhanced
Absolute mode (W-mode). The extended W-Mode confuses our driver and
causes missing button presses on some Thinkpads (x250, T450s), so let's
make sure we do not enable it.

Also, according to the spec W mode "... bit is defined only in Absolute
mode on pads whose capExtended capability bit is set. In Relative mode and
in TouchPads without this capability, the bit is reserved and should be
left at 0.", so let's make sure we respect this requirement as well.

Reported-by: Nick Bowler <nbowler@draconx.ca>
Suggested-by: Gabor Balla <gaborwho@gmail.com>
Tested-by: Gabor Balla <gaborwho@gmail.com>
Tested-by: Nick Bowler <nbowler@draconx.ca>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-08-26 10:09:22 -07:00
Jiri Kosina ab80ee3895 Input: synaptics - dump ext10 capabilities as well
Make extended capabilities obtained through $10 query also available in
touchpad identification.

Signed-off-by: Jiri Kosina <jkosina@suse.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-07-27 15:43:45 -07:00
Dmitry Torokhov dbf3c37086 Revert "Input: synaptics - allocate 3 slots to keep stability in image sensors"
This reverts commit 63c4fda3c0 as it
causes issues with detecting 3-finger taps.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=100481
Cc: stable@vger.kernel.org
Acked-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
2015-07-10 10:11:07 -07:00
Peter Hutterer 7f2ca8b55a Input: synaptics - add min/max quirk for Lenovo S540
https://bugzilla.redhat.com/show_bug.cgi?id=1223051#c2

Cc: stable@vger.kernel.org
Tested-by: tommy.gagnes@gmail.com
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-06-08 10:19:08 -07:00
Dmitry Torokhov 5f63e885ac Linux 4.0-rc7
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVIws/AAoJEHm+PkMAQRiGwEcH/1GCBqrBzXaKwDdCPMRcYVUb
 MYkXmGkCGRYWe5MXI8QNAaa/CdG6mAFMHWN6CaMMpLTxnM1m87uBg01fQMsh73BO
 mRVLKE/soiJDnR1gYzBBDBYV/AUvytN5PhgeNaA95YIJvU3T1f3iTnV8vs30Dp0L
 YpxSqwr3C0k7C9IE0VcgfzvWJPCnQ9IWHuX3jn5s1XjGKVNbBYHMt6FusHdyXMfT
 dp8ksuGHwm30mTFI5xJpKOrRzfi+P5EsEUrsnFRPRM/iFTVrM5R7eaUhsRZb2+Wo
 YApnbYhUYz7om1AuQ+UZ/+S6y7ZLlGWegI1lWI754GIsczG5vPHEYhhgkzMhTsc=
 =kR1V
 -----END PGP SIGNATURE-----

Merge tag 'v4.0-rc7' into next

Sync up with Linux 4.0-rc7 to bring in ALPS changes.
2015-04-07 08:46:23 -07:00
Benjamin Tissoires 63c4fda3c0 Input: synaptics - allocate 3 slots to keep stability in image sensors
When slowly dropping 1, 2 and then 3 fingers on an image sensor touchpad,
we can see that the first finger gets reassigned a new slot while it did
not move. This is due to the kernel tracking algorithm which can not assign
correctly the 3 touches, being out of slots.

Declaring that we support 3 slots allows to actually forward:
slot 0 -> down, slot 1 -> up, slot 2 -> down

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Henrik Rydberg <rydberg@bitmath.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-06 09:38:07 -07:00
Benjamin Tissoires 58fd9af6e1 Input: Revert "Revert "synaptics - use dmax in input_mt_assign_slots""
This reverts commit 09d042a2eb ("Revert "Input: synaptics - use dmax in
input_mt_assign_slots"")

Now that balanced slots assignments seem to be fixed, let's re-enable the
use in synaptics.c and wait for users to complain if there are still
problems.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Henrik Rydberg <rydberg@bitmath.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-06 09:38:07 -07:00
Filip Ayazi 85734b1a5d Input: synaptics - fix min-max quirk value for E440
Commit 98dc070373 ("Input: synaptics - add quirk for Thinkpad E440") had
a typo in ymax, this changes the value to the one reported by
touchpad-edge-detector and mentioned in the commit.

Signed-off-by: Filip Ayazi <filipayazi@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-31 14:46:39 -07:00
Ramiro Morales 98dc070373 Input: synaptics - add quirk for Thinkpad E440
Its ClickPad shares PNP ID "LEN2006" with the one in model E540 which is
already handled by the driver (both are Haswell iterations of the Edge
line, launched in 2014) but the dimensions it reports are different:

  $ sudo ./touchpad-edge-detector /dev/input/event3
  Touchpad SynPS/2 Synaptics TouchPad on /dev/input/event3
  Move one finger around the touchpad to detect the actual edges
  Kernel says: x [1472..5044], y [1408..3398]
  Touchpad sends: x [1024..5045], y [2457..4832] /^C

Fortunately we can use the board ID, which is also different, to
distinguish among them.

  $ dmesg | grep -i synaptics
  psmouse serio1: synaptics: Touchpad model: 1, fw: 8.1, id: 0x1e2b1,
      caps: 0xd001a3/0x940300/0x127c00, board id: 2691, fw id: 1494646
  psmouse serio1: synaptics: serio: Synaptics pass-through port at
      isa0060/serio1/input0
  input: SynPS/2 Synaptics TouchPad as
      /devices/platform/i8042/serio1/input/input4

Board ID in E540 is 2722:

  psmouse serio1: synaptics: Touchpad model: 1, fw: 8.1, id: 0x1e2b1,
      caps: 0xd001a3/0x940300/0x127c00, board id: 2722, fw id: 1484859

(from https://launchpadlibrarian.net/179702965/BootDmesg.txt)

Signed-off-by: Ramiro Morales <cramm0@gmail.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-23 10:35:42 -07:00
Dmitry Torokhov 188933ac13 Linux 4.0-rc5
-----BEGIN PGP SIGNATURE-----
 Version: GnuPG v1
 
 iQEcBAABAgAGBQJVD1VGAAoJEHm+PkMAQRiG7yoH/juKOQ1zbxi5M+mleDEEJtA0
 RxQSojqEMWIKrWi8PNZxjENn1OZB6XOLIXOhlyAZBrmgsjO34p1DyXlZMznr/R8W
 kQ2Xxs061hRtB3OuruMIqOApUrjuqsaCwgbgUS1qWmqZcoyZN4oELyZMP6OOlqv5
 UUBZm8MfyXGyxrCcg39mjct3VEOhiuEcvL6SUxOC380CdSVAnyqHFPcz0JVqMUn9
 9RUBs0T9cMdhb0mZ2bfXzt6AKArj63G2nXOum+VzFcvspSm2U+MPIDCuoE+ZbTPS
 jqIAgG0rj1ezRyb5oeJrvlU0Yy3u/cXoMPs9+kORvpladooYNLti8ovh6qllm0I=
 =d/ye
 -----END PGP SIGNATURE-----

Merge tag 'v4.0-rc5' into next

Merge with the latest upstream to synchronize Synaptics changes
and bring in new infrastructure pieces.

Conflicts:
	drivers/input/mouse/synaptics.c
2015-03-23 09:18:27 -07:00
Dmitry Torokhov 09d042a2eb Revert "Input: synaptics - use dmax in input_mt_assign_slots"
This reverts commit 6ab17a8484 since it,
according to Benjamin, causes issues with slot assignment:

E: 15.669119 0000 0000 0000     # ------------ SYN_REPORT (0) ----------
E: 15.954242 0003 002f 0000     # EV_ABS / ABS_MT_SLOT          0
E: 15.954242 0003 0039 0505     # EV_ABS / ABS_MT_TRACKING_ID   505
E: 15.954242 0003 0035 3851     # EV_ABS / ABS_MT_POSITION_X    3851
E: 15.954242 0003 0036 4076     # EV_ABS / ABS_MT_POSITION_Y    4076
E: 15.954242 0003 003a 0034     # EV_ABS / ABS_MT_PRESSURE      34
E: 15.954242 0001 014a 0001     # EV_KEY / BTN_TOUCH            1
E: 15.954242 0003 0000 3851     # EV_ABS / ABS_X                3851
E: 15.954242 0003 0001 4076     # EV_ABS / ABS_Y                4076
E: 15.954242 0003 0018 0034     # EV_ABS / ABS_PRESSURE         34
E: 15.954242 0001 0145 0001     # EV_KEY / BTN_TOOL_FINGER      1
E: 15.954242 0000 0000 0000     # ------------ SYN_REPORT (0) ----------
... (bunch of regular events)...
E: 16.020614 0000 0000 0000     # ------------ SYN_REPORT (0) ----------
E: 16.043601 0003 0035 3873     # EV_ABS / ABS_MT_POSITION_X    3873
E: 16.043601 0003 0036 3903     # EV_ABS / ABS_MT_POSITION_Y    3903
E: 16.043601 0003 003a 0050     # EV_ABS / ABS_MT_PRESSURE      50
E: 16.043601 0003 0035 3032     # EV_ABS / ABS_MT_POSITION_X    3032
E: 16.043601 0003 0036 3832     # EV_ABS / ABS_MT_POSITION_Y    3832
E: 16.043601 0003 003a 0044     # EV_ABS / ABS_MT_PRESSURE      44
E: 16.043601 0003 0000 3032     # EV_ABS / ABS_X                3032
E: 16.043601 0003 0001 3832     # EV_ABS / ABS_Y                3832
E: 16.043601 0003 0018 0044     # EV_ABS / ABS_PRESSURE         44
E: 16.043601 0001 0145 0000     # EV_KEY / BTN_TOOL_FINGER      0
E: 16.043601 0001 014d 0001     # EV_KEY / BTN_TOOL_DOUBLETAP   1
E: 16.043601 0000 0000 0000     # ------------ SYN_REPORT (0) ----------
E: 16.068837 0003 002f 0001     # EV_ABS / ABS_MT_SLOT          1
E: 16.068837 0003 0039 0506     # EV_ABS / ABS_MT_TRACKING_ID   506
E: 16.068837 0003 0035 3912     # EV_ABS / ABS_MT_POSITION_X    3912
E: 16.068837 0003 0036 3743     # EV_ABS / ABS_MT_POSITION_Y    3743
E: 16.068837 0003 003a 0056     # EV_ABS / ABS_MT_PRESSURE      56
E: 16.068837 0003 002f 0000     # EV_ABS / ABS_MT_SLOT          0
E: 16.068837 0003 0035 3026     # EV_ABS / ABS_MT_POSITION_X    3026
E: 16.068837 0003 0036 3708     # EV_ABS / ABS_MT_POSITION_Y    3708
E: 16.068837 0003 003a 0052     # EV_ABS / ABS_MT_PRESSURE      52
E: 16.068837 0003 0000 3026     # EV_ABS / ABS_X                3026
E: 16.068837 0003 0001 3708     # EV_ABS / ABS_Y                3708
E: 16.068837 0003 0018 0052     # EV_ABS / ABS_PRESSURE         52
E: 16.068837 0000 0000 0000     # ------------ SYN_REPORT (0) ----------

Slot 0 and 1 gets inverted in the second report above, which
introduces a cursor jump. The problem is that this cursor jump is
often enough to leave the current widget, and X sends the
scrolling events to whoever is now under the cursor.

Reported-by: Benjamin Tissoires <btissoir@redhat.com>
Reported-by: Hans de Goede <hdegoede@redhat.com>
2015-03-16 09:17:16 -07:00
Dmitry Torokhov 6067fe5e0b Merge branch 'synaptics' into for-linus
Bring in changes needed to properly handle Lenovo 2015 lineup.
2015-03-16 09:12:56 -07:00
Benjamin Tissoires 8f004f3f4d Input: synaptics - remove X250 from the topbuttonpad list
Lenovo X250 has a PnpID of LEN0046, but it does not have the top software
button requirement.

For the record, Lenovo T450s and W541 have a PnpID of LEN200f and LEN004a,
so they are not on the top software button list.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Reviewed-by: Daniel Martin <consume.noise@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:36:54 -07:00
Benjamin Tissoires 860e6f7fcb Input: synaptics - remove X1 Carbon 3rd gen from the topbuttonpad list
Lenovo decided to switch back to physical buttons for the trackstick on
their latest series. The PNPId list was provided before they reverted back
to physical buttons, so it contains the new models too.  We can know from
the touchpad capabilities that the touchpad has physical buttons, so
removing the ids from the list is not mandatory. It is still nicer to
remove the wrong ids, so start by removing the X1 Carbon 3rd gen, with the
PNPId of LEN0048.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:36:54 -07:00
Benjamin Tissoires cdd9dc1959 Input: synaptics - re-route tracksticks buttons on the Lenovo 2015 series
The 2015 series of the Lenovo thinkpads added back the hardware buttons on
top of the touchpad for the trackstick.

Unfortunately, they are wired to the touchpad, and not the trackstick.
Thus, they are seen as extra buttons from the kernel point of view.

This leads to a problem in user space because extra buttons on synaptics
devices used to be used as scroll up/down buttons. So in the end, the
experience for the user is scroll events for buttons left and right when
using the trackstick. Yay!

Fortunately, the firmware advertises such behavior in the extended
capability $10, and so we can re-route the buttons through the pass-through
interface.

Hallelujah-expressed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:36:53 -07:00
Benjamin Tissoires 3adde1f591 Input: synaptics - remove TOPBUTTONPAD property for Lenovos 2015
The 2015 series of the Lenovo thinkpads added back the hardware buttons on
top of the touchpad for the trackstick.

Unfortunately, Lenovo used the PNPIDs that are supposed to be "5 buttons"
touchpads, so the new laptops also have the INPUT_PROP_TOPBUTTONPAD. Yay!

Instead of manually removing each of the new ones, or hoping that we know
all the current ones, we can consider that the PNPIDs list that were given
contains touchpads that have the trackstick buttons, either physically
wired to them, or emulated with the top software button property.

Thanks to the extra buttons capability in query $10, we can reliably detect
the physical buttons from the software ones, and so we can remove the
TOPBUTTONPAD property even if it was declared as such.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:36:53 -07:00
Benjamin Tissoires 06aa374bc7 Input: synaptics - retrieve the extended capabilities in query $10
Newer Synaptics touchpads need to get information from the query $10.
Retrieve it if available.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:36:52 -07:00
Benjamin Tissoires b57a7128be Input: synaptics - do not retrieve the board id on old firmwares
The board id capability has been added in firmware 7.5.

Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:36:52 -07:00
Benjamin Tissoires ebc80840b8 Input: synaptics - handle spurious release of trackstick buttons
The Fimware 8.1 has a bug in which the extra buttons are only sent when the
ExtBit is 1.  This should be fixed in a future FW update which should have
a bump of the minor version.

Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:34:48 -07:00
Dmitry Torokhov dc5465dc8a Input: synaptics - fix middle button on Lenovo 2015 products
On the X1 Carbon 3rd gen (with a 2015 broadwell cpu), the physical middle
button of the trackstick (attached to the touchpad serio device, of course)
seems to get lost.

Actually, the touchpads reports 3 extra buttons, which falls in the switch
below to the '2' case. Let's handle the case of odd numbers also, so that
the middle button finds its way back.

Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:34:34 -07:00
Benjamin Tissoires 02e07492cd Input: synaptics - skip quirks when post-2013 dimensions
Post-2013 Lenovo laptops provide correct min/max dimensions, which are
different with the ones currently quirked.  According to
https://bugzilla.kernel.org/show_bug.cgi?id=91541 the following board ids
are assigned in the post-2013 touchpads:

t440p/t440s: LEN0036 -> 2964/2962
t540p:       LEN0034 -> 2964

Using 2961 as the common minimum makes these 3 laptops OK. We may need
to update those values later if other pnp_ids has a lower board_id.

Cc: stable@vger.kernel.org
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:33:16 -07:00
Daniel Martin 5b3089ddb5 Input: synaptics - support min/max board id in min_max_pnpid_table
Add a min/max range for board ids to the min/max coordinates quirk. This
makes it possible to restrict quirks to specific models based upon their
board id. The define ANY_BOARD_ID (0) serves as a wild card.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=91541

Cc: stable@vger.kernel.org
Signed-off-by: Daniel Martin <daniel.martin@secunet.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:33:16 -07:00