Commit graph

2019 commits

Author SHA1 Message Date
Linus Torvalds
f78e9de80f Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov:
 "Just one new driver (Cypress StreetFighter touchkey), and no input
  core changes this time.

  Plus various fixes and enhancements to existing drivers"

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (54 commits)
  Input: iforce - fix control-message timeout
  Input: wacom_i2c - use macros for the bit masks
  Input: ili210x - reduce sample period to 15ms
  Input: ili210x - improve polled sample spacing
  Input: ili210x - special case ili251x sample read out
  Input: elantench - fix misreporting trackpoint coordinates
  Input: synaptics-rmi4 - Fix device hierarchy
  Input: i8042 - Add quirk for Fujitsu Lifebook T725
  Input: cap11xx - add support for cap1206
  Input: remove unused header <linux/input/cy8ctmg110_pdata.h>
  Input: ili210x - add ili251x firmware update support
  Input: ili210x - export ili251x version details via sysfs
  Input: ili210x - use resolution from ili251x firmware
  Input: pm8941-pwrkey - respect reboot_mode for warm reset
  reboot: export symbol 'reboot_mode'
  Input: max77693-haptic - drop unneeded MODULE_ALIAS
  Input: cpcap-pwrbutton - do not set input parent explicitly
  Input: max8925_onkey - don't mark comment as kernel-doc
  Input: ads7846 - do not attempt IRQ workaround when deferring probe
  Input: ads7846 - use input_set_capability()
  ...
2021-11-12 11:53:16 -08:00
Dmitry Torokhov
efe6f16c6f Merge branch 'next' into for-linus
Prepare input updates for 5.16 merge window.
2021-11-11 21:58:54 -08:00
Alistair Francis
91e2e76695 Input: wacom_i2c - use macros for the bit masks
To make the code easier to read use macros for the bit masks.

Signed-off-by: Alistair Francis <alistair@alistair23.me>
Link: https://lore.kernel.org/r/20211009113707.17568-2-alistair@alistair23.me
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-11-09 22:52:07 -08:00
Marek Vasut
27931d38ce Input: ili210x - reduce sample period to 15ms
Modern devices may redraw display at 60 Hz, make sure we have one input
sample per one frame. Reduce sample period to 15ms, so we would get up
to 66.6 samples per second, although realistically with all the jitter
and extra scheduling wiggle room, we would end up just above 60 samples
per second. This should be a good compromise between sampling too often
and sampling too seldom.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20211108114145.84118-1-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-11-09 22:23:02 -08:00
Marek Vasut
8639e042ad Input: ili210x - improve polled sample spacing
Currently the ili210x driver implements a threaded interrupt handler which
starts upon edge on the interrupt line, and then polls the touch controller
for samples. Every time a sample is obtained from the controller, the thread
function checks whether further polling is required, and if so, waits fixed
amount of time before polling for next sample.

The delay between consecutive samples can thus vary greatly, because the
I2C transfer required to retrieve the sample from the controller takes
different amount of time on different platforms. Furthermore, different
models of the touch controllers supported by this driver require different
delays during retrieval of samples too.

Instead of waiting fixed amount of time before polling for next sample,
determine how much time passed since the beginning of sampling cycle and
then wait only the remaining amount of time within the sampling cycle.
This makes the driver deliver samples with equal spacing between them.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20211108005216.480525-1-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-11-09 22:23:00 -08:00
Marek Vasut
de88910839 Input: ili210x - special case ili251x sample read out
The ili251x touch controller needs 5ms delay between sending I2C device
address and register address, and, writing or reading register data.

According to downstream ili251x example code, this 5ms delay is not
required when reading touch samples out of the controller. Implement
such a special case.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20211108005259.480545-1-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-11-09 22:22:59 -08:00
Linus Torvalds
12dbbfadd8 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input fixes from Dmitry Torokhov:

 - a new product ID for the xpad joystick driver

 - fixes to resistive-adc-touch and snvs_pwrkey drivers

 - a change to touchscreen helpers to make clang happier

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: touchscreen - avoid bitwise vs logical OR warning
  Input: xpad - add support for another USB ID of Nacon GC-100
  Input: resistive-adc-touch - fix division by zero error on z1 == 0
  Input: snvs_pwrkey - add clk handling
2021-10-17 16:57:06 -10:00
Marek Vasut
c6ac8f0b4c Input: ili210x - add ili251x firmware update support
The ili251x firmware can be updated, this is used when switching between
different modes of operation of the touch surface, e.g. glove operation.
This patch implements the firmware update mechanism triggered by a write
into an sysfs attribute.

The firmware itself is distributed as an intel hex file with non-standard
types. The first two lines are of type 0xad, which indicates the start of
DataFlash payload, that is always at address 0xf000 on the ili251x, so it
can be dropped, and 0xac which indicates the position of firmware info in
the Application payload, that is always at address 0x2020 on the ili251x
and we do not care. The rest of the firmware is data of type 0x00, and we
care about that. To convert the firmware hex file into something usable
by the kernel, remove the first two lines and then use ihex2fw:

 $ tail -n +3 input.hex > temp.hex
 $ ./tools/firmware/ihex2fw temp.hex firmware/ilitek/ili251x.bin

To trigger the firmware update, place firmware file ilitek/ili251x.bin
into /lib/firmware/, write into firmware_update sysfs attribute and wait
about 30-40 seconds. The firmware update is slow. Afterward, verify the
firmware_version and mode sysfs attributes to check whether the firmware
got updated and the controller switched back to application (AP) mode by
reading out 'mode' attribute in sysfs.

Note that the content of firmware_version, e.g. 0600.0005.abcd.aa04 can
be matched to the content of the firmware hex file. The first four bytes,
0x06 0x00 0x00 0x05 can be found at ^:102030 00 05000006, the next four
bytes 0xab 0xcd 0xaa 0x04 at ^:10F000 00 nnnnnnnn ABCDAA04.

Note that the protocol differs considerably between the ili2xxx devices,
this patch therefore implements this functionality only for ili251x that
I can test.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20210831202506.181927-3-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-16 22:29:35 -07:00
Marek Vasut
70a7681db0 Input: ili210x - export ili251x version details via sysfs
The ili251x firmware protocol permits readout of firmware version,
protocol version, mcu version and current mode (application, boot
loader, forced update). These information are useful when updating
the firmware on the il251x, e.g. to avoid updating the same firmware
into the device multiple times. The locking is now necessary to avoid
races between interrupt handler and the sysfs readouts.

Note that the protocol differs considerably between the ili2xxx devices,
this patch therefore implements this functionality only for ili251x that
I can test.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20210831202506.181927-2-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-16 22:29:34 -07:00
Marek Vasut
235300ed8c Input: ili210x - use resolution from ili251x firmware
The ili251x firmware protocol permits readout of panel resolution,
implement this, but make it possible to override this value using
DT bindings. This way, older DTs which contain touchscreen-size-x
and touchscreen-size-y properties will behave just like before and
new DTs may avoid specifying these for ILI251x.

Note that the command format is different on other controllers, so
this functionality is isolated to ILI251x.

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20210831202506.181927-1-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-16 22:29:32 -07:00
Oleksij Rempel
fe0a7e3d01 Input: resistive-adc-touch - fix division by zero error on z1 == 0
For proper pressure calculation we need at least x and z1 to be non
zero. Even worse, in case z1 we may run in to division by zero
error.

Fixes: 60b7db914d ("Input: resistive-adc-touch - rework mapping of channels")
Signed-off-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/r/20211007095727.29579-1-o.rempel@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-15 22:11:03 -07:00
Dmitry Torokhov
36fc54375f Input: ads7846 - do not attempt IRQ workaround when deferring probe
When request_irq() returns -EPORBE_DEFER we should abort probe and try
again later instead of trying to engage IRQ trigger workaround.

Link: https://lore.kernel.org/r/20210910045039.4020199-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-15 22:09:48 -07:00
Dmitry Torokhov
ccd661392a Input: ads7846 - use input_set_capability()
Instead of manipulating capability bits directly use
input_set_capability(). Also stop setting EV_ABS explicitly as
input_set_abs_params() does it for us.

Link: https://lore.kernel.org/r/20210910045039.4020199-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-15 22:09:48 -07:00
Dmitry Torokhov
9271cda2bb Input: ads7846 - set input device bus type and product ID
Set input device's bus type as BUS_SPI and use model as product ID.

Link: https://lore.kernel.org/r/20210910045039.4020199-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-15 22:09:48 -07:00
Uwe Kleine-König
39e4e75a9f Input: tsc200x - make tsc200x_remove() return void
Up to now tsc200x_remove() returns zero unconditionally. Make it return
void instead which makes it easier to see in the callers that there is
no error to handle.

Also the return value of i2c and spi remove callbacks is ignored anyway.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20211012153945.2651412-7-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-12 19:48:54 -07:00
John Keeping
b415ed4f49 Input: st1232 - prefer asynchronous probing
The device may take up to 100ms to become responsive during probe, so
prefer asynchronous probing to avoid delaying the rest of the system.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: John Keeping <john@metanate.com>
Link: https://lore.kernel.org/r/20211007111217.1935858-1-john@metanate.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-11 18:32:56 -07:00
John Keeping
2667f6b7af Input: st1232 - increase "wait ready" timeout
I have a ST1633 touch controller which fails to probe due to a timeout
waiting for the controller to become ready.  Increasing the minimum
delay to 100ms ensures that the probe sequence completes successfully.

The ST1633 datasheet says nothing about the maximum delay here and the
ST1232 I2C protocol document says "wait until" with no notion of a
timeout.

Since this only runs once during probe, being generous with the timout
seems reasonable and most likely the device will become ready
eventually.

(It may be worth noting that I saw this issue with a PREEMPT_RT patched
kernel which probably has tighter wakeups from usleep_range() than other
preemption models.)

Fixes: f605be6a57 ("Input: st1232 - wait until device is ready before reading resolution")
Signed-off-by: John Keeping <john@metanate.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Link: https://lore.kernel.org/r/20210929152609.2421483-1-john@metanate.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-10-11 18:32:54 -07:00
Cai Huoqing
4b3ed1ae28 Input: raydium_i2c_ts - make use of the helper function devm_add_action_or_reset()
The helper function devm_add_action_or_reset() will internally
call devm_add_action(), and if devm_add_action() fails then it will
execute the action mentioned and return the error code. So
use devm_add_action_or_reset() instead of devm_add_action()
to simplify the error handling, reduce the code.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210922125212.95-3-caihuoqing@baidu.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-22 21:56:49 -07:00
Cai Huoqing
b083704fbf Input: elants_i2c - make use of devm_add_action_or_reset()
The helper function devm_add_action_or_reset() will internally
call devm_add_action(), and if devm_add_action() fails then it will
execute the action mentioned and return the error code. So
use devm_add_action_or_reset() instead of devm_add_action()
to simplify the error handling, reduce the code.

Signed-off-by: Cai Huoqing <caihuoqing@baidu.com>
Link: https://lore.kernel.org/r/20210922125212.95-2-caihuoqing@baidu.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-22 21:56:47 -07:00
Hans de Goede
09182ed20c Input: goodix - add support for controllers without flash
Some Goodix touchscreen controllers, such as for example the GT912,
don't have flash-storage for their firmware.

These models require the OS to load the firmware at runtime, as well as
some other special handling. Add support for this to the goodix driver.

This patch was developed and tested on a Glavey TM800A550L tablet.

Note the "goodix,main-clk" and "firmware-name" device-properties used
by the new code are *not* documented in the
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml
device-tree bindings for now.

Not documenting these is intentional. This is done because this code has
only been tested on x86/ACPI so far, where devicetree is not used.
Instead these properties are set through a software-fwnode attached to the
device by the drivers/platform/x86/touchscreen_dmi.c code. This means that
the use of this properties for now is purely a kernel-internal thing and
the name/working of the properties may still be changed for now.

Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210920150643.155872-7-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-20 22:00:29 -07:00
Hans de Goede
20e317222e Input: goodix - allow specifying the config filename
The config which needs to be send to the controller on some device-models
is model-specific. Allow specifying a model-specific filename through
a device-property, rather then always using a fixed filename.

Note the "goodix,config-name" device-property used by this is
*not* documented in the
Documentation/devicetree/bindings/input/touchscreen/goodix.yaml
device-tree bindings for now.

Not documenting these is intentional. This is done because this code has
only been tested on x86/ACPI so far, where devicetree is not used.
Instead these properties are set through a software-fwnode attached to the
device by the drivers/platform/x86/touchscreen_dmi.c code. This means that
the use of this property for now is purely a kernel-internal thing and
the name/working of the property may still be changed for now.

Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210920150643.155872-6-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-20 22:00:28 -07:00
Hans de Goede
7642f29c73 Input: goodix - push error logging up into i2c_read and i2c_write helpers
Make the goodix_i2c_read() and goodix_i2c_write*() helpers log errors
themselves. This allows removing all the error logging from their callers.

This already results in a nice cleanup with the current code and it also
helps to make the upcoming support for controllers without flash cleaner.

Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210920150643.155872-5-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-20 22:00:26 -07:00
Hans de Goede
209bda4741 Input: goodix - refactor reset handling
Refactor reset handling a bit, change the main reset handler
into a new goodix_reset_no_int_sync() helper and add a
goodix_reset() wrapper which calls goodix_int_sync()
separately.

Also push the dev_err() call on reset failure into the
goodix_reset_no_int_sync() and goodix_int_sync() functions,
so that we don't need to have separate dev_err() calls in
all their callers.

This is a preparation patch for adding support for controllers
without flash, which need to have their firmware uploaded and
need some other special handling too.

Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210920150643.155872-4-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-20 22:00:25 -07:00
Hans de Goede
a2233cb7b6 Input: goodix - add a goodix.h header file
Add a goodix.h header file, and move the register definitions,
and struct declarations there and add prototypes for various
helper functions.

This is a preparation patch for adding support for controllers
without flash, which need to have their firmware uploaded and
need some other special handling too.

Since MAINTAINERS needs updating because of this change anyways,
also add myself as co-maintainer.

Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210920150643.155872-3-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-20 22:00:23 -07:00
Hans de Goede
31ae0102a3 Input: goodix - change goodix_i2c_write() len parameter type to int
Change the type of the goodix_i2c_write() len parameter to from 'unsigned'
to 'int' to avoid bare use of 'unsigned', changing it to 'int' makes
goodix_i2c_write()' prototype consistent with goodix_i2c_read().

Reviewed-by: Bastien Nocera <hadess@hadess.net>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20210920150643.155872-2-hdegoede@redhat.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-20 22:00:22 -07:00
Linus Torvalds
765092e4cd Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov:

 - several device tree bindings for input devices have been converted to
   yaml

 - dropped no longer used ixp4xx-beeper and CSR Prima2 PWRC drivers

 - analog joystick has been converted to use ktime API and no longer
   warn about low resolution timers

 - a few driver fixes

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (24 commits)
  Input: analog - always use ktime functions
  Input: mms114 - support MMS134S
  Input: elan_i2c - reduce the resume time for controller in Whitebox
  Input: edt-ft5x06 - added case for EDT EP0110M09
  Input: adc-keys - drop bogus __refdata annotation
  Input: Fix spelling mistake in Kconfig "useable" -> "usable"
  Input: Fix spelling mistake in Kconfig "Modul" -> "Module"
  Input: remove dead CSR Prima2 PWRC driver
  Input: adp5589-keys - use the right header
  Input: adp5588-keys - use the right header
  dt-bindings: input: tsc2005: Convert to YAML schema
  Input: ep93xx_keypad - prepare clock before using it
  dt-bindings: input: sun4i-lradc: Add wakeup-source
  dt-bindings: input: Convert Regulator Haptic binding to a schema
  dt-bindings: input: Convert Pixcir Touchscreen binding to a schema
  dt-bindings: input: Convert ChipOne ICN8318 binding to a schema
  Input: pm8941-pwrkey - fix comma vs semicolon issue
  dt-bindings: power: reset: qcom-pon: Convert qcom PON binding to yaml
  dt-bindings: input: pm8941-pwrkey: Convert pm8941 power key binding to yaml
  dt-bindings: power: reset: Change 'additionalProperties' to true
  ...
2021-09-11 09:08:28 -07:00
Daniel Mack
845ef3a7ce Input: ads7846 - switch to devm initialization
This simplies the code a lot and fixes some potential resource leaks in
the error return paths.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Link: https://lore.kernel.org/r/20210907200726.2034962-4-daniel@zonque.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-09 21:30:02 -07:00
Daniel Mack
937f5d5ec6 Input: ads7846 - remove custom filter handling functions from pdata
The functions in the platform data struct to initialize, cleanup and
apply custom filters are not in use by any mainline board.

Remove support for them to pave the road for more cleanups to come.

The enum was moved as it has no users outside of the driver code
itself.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20210907200726.2034962-3-daniel@zonque.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-09 21:30:01 -07:00
Daniel Mack
de609b56b8 Input: ads7846 - add short-hand for spi->dev in probe() function
This will make the code a bit more terse.
No functional change intended.

Signed-off-by: Daniel Mack <daniel@zonque.org>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20210907200726.2034962-2-daniel@zonque.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-09 21:29:59 -07:00
Linus Walleij
ab10867819 Input: mms114 - support MMS134S
The MMS134S like the MMS136 has an event size of 6 bytes.

After this patch, the touchscreen on the Samsung SGH-I407
works fine with PostmarketOS.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210706235951.189289-1-linus.walleij@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-06 23:33:26 -07:00
simba.hsu
d5f9c43d41 Input: raydium_i2c_ts - read device version in bootloader mode
Add support reading device ID when controller is in bootloader mode, which
may happen if firmware update has been interrupted.

Signed-off-by: simba.hsu <simba.hsu@rad-ic.com>
Link: https://lore.kernel.org/r/20210818063644.8654-1-simba.hsu@rad-ic.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-05 19:42:43 -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
Dmitry Torokhov
8be98d2f2a Merge branch 'next' into for-linus
Prepare input updates for 5.15 merge window.
2021-09-05 18:58:05 -07:00
Colin Ian King
ca595ac271 Input: Fix spelling mistake in Kconfig "Modul" -> "Module"
There is a spelling mistake in the Kconfig text. Fix it.

Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210704095702.37567-1-colin.king@canonical.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-09-03 23:49:55 -07:00
Dmitry Torokhov
320424c7d4 Linux 5.13
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmDY+dceHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGx1YH/idbXKwfQkBpBCud
 BvUo2RaRetACEXo38ydiHNxSyAkde79AVMNDXWCBgnWFwpUG51TtFIAn2VhVIv7d
 WlBJPWhbmHwddQB+HACYXsRcBRCc2md7RufOqR/yulx+T8QxQy7yHEd7wOlSdYWC
 /BUb/94qREK60FwdWjATSdqO5ditOd5XxvBnfGh04iUmiMRwubOtYPfaomo9MIK6
 Qs/Yt6SkIROi9cMQf2NakE2UFeVnQ+/TrDTRsTqokUtLSzpjxDjX39JoRNjLVgS1
 XOhrOlUQ+sJ1O1Hq4vSfy8maWivzF9XCCsApd6+Ks1yMB6yw15kU7cQ2yF++UPvC
 ktrHsiM=
 =I8Bu
 -----END PGP SIGNATURE-----

Merge tag 'v5.13' into next

Sync up with the mainline to get the latest parport API.
2021-07-18 18:56:58 -07:00
Linus Torvalds
1f89a590b2 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input
Pull input updates from Dmitry Torokhov:

 - a new driver for SparkFun Qwiic Joystick

 - pm8941-pwrkey driver now supports PMK8350

 - a bunch of assorted driver fixes

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (44 commits)
  Input: joydev - prevent use of not validated data in JSIOCSBTNMAP ioctl
  Input: hideep - fix the uninitialized use in hideep_nvm_unlock()
  Input: trackpoint - use kobj_to_dev()
  Input: atkbd - use kobj_to_dev()
  Input: tsc200x-core - use kobj_to_dev()
  Input: ims-pcu - use kobj_to_dev()
  Input: cros_ec_keyb - use kobj_to_dev() API
  dt-bindings: input: touchscreen: st1232: Convert to json-schema
  Input: i8042 - fix typos in comments
  Input: add SparkFun Qwiic Joystick driver
  dt-bindings: Add vendor prefix and bindings for Qwiic Joystick
  Input: cy8ctmg110_ts - switch to using gpiod API
  Input: cy8ctmg110_ts - switch to using managed resources
  Input: cy8ctmg110_ts - use endian helpers when converting data on wire
  Input: cy8ctmg110_ts - let I2C core configure wake interrupt
  Input: cy8ctmg110_ts - do not hardcode as wakeup source
  Input: cy8ctmg110_ts - do not hard code interrupt trigger
  Input: cy8ctmg110_ts - rely on platform code to supply interrupt
  Input: resistive-adc-touch - fix uninitialized variable 'press'
  Input: pm8941-pwrkey - add support for PMK8350 PON_HLOS PMIC peripheral
  ...
2021-07-05 11:42:45 -07:00
Dmitry Torokhov
818b265889 Merge branch 'next' into for-linus
Prepare input updates for 5.14 merge window.
2021-07-04 23:05:31 -07:00
Yizhuo Zhai
cac7100d4c Input: hideep - fix the uninitialized use in hideep_nvm_unlock()
Inside function hideep_nvm_unlock(), variable "unmask_code" could
be uninitialized if hideep_pgm_r_reg() returns error, however, it
is used in the later if statement after an "and" operation, which
is potentially unsafe.

Signed-off-by: Yizhuo <yzhai003@ucr.edu>
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-19 22:36:28 -07:00
YueHaibing
6ffd4c7964 Input: tsc200x-core - use kobj_to_dev()
Use kobj_to_dev() instead of container_of()

Generated by: scripts/coccinelle/api/kobj_to_dev.cocci

Signed-off-by: YueHaibing <yuehaibing@huawei.com>
Link: https://lore.kernel.org/r/20210607122451.36708-1-yuehaibing@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-19 22:36:23 -07:00
Dmitry Torokhov
83b41248ed Input: cy8ctmg110_ts - switch to using gpiod API
Instead of legacy gpio API let's use newer gpiod API. This also allows us
to get rid of platform data.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210603043726.3793876-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-05 20:34:16 -07:00
Dmitry Torokhov
4e5220cb8e Input: cy8ctmg110_ts - switch to using managed resources
This simplifies error handling paths and allows to get rid of
cy8ctmg110_remove() method.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210603043726.3793876-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-05 20:34:14 -07:00
Dmitry Torokhov
1c68b7cfd1 Input: cy8ctmg110_ts - use endian helpers when converting data on wire
Switch to using be16_to_cpup() instead of shifting and combining data by
hand.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210603043726.3793876-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-05 20:34:12 -07:00
Dmitry Torokhov
172b07a6ea Input: cy8ctmg110_ts - let I2C core configure wake interrupt
I2C core already configures interrupt as wakeup source when device is
registered using I2C_CLIENT_WAKE flag, so let's rely on it instead of
configuring it ourselves.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210603043726.3793876-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-05 20:34:11 -07:00
Dmitry Torokhov
2a15cebb8b Input: cy8ctmg110_ts - do not hardcode as wakeup source
Let platform specify whether the controller should be a wakeup source
by registering as I2C_CLIENT_WAKE.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210603043726.3793876-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-05 20:34:09 -07:00
Dmitry Torokhov
9a9b1a7b2b Input: cy8ctmg110_ts - do not hard code interrupt trigger
Rely on the platform to set up interrupt polarity/type properly instead
of hard-coding falling edge.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210603043726.3793876-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-05 20:34:08 -07:00
Dmitry Torokhov
6abee58203 Input: cy8ctmg110_ts - rely on platform code to supply interrupt
Instead of using platform data to specify GPIO that is used as interrupt
source, rely on the platform and I2C core to set it up properly.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210603043726.3793876-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-05 20:34:06 -07:00
Colin Ian King
6cdc1ef84e Input: resistive-adc-touch - fix uninitialized variable 'press'
In the case where st->ch_map[GRTS_CH_PRESSURE] < GRTS_MAX_CHANNELS is false
and also st->ch_map[GRTS_CH_Z1] < GRTS_MAX_CHANNELS is false the variable
press is not initialized and contains garbage. In this situation
st->pressure is also false, so we do not actually use press value, but
it is impossible for the compiler to realize this, and it emits
"uninitialized variable" warning. Fix this by initializing press
to 0 and allows us to also remove an else clause that sets press to 0.

Addresses-Coverity: ("Uninitialized scalar variable")
Fixes: 60b7db914d ("Input: resistive-adc-touch - rework mapping of channels")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Link: https://lore.kernel.org/r/20210603220809.155118-1-colin.king@canonical.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-05 16:41:08 -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
d27ac0fba7 Input: cyttsp - remove public header
There is nothing in include/linux/input/cyttsp.h that might be of interes
to the kernel at large, so let's move this information into the driver
code and remove the header.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210531052307.1433979-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-01 21:13:11 -07:00
Dmitry Torokhov
60b7db914d Input: resistive-adc-touch - rework mapping of channels
Instead of iterating over channels establish and use channel map to
retrieve data. As a side effect this will silence "uninitialized variable"
warnings.

Tested-by: Oleksij Rempel <o.rempel@pengutronix.de>
Link: https://lore.kernel.org/r/YLXR2brkc4H54xtK@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2021-06-01 15:19:52 -07:00