History log of /linux-master/drivers/input/mouse/focaltech.c
Revision Date Author Comments
# 8980f190 19-Mar-2023 Jason A. Donenfeld <Jason@zx2c4.com>

Input: focaltech - use explicitly signed char type

The recent change of -funsigned-char causes additions of negative
numbers to become additions of large positive numbers, leading to wrong
calculations of mouse movement. Change these casts to be explicitly
signed, to take into account negative offsets.

Fixes: 3bc753c06dd0 ("kbuild: treat char as always unsigned")
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Cc: stable@vger.kernel.org
Link: https://bugzilla.kernel.org/show_bug.cgi?id=217211
Link: https://lore.kernel.org/r/20230318133010.1285202-1-Jason@zx2c4.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 2874c5fd 27-May-2019 Thomas Gleixner <tglx@linutronix.de>

treewide: Replace GPLv2 boilerplate/reference with SPDX - rule 152

Based on 1 normalized pattern(s):

this program is free software you can redistribute it and or modify
it under the terms of the gnu general public license as published by
the free software foundation either version 2 of the license or at
your option any later version

extracted by the scancode license scanner the SPDX license identifier

GPL-2.0-or-later

has been chosen to replace the boilerplate/reference in 3029 file(s).

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Allison Randal <allison@lohutok.net>
Cc: linux-spdx@vger.kernel.org
Link: https://lkml.kernel.org/r/20190527070032.746973796@linutronix.de
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>


# 324ae095 24-Oct-2016 Dmitry Tunin <hanipouspilot@gmail.com>

Input: psmouse - cleanup Focaltech code

psmouse->name "Focaltech Touchpad" is an overkill. In xinput it is too long
as "FocaltechPS/2 Focaltech Focaltech Touchpad"

In focaltech_report_state() pointer to psmouse->dev is already stored as
*dev

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# db808498 05-Sep-2016 Baoyou Xie <baoyou.xie@linaro.org>

Input: focaltech - mark focaltech_set_resolution() static

We get 1 warning when building kernel with W=1:
drivers/input/mouse/focaltech.c:393:6: warning: no previous prototype for 'focaltech_set_resolution' [-Wmissing-prototypes]

In fact, this function is only used in the file in which it is
declared and don't need a declaration, but can be made static.
So this patch marks it 'static'.

Signed-off-by: Baoyou Xie <baoyou.xie@linaro.org>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 2b6f39e9 27-Nov-2015 Dmitry Torokhov <dmitry.torokhov@gmail.com>

Input: psmouse - rearrange Focaltech init code

The fact that we were calling focaltech_init() even when Focaltech support
is disabled was confusing. Rearrange the code so that if support is
disabled we continue to fall through the rest of protocol probing code
until we get to full reset that Focaltech devices need to work properly.

Also, replace focaltech_init() with a stub now that it is only called when
protocol is enabled.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Reviewed-by: Pali Rohár <pali.rohar@gmail.com>
Tested-by: Marcin Sochacki <msochacki+kernel@gmail.com>
Tested-by: Till <till2.schaefer@uni-dortmund.de>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 85919a00 31-May-2015 Dmitry Tunin <hanipouspilot@gmail.com>

Input: focaltech - report finger width to userspace

Focaltech touchpads report finger width in packet[5] of absolute packet.
Range for width in raw format is 0x10 - 0x70. Second half-byte is always 0.
0xff is reported, when a large contact area is detected.
This can be handled in userspace.

Signed-off-by: Dmitry Tunin <hanipouspilot@gmail.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 4eb8d6e7 07-Mar-2015 Mathias Gottschlag <mgottschlag@gmail.com>

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>


# 4ec212f0 07-Mar-2015 Mathias Gottschlag <mgottschlag@gmail.com>

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>


# 679d83ea 07-Mar-2015 Mathias Gottschlag <mgottschlag@gmail.com>

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>


# 3e984525 07-Mar-2015 Mathias Gottschlag <mgottschlag@gmail.com>

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>


# 290b799c 29-Dec-2014 Dmitry Torokhov <dmitry.torokhov@gmail.com>

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>


# 05be1d07 29-Dec-2014 Mathias Gottschlag <mgottschlag@gmail.com>

Input: psmouse - support for the FocalTech PS/2 protocol extensions

Most of the protocol for these touchpads has been reverse engineered. This
commit adds a basic multitouch-capable driver.

A lot of the protocol is still unknown. Especially, we don't know how to
identify the device yet apart from the PNP ID.

The previous workaround for these devices has been left in place in case
the driver is not compiled into the kernel or in case some other device
with the same PNP ID is not recognized by the driver yet still has the same
problems with the device probing code.

Signed-off-by: Mathias Gottschlag <mgottschlag@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 3ace3686 12-Sep-2014 Hans de Goede <hdegoede@redhat.com>

Input: psmouse - add support for detecting FocalTech PS/2 touchpads

The Asus X450 and X550 laptops use a PS/2 touchpad from a new
manufacturer called FocalTech:

https://bugzilla.kernel.org/show_bug.cgi?id=77391
https://bugzilla.redhat.com/show_bug.cgi?id=1110011

The protocol for these devices is not known at this time, but even
without knowing the protocol they need some special handling. They get
upset by some of our other PS/2 device probing, and once upset generate
random mouse events making things unusable even with an external mouse.

This patch adds detection of these devices based on their pnp ids, and
when they are detected, treats them as a bare ps/2 mouse. Doing things
this way they at least work in their ps/2 mouse emulation mode.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>