ye xingchen
e50389f208
Input: touchscreen - use sysfs_emit[_at]() instead of scnprintf()
...
Follow the advice of the Documentation/filesystems/sysfs.rst and show()
should only use sysfs_emit() or sysfs_emit_at() when formatting the
value to be returned to user space.
Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn >
Acked-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Acked-by: Oliver Graute <oliver.graute@kococonnector.com >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-12-13 21:26:11 -08:00
Dmitry Torokhov
a1bdf45845
Input: edt-ft5x06 - use device core to create driver-specific device attributes
...
Instead of creating driver-specific device attributes with
devm_device_add_group() have device core do this by setting up dev_groups
pointer in the driver structure.
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Link: https://lore.kernel.org/r/20230729005133.1095051-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-09-06 14:27:18 -07:00
Krzysztof Kozlowski
14e5f4db20
Input: edf-ft5x06 - simplify with dev_err_probe()
...
Common pattern of handling deferred probe can be simplified with
dev_err_probe(). Less code and also it prints the error value.
Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org >
Reviewed-by: Hans de Goede <hdegoede@redhat.com >
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Link: https://lore.kernel.org/r/20230625162817.100397-11-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-07-07 16:54:28 -07:00
Uwe Kleine-König
d8bde56dfd
Input: Switch i2c drivers back to use .probe()
...
After commit b8a1a4cd5a ("i2c: Provide a temporary .probe_new()
call-back type"), all drivers being converted to .probe_new() and then
03c835f498 ("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 >
2023-05-17 09:59:11 -07:00
Philipp Puschmann
5672bd308e
Input: edt-ft5x06 - add delay after waking up
...
The touch controller needs some time to wake-up after setting the wake-up
gpio. Without having a delay after wake-up probing regularly fails in
edt_ft5x06_ts_identify() with an error (i.e. EREMOTEIO) that was caused
by a failed i2c transfer.
The datasheet sets the wake-up time to 5 ms, although it is not entirely
clear.
Signed-off-by: Philipp Puschmann <p.puschmann@pironex.com >
Link: https://lore.kernel.org/r/20230505115823.545803-1-p.puschmann@pironex.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-05-05 11:50:14 -07:00
Dario Binacchi
0df28e7166
Input: edt-ft5x06 - calculate points data length only once
...
It is pointless and expensive to calculate data in the interrupt that
depends on the type of touchscreen, which is detected on the driver
probe and cannot then be changed.
So calculate the size of the data buffer on the driver probe, as well as
the data retrieval command, and then use them in the ISR.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230402200951.1032513-10-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-04-02 21:38:05 -07:00
Dario Binacchi
079e60a53c
Input: edt-ft5x06 - unify the crc check
...
With this patch, the CRC is always verified by the same function, even in
the case of accessing registers where the number of bytes is minimal.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230402200951.1032513-9-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-04-02 21:38:03 -07:00
Dario Binacchi
9dfd9708ff
Input: edt-ft5x06 - convert to use regmap API
...
It replaces custom read/write functions with regmap API, making the
driver code more generic.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230402200951.1032513-8-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-04-02 21:38:01 -07:00
Dario Binacchi
24642661e9
Input: edt-ft5x06 - don't print error messages with dev_dbg()
...
In some parts of the code, error messages were improperly printed with
dev_dbg() calls. In those cases, dev_dbg() has been replaced with
dev_err().
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230402200951.1032513-7-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-04-02 21:37:59 -07:00
Dario Binacchi
65c67985a0
Input: edt-ft5x06 - remove code duplication
...
The use of the macros M06_REG_ADDR and M06_REG_CMD avoids code
duplication without impacting the application load, and reduces the
chances of errors or mistakes.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230402200951.1032513-6-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-04-02 21:37:58 -07:00
Dario Binacchi
38e8cf7b97
Input: edt-ft5x06 - don't recalculate the CRC
...
There is no need to recalculate the CRC when the data has not changed.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230402200951.1032513-5-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-04-02 21:37:56 -07:00
Dario Binacchi
f8a2257056
Input: edt-ft5x06 - add spaces to ensure format specification
...
It adds spaces around '-' as recommended by the Linux coding style.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230402200951.1032513-4-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-04-02 21:37:54 -07:00
Dario Binacchi
6114f4749b
Input: edt-ft5x06 - remove unnecessary blank lines
...
It removes unnecessary blank lines so that checkpatch doesn't complain
anymore.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230402200951.1032513-3-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-04-02 21:37:53 -07:00
Dario Binacchi
d19ec82c74
Input: edt-ft5x06 - fix indentation
...
Matches the alignment to the open parenthesis as suggested by
checkpatch.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230402200951.1032513-2-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-04-02 21:37:51 -07:00
Dario Binacchi
62c5e854b4
Input: edt-ft5x06 - fix typo in a comment
...
Replace 'firmares' with 'firmwares'.
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20230128162325.64467-1-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-01-29 20:37:01 -08:00
Jonathan Cameron
6e6ebfc54e
Input: edt-ft5x06 - switch to DEFINE_SIMPLE_DEV_PM_OPS() and pm_sleep_ptr()
...
SIMPLE_DEV_PM_OPS() is deprecated as it requires explicit protection
against unused function warnings. The new combination of pm_sleep_ptr()
and DEFINE_SIMPLE_DEV_PM_OPS() allows the compiler to see the functions,
thus suppressing the warning, but still allowing the unused code to be
removed. Thus also drop the __maybe_unused markings.
Signed-off-by: Jonathan Cameron <Jonathan.Cameron@huawei.com >
Cc: Michael Trimarchi <michael@amarulasolutions.com >
Cc: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Reviewed-by: Linus Walleij <linus.walleij@linaro.org >
Link: https://lore.kernel.org/r/20230102181842.718010-42-jic23@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2023-01-09 20:25:25 -08:00
Uwe Kleine-König
e7c3121808
Input: edt-ft5x06 - Convert to i2c's .probe_new()
...
.probe_new() doesn't get the i2c_device_id * parameter, so determine
that explicitly in the probe function.
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Acked-by: Oliver Graute <oliver.graute@kococonnector.com >
Link: https://lore.kernel.org/r/20221118224540.619276-238-uwe@kleine-koenig.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2022-12-02 14:53:45 -08:00
Wolfram Sang
a9f08ad7ad
Input: move from strlcpy with unused retval to strscpy
...
Follow the advice of the below link and prefer 'strscpy' in this
subsystem. Conversion is 1:1 because the return value is not used.
Generated by a coccinelle script.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com >
Link: https://lore.kernel.org/r/20220818210022.6865-1-wsa+renesas@sang-engineering.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2022-08-18 15:44:08 -07:00
Uwe Kleine-König
ed5c2f5fd1
i2c: Make remove callback return void
...
The value returned by an i2c driver's remove function is mostly ignored.
(Only an error message is printed if the value is non-zero that the
error is ignored.)
So change the prototype of the remove function to return no value. This
way driver authors are not tempted to assume that passing an error to
the upper layer is a good idea. All drivers are adapted accordingly.
There is no intended change of behaviour, all callbacks were prepared to
return 0 before.
Reviewed-by: Peter Senna Tschudin <peter.senna@gmail.com >
Reviewed-by: Jeremy Kerr <jk@codeconstruct.com.au >
Reviewed-by: Benjamin Mugnier <benjamin.mugnier@foss.st.com >
Reviewed-by: Javier Martinez Canillas <javierm@redhat.com >
Reviewed-by: Crt Mori <cmo@melexis.com >
Reviewed-by: Heikki Krogerus <heikki.krogerus@linux.intel.com >
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Acked-by: Marek Behún <kabel@kernel.org > # for leds-turris-omnia
Acked-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Petr Machata <petrm@nvidia.com > # for mlxsw
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com > # for surface3_power
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com > # for bmc150-accel-i2c + kxcjk-1013
Reviewed-by: Hans Verkuil <hverkuil-cisco@xs4all.nl > # for media/* + staging/media/*
Acked-by: Miguel Ojeda <ojeda@kernel.org > # for auxdisplay/ht16k33 + auxdisplay/lcd2s
Reviewed-by: Luca Ceresoli <luca.ceresoli@bootlin.com > # for versaclock5
Reviewed-by: Ajay Gupta <ajayg@nvidia.com > # for ucsi_ccg
Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com > # for iio
Acked-by: Peter Rosin <peda@axentia.se > # for i2c-mux-*, max9860
Acked-by: Adrien Grassein <adrien.grassein@gmail.com > # for lontium-lt8912b
Reviewed-by: Jean Delvare <jdelvare@suse.de > # for hwmon, i2c-core and i2c/muxes
Acked-by: Corey Minyard <cminyard@mvista.com > # for IPMI
Reviewed-by: Vladimir Oltean <olteanv@gmail.com >
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com > # for drivers/power
Acked-by: Krzysztof Hałasa <khalasa@piap.pl >
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de >
Signed-off-by: Wolfram Sang <wsa@kernel.org >
2022-08-16 12:46:26 +02:00
Dario Binacchi
b777f93b6a
Input: edt-ft5x06 - show crc and header errors by sysfs
...
M06 sends packets with header and crc for data verification. Now you can
check at runtime how many packets have been dropped.
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com >
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com >
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20220621123937.1330389-7-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2022-06-28 22:00:18 -07:00
Dario Binacchi
480343dc89
Input: edt-ft5x06 - show firmware version by sysfs
...
The firmware version was printed only if debug mode was enabled. Now you
can always get it from sysfs.
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com >
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com >
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Acked-by: Oliver Graute <oliver.graute@kococonnector.com >
Link: https://lore.kernel.org/r/20220621123937.1330389-6-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2022-06-28 22:00:17 -07:00
Dario Binacchi
60790a5802
Input: edt-ft5x06 - show model name by sysfs
...
The model name was printed only if debug mode was enabled. Now you can
always get it from sysfs.
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com >
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com >
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Acked-by: Oliver Graute <oliver.graute@kococonnector.com >
Link: https://lore.kernel.org/r/20220621123937.1330389-5-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2022-06-28 22:00:01 -07:00
Dario Binacchi
5bcee83a40
Input: edt-ft5x06 - set report rate by dts property
...
It allows to change the M06/M12 default scan rate on driver probing.
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com >
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com >
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20220621123937.1330389-4-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2022-06-28 22:00:00 -07:00
Dario Binacchi
23ea98f4ba
Input: edt-ft5x06 - get/set M12 report rate by sysfs
...
Add support for reading/writing scan rate (SC) register for M12 by
sysfs. The register value is equal to the SC (Hz), unlike M06, where
instead it is equal to SC / 10.
Co-developed-by: Michael Trimarchi <michael@amarulasolutions.com >
Signed-off-by: Michael Trimarchi <michael@amarulasolutions.com >
Tested-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com >
Link: https://lore.kernel.org/r/20220621123937.1330389-3-dario.binacchi@amarulasolutions.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2022-06-28 21:59:58 -07:00
Oliver Graute
146ea9b679
Input: edt-ft5x06 - added case for EDT EP0110M09
...
Add Support for EP011M09 Firmware
Signed-off-by: Oliver Graute <oliver.graute@kococonnector.com >
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de >
Link: https://lore.kernel.org/r/20210813062110.13950-1-oliver.graute@kococonnector.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2021-09-05 19:10:11 -07:00
Stephan Gerhold
df4c40f484
Input: edt-ft5x06 - add support for iovcc-supply
...
At the moment, the edt-ft5x06 driver can control a single regulator
("vcc"). However, some FocalTech touch controllers have an additional
IOVCC pin that should be supplied with the digital I/O voltage.
The I/O voltage might be provided by another regulator that should also
be kept on. Otherwise, the touchscreen can randomly stop functioning if
the regulator is turned off because no other components still require it.
Implement (optional) support for also enabling an "iovcc-supply".
The datasheet specifies a delay of ~ 10us before enabling VDD/VCC
after IOVCC is enabled, so make sure to enable IOVCC first.
Signed-off-by: Stephan Gerhold <stephan@gerhold.net >
Link: https://lore.kernel.org/r/20210510193108.50178-2-stephan@gerhold.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2021-06-01 21:35:24 -07:00
Dmitry Torokhov
03161a952c
Input: edt-ft5x06 - consolidate handling of number of electrodes
...
Instead of special-casing retrieval of number of X/Y electrodes based on
the firmware, let's select default values and mark registers as
non-existent on firmwares that do not support this operation.
Also mark "report rate" register as non-existent for generic firmwares
as having it set to 0 does not make sense.
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Acked-by: Marco Felsch <m.felsch@pengutronix.de >
Reviewed-by: Simon Budig <simon.budig@kernelconcepts.de >
Link: https://lore.kernel.org/r/X9FZFs3NZADoIhhH@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-12-10 21:46:24 -08:00
Gustavo A. R. Silva
6f49c4f5b9
Input: Use fallthrough pseudo-keyword
...
Replace the existing /* fall through */ comments and its variants with
the new pseudo-keyword macro fallthrough[1]. Also, remove unnecessary
fall-through markings when it is the case.
[1] https://www.kernel.org/doc/html/latest/process/deprecated.html?highlight=fallthrough#implicit-switch-case-fall-through
Signed-off-by: Gustavo A. R. Silva <gustavoars@kernel.org >
Link: https://lore.kernel.org/r/20200707180857.GA30600@embeddedor
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-07-07 11:25:54 -07:00
Ahmad Fatoum
0f58daaacc
Input: edt-ft5x06 - prefer asynchronous probe
...
Probing the device takes a while, because we sleep for 300 ms after a
reset; allow asynchronous probing so this can happen in the background
while other devices are being probed.
Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de >
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Link: https://lore.kernel.org/r/20200227112819.16754-5-m.felsch@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-05-09 14:39:38 -07:00
Marco Felsch
21d1611a83
Input: edt-ft5x06 - improve power management operations
...
It is possible to bring the device into a deep sleep state. To exit this
state the reset or wakeup pin must be toggeled as documented in [1].
Because of the poor documentation I used the several downstream kernels
[2] and other applications notes [3] to indentify the related registers.
Furthermore I added the support to disable the device completely which
is obviously the most effective power-saving mechanism. This mechanism
needs the reset pin to ensure the power-up/down sequence.
We can't apply any of these power-saving mechanism if both pins are
missing (not connected) or if it is a wakeup device.
[1] https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x26.pdf
https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x06.pdf
[2] https://github.com/linux-sunxi/linux-sunxi/blob/sunxi-3.4/drivers/input/touchscreen/ft5x_ts.c
https://github.com/Pablito2020/focaltech-touch-driver/blob/master/ft5336_driver.c
[3] https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x16_registers.pdf
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Link: https://lore.kernel.org/r/20200227112819.16754-4-m.felsch@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-05-09 14:39:37 -07:00
Marco Felsch
f4ee52f3ad
Input: edt-ft5x06 - move parameter restore into helper
...
We need to restore the parameters if we switch between the
factory/work mode and during the resume process if we switched off the
power-supply. Therefore refactor edt_ft5x06_work_mode() and move the
"restore the parameters" into a helper routine so we can reuse it later.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Link: https://lore.kernel.org/r/20200227112819.16754-3-m.felsch@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-05-09 14:39:36 -07:00
Marco Felsch
255cdaf734
Input: edt-ft5x06 - fix get_default register write access
...
Since commit b6eba86030 ("Input: edt-ft5x06 - add offset support for
ev-ft5726") offset-x and offset-y is supported. Devices using those
offset parameters don't support the offset parameter so we need to add
the NO_REGISTER check for edt_ft5x06_ts_get_defaults().
Fixes: b6eba86030 ("Input: edt-ft5x06 - add offset support for ev-ft5726")
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Link: https://lore.kernel.org/r/20200227112819.16754-2-m.felsch@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-05-09 14:39:35 -07:00
Marco Felsch
643dd74166
Input: edt-ft5x06 - use pm core to enable/disable the wake irq
...
We do not have to handle the wake-irq within the driver because the pm
core can handle this for us. The only use case for the suspend/resume
callbacks was to handle the wake-irq so we can remove the callbacks.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-01-10 14:45:36 -08:00
Marco Felsch
53435cd88e
Input: edt-ft5x06 - make wakeup-source switchable
...
Since day one the touch controller acts as wakeup-source. This seems to
be wrong since the device supports deep-sleep mechanism [1] which
requires a reset to leave it. Also some designs won't use the
touchscreen as wakeup-source.
According discussion [2] we decided to break backward compatibility and
go the common way by using the 'wakeup-source' device-property.
[1] https://www.newhavendisplay.com/appnotes/datasheets/touchpanel/FT5x26.pdf
[2] https://patchwork.kernel.org/patch/11149037/
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-01-10 14:45:35 -08:00
Marco Felsch
8726e4c9a3
Input: edt-ft5x06 - alphabetical include reorder
...
It seems that the include order is historical increased and no one takes
care of it. Fix this to align it with the common rule to be in a
alphabetical order.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-01-10 14:45:34 -08:00
Philipp Zabel
e112324cc0
Input: edt-ft5x06 - work around first register access error
...
The EP0700MLP1 returns bogus data on the first register read access
(reading the threshold parameter from register 0x00):
edt_ft5x06 2-0038: crc error: 0xfc expected, got 0x40
It ignores writes until then. This patch adds a dummy read after which
the number of sensors and parameter read/writes work correctly.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de >
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Tested-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2020-01-10 14:45:33 -08:00
Mylène Josserand
7448bfec6b
Input: edt-ft5x06 - add support for regulator
...
Add the support for enabling optional regulator that may be used as VCC
source.
Signed-off-by: Mylène Josserand <mylene.josserand@bootlin.com >
Signed-off-by: Ondrej Jirman <megous@megous.com >
Reviewed-by: Rob Herring <robh@kernel.org > # bindings
Link: https://lore.kernel.org/r/20191029005806.3577376-2-megous@megous.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2019-10-28 21:11:33 -07:00
Greg Kroah-Hartman
042cc4c778
Input: edt-ft5x06 - no need to check return value of debugfs_create functions
...
When calling debugfs functions, there is no need to ever check the
return value. The function can work or not, but the code logic should
never do something different based on this.
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2019-08-12 00:10:58 -07:00
Dmitry Torokhov
17b92927f8
Input: edt-ft5x06 - simplify event reporting code
...
Now that input_mt_report_slot_state() returns true if slot is active we no
longer need a temporary for the slot state.
Tested-by: Benoit Parrot <bparrot@ti.com >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2019-07-05 10:19:13 -07:00
Dmitry Torokhov
1b9c698c41
Input: edt-ft5x06 - use get_unaligned_be16()
...
Instead of doing conversion by hand, let's use the proper accessors.
Reviewed-by: Andy Shevchenko <andy.shevchenko@gmail.com >
Tested-by: Benoit Parrot <bparrot@ti.com >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2019-06-30 00:18:12 -07:00
Andy Shevchenko
6d3a41ab0c
Input: edt-ft5x06 - convert to use SPDX identifier
...
Reduce size of duplicated comments by switching to use SPDX identifier.
No functional change.
While here, correct MODULE_LICENSE() string to be aligned with license text.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2019-03-03 23:38:39 -08:00
Andy Shevchenko
fc226eb23e
Input: edt-ft5x06 - enable ACPI enumeration
...
ACPI allows to enumerate specific devices by using compatible strings.
Enable that enumeration for EDT touchscreen devices.
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2019-03-03 23:38:38 -08:00
Marco Felsch
b6eba86030
Input: edt-ft5x06 - add offset support for ev-ft5726
...
Unfortunately the evervision focaltech implementation uses two offset
registers, one for the x coordinate and one for y.
This patch extends the driver to handle those offset registers only for
devices that support these.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2019-01-13 23:13:28 -08:00
Marco Felsch
2ebc1919e9
Input: edt-ft5x06 - add support to update ev-ft5726 registers
...
Currently only the threshold and gain parameters can be read.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2019-01-13 23:13:27 -08:00
Marco Felsch
a2f39dac0d
Input: edt-ft5x06 - add support for Evervision FT5726
...
Evervision displays are using different Focaltech touchscreen
controllers. This commit adds the initial support for the ones using the
FT5726 controller. Receiving the touch data is the same as for the
GENERIC_FT but the x and y cooridnates are swapped. The main differences
are the register addresses where the GAIN and THRESHOLD parameters are
stored.
Signed-off-by: Marco Felsch <m.felsch@pengutronix.de >
Reviewed-by: Rob Herring <robh@kernel.org >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2019-01-13 23:13:26 -08:00
Dmitry Torokhov
4b3e910d7f
Input: edt-ft5x06 - fix error handling for factory mode on non-M06
...
When attempting enter factory mode on firmware that does not support it,
we'd error out, but leave the device with interrupts disabled, and thus
touch not working. Fix it by moving the check before we disable
interrupts/allocate memory for debug buffers.
Fixes: fd335ab04b ("Input: edt-ft5x06 - add support for M09 firmware version")
Reviewed-by: Andi Shyti <andi@etezian.org >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2018-01-24 14:43:10 -08:00
Simon Budig
aed5d0ee77
Input: edt-ft5x06 - implement support for the EDT-M12 series
...
This adds support for the EDT M12 series of touchscreens.
Signed-off-by: Simon Budig <simon.budig@kernelconcepts.de >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2017-10-19 17:17:47 -07:00
Simon Budig
169110c364
Input: edt-ft5x06 - make distinction between m06/m09/generic more clear
...
Since the driver also is useful for some non-EDT touchscreens based on
the focaltec chips introduce the concept of a "generic" focaltec based
touch.
Use a better heuristics for model detection and be more specific in the
source.
Signed-off-by: Simon Budig <simon.budig@kernelconcepts.de >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2017-10-19 17:17:46 -07:00
Andi Shyti
e3adf559a3
Input: edt-ft5x06 - use managed devm_device_add_group
...
Commit 57b8ff070f ("driver core: add devm_device_add_group() and
friends") has added the managed version for creating sysfs group files.
Use devm_device_add_group instead of sysfs_create_group and remove the
relative sysfs_remove_group and goto label.
Signed-off-by: Andi Shyti <andi@etezian.org >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2017-09-29 16:51:06 -07:00
Luca Ceresoli
4701475282
Input: edt-ft5x06 - fix access to non-existing register
...
reg_addr->reg_report_rate is supposed to exist in M06, not M09.
The driver is written to skip avoids access to non-existing registers
when the register address is NO_REGISTER (0xff). But
reg_addr->reg_report_rate is initialized to 0x00 by devm_kzalloc() (in
edt_ft5x06_ts_probe()) and not changed thereafter. So the checks do
not work and an access to register 0x00 is done.
Fix by setting reg_addr->reg_report_rate to NO_REGISTER.
Also fix the only place where reg_report_rate is checked against zero
instead of NO_REGISTER.
Signed-off-by: Luca Ceresoli <luca@lucaceresoli.net >
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com >
2017-09-11 14:23:41 -07:00