Commit Graph

705 Commits

Author SHA1 Message Date
Hans de Goede e3a79212ea Input: alps - report V2 Dualpoint Stick events via the right evdev node
On V2 devices the DualPoint Stick reports bare packets, these should be
reported via the "AlpsPS/2 ALPS DualPoint Stick" dev2 evdev node, which also
has the INPUT_PROP_POINTING_STICK propbit set.

Note that since there is no way to distinguish these packets from an external
PS/2 mouse (insofar as these laptops have an external PS/2 port) this means
that we will be reporting PS/2 mouse events via this evdev node too, as we've
been doing in kernel 3.19 and older.

This has been tested on a Dell Latitude D620 and a Dell Latitude E6400,
which both have a V2 touchpad + a DualPoint Stick which reports bare packets.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-05 11:48:35 -07:00
Hans de Goede 59c30afbd3 Input: alps - report interleaved bare PS/2 packets via dev3
Bare packets should be reported via the same evdev device independent on
whether they are detected on the beginning of a packet or in the middle
of a packet.

This has been tested on a Dell Latitude E6400, where the DualPoint Stick
reports bare packets, which get reported via dev3 when the touchpad is
idle, and via dev2 when the touchpad and stick are used simultaneously.

This commit fixes this inconsistency by always reporting bare packets via
dev3. Note that since the come from a DualPoint Stick they really should be
reported via dev2, this gets fixed in a later commit.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-04-05 11:48:34 -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 c164c147c9 Input: ALPS - fix max coordinates for v5 and v7 protocols
Commit 3296f71cd2 ("Input: ALPS - consolidate
setting protocol parameters") inadvertently moved call to
alps_dolphin_get_device_area() from v5 to v7 protocol, causing both
protocols report incorrect maximum values for X and Y axes which resulted
in crash in Synaptics X driver.

Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=94801
Reported-by: Santiago Gala <sgala@apache.org>
Reported-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-23 09:14:25 -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
Daniel Martin b05f4d1c33 Input: synaptics - remove obsolete min/max quirk for X240
The firmware of the X240 (LEN0035, 2013/12) exposes the same values
    x [1232..5710], y [1156..4696]
as the quirk applies.

Cc: stable@vger.kernel.org
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:32:19 -07:00
Daniel Martin ac097930f0 Input: synaptics - query min dimensions for fw v8.1
Query the min dimensions even if the check
SYN_EXT_CAP_REQUESTS(priv->capabilities) >= 7 fails, but we know that the
firmware version 8.1 is safe.

With that we don't need quirks for post-2013 models anymore as they expose
correct min and max dimensions.

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

Cc: stable@vger.kernel.org
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
  re-order the tests to check SYN_CAP_MIN_DIMENSIONS even on FW 8.1
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:32:19 -07:00
Daniel Martin 9aff65982d Input: synaptics - log queried and quirked dimension values
Logging the dimension values we queried and the values we use from a quirk
to overwrite can be helpful for debugging.

This partly relates to bug:
    https://bugzilla.kernel.org/show_bug.cgi?id=91541

Cc: stable@vger.kernel.org
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:32:18 -07:00
Daniel Martin 8b04baba10 Input: synaptics - split synaptics_resolution(), query first
Split the function synaptics_resolution() into synaptics_resolution() and
synaptics_quirks().  synaptics_resolution() will be called before
synaptics_quirks() to query dimensions and resolutions before overwriting
them with quirks.

Cc: stable@vger.kernel.org
Signed-off-by: Daniel Martin <consume.noise@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-08 23:32:18 -07:00
Mathias Gottschlag 4eb8d6e7e5 Input: psmouse - disable "palm detection" in the focaltech driver
Apparently, the threshold for large contact area seems to be rather low on
some devices, causing the touchpad to frequently freeze during normal
usage. Because we do now know how we are supposed to use the value in
question, this commit just drops the related code completely.

Signed-off-by: Mathias Gottschlag <mgottschlag@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-07 13:40:21 -08:00
Mathias Gottschlag 4ec212f003 Input: psmouse - disable changing resolution/rate/scale for FocalTech
These PS/2 commands make some touchpads stop responding, so this commit
adds some dummy functions to replace the generic implementation. Because
scale changes were not encapsulated in a method of struct psmouse yet, this
commit adds a method set_scale to psmouse.

Signed-off-by: Mathias Gottschlag <mgottschlag@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-07 13:40:21 -08:00
Mathias Gottschlag 679d83ea93 Input: psmouse - ensure that focaltech reports consistent coordinates
We don't know whether x_max or y_max really hold the maximum possible
coordinates, and we don't know for sure whether we correctly interpret the
coordinates sent by the touchpad, so we clamp the reported values to
prevent confusion in userspace code.

Signed-off-by: Mathias Gottschlag <mgottschlag@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-07 13:40:20 -08:00
Mathias Gottschlag 3e98452519 Input: psmouse - remove hardcoded touchpad size from the focaltech driver
The size has in most cases already been fetched from the touchpad, the
hardcoded values should have been removed.

Signed-off-by: Mathias Gottschlag <mgottschlag@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-07 13:40:20 -08:00
Dmitry Torokhov 93050db206 Input: ALPS - fix memory leak when detection fails
This fixes memory leak introduced by commit
a09221e83e

Acked-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-04 15:17:08 -08:00
Geert Uytterhoeven 2523caab3c Input: cyapa - remove superfluous type check in cyapa_gen5_read_idac_data()
drivers/input/mouse/cyapa_gen5.c: In function ‘cyapa_gen5_read_idac_data’:
drivers/input/mouse/cyapa_gen5.c:1876: warning: ‘max_element_cnt’ may be used uninitialized in this function
drivers/input/mouse/cyapa_gen5.c:1873: warning: ‘offset’ may be used uninitialized in this function

If *data_size is non-zero, and idac_data_type contains an unknown type,
max_element_cnt and offset will be uninitialized, and the loop will
process non-existing data.

However, this cannot happen (for now), as there's a test for unknown
types at the top of cyapa_gen5_read_idac_data().

As no "if ... else if ..." is used in other places, remove the
superfluous "if" to silence the compiler warning.

Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-02 13:31:33 -08:00
Dudley Du 17a28055d5 Input: cyapa - fix unaligned functions redefinition error
Use asm/unaligned.h instead of linux/unaligned/access_ok.h header file to
fix compiling issues such as following while doing cross platform
compiling:

"include/linux/unaligned/access_ok.h:7:19: error: redefinition of
 'get_unaligned_le16'
...
include/linux/unaligned/le_struct.h:6:19: note: previous definition of
 'get_unaligned_le16' was here".

Reported-by: kbuild test robot <kbuild-all@01.org>
Signed-off-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-03-02 13:31:32 -08:00
Dmitry Torokhov 290b799c39 Input: psmouse - use IS_ENABLED instead of homegrown code
Instead of having various protocols provide <protocol>_supported()
functions, let's use IS_ENABLED() macro that works well in "if" statements.

Acked-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 16:08:35 -08:00
Dmitry Torokhov 97ae2b5c17 Merge branch 'bfin_rotary' into next
Merge bfin_rotary driver changes from Sonic Zhang.
2015-02-15 16:07:18 -08:00
Pali Rohár ef47fa5280 Input: ALPS - move v7 packet info to Documentation and v6 packet info
This patch move all packet info from driver source code to documentation
and adds info about v6 packet format (from driver source code).

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Acked-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 16:04:23 -08:00
Dmitry Torokhov 626b9da0b5 Input: ALPS - fix confusing comment in protocol data
The comment about suspicions entry 0x20, 0x02, 0x0e has over time drifted
away and it become hard to figure out what it meant. Let's move it back so
it is clear.

Reported-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 16:04:23 -08:00
Pali Rohár 04aae283ba Input: ALPS - do not mix trackstick and external PS/2 mouse data
Previously dev2 device was used for both external PS/2 mouse and internal
trackstick device (if available). This change introduces dev3 device which
is used for external PS/2 mouse data and dev2 is now used only for
trackstick.

In case that trackstick is not present dev2 is not created, so userspace
does not see non existent device in system.

Because laptops with ALPS devices often do not use i8042 active
multiplexing all data (from touchpad, trackstick and external PS/2 mouse)
come to one port.  So it is not possible to know if external PS/2 mouse is
connected or not. In most cases external PS/2 mouse is not connected so
driver will create dev3 input device after first bare PS/2 packet will be
received. So there will not be "ghost" input device.

This change also helps in identifying possible problems in future if driver
decides to report 6-bytes trackstick packets as 3-bytes bare PS/2 (data
will be reported to dev3 instead dev2).

Signed-off-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 15:44:19 -08:00
Dmitry Torokhov a09221e83e Input: ALPS - fix trackstick detection on some Dell Latitudes
On some Dell Latitudes we fail to identify presence of trackstick unless we
reset the device. The issue is quite benign as we do perform reset in
alps_init(), so the trackstick ends up working, but mouse name reported to
userspace is not accurate.

In order to fix the issue while avoiding the additional lengthy reset we
move the resrt to alps_detect() and keep the discovered state to be used
later in alps_init().

Reported-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 15:44:18 -08:00
Dmitry Torokhov 3296f71cd2 Input: ALPS - consolidate setting protocol parameters
Move setting of all protocol properties into alps_set_protocol (former
alps_set_defaults) instead of having it split between several functions.

Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 15:44:18 -08:00
Dmitry Torokhov 8326bb5741 Input: ALPS - split protocol data from model info
In preparation of reworking the way we set protocol parameters let's
split certain protocol items from alps_model_info into a separate
structure.

Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 15:44:17 -08:00
Dmitry Torokhov fb2dd7a61d Input: ALPS - make Rushmore a separate protocol
Even though Rushmore is very close to V3 protocol it is sufficiently
different to warrant it's own protocol name.

Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 15:44:17 -08:00
Dmitry Torokhov d7c13d3470 Input: ALPS - renumber protocol numbers
In order to accommodate new protocol number for Rushmore touchpads
let's shift protocol numbers by 8 bits (i.e. 1 -> 0x100) - this way
we keep protocol version reported in input device id the same as it
was, but add some holes in numbering.

Tested-by: Pali Rohár <pali.rohar@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-15 15:44:16 -08:00
Rasmus Villemoes 98a4a59ee3 Input: elan_i2c - fix wrong %p extension
There's no %px extension. From the context I think the intention was to
dump the five bytes which were not as expected, and for that one should use
%ph.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-06 15:32:18 -08:00
Benjamin Tissoires 6ab17a8484 Input: synaptics - use dmax in input_mt_assign_slots
When tapping a clickpad with two fingers, there is a chance that the sensor
sees first only one finger, and at the next scan only the second one.  In
this case, the sensors says that there has been only one finger on the
clickpad, which moved really fast between two scans.

We can try to counter this by adding a limit to what an actual finger can
move between 2 scans.  A distance of 1cm between two scans for one finger
seems reasonable.  However, this is not really accurate because the
resolution in X and in Y differs. But heh, that's how the in-kernel
tracking works right now, and its job is quite good, even with this
approximation.

This parameter solves most of the jumps observed, not all of them however.
But this is a hardware defect, and we might not be able to get something
better without much heavier computations.

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

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-03 15:36:32 -08:00
Linus Torvalds 3441456bfa Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input layer updates from Dmitry Torokhov:
 "Just a few quirks for PS/2 this time"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: elantech - add more Fujtisu notebooks to force crc_enabled
  Input: i8042 - add noloop quirk for Medion Akoya E7225 (MD98857)
  Input: synaptics - adjust min/max for Lenovo ThinkPad X1 Carbon 2nd
2015-02-01 13:16:40 -08:00
Rainer Koenig 47c1ffb2b6 Input: elantech - add more Fujtisu notebooks to force crc_enabled
Add two more Fujitsu LIFEBOOK models that also ship with the Elantech
touchpad and don't work with crc_disabled to the quirk list.

Signed-off-by: Rainer Koenig <Rainer.Koenig@ts.fujitsu.com>
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-01 11:51:26 -08:00
Henrik Rydberg 448c7f3830 Input: MT - add support for balanced slot assignment
Some devices are not fast enough to differentiate between a fast-moving
contact and a new contact. This problem cannot be fully resolved because
information is truly missing, but it is possible to safe-guard against
obvious mistakes by restricting movement with a maximum displacement.

The new problem formulation for dmax > 0 cannot benefit from the speedup
for positive definite matrices, but since the convergence is faster, the
result is about the same. For a handful of contacts, the latency difference
is truly negligible.

Suggested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Signed-off-by: Henrik Rydberg <rydberg@bitmath.org>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-02-01 11:50:35 -08:00
Duson Lin bb03bf3f84 Input: elan_i2c - verify firmware signature applying it
To allow for different firmware sizes let's replace the original size check
with with checking the signature in the firmware data.

Signed-off-by: Duson Lin <dusonlin@emc.com.tw>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-23 09:44:21 -08:00
Dmitry Torokhov e719963c4a Input: elantech - remove stale comment from Kconfig
The fixes to the X.org driver have been applied long time ago and
the patch on kernel.org has long since gone so let's remove the
comment.

Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-22 13:16:14 -08:00
Dan Carpenter b481077375 Input: cyapa - off by one in cyapa_update_fw_store()
If "(count == NAME_MAX)" then we could end up putting the NUL terminator
one space beyond the end of the fw_name[] array.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-22 08:23:15 -08:00
Dudley Du a535a9f16c Input: cyapa - fix variable being dereferenced before check
Fixes the warning regarding variable being dereferenced before check
'gen5_pip->resp_len'.

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-22 08:23:14 -08:00
Dmitry Torokhov 2be7256fe7 Input: cyapa - fix endianness issues in gen5 firmware update support
gen5_bl_metadata_row_params structure has its fields specified with
explicit endianness, so we should not be trying to convert to native CPU
endianness when filling the structure.

Also fix firmware validation checks and misspelled field in
gen5_bl_metadata_row_params.

Reported-by: kbuild test robot <fengguang.wu@intel.com>
Reviewed-by: Dudley Du <dudl@cypress.com>
Tested-by: Dudley Du <dudl@cypress.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-22 07:57:36 -08:00
Peter Hutterer 8543cf1c24 Input: synaptics - adjust min/max for Lenovo ThinkPad X1 Carbon 2nd
LEN0037 found in the Lenovo ThinkPad X1 Carbon 2nd (2014 model)

Cc: stable@vger.kernel.org
Reported-and-tested-by: Bjoern Olausson <bjoern@olausson.de>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2015-01-19 16:37:32 -08:00
Linus Torvalds 66893885bb Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input subsystem fixes from Dmitry Torokhov.

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: uinput - fix ioctl nr overflow for UI_GET_SYSNAME/VERSION
  Input: I8042 - add Acer Aspire 7738 to the nomux list
  Input: elantech - support new ICs types for version 4
  Input: i8042 - reset keyboard to fix Elantech touchpad detection
  MAINTAINERS: remove Dmitry Torokhov's alternate address
2015-01-19 04:55:23 +12:00