linux-block.git
4 months agoInput: edt-ft5x06 - add support for FocalTech FT5452 and FT8719
Joel Selvaraj [Tue, 21 May 2024 14:02:58 +0000 (09:02 -0500)]
Input: edt-ft5x06 - add support for FocalTech FT5452 and FT8719

The driver is compatible with FocalTech FT5452 and FT8719 touchscreens
too. FT5452 supports up to 5 touch points. FT8719 supports up to 10 touch
points. Add compatible data for both of them.

Signed-off-by: Joel Selvaraj <joelselvaraj.oss@gmail.com>
Link: https://lore.kernel.org/r/20240521-add-support-ft5452-and-ft8719-touchscreen-v1-2-2a648ac7176b@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
4 months agodt-bindings: input: touchscreen: edt-ft5x06: Document FT5452 and FT8719 support
Joel Selvaraj [Tue, 21 May 2024 14:02:57 +0000 (09:02 -0500)]
dt-bindings: input: touchscreen: edt-ft5x06: Document FT5452 and FT8719 support

Document FocalTech FT5452 and FT8719 support by adding their compatibles.

Signed-off-by: Joel Selvaraj <joelselvaraj.oss@gmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240521-add-support-ft5452-and-ft8719-touchscreen-v1-1-2a648ac7176b@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
4 months agoInput: xpad - add support for Machenike G5 Pro Controller
Kirill Artemev [Thu, 16 May 2024 03:29:27 +0000 (08:29 +0500)]
Input: xpad - add support for Machenike G5 Pro Controller

Add VID and PID to the xpad_device and VID to the xpad_table
to allow driver to use Machenike G5 Pro Controller, which is
XTYPE_XBOX360 compatible in Xinput mode.

Signed-off-by: Kirill Artemev <artewar6767@gmail.com>
Link: https://lore.kernel.org/r/20240516032926.12501-2-artewar6767@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
4 months agoInput: try trimming too long modalias strings
Dmitry Torokhov [Mon, 29 Apr 2024 21:50:41 +0000 (14:50 -0700)]
Input: try trimming too long modalias strings

If an input device declares too many capability bits then modalias
string for such device may become too long and not fit into uevent
buffer, resulting in failure of sending said uevent. This, in turn,
may prevent userspace from recognizing existence of such devices.

This is typically not a concern for real hardware devices as they have
limited number of keys, but happen with synthetic devices such as
ones created by xen-kbdfront driver, which creates devices as being
capable of delivering all possible keys, since it doesn't know what
keys the backend may produce.

To deal with such devices input core will attempt to trim key data,
in the hope that the rest of modalias string will fit in the given
buffer. When trimming key data it will indicate that it is not
complete by placing "+," sign, resulting in conversions like this:

old: k71,72,73,74,78,7A,7B,7C,7D,8E,9E,A4,AD,E0,E1,E4,F8,174,
new: k71,72,73,74,78,7A,7B,7C,+,

This should allow existing udev rules continue to work with existing
devices, and will also allow writing more complex rules that would
recognize trimmed modalias and check input device characteristics by
other means (for example by parsing KEY= data in uevent or parsing
input device sysfs attributes).

Note that the driver core may try adding more uevent environment
variables once input core is done adding its own, so when forming
modalias we can not use the entire available buffer, so we reduce
it by somewhat an arbitrary amount (96 bytes).

Reported-by: Jason Andryuk <jandryuk@gmail.com>
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Tested-by: Jason Andryuk <jandryuk@gmail.com>
Link: https://lore.kernel.org/r/ZjAWMQCJdrxZkvkB@google.com
Cc: stable@vger.kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
4 months agoInput: drop explicit initialization of struct i2c_device_id::driver_data to 0
Uwe Kleine-König [Thu, 9 May 2024 17:41:59 +0000 (19:41 +0200)]
Input: drop explicit initialization of struct i2c_device_id::driver_data to 0

These drivers don't use the driver_data member of struct i2c_device_id,
so don't explicitly initialize this member.

This prepares putting driver_data in an anonymous union which requires
either no initialization or named designators. But it's also a nice
cleanup on its own.

While add it, also remove commas after the sentinel entries.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Link: https://lore.kernel.org/r/20240509174158.2211071-2-u.kleine-koenig@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
4 months agoInput: zet6223 - remove an unused field in struct zet6223_ts
Christophe JAILLET [Sun, 12 May 2024 09:58:00 +0000 (11:58 +0200)]
Input: zet6223 - remove an unused field in struct zet6223_ts

In "struct zet6223_ts", the 'vcc' and 'vio' fields are unused.

So, remove them.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/3065d885341e2730dd3e7905d75514796a8c25e4.1715507858.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
4 months agoInput: chipone_icn8505 - remove an unused field in struct icn8505_data
Christophe JAILLET [Sun, 12 May 2024 08:25:17 +0000 (10:25 +0200)]
Input: chipone_icn8505 - remove an unused field in struct icn8505_data

In "struct icn8505_data", the 'wake_gpio' field is unused.
There is also nothing about gpio neither in this driver nor in the
data-sheet.

So, remove it.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/37443a675ca07c91c5f0118ce255406e6e3c08f5.1715502304.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: cros_ec_keyb - remove an unused field in struct cros_ec_keyb
Christophe JAILLET [Wed, 1 May 2024 06:49:47 +0000 (08:49 +0200)]
Input: cros_ec_keyb - remove an unused field in struct cros_ec_keyb

In "struct cros_ec_keyb", the 'keymap_data' field is unused.
Remove it.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/6bab1449c01c4537aa2d9cb4481e1d5da8aa2389.1714546173.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: lpc32xx-keys - remove an unused field in struct lpc32xx_kscan_drv
Christophe JAILLET [Wed, 1 May 2024 06:39:23 +0000 (08:39 +0200)]
Input: lpc32xx-keys - remove an unused field in struct lpc32xx_kscan_drv

In "struct lpc32xx_kscan_drv", the 'irq' field is unused.
Remove it.

Found with cppcheck, unusedStructMember.

While at it, move the 'row_shift' field in order to fill a hole in the
structure (at least on 64 bits arch).

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/e006dfb77e35762c6e4f8ba6ba792b0c52fde375.1714545542.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: matrix_keypad - remove an unused field in struct matrix_keypad
Christophe JAILLET [Wed, 1 May 2024 05:41:21 +0000 (07:41 +0200)]
Input: matrix_keypad - remove an unused field in struct matrix_keypad

In "struct matrix_keypad", the 'gpio_all_disabled' field is unused.
Remove it.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/4f1a946789445500b6118b9ee1d6ef5255f8c696.1714542052.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: tca6416-keypad - remove unused struct tca6416_drv_data
Christophe JAILLET [Wed, 1 May 2024 05:30:55 +0000 (07:30 +0200)]
Input: tca6416-keypad - remove unused struct tca6416_drv_data

"struct tca6416_drv_data" is unused.
Remove it.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/3e6fd1d0875ef3c90ecaab7adf7fd4a5e8e6f708.1714541432.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: tca6416-keypad - remove an unused field in struct tca6416_keypad_chip
Christophe JAILLET [Wed, 1 May 2024 05:30:54 +0000 (07:30 +0200)]
Input: tca6416-keypad - remove an unused field in struct tca6416_keypad_chip

In "struct tca6416_keypad_chip", the 'irqnum' field is unused.
Remove it.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/926c0f40040671565dcc54d5146a8f9511fb6d46.1714541432.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: da7280 - remove an unused field in struct da7280_haptic
Christophe JAILLET [Wed, 1 May 2024 05:05:05 +0000 (07:05 +0200)]
Input: da7280 - remove an unused field in struct da7280_haptic

In "struct da7280_haptic", the 'legacy' field is unused.
Remove it.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/ac251b456933bcc6fe297b738f9304bd259185c1.1714539865.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: ff-core - prefer struct_size over open coded arithmetic
Erick Archer [Sat, 27 Apr 2024 15:05:56 +0000 (17:05 +0200)]
Input: ff-core - prefer struct_size over open coded arithmetic

This is an effort to get rid of all multiplications from allocation
functions in order to prevent integer overflows [1][2].

As the "ff" variable is a pointer to "struct ff_device" and this
structure ends in a flexible array:

struct ff_device {
[...]
struct file *effect_owners[] __counted_by(max_effects);
};

the preferred way in the kernel is to use the struct_size() helper to
do the arithmetic instead of the calculation "size + count * size" in
the kzalloc() function.

The struct_size() helper returns SIZE_MAX on overflow. So, refactor
the comparison to take advantage of this.

This way, the code is more readable and safer.

This code was detected with the help of Coccinelle, and audited and
modified manually.

Link: https://www.kernel.org/doc/html/latest/process/deprecated.html#open-coded-arithmetic-in-allocator-arguments
Link: https://github.com/KSPP/linux/issues/160
Signed-off-by: Erick Archer <erick.archer@outlook.com>
Reviewed-by: Kees Cook <keescook@chromium.org>
Link: https://lore.kernel.org/r/AS8PR02MB72371E646714BAE2E51A6A378B152@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: cyapa - add missing input core locking to suspend/resume functions
Marek Szyprowski [Mon, 9 Oct 2023 12:10:18 +0000 (14:10 +0200)]
Input: cyapa - add missing input core locking to suspend/resume functions

Grab input->mutex during suspend/resume functions like it is done in
other input drivers. This fixes the following warning during system
suspend/resume cycle on Samsung Exynos5250-based Snow Chromebook:

------------[ cut here ]------------
WARNING: CPU: 1 PID: 1680 at drivers/input/input.c:2291 input_device_enabled+0x68/0x6c
Modules linked in: ...
CPU: 1 PID: 1680 Comm: kworker/u4:12 Tainted: G        W          6.6.0-rc5-next-20231009 #14109
Hardware name: Samsung Exynos (Flattened Device Tree)
Workqueue: events_unbound async_run_entry_fn
 unwind_backtrace from show_stack+0x10/0x14
 show_stack from dump_stack_lvl+0x58/0x70
 dump_stack_lvl from __warn+0x1a8/0x1cc
 __warn from warn_slowpath_fmt+0x18c/0x1b4
 warn_slowpath_fmt from input_device_enabled+0x68/0x6c
 input_device_enabled from cyapa_gen3_set_power_mode+0x13c/0x1dc
 cyapa_gen3_set_power_mode from cyapa_reinitialize+0x10c/0x15c
 cyapa_reinitialize from cyapa_resume+0x48/0x98
 cyapa_resume from dpm_run_callback+0x90/0x298
 dpm_run_callback from device_resume+0xb4/0x258
 device_resume from async_resume+0x20/0x64
 async_resume from async_run_entry_fn+0x40/0x15c
 async_run_entry_fn from process_scheduled_works+0xbc/0x6a8
 process_scheduled_works from worker_thread+0x188/0x454
 worker_thread from kthread+0x108/0x140
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xf1625fb0 to 0xf1625ff8)
...
---[ end trace 0000000000000000 ]---
...
------------[ cut here ]------------
WARNING: CPU: 1 PID: 1680 at drivers/input/input.c:2291 input_device_enabled+0x68/0x6c
Modules linked in: ...
CPU: 1 PID: 1680 Comm: kworker/u4:12 Tainted: G        W          6.6.0-rc5-next-20231009 #14109
Hardware name: Samsung Exynos (Flattened Device Tree)
Workqueue: events_unbound async_run_entry_fn
 unwind_backtrace from show_stack+0x10/0x14
 show_stack from dump_stack_lvl+0x58/0x70
 dump_stack_lvl from __warn+0x1a8/0x1cc
 __warn from warn_slowpath_fmt+0x18c/0x1b4
 warn_slowpath_fmt from input_device_enabled+0x68/0x6c
 input_device_enabled from cyapa_gen3_set_power_mode+0x13c/0x1dc
 cyapa_gen3_set_power_mode from cyapa_reinitialize+0x10c/0x15c
 cyapa_reinitialize from cyapa_resume+0x48/0x98
 cyapa_resume from dpm_run_callback+0x90/0x298
 dpm_run_callback from device_resume+0xb4/0x258
 device_resume from async_resume+0x20/0x64
 async_resume from async_run_entry_fn+0x40/0x15c
 async_run_entry_fn from process_scheduled_works+0xbc/0x6a8
 process_scheduled_works from worker_thread+0x188/0x454
 worker_thread from kthread+0x108/0x140
 kthread from ret_from_fork+0x14/0x28
Exception stack(0xf1625fb0 to 0xf1625ff8)
...
---[ end trace 0000000000000000 ]---

Fixes: d69f0a43c677 ("Input: use input_device_enabled()")
Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Andrzej Pietrasiewicz <andrzej.p@collabora.com>
Link: https://lore.kernel.org/r/20231009121018.1075318-1-m.szyprowski@samsung.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoinput: pm8xxx-vibrator: add new SPMI vibrator support
Fenglin Wu [Tue, 16 Apr 2024 02:44:34 +0000 (10:44 +0800)]
input: pm8xxx-vibrator: add new SPMI vibrator support

Add support for a new SPMI vibrator module which is very similar
to the vibrator module inside PM8916 but has a finer drive voltage
step and different output voltage range, its drive level control
is expanded across 2 registers. The vibrator module can be found
in following Qualcomm PMICs: PMI632, PM7250B, PM7325B, PM7550BA.

Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Link: https://lore.kernel.org/r/20240416-pm8xxx-vibrator-new-design-v11-3-7b1c951e1515@quicinc.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agodt-bindings: input: qcom,pm8xxx-vib: add new SPMI vibrator module
Fenglin Wu [Tue, 16 Apr 2024 02:44:33 +0000 (10:44 +0800)]
dt-bindings: input: qcom,pm8xxx-vib: add new SPMI vibrator module

Add compatible strings to support vibrator module inside PMI632,
PMI7250B, PM7325B, PM7550BA.

Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Link: https://lore.kernel.org/r/20240416-pm8xxx-vibrator-new-design-v11-2-7b1c951e1515@quicinc.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoinput: pm8xxx-vibrator: refactor to support new SPMI vibrator
Fenglin Wu [Tue, 16 Apr 2024 02:44:32 +0000 (10:44 +0800)]
input: pm8xxx-vibrator: refactor to support new SPMI vibrator

Currently, vibrator control register addresses are hard coded,
including the base address and offsets, it's not flexible to
support new SPMI vibrator module which is usually included in
different PMICs with different base address. Refactor it by using
the base address defined in devicetree.

Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240416-pm8xxx-vibrator-new-design-v11-1-7b1c951e1515@quicinc.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation
Fenglin Wu [Mon, 15 Apr 2024 23:03:40 +0000 (16:03 -0700)]
Input: pm8xxx-vibrator - correct VIB_MAX_LEVELS calculation

The output voltage is inclusive hence the max level calculation is
off-by-one-step. Correct it.

iWhile we are at it also add a define for the step size instead of
using the magic value.

Fixes: 11205bb63e5c ("Input: add support for pm8xxx based vibrator driver")
Signed-off-by: Fenglin Wu <quic_fenglinw@quicinc.com>
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org>
Link: https://lore.kernel.org/r/20240412-pm8xxx-vibrator-new-design-v10-1-0ec0ad133866@quicinc.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
5 months agoInput: sur40 - convert le16 to cpu before use
Ricardo Ribalda [Mon, 15 Apr 2024 21:53:03 +0000 (14:53 -0700)]
Input: sur40 - convert le16 to cpu before use

Smatch found this issue:
drivers/input/touchscreen/sur40.c:424:55: warning: incorrect type in argument 2 (different base types)
drivers/input/touchscreen/sur40.c:424:55:    expected int key
drivers/input/touchscreen/sur40.c:424:55:    got restricted __le16 [usertype] blob_id

Signed-off-by: Ricardo Ribalda <ribalda@chromium.org>
Link: https://lore.kernel.org/r/20240410-smatch-v1-6-785d009a852b@chromium.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: adafruit-seesaw - only report buttons that changed state
Dmitry Torokhov [Thu, 11 Jan 2024 07:13:01 +0000 (23:13 -0800)]
Input: adafruit-seesaw - only report buttons that changed state

If a button has not changed its state when we poll the device the
driver does not need to report it. While duplicate events will be
filtered out by the input core anyway we can do it very cheaply
directly in the driver.

Link: https://lore.kernel.org/r/ZZ-U_bmZpIdoYA6c@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: ioc3kbd - add device table
Karel Balej [Fri, 15 Mar 2024 19:46:14 +0000 (12:46 -0700)]
Input: ioc3kbd - add device table

Without the device table the driver will not auto-load when compiled as
a module.

Fixes: 273db8f03509 ("Input: add IOC3 serio driver")
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Link: https://lore.kernel.org/r/20240313115832.8052-1-balejk@matfyz.cz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: ims-pcu - fix printf string overflow
Arnd Bergmann [Thu, 28 Mar 2024 20:28:56 +0000 (13:28 -0700)]
Input: ims-pcu - fix printf string overflow

clang warns about a string overflow in this driver

drivers/input/misc/ims-pcu.c:1802:2: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 12 [-Werror,-Wformat-truncation]
drivers/input/misc/ims-pcu.c:1814:2: error: 'snprintf' will always be truncated; specified size is 10, but format string expands to at least 12 [-Werror,-Wformat-truncation]

Make the buffer a little longer to ensure it always fits.

Fixes: 628329d52474 ("Input: add IMS Passenger Control Unit driver")
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/20240326223825.4084412-7-arnd@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: stmpe - drop driver owner assignment
Krzysztof Kozlowski [Wed, 27 Mar 2024 17:46:55 +0000 (18:46 +0100)]
Input: stmpe - drop driver owner assignment

Core in platform_driver_register() already sets the .owner, so driver
does not need to.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240327174655.519503-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: xpad - add support for Snakebyte GAMEPADs
Matt Scialabba [Fri, 15 Mar 2024 18:56:19 +0000 (11:56 -0700)]
Input: xpad - add support for Snakebyte GAMEPADs

Add Snakebyte GAMEPAD BASE X and Snakebyte GAMEPAD RGB X to the list
of supported devices.

Signed-off-by: Matt Scialabba <matt.git@fastmail.fm>
Link: https://lore.kernel.org/r/efbfb428-06b0-48f9-8701-db291c2a9d65@app.fastmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agodt-bindings: input: samsung,s3c6410-keypad: convert to DT Schema
Krzysztof Kozlowski [Tue, 12 Mar 2024 18:30:01 +0000 (19:30 +0100)]
dt-bindings: input: samsung,s3c6410-keypad: convert to DT Schema

Convert Samsung SoC Keypad bindings to DT schema with changes:
1. Rename "linux,keypad-no-autorepeat" property to
   "linux,input-no-autorepeat", because the latter was implemented in
   the Linux driver.
2. Add clocks and clock-names, already used by DTS and the Linux driver.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20240312183001.714626-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: imagis - add touch key support
Duje Mihanović [Sun, 10 Mar 2024 05:19:06 +0000 (21:19 -0800)]
Input: imagis - add touch key support

IST3032C (and possibly some other models) has touch keys. Add support
for them to the imagis driver.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
Link: https://lore.kernel.org/r/20240306-b4-imagis-keys-v3-3-2c429afa8420@skole.hr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agodt-bindings: input: imagis: Document touch keys
Duje Mihanović [Sun, 10 Mar 2024 05:18:55 +0000 (21:18 -0800)]
dt-bindings: input: imagis: Document touch keys

IST3032C (and possibly some other models) has touch keys. Document this.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240306-b4-imagis-keys-v3-2-2c429afa8420@skole.hr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: imagis - use FIELD_GET where applicable
Duje Mihanović [Sun, 10 Mar 2024 05:18:05 +0000 (21:18 -0800)]
Input: imagis - use FIELD_GET where applicable

Instead of manually extracting certain bits from registers with binary
ANDs and shifts, the FIELD_GET macro can be used. With this in mind, the
*_SHIFT macros can be dropped.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
Link: https://lore.kernel.org/r/20240306-b4-imagis-keys-v3-1-2c429afa8420@skole.hr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
6 months agoInput: make input_class constant
Ricardo B. Marliere [Sun, 10 Mar 2024 05:10:08 +0000 (21:10 -0800)]
Input: make input_class constant

Since commit 43a7206b0963 ("driver core: class: make class_register() take
a const *"), the driver core allows for struct class to be in read-only
memory, so move the input_class structure to be declared at build time
placing it into read-only memory, instead of having to be dynamically
allocated at boot time.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240305-class_cleanup-input-v1-1-0c3d950c25db@marliere.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agodt-bindings: input: atmel,captouch: convert bindings to YAML
Dharma Balasubiramani [Fri, 9 Feb 2024 06:47:55 +0000 (12:17 +0530)]
dt-bindings: input: atmel,captouch: convert bindings to YAML

Convert the Atmel capacitive touchscreen bindings to YAML format.

Signed-off-by: Dharma Balasubiramani <dharma.b@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240209064755.47516-1-dharma.b@microchip.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: iqs7222 - add support for IQS7222D v1.1 and v1.2
Jeff LaBundy [Thu, 7 Mar 2024 05:40:21 +0000 (23:40 -0600)]
Input: iqs7222 - add support for IQS7222D v1.1 and v1.2

The vendor has introduced two new revisions with slightly different
memory maps; update the driver to support them.

Fixes: dd24e202ac72 ("Input: iqs7222 - add support for Azoteq IQS7222D")
Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/ZelTRYX3fenMQuhF@nixie71
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agodt-bindings: input: allwinner,sun4i-a10-lrad: drop redundant type from label
Krzysztof Kozlowski [Mon, 26 Feb 2024 12:29:34 +0000 (13:29 +0100)]
dt-bindings: input: allwinner,sun4i-a10-lrad: drop redundant type from label

dtschema defines label as string, so $ref in other bindings is
redundant.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Acked-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20240226122934.89257-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: serio - make serio_bus const
Ricardo B. Marliere [Sun, 3 Mar 2024 23:05:42 +0000 (15:05 -0800)]
Input: serio - make serio_bus const

Now that the driver core can properly handle constant struct bus_type,
move the serio_bus variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240210-bus_cleanup-input2-v1-2-0daef7e034e0@marliere.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: synaptics-rmi4 - make rmi_bus_type const
Ricardo B. Marliere [Sun, 3 Mar 2024 23:05:23 +0000 (15:05 -0800)]
Input: synaptics-rmi4 - make rmi_bus_type const

Now that the driver core can properly handle constant struct bus_type,
move the variable rmi_bus_type to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ricardo B. Marliere <ricardo@marliere.net>
Link: https://lore.kernel.org/r/20240210-bus_cleanup-input2-v1-1-0daef7e034e0@marliere.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: xilinx_ps2 - fix kernel-doc for xps2_of_probe function
Yang Li [Sun, 3 Mar 2024 23:02:08 +0000 (15:02 -0800)]
Input: xilinx_ps2 - fix kernel-doc for xps2_of_probe function

The existing comment block above the xps2_of_probe function
does not conform to the kernel-doc standard. This patch fixes the
documentation to match the expected kernel-doc format, which includes
a structured documentation header with param and return value.

Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Reviewed-by: Michal Simek <michal.simek@amd.com>
Link: https://lore.kernel.org/r/20240301092115.123092-1-yang.lee@linux.alibaba.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoinput/touchscreen: imagis: add support for IST3032C
Karel Balej [Fri, 1 Mar 2024 16:41:04 +0000 (17:41 +0100)]
input/touchscreen: imagis: add support for IST3032C

IST3032C is a touchscreen chip used for instance in the
samsung,coreprimevelte smartphone, with which this was tested. Add the
chip specific information to the driver.

Reviewed-by: Markuss Broks <markuss.broks@gmail.com>
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Link: https://lore.kernel.org/r/20240301164659.13240-6-karelb@gimli.ms.mff.cuni.cz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agodt-bindings: input/touchscreen: imagis: add compatible for IST3032C
Karel Balej [Fri, 1 Mar 2024 16:41:03 +0000 (17:41 +0100)]
dt-bindings: input/touchscreen: imagis: add compatible for IST3032C

IST3032C is a touchscreen IC which seems mostly compatible with IST3038C
except that it reports a different chip ID value.

Acked-by: Rob Herring <robh@kernel.org>
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Link: https://lore.kernel.org/r/20240301164659.13240-5-karelb@gimli.ms.mff.cuni.cz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoinput/touchscreen: imagis: Add support for Imagis IST3038B
Markuss Broks [Fri, 1 Mar 2024 16:41:02 +0000 (17:41 +0100)]
input/touchscreen: imagis: Add support for Imagis IST3038B

Imagis IST3038B is another variant of Imagis IST3038 IC, which has
a different register interface from IST3038C (possibly firmware defined).
This should also work for IST3044B (though untested), however other
variants using this interface/protocol(IST3026, IST3032, IST3026B,
IST3032B) have a different format for coordinates, and they'd need
additional effort to be supported by this driver.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Link: https://lore.kernel.org/r/20240301164659.13240-4-karelb@gimli.ms.mff.cuni.cz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agodt-bindings: input/touchscreen: Add compatible for IST3038B
Markuss Broks [Fri, 1 Mar 2024 16:41:01 +0000 (17:41 +0100)]
dt-bindings: input/touchscreen: Add compatible for IST3038B

Imagis IST3038B is a variant (firmware?) of Imagis IST3038 IC
differing from IST3038C in its register interface. Add the
compatible for it to the IST3038C bindings.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
[balejk@matfyz.cz: elaborate chip differences in the commit message]
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Link: https://lore.kernel.org/r/20240301164659.13240-3-karelb@gimli.ms.mff.cuni.cz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoinput/touchscreen: imagis: Correct the maximum touch area value
Markuss Broks [Fri, 1 Mar 2024 16:41:00 +0000 (17:41 +0100)]
input/touchscreen: imagis: Correct the maximum touch area value

As specified in downstream IST3038B driver and proved by testing,
the correct maximum reported value of touch area is 16.

Signed-off-by: Markuss Broks <markuss.broks@gmail.com>
Signed-off-by: Karel Balej <balejk@matfyz.cz>
Link: https://lore.kernel.org/r/20240301164659.13240-2-karelb@gimli.ms.mff.cuni.cz
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: leds - change config symbol dependency for audio mute trigger
Heiner Kallweit [Sun, 3 Mar 2024 22:32:00 +0000 (14:32 -0800)]
Input: leds - change config symbol dependency for audio mute trigger

In a follow-up patch implementation of the LED audio trigger will be
moved to sound/core/snd_ctl_led, including removal of config symbol
LEDS_AUDIO_TRIGGER. Also as of today the audio mute LED trigger
is effectively a no-op w/o config symbol SND_CTL_LED being defined.
Therefore switch the dependency to this config symbol.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Link: https://lore.kernel.org/r/6011ca63-187c-42dd-a5fd-7dd733d6257c@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: ti_am335x_tsc - remove redundant assignment to variable config
Colin Ian King [Thu, 8 Feb 2024 20:01:00 +0000 (12:01 -0800)]
Input: ti_am335x_tsc - remove redundant assignment to variable config

The variable config is being initialized with a value that is never
read, it is being re-assigned in the next statement. The initialization
is redundant and can be removed.

Cleans up clang scan build warning:
drivers/input/touchscreen/ti_am335x_tsc.c:160:2: warning: Value stored
to 'config' is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Link: https://lore.kernel.org/r/20240205215940.1851349-1-colin.i.king@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
7 months agoInput: xpad - sort xpad_device by vendor and product ID
Brenton Simpson [Thu, 8 Feb 2024 19:13:17 +0000 (11:13 -0800)]
Input: xpad - sort xpad_device by vendor and product ID

This helps making sure there are no duplicate entries in the tables.

Signed-off-by: Brenton Simpson <appsforartists@google.com>
Link: https://lore.kernel.org/r/20240130231903.293265-1-appsforartists@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: gameport - make gameport_bus const
Ricardo B. Marliere [Sun, 4 Feb 2024 19:56:34 +0000 (16:56 -0300)]
Input: gameport - make gameport_bus const

Now that the driver core can properly handle constant struct bus_type,
move the gameport_bus variable to be a constant structure as well,
placing it into read-only memory which can not be modified at runtime.

Suggested-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: "Ricardo B. Marliere" <ricardo@marliere.net>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240204-bus_cleanup-input-v1-1-74c2438801cf@marliere.net
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: matrix_keypad - switch to using managed resources
Dmitry Torokhov [Sun, 21 Jan 2024 05:32:30 +0000 (21:32 -0800)]
Input: matrix_keypad - switch to using managed resources

Switch the drivers to use managed resources (devm) to simplify error
handling and remove the need to have remove() implementation.

Link: https://lore.kernel.org/r/20240121053232.276968-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: matrix_keypad - consolidate handling of clustered interrupt
Dmitry Torokhov [Sun, 21 Jan 2024 05:32:29 +0000 (21:32 -0800)]
Input: matrix_keypad - consolidate handling of clustered interrupt

Now that the driver stores interrupt numbers corresponding to individual
GPIOs in non-clustered mode, it is possible to unify handling of both
modes by storing clustered interrupt at position 0 and setting the
number of interrupts in this case to 1.

Link: https://lore.kernel.org/r/20240121053232.276968-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: matrix_keypad - avoid repeatedly converting GPIO to IRQ
Dmitry Torokhov [Sun, 21 Jan 2024 05:32:28 +0000 (21:32 -0800)]
Input: matrix_keypad - avoid repeatedly converting GPIO to IRQ

There is no need to do conversion from GPIOs to interrupt numbers.
Convert row GPIOs to interrupt numbers once in probe() and use
this information when the driver needs to enable or disable given
interrupt line.

Link: https://lore.kernel.org/r/20240121053232.276968-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: goodix-berlin - add SPI support for Goodix Berlin Touchscreen IC
Neil Armstrong [Mon, 29 Jan 2024 09:16:38 +0000 (10:16 +0100)]
Input: goodix-berlin - add SPI support for Goodix Berlin Touchscreen IC

Add initial support for the new Goodix "Berlin" touchscreen ICs
over the SPI interface.

The driver doesn't use the regmap_spi code since the SPI messages
needs to be prefixed, thus this custom regmap code.

This initial driver is derived from the Goodix goodix_ts_berlin
available at [1] and [2] and only supports the GT9916 IC
present on the Qualcomm SM8550 MTP & QRD touch panel.

The current implementation only supports BerlinD, aka GT9916.

[1] https://github.com/goodix/goodix_ts_berlin
[2] https://git.codelinaro.org/clo/la/platform/vendor/opensource/touch-drivers

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240129-topic-goodix-berlin-upstream-initial-v15-4-6f7d096c0a0a@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: goodix-berlin - add I2C support for Goodix Berlin Touchscreen IC
Neil Armstrong [Mon, 29 Jan 2024 09:16:37 +0000 (10:16 +0100)]
Input: goodix-berlin - add I2C support for Goodix Berlin Touchscreen IC

Add initial support for the new Goodix "Berlin" touchscreen ICs
over the I2C interface.

This initial driver is derived from the Goodix goodix_ts_berlin
available at [1] and [2] and only supports the GT9916 IC
present on the Qualcomm SM8550 MTP & QRD touch panel.

The current implementation only supports BerlinD, aka GT9916.

[1] https://github.com/goodix/goodix_ts_berlin
[2] https://git.codelinaro.org/clo/la/platform/vendor/opensource/touch-drivers

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240129-topic-goodix-berlin-upstream-initial-v15-3-6f7d096c0a0a@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: add core support for Goodix Berlin Touchscreen IC
Neil Armstrong [Mon, 29 Jan 2024 09:16:36 +0000 (10:16 +0100)]
Input: add core support for Goodix Berlin Touchscreen IC

Add initial support for the new Goodix "Berlin" touchscreen ICs.

These touchscreen ICs support SPI, I2C and I3C interface, up to
10 finger touch, stylus and gestures events.

This initial driver is derived from the Goodix goodix_ts_berlin
available at [1] and [2] and only supports the GT9916 IC
present on the Qualcomm SM8550 MTP & QRD touch panel.

The current implementation only supports BerlinD, aka GT9916.

Support for advanced features like:
- Firmware & config update
- Stylus events
- Gestures events
- Previous revisions support (BerlinA or BerlinB)
is not included in current version.

The current support will work with currently flashed firmware
and config, and bail out if firmware or config aren't flashed yet.

[1] https://github.com/goodix/goodix_ts_berlin
[2] https://git.codelinaro.org/clo/la/platform/vendor/opensource/touch-drivers

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240129-topic-goodix-berlin-upstream-initial-v15-2-6f7d096c0a0a@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agodt-bindings: input: document Goodix Berlin Touchscreen IC
Neil Armstrong [Mon, 29 Jan 2024 09:16:35 +0000 (10:16 +0100)]
dt-bindings: input: document Goodix Berlin Touchscreen IC

Document the Goodix GT9916 wich is part of the "Berlin" serie
of Touchscreen controllers IC from Goodix.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20240129-topic-goodix-berlin-upstream-initial-v15-1-6f7d096c0a0a@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agodt-bindings: input: melfas,mms114: add MMS252 compatible
Luca Weiss [Tue, 23 Jan 2024 03:33:35 +0000 (19:33 -0800)]
dt-bindings: input: melfas,mms114: add MMS252 compatible

Add a compatible for MMS252 touchscreen which appears to work fine with
the MMS114 driver.

Signed-off-by: Luca Weiss <luca@z3ntu.xyz>
Signed-off-by: Bryant Mairs <bryant@mai.rs>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231105204759.37107-2-bryant@mai.rs
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: 88pm80x_onkey - add SPDX and drop GPL boilerplate
Duje Mihanović [Mon, 22 Jan 2024 19:13:17 +0000 (11:13 -0800)]
Input: 88pm80x_onkey - add SPDX and drop GPL boilerplate

Add a SPDX-License-Identifier to the 88PM80x onkey driver and drop the
GPL boilerplate in accordance with current kernel code guidelines.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240121-88pm80x-onkey-spdx-v1-1-b646d4749f5b@skole.hr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: leds - set default-trigger for mute
Bernhard Seibold [Sat, 13 Jan 2024 10:37:42 +0000 (11:37 +0100)]
Input: leds - set default-trigger for mute

Set the default-trigger for the mute led to audio-mute.

Signed-off-by: Bernhard Seibold <mail@bernhard-seibold.de>
Link: https://lore.kernel.org/r/20240113103743.97205-1-mail@bernhard-seibold.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agodt-bindings: input: touchscreen: goodix: clarify irq-gpios misleading text
Luca Ceresoli [Tue, 2 Jan 2024 08:19:34 +0000 (09:19 +0100)]
dt-bindings: input: touchscreen: goodix: clarify irq-gpios misleading text

The irq-gpios description misleading, apparently saying that driving the
IRQ GPIO resets the device, which is even more puzzling as there is a reset
GPIO as well.

In reality the IRQ pin can be driven during the reset sequence to configure
the client address, as it becomes clear after checking both the datasheet
and the driver code. Improve the text to clarify that.

Also rephrase to remove reference to the driver, which is not appropriate
in the bindings.

Signed-off-by: Luca Ceresoli <luca.ceresoli@bootlin.com>
Acked-by: Rob Herring <robh@kernel.org>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20240102081934.11293-1-luca.ceresoli@bootlin.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: bcm-keypad - remove redundant of_match_ptr()
Ruan Jinjie [Wed, 9 Aug 2023 10:16:26 +0000 (18:16 +0800)]
Input: bcm-keypad - remove redundant of_match_ptr()

The driver depends on CONFIG_OF, it is not necessary to use
of_match_ptr() here.

Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Link: https://lore.kernel.org/r/20230809101626.2664651-1-ruanjinjie@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agodt-bindings: input: silead,gsl1680: do not override firmware-name $ref
Krzysztof Kozlowski [Mon, 15 Jan 2024 18:20:57 +0000 (19:20 +0100)]
dt-bindings: input: silead,gsl1680: do not override firmware-name $ref

dtschema package defines firmware-name as string-array, so individual
bindings should not make it a string but instead just narrow the number
of expected firmware file names.

Signed-off-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240115182057.1610195-1-krzysztof.kozlowski@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: remove usage of the deprecated ida_simple_xx() API
Christophe JAILLET [Mon, 15 Jan 2024 20:19:04 +0000 (21:19 +0100)]
Input: remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

Note that the upper limit of ida_simple_get() is exclusive, but the one of
ida_alloc_range() is inclusive. So a -1 has been added when needed.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/a885de14beead2cc3c1c946f192b8b178dac696a.1705349930.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: synaptics-rmi4 - fail probing if memory allocation for "phys" fails
Kunwu Chan [Thu, 18 Jan 2024 19:37:59 +0000 (11:37 -0800)]
Input: synaptics-rmi4 - fail probing if memory allocation for "phys" fails

While input core can work with input->phys set to NULL userspace might
depend on it, so better fail probing if allocation fails. The system must
be in a pretty bad shape for it to happen anyway.

Signed-off-by: Kunwu Chan <chentao@kylinos.cn>
Link: https://lore.kernel.org/r/20240117073124.143636-1-chentao@kylinos.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: navpoint - remove driver
Duje Mihanović [Tue, 16 Jan 2024 21:54:31 +0000 (13:54 -0800)]
Input: navpoint - remove driver

This driver does not use the SPI core as it should, instead tampering
with the SSP registers manually. Refactoring the driver is almost
certainly not worth it as the hardware seems to have been designed for
and used only in the HP iPAQ hx4700 removed more than a year ago in
d6df7df7ae5a ("ARM: pxa: remove unused board files"), so let's remove
it.

Signed-off-by: Duje Mihanović <duje.mihanovic@skole.hr>
Link: https://lore.kernel.org/r/20240116-navpoint-removal-v2-2-e566806f1009@skole.hr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: driver for Adafruit Seesaw Gamepad
Anshul Dalal [Tue, 9 Jan 2024 22:39:26 +0000 (14:39 -0800)]
Input: driver for Adafruit Seesaw Gamepad

Adds a driver for a mini gamepad that communicates over i2c, the gamepad
has bidirectional thumb stick input and six buttons.

The gamepad chip utilizes the open framework from Adafruit called 'Seesaw'
to transmit the ADC data for the joystick and digital pin state for the
buttons. I have only implemented the functionality required to receive the
thumb stick and button state.

Steps in reading the gamepad state over i2c:
  1. Reset the registers
  2. Set the pin mode of the pins specified by the `BUTTON_MASK` to input
      `BUTTON_MASK`: A bit-map for the six digital pins internally
       connected to the joystick buttons.
  3. Enable internal pullup resistors for the `BUTTON_MASK`
  4. Bulk set the pin state HIGH for `BUTTON_MASK`
  5. Poll the device for button and joystick state done by:
      `seesaw_read_data(struct i2c_client *client, struct seesaw_data *data)`

Product page:
  https://www.adafruit.com/product/5743
Arduino driver:
  https://github.com/adafruit/Adafruit_Seesaw

Driver tested on RPi Zero 2W

Reviewed-by: Thomas Weißschuh <linux@weissschuh.net>
Signed-off-by: Anshul Dalal <anshulusr@gmail.com>
Link: https://lore.kernel.org/r/20240106015111.882325-2-anshulusr@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agodt-bindings: input: bindings for Adafruit Seesaw Gamepad
Anshul Dalal [Tue, 9 Jan 2024 22:38:57 +0000 (14:38 -0800)]
dt-bindings: input: bindings for Adafruit Seesaw Gamepad

Adds bindings for the Adafruit Seesaw Gamepad.

The gamepad functions as an i2c device with the default address of 0x50
and has an IRQ pin that can be enabled in the driver to allow for a rising
edge trigger on each button press or joystick movement.

Product page:
  https://www.adafruit.com/product/5743
Arduino driver:
  https://github.com/adafruit/Adafruit_Seesaw

Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Signed-off-by: Anshul Dalal <anshulusr@gmail.com>
Link: https://lore.kernel.org/r/20240106015111.882325-1-anshulusr@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: da9063_onkey - avoid explicitly setting input's parent
Dmitry Torokhov [Thu, 21 Dec 2023 03:09:45 +0000 (19:09 -0800)]
Input: da9063_onkey - avoid explicitly setting input's parent

devm_input_allocate_device() already sets parent of the new input
device, there's no need to set it up explicitly.

Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/ZYOseYfVgg0Ve6Zl@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: da9063_onkey - avoid using OF-specific APIs
Dmitry Torokhov [Thu, 21 Dec 2023 03:09:05 +0000 (19:09 -0800)]
Input: da9063_onkey - avoid using OF-specific APIs

There is nothing OF-specific in the driver, so switch from OF properties
helpers to generic device helpers.

Reviewed-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/ZYOsUfKceOFXuCt5@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: iqs269a - add support for OTP variants
Jeff LaBundy [Mon, 1 Jan 2024 20:02:45 +0000 (14:02 -0600)]
Input: iqs269a - add support for OTP variants

This patch adds support for each available OTP variant of the device.
The OTP configuration cannot be read over I2C, so it is derived from
a compatible string instead.

Early revisions of the D0 order code require their OTP-enabled func-
tionality to be manually restored following a soft reset; this patch
accommodates this erratum as well.

Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/ZZMaZbdk6iAKUjlm@nixie71
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agodt-bindings: input: iqs269a: Add bindings for OTP variants
Jeff LaBundy [Mon, 1 Jan 2024 20:02:35 +0000 (14:02 -0600)]
dt-bindings: input: iqs269a: Add bindings for OTP variants

This patch adds bindings for the D0 order code of the device. This
order code represents an OTP variant that enables a touch-and-hold
function in place of slider 1.

Also included is the ability to specify the 00 order code (default
option with no OTP customization) explicitly.

Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/ZZMaW9RkQ9bKXOUn@nixie71
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: iqs269a - add support for slider gestures
Jeff LaBundy [Mon, 1 Jan 2024 20:02:23 +0000 (14:02 -0600)]
Input: iqs269a - add support for slider gestures

This patch adds support for slider gestures that can be expressed
by the device. Each gesture (e.g. tap or hold) can be mapped to a
unique keycode for either slider 0 or 1.

With this change, raw slider coordinates are reported only if the
slider has no keycodes defined. This prevents unwanted mouse cur-
sor movement when expressing axial gestures (e.g. swipe) and also
eliminates some unnecessary I2C traffic.

Different revisions of silicon use different tap and swipe timeout
step sizes. Apply an appropriate scaling factor depending on which
revision is found.

To facilitate this change, store the iqs269_ver_info struct in the
driver's private data so that other functions can use it after the
driver has probed.

Last but not least, a former reserved field in iqs269_ver_info now
contains useful information; give it a name (fw_num).

Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/ZZMaT46WQq1/Nrsb@nixie71
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agodt-bindings: input: iqs269a: Add bindings for slider gestures
Jeff LaBundy [Mon, 1 Jan 2024 20:02:06 +0000 (14:02 -0600)]
dt-bindings: input: iqs269a: Add bindings for slider gestures

This patch adds bindings for slider gestures that can be expressed
by the device.

Signed-off-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/ZZMaPrbSi4IrzwKF@nixie71
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: gpio-keys - filter gpio_keys -EPROBE_DEFER error messages
Hermes Zhang [Fri, 29 Dec 2023 01:36:57 +0000 (09:36 +0800)]
Input: gpio-keys - filter gpio_keys -EPROBE_DEFER error messages

commit ae42f9288846 ("gpio: Return EPROBE_DEFER if gc->to_irq is NULL")
make gpiod_to_irq() possible to return -EPROBE_DEFER when the racing
happens. This causes the following error message to be printed:

    gpio-keys gpio_keys: Unable to get irq number for GPIO 0, error -517

Fix that by changing dev_err() to dev_err_probe()

Signed-off-by: Hermes Zhang <chenhuiz@axis.com>
Link: https://lore.kernel.org/r/20231229013657.692600-1-Hermes.Zhang@axis.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: zforce_ts - accept standard touchscreen properties
Andreas Kemnade [Sun, 24 Dec 2023 08:04:23 +0000 (00:04 -0800)]
Input: zforce_ts - accept standard touchscreen properties

Only driver-specific properties were accepted, change it
to use the now-available standard properties.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://lore.kernel.org/r/20231223221213.774868-4-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agodt-bindings: touchscreen: neonode,zforce: Use standard properties
Andreas Kemnade [Sun, 24 Dec 2023 08:04:12 +0000 (00:04 -0800)]
dt-bindings: touchscreen: neonode,zforce: Use standard properties

Enable touchscreen orientation to be specified by using standard
properties.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Rob Herring <robh@kernel.org>
Link: https://lore.kernel.org/r/20231223221213.774868-3-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agodt-bindings: touchscreen: convert neonode,zforce to json-schema
Andreas Kemnade [Sun, 24 Dec 2023 08:04:00 +0000 (00:04 -0800)]
dt-bindings: touchscreen: convert neonode,zforce to json-schema

Convert Neonode infrared touchscreen controller binding to DT schema.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231223221213.774868-2-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agodt-bindings: input: convert drv266x to json-schema
Anshul Dalal [Thu, 21 Dec 2023 18:31:08 +0000 (00:01 +0530)]
dt-bindings: input: convert drv266x to json-schema

Convert devicetree binding documentation for ti drv2665 and drv2667
haptics driver to json-schema. The previously two separate bindings have
been merged into a single drv266x.yaml.

Signed-off-by: Anshul Dalal <anshulusr@gmail.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231221183109.684325-1-anshulusr@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: da9063 - use dev_err_probe()
Biju Das [Fri, 15 Dec 2023 06:05:20 +0000 (22:05 -0800)]
Input: da9063 - use dev_err_probe()

Replace dev_err()->dev_err_probe() to simplify probe().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20231213214803.9931-4-biju.das.jz@bp.renesas.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: da9063 - drop redundant prints in probe()
Biju Das [Thu, 14 Dec 2023 07:48:38 +0000 (23:48 -0800)]
Input: da9063 - drop redundant prints in probe()

The memory allocation core code already prints error message in case of
OOM. So, drop additional print messages for OOM cases.

While at it, input_register_device() is already printing error messages on
failure. Drop the redundant print.

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20231213214803.9931-3-biju.das.jz@bp.renesas.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: da9063 - simplify obtaining OF match data
Biju Das [Thu, 14 Dec 2023 05:37:15 +0000 (21:37 -0800)]
Input: da9063 - simplify obtaining OF match data

Simplify probe() by replacing of_match_node() for retrieving match data by
device_get_match_data().

Some minor cleanups:
 * Remove the trailing comma in the terminator entry for the OF
   table making code robust against (theoretical) misrebases or other
   similar things where the new entry goes _after_ the termination without
   the compiler noticing.
 * Move OF table near to the user.
 * Arrange variables in reverse xmas tree order in probe().

Signed-off-by: Biju Das <biju.das.jz@bp.renesas.com>
Link: https://lore.kernel.org/r/20231213214803.9931-2-biju.das.jz@bp.renesas.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: as5011 - convert to GPIO descriptor
Linus Walleij [Wed, 13 Dec 2023 07:04:47 +0000 (23:04 -0800)]
Input: as5011 - convert to GPIO descriptor

This driver does not have any in-tree users but is passing a
legacy GPIO number through platform data.

Convert it to use a GPIO descriptor, new users or outoftree
users can easily be implemented using GPIO descriptor tables
or software nodes.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231129-descriptors-input-v1-4-9433162914a3@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: omap-keypad - drop optional GPIO support
Linus Walleij [Wed, 13 Dec 2023 07:06:55 +0000 (23:06 -0800)]
Input: omap-keypad - drop optional GPIO support

The driver supports passing some GPIO lines for rows and columns
through the driver data, but there is no in-kernel user of this.

Further the use seems convoluted because the GPIO lines are unused
in the driver, then explicitly free:ed when removing it without
being requested when probing it, which is assymetric and just
a recepie for disaster.

Remove the support for these unused GPIOs, if need be support can
be reestablished in an organized fashion using GPIO descriptors.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20231129-descriptors-input-v1-3-9433162914a3@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: tca6416-keypad - drop unused include
Linus Walleij [Wed, 13 Dec 2023 07:04:35 +0000 (23:04 -0800)]
Input: tca6416-keypad - drop unused include

The TCA6416 keypad driver is including the legacy GPIO
header <linux/gpio.h> for no reason, it is not using any
of its symbols. Drop the header.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231129-descriptors-input-v1-2-9433162914a3@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: navpoint - convert to use GPIO descriptor
Linus Walleij [Wed, 13 Dec 2023 07:02:56 +0000 (23:02 -0800)]
Input: navpoint - convert to use GPIO descriptor

The Navpoint driver uses a GPIO line, convert this to use
a GPIO descriptor. There are no in-kernel users but out of tree
users can easily be added or converted using a GPIO descriptor
table as with numerous other drivers.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20231129-descriptors-input-v1-1-9433162914a3@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: vivaldi - convert to use sysfs_emit_at() API
ye xingchen [Wed, 13 Dec 2023 06:41:50 +0000 (22:41 -0800)]
Input: vivaldi - convert to use sysfs_emit_at() API

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>
Link: https://lore.kernel.org/r/202212071644171074630@zte.com.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: iqs269a - use sysfs_emit() instead of scnprintf()
ye xingchen [Wed, 13 Dec 2023 06:28:54 +0000 (22:28 -0800)]
Input: iqs269a - use sysfs_emit() instead of scnprintf()

Replace calls to scnprintf() in the methods showing device attributes
with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202212011548387254492@zte.com.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: ims-pcu - use sysfs_emit() instead of scnprintf()
ye xingchen [Wed, 13 Dec 2023 06:21:11 +0000 (22:21 -0800)]
Input: ims-pcu - use sysfs_emit() instead of scnprintf()

Replace calls to scnprintf() in the methods showing device attributes
with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202212011548387254492@zte.com.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: synaptics-rmi4 - use sysfs_emit() to instead of scnprintf()
ye xingchen [Wed, 13 Dec 2023 06:31:44 +0000 (22:31 -0800)]
Input: synaptics-rmi4 - use sysfs_emit() to instead of scnprintf()

Replace calls to scnprintf() in the methods showing device attributes
with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202212011551429834598@zte.com.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: touchscreen - use sysfs_emit[_at]() instead of scnprintf()
ye xingchen [Wed, 13 Dec 2023 05:53:40 +0000 (21:53 -0800)]
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>
9 months agoInput: mouse - use sysfs_emit[_at]() instead of scnprintf()
ye xingchen [Wed, 13 Dec 2023 06:12:01 +0000 (22:12 -0800)]
Input: mouse - use sysfs_emit[_at]() instead of scnprintf()

Replace the calls to various *printf() functions with sysfs_emit() to
simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202212021453578171100@zte.com.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: use sysfs_emit() instead of scnprintf()
ye xingchen [Wed, 13 Dec 2023 06:37:16 +0000 (22:37 -0800)]
Input: use sysfs_emit() instead of scnprintf()

Replace calls to scnprintf() in the methods showing device attributes
with sysfs_emit() to simplify the code.

Signed-off-by: ye xingchen <ye.xingchen@zte.com.cn>
Link: https://lore.kernel.org/r/202212021133398847947@zte.com.cn
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: max77693-haptic - add device-tree compatible strings
Marek Szyprowski [Fri, 6 Oct 2023 10:03:20 +0000 (12:03 +0200)]
Input: max77693-haptic - add device-tree compatible strings

Add the needed device-tree compatible strings to the MAX77693 haptic
driver, so it can be automatically loaded when compiled as a kernel
module and given device-tree contains separate (i.e. 'motor-driver') node
under the main PMIC node. When device is instantiated from device-tree,
the driver data cannot be read via platform_get_device_id(), so get
device type from the parent MFD device instead, what works for both
cases.

Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231006100320.2908210-1-m.szyprowski@samsung.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: qt1050 - convert to use maple tree register cache
Mark Brown [Sat, 30 Sep 2023 23:43:40 +0000 (01:43 +0200)]
Input: qt1050 - convert to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-input-maple-v1-3-ed3716051431@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: cap11xx - convert to use maple tree register cache
Mark Brown [Sat, 30 Sep 2023 23:43:39 +0000 (01:43 +0200)]
Input: cap11xx - convert to use maple tree register cache

The maple tree register cache is based on a much more modern data structure
than the rbtree cache and makes optimisation choices which are probably
more appropriate for modern systems than those made by the rbtree cache.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-input-maple-v1-2-ed3716051431@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: cap11xx - cache hardware ID registers
Mark Brown [Sat, 30 Sep 2023 23:43:38 +0000 (01:43 +0200)]
Input: cap11xx - cache hardware ID registers

The cap11xx devices have three hardware identification registers which are
currently marked as volatile, preventing caching of those registers. This
is not ideal since the registers should never change at runtime, we should
be able to cache the value after the first read. Stop marking the registers
as volatile, we don't have register defaults specified in the driver so
this will result in reading from the hardware on first use.

Signed-off-by: Mark Brown <broonie@kernel.org>
Link: https://lore.kernel.org/r/20231001-input-maple-v1-1-ed3716051431@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: cap11xx - add advanced sensitivity settings
Jiri Valek - 2N [Tue, 12 Dec 2023 02:54:45 +0000 (18:54 -0800)]
Input: cap11xx - add advanced sensitivity settings

Add support for advanced sensitivity settings that allows more precise
tunig of touch buttons. Input-treshold allows to set the sensitivity for
each channel separately. Also add signal guard feature for CAP129x chips.

Signed-off-by: Jiri Valek - 2N <jiriv@axis.com>
Link: https://lore.kernel.org/r/20231121155250.613242-3-jiriv@axis.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agodt-bindings: input: microchip,cap11xx: add advanced sensitivity settings
Jiri Valek - 2N [Tue, 12 Dec 2023 02:54:22 +0000 (18:54 -0800)]
dt-bindings: input: microchip,cap11xx: add advanced sensitivity settings

Add support for advanced sensitivity settings and signal guard feature.

Signed-off-by: Jiri Valek - 2N <jiriv@axis.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231121155250.613242-2-jiriv@axis.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: xpad - remove usage of the deprecated ida_simple_xx() API
Christophe JAILLET [Sun, 10 Dec 2023 17:20:57 +0000 (18:20 +0100)]
Input: xpad - remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/a3e30e30f18cc5d6f032c8013ce9d900c8e223e5.1702228806.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: omap4-keypad - react on keypresses if device is runtime-suspended
Andreas Kemnade [Mon, 11 Dec 2023 22:17:57 +0000 (23:17 +0100)]
Input: omap4-keypad - react on keypresses if device is runtime-suspended

According to SWPU235AB, table 26-6, fclk is required to generate events
at least on OMAP4460, so keep fclk enabled all the time the device
is opened.

Suggested-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20231211221757.517427-1-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: pxrc - simplify mutex handling with guard macro
Marcus Folkesson [Sat, 2 Dec 2023 16:59:48 +0000 (17:59 +0100)]
Input: pxrc - simplify mutex handling with guard macro

Use the guard(mutex) macro for handle mutex lock/unlocks.

Signed-off-by: Marcus Folkesson <marcus.folkesson@gmail.com>
Link: https://lore.kernel.org/r/20231202-pxrc-guard-v3-1-2ca8bc8cf689@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agodt-bindings: input: gpio-mouse: Convert to json-schema
Anshul Dalal [Fri, 8 Dec 2023 07:50:35 +0000 (13:20 +0530)]
dt-bindings: input: gpio-mouse: Convert to json-schema

Convert device tree binding documentation for GPIO attached mouse to
json-schema.

Signed-off-by: Anshul Dalal <anshulusr@gmail.com>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20231208075037.114598-1-anshulusr@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: gpio-keys - add system suspend support for dedicated wakeirqs
Tony Lindgren [Wed, 29 Nov 2023 11:06:15 +0000 (13:06 +0200)]
Input: gpio-keys - add system suspend support for dedicated wakeirqs

Some SoCs have a separate dedicated wake-up interrupt controller that can
be used to wake up the system from deeper idle states. We already support
configuring a separate interrupt for a gpio-keys button to be used with a
gpio line. However, we are lacking support system suspend for cases where
a separate interrupt needs to be used in deeper sleep modes.

Because of it's nature, gpio-keys does not know about the runtime PM state
of the button gpios, and may have several gpio buttons configured for each
gpio-keys device instance. Implementing runtime PM support for gpio-keys
does not help, and we cannot use drivers/base/power/wakeirq.c support. We
need to implement custom wakeirq support for gpio-keys.

For handling a dedicated wakeirq for system suspend, we enable and disable
it with gpio_keys_enable_wakeup() and gpio_keys_disable_wakeup() that we
already use based on device_may_wakeup().

Some systems may have a dedicated wakeirq that can also be used as the
main interrupt, this is already working for gpio-keys. Let's add some
wakeirq related comments while at it as the usage with a gpio line and
separate interrupt line may not be obvious.

Tested-by: Dhruva Gole <d-gole@ti.com>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20231129110618.27551-2-tony@atomide.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agodt-bindings: input: gpio-keys: Allow optional dedicated wakeirq
Tony Lindgren [Wed, 29 Nov 2023 11:06:14 +0000 (13:06 +0200)]
dt-bindings: input: gpio-keys: Allow optional dedicated wakeirq

Allow configuring an optional dedicated wakeirq for gpio-keys that
some SoCs have.

Let's use the common interrupt naming "irq" and "wakeup" that we already
have in use for some drivers and subsystems like i2c framework.

Note that the gpio-keys interrupt property is optional. If only a gpio
property is specified, the driver tries to translate the gpio into an
interrupt.

Reviewed-by: Rob Herring <robh@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
Link: https://lore.kernel.org/r/20231129110618.27551-1-tony@atomide.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>