History log of /linux-master/drivers/input/touchscreen/cyttsp5.c
Revision Date Author Comments
# 2f06996d 27-Oct-2023 Lin, Meng-Bo <linmengbo0689@protonmail.com>

Input: cyttsp5 - add handling for vddio regulator

The Cypress touchscreen controllers are often used with external pull-up
for the interrupt line and the I2C lines, so we might need to enable
a regulator to bring the lines into usable state. Otherwise, this might
cause spurious interrupts and reading from I2C will fail.

Implement support for a "vddio-supply" that is enabled by the cyttsp5
driver so that the regulator gets enabled when needed.

Signed-off-by: Lin, Meng-Bo <linmengbo0689@protonmail.com>
Acked-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20221117190507.87535-3-linmengbo0689@protonmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# dbce1a7d 17-Jul-2023 Rob Herring <robh@kernel.org>

Input: Explicitly include correct DT includes

The DT of_device.h and of_platform.h date back to the separate
of_platform_bus_type before it as merged into the regular platform bus.
As part of that merge prepping Arm DT support 13 years ago, they
"temporarily" include each other. They also include platform_device.h
and of.h. As a result, there's a pretty much random mix of those include
files used throughout the tree. In order to detangle these headers and
replace the implicit includes with struct declarations, users need to
explicitly include the correct includes.

Signed-off-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20230714174633.4058096-1-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# d8bde56d 17-May-2023 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Input: Switch i2c drivers back to use .probe()

After commit b8a1a4cd5a98 ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498b5 ("i2c: Switch .probe() to not take an id parameter") convert
back to (the new) .probe() to be able to eventually drop .probe_new() from
struct i2c_driver.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20230517164645.162294-1-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 3c98b8db 05-May-2023 Maximilian Weigand <mweigand@mweigand.net>

Input: cyttsp5 - implement proper sleep and wakeup procedures

The touchscreen can be put into a deep sleep state that prevents it from
emitting touch irqs. Put the touchscreen into deep sleep during suspend
if it is not marked as a wakeup source.

This also fixes a problem with the touchscreen getting unresponsive after
system resume when a falling edge trigger is used for the interrupt.
When left on during suspend, the touchscreen would pull the interrupt
line down in response to touch events, leaving the interrupt effectively
disabled after resume.

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20230504120316.408687-2-mweigand2017@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 529de2f1 01-May-2023 Maximilian Weigand <mweigand@mweigand.net>

Input: cyttsp5 - fix array length

The cmd array should be initialized with the proper command size and not
with the actual command value that is sent to the touchscreen.

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20230501113010.891786-2-mweigand@mweigand.net
Fixes: 5b0c03e24a06 ("Input: Add driver for Cypress Generation 5 touchscreen")
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 14d55bc3 01-May-2023 Maximilian Weigand <mweigand@mweigand.net>

Input: cyttsp5 - remove unused code

The removed lines are remnants of the vendor driver and are not used in
the upstream driver.

Signed-off-by: Maximilian Weigand <mweigand@mweigand.net>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20230501113010.891786-3-mweigand@mweigand.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 5dc63e56 14-Apr-2023 hrdl <git@hrdl.eu>

Input: cyttsp5 - fix sensing configuration data structure

Prior to this patch, the sensing configuration data was not parsed
correctly, breaking detection of max_tch. The vendor driver includes
this field. This change informs the driver about the correct maximum
number of simultaneous touch inputs.

Tested on a Pine64 PineNote with a modified touch screen controller
firmware.

Signed-off-by: hrdl <git@hrdl.eu>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20230411211651.3791304-1-git@hrdl.eu
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 04249314 03-Feb-2023 Richard Kjerstadius <kjerstadius@gmail.com>

Input: cyttsp5 - fix bitmask for touch buttons

Prior to this patch, the bitmask ends up being 0x3, as opposed to 0x1
which likely was the intention. The erroneous bit results in the driver
reporting 2 different button activations in designs with 2 or more
buttons.

To detect which button has been pressed, cyttsp5_btn_attention() uses a
for loop to iterate through the input buffer, while shifting and
applying a bitmask to determine the state for each button.
Unfortunately, when the bitmask is 0x3 and there are multiple buttons,
this procedure falls apart.

Consider a design with 3 buttons. Pressing the third button will result
in a call to cyttsp5_btn_attention() with the input buffer containing
0x4 (binary 0100). In the first iteration of the for loop cur_btn_state
will be:

(0x4 >> 0 * 1) & 0x3 = 0x4 & 0x3 = 0x0

This is correct. However, in the next iteration this happens:

(0x4 >> 1 * 1) & 0x3 = 0x2 & 0x3 = 0x2

Which means that a key event for key 1 is generated, even though it's
not really active. In the third iteration, the loop detects the button
that was actually pressed:

(0x4 >> 2 * 1) & 0x3 = 0x1 & 0x3 = 0x1

This key event is the only one that should have been detected, but it is
accompanied by the preceding key. Ensuring the applied mask is 0x1
solves this problem.

Signed-off-by: Richard Kjerstadius <richard.kjerstadius@teledyne.com>
Reviewed-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20230127102903.3317089-1-richard.kjerstadius@teledyne.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# eebf2bf1 18-Nov-2022 Uwe Kleine-König <u.kleine-koenig@pengutronix.de>

Input: cyttsp5: Convert to i2c's .probe_new()

The probe function doesn't make use of the i2c_device_id * parameter so it
can be trivially converted.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20221118224540.619276-236-uwe@kleine-koenig.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>


# 5b0c03e2 31-Oct-2022 Alistair Francis <alistair@alistair23.me>

Input: Add driver for Cypress Generation 5 touchscreen

This is the basic driver for the Cypress TrueTouch Gen5 touchscreen
controllers. This driver supports only the I2C bus but it uses regmap
so SPI support could be added later.
The touchscreen can retrieve some defined zone that are handled as
buttons (according to the hardware). That is why it handles
button and multitouch events.

Reviewed-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com>
Signed-off-by: Alistair Francis <alistair@alistair23.me>
Tested-by: Andreas Kemnade <andreas@kemnade.info> # Kobo Clara HD
Tested-by: Peter Geis <pgwipeout@gmail.com>
Link: https://lore.kernel.org/r/20221026114908.191472-2-alistair@alistair23.me
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>