Commit Graph

1622 Commits

Author SHA1 Message Date
Dmitry Torokhov
6b6b40ff05 Input: maple_keyb - use guard notation when acquiring mutex
Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/Zx8mGiWOw1Av28TX@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-11-05 14:17:32 -08:00
Dmitry Torokhov
229ba714e5 Input: locomokbd - use guard notation when acquiring spinlock
Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/Zxr4AMJrzhZlHAlf@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-11-05 14:17:25 -08:00
Dmitry Torokhov
dda8fdb033 Input: hilkbd - use guard notation when acquiring spinlock
Using guard notation makes the code more compact and error handling
more robust by ensuring that locks are released in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/Zxr30BpPobpM65vO@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-11-05 14:17:20 -08:00
Dmitry Torokhov
e1325e19d2 Input: omap-keypad - use guard notation when acquiring mutex
Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released in all code paths
when control leaves critical section.

Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/Zxr4nF-igbrmgq85@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-30 15:54:51 -07:00
Javier Carrasco
0ec6f58b63 Input: sun4i-lradc-keys - switch to for_each_child_of_node_scoped
Use the scoped variant of the macro to simplify the code and error
handling. This makes the error handling more robust by ensuring that
the child node is always freed.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Andre Przywara <andre.przywara@arm.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-3-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-19 21:21:38 -07:00
Javier Carrasco
2e6980c169 Input: mtk-pmic-keys - switch to for_each_child_of_node_scoped
Use the scoped variant of the macro to simplify the code and error
handling. This makes the error handling more robust by ensuring that
the child node is always freed.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-2-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-19 21:21:37 -07:00
Javier Carrasco
ac2b6ce672 Input: cap11xx - switch to for_each_child_of_node_scoped
Use the scoped variant of the macro to simplify the code and error
handling. This makes the error handling more robust by ensuring that
the child node is always freed.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-1-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-19 21:21:37 -07:00
Uwe Kleine-König
2c19d01599 Input: switch back to struct platform_driver::remove()
After commit 0edb555a65 ("platform: Make platform_driver::remove()
return void") .remove() is (again) the right callback to implement for
platform drivers.

Convert all platform drivers below drivers/input/ to use .remove(), with
the eventual goal to drop struct platform_driver::remove_new(). As
.remove() and .remove_new() have the same prototypes, conversion is done
by just changing the structure member name in the driver initializer.

While touching these files, make indention of the struct initializer
consistent in a few drivers.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@baylibre.com>
Link: https://lore.kernel.org/r/20241008090009.462836-2-u.kleine-koenig@baylibre.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-15 11:43:25 -07:00
Yang Li
1ec46bf0e4 Input: matrix_keypad - remove duplicated include
The header files consumer.h is included twice in matrix_keypad.c,
so one inclusion of each can be removed.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=10823
Signed-off-by: Yang Li <yang.lee@linux.alibaba.com>
Link: https://lore.kernel.org/r/20240910010133.44579-1-yang.lee@linux.alibaba.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-04 04:15:55 -07:00
Dmitry Torokhov
bc656ececf Input: sunkbd - use guard notation when pausing serio port
Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-04 00:58:15 -07:00
Dmitry Torokhov
30cb2f6350 Input: atkbd - use guard notation when pausing serio port
Using guard notation makes the code more compact and error handling
more robust by ensuring that serio ports are resumed in all code paths
when control leaves critical section.

Link: https://lore.kernel.org/r/20240905041732.2034348-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-04 00:58:15 -07:00
Dmitry Torokhov
b18d9d75dd Input: st-keyscan - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-17-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
f0d8229869 Input: spear-keyboard - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-16-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
b8a3e18141 Input: pxa27x_keypad - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-15-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
9e09354cb6 Input: pmic8xxx-keypad - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-14-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
a49e229319 Input: omap4-keypad - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-13-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:57 -07:00
Dmitry Torokhov
405b1762ae Input: matrix_keypad - use guard notation when acquiring spinlock
This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-12-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:58:56 -07:00
Dmitry Torokhov
e9495ead52 Input: lpc32xx-keys - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-11-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:31 -07:00
Dmitry Torokhov
02e4f823ce Input: lm8323 - use guard notation when acquiring mutexes
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-10-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:31 -07:00
Dmitry Torokhov
d1212ac94e Input: ipaq-micro-keys - use guard notation when acquiring mutex and spinlock
This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:14 -07:00
Dmitry Torokhov
2f39a9fc87 Input: imx_keypad - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:14 -07:00
Dmitry Torokhov
946a48090e Input: ep93xx_keypad - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:53:03 -07:00
Dmitry Torokhov
932fc59b30 Input: applespi - use guard notation when acquiring spinlock
This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:52:33 -07:00
Dmitry Torokhov
2e969e5b15 Input: adp5589-keys - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Link: https://lore.kernel.org/r/20240825051627.2848495-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 08:52:33 -07:00
Rob Herring (Arm)
c7c878ff32 Input: tegra-kbc - use of_property_read_variable_u32_array() and of_property_present()
There's no need to get the length of an DT array property before
parsing the array. of_property_read_variable_u32_array() takes a
minimum and maximum length and returns the actual length (or error
code).

This is part of a larger effort to remove callers of of_get_property()
and similar functions. of_get_property() leaks the DT property data
pointer which is a problem for dynamically allocated nodes which may
be freed.

Acked-by: Thierry Reding <treding@nvidia.com>
Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240913200827.546649-1-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-13 23:16:23 -07:00
Dmitry Torokhov
78af00d893 Input: tegra-kbc - use guard notation when acquiring mutex and spinlock
This makes the code more compact and error handling more robust
by ensuring that locks are released in all code paths when control
leaves critical section.

Acked-by: Thierry Reding <treding@nvidia.com>
Link: https://lore.kernel.org/r/20240825051627.2848495-18-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:53:34 -07:00
Dmitry Torokhov
22df24590f Input: iqs62x-keys - use cleanup facility for fwnodes
Use __free(fwnode_handle) cleanup facility to ensure that references
to acquired fwnodes are dropped at appropriate times automatically.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20240825051627.2848495-9-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:53:28 -07:00
Dmitry Torokhov
43a365abaf Input: gpio-keys - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code
and error handling. This makes the code more compact and error
handling more robust by ensuring that locks are released in all
code paths when control leaves critical section and all allocated
memory is freed.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240825051627.2848495-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:53:20 -07:00
Dmitry Torokhov
934976f61e Input: atkbd - use guard notation when acquiring mutex
This makes the code more compact and error handling more robust
by ensuring that mutexes are released in all code paths when control
leaves critical section.

Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240825051627.2848495-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 22:53:11 -07:00
Dmitry Torokhov
f057b57270 Merge branch 'ib/6.11-rc6-matrix-keypad-spitz' into next
Bring in changes removing support for platform data from matrix-keypad
driver.
2024-09-05 21:49:07 -07:00
Dmitry Torokhov
de35996d4b Input: matrix_keypad - remove support for platform data
There are no more users of struct matrix_keypad_platform_data in the
kernel, remove support for it from the driver.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240805014710.1961677-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 21:43:42 -07:00
Dmitry Torokhov
584bf366f8 Input: matrix_keypad - switch to gpiod API and generic device properties
gpiod API and generic device properties work with software nodes and
static properties, which will allow removing platform data support
from the driver, simplifying and streamlining the code.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240805014710.1961677-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 21:43:42 -07:00
Dmitry Torokhov
5080f62adb Input: matrix_keypad - remove support for clustered interrupt
There are no users of this functionality in the mainline kernel (it was
only available to boards using platform data and not device tree).
Remove it to simplify the code.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240805014710.1961677-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-05 21:43:42 -07:00
Dmitry Torokhov
092b7d431f Input: snvs_pwrkey - use devm_clk_get_optional_enabled()
Switch to using devm_clk_get_optional_enabled() helper instead of
acquiring the clock with devm_clk_get_optional(), enabling it, and
defining and installing a custom devm action to call clk_disable().

Reviewed-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/ZtDDGMaOFlMYjOrt@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-31 15:25:05 -07:00
Utsav Agarwal
dc748812fc Input: adp5588-keys - add support for pure gpio
Keypad specific setup is relaxed if no keypad rows/columns are specified,
enabling a purely gpio operation.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Signed-off-by: Utsav Agarwal <utsav.agarwal@analog.com>
Link: https://lore.kernel.org/r/20240826-adp5588_gpio_support-v11-2-3e5ac2bd31b7@analog.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-28 18:50:45 -07:00
Dmitry Torokhov
f0da267996 Input: adp5588-keys - use guard notation when acquiring mutexes
This makes the code more compact and error handling more robust.

Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20240826-adp5588_gpio_support-v11-1-3e5ac2bd31b7@analog.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-28 18:49:05 -07:00
Dmitry Torokhov
e2e75e4202 Input: mt6779-keypad - use devm_clk_get_enabled()
Switch to using devm_clk_get_enable() helper instead of acquiring the
clock with devm_clk_get(), enabling it, and defining and installing
a custom devm action to call clk_disable().

Reviewed-by: Mattijs Korpershoek <mkorpershoek@baylibre.com>
Link: https://lore.kernel.org/r/Zs4UWGKt3hLjNmoP@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-28 11:10:05 -07:00
Liao Chen
387e4975ec Input: mt6779-keypad - fix module autoloading
Add MODULE_DEVICE_TABLE(), so modules could be properly autoloaded
based on the alias from of_device_id table.

Signed-off-by: Liao Chen <liaochen4@huawei.com>
Link: https://lore.kernel.org/r/20240827123411.431388-1-liaochen4@huawei.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-27 08:26:01 -07:00
Dmitry Torokhov
6c65914a40 Input: keypad-nomadik-ske - remove the driver
The users of this driver were removed in 2013 in commit 28633c54bd
("ARM: ux500: Rip out keypad initialisation which is no longer used").

Remove the driver as well.

Acked-by: Arnd Bergmann <arnd@arndb.de>
Link: https://lore.kernel.org/r/Zr-gX0dfN4te_8VG@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-22 11:36:25 -07:00
Rob Herring (Arm)
8bd2aa8529 Input: tc3589x - use of_property_present()
Use of_property_present() to test for property presence rather than
of_get_property(). This is part of a larger effort to remove callers
of of_get_property() and similar functions. of_get_property() leaks
the DT property data pointer which is a problem for dynamically
allocated nodes which may be freed.

Signed-off-by: Rob Herring (Arm) <robh@kernel.org>
Link: https://lore.kernel.org/r/20240731191312.1710417-14-robh@kernel.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-31 12:36:49 -07:00
Christophe JAILLET
3fe81a5625 Input: spear-keyboard - switch to devm_clk_get_prepared()
Use devm_clk_get_prepared() in order to remove a clk_unprepare() in an
error handling path of the probe and from the .remove() function.

This done, the whole .remove() function can also be axed because
'input_dev' is a managed resource allocated with
devm_input_allocate_device() and we can fully rely on devm for cleaning up.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Link: https://lore.kernel.org/r/062986b0a5105cbc61330da0e55b22c00e2c1c4f.1722062145.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-28 16:41:12 -07:00
Dmitry Torokhov
dd29eadee1 Input: msc_touchkey - remove the driver
MCS-5000/5080 chips belong to the 1st generation of Melfas chips,
manufactured in 2000-2007.

The driver relies on custom platform data (no DT support) and there
never were any users of this driver in the mainline kernel. It is likely
that the driver was (like mcs5000_ts driver) was tested on S3C6410 NCP
board (with Samsung S3C6410 SoC), but the touchkey device was never
added to the board file. This board was removed in v6.3 in commit
743c8fbb90 ("ARM: s3c: remove most s3c64xx board support").

Remove the driver since there are no users.

Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>
Link: https://lore.kernel.org/r/20240714060029.1528662-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:12:23 -07:00
Javier Carrasco
44f9c7c5f5 Input: adc-keys - use device_for_each_child_node_scoped()
Switch to the _scoped() version introduced in commit 365130fd47
("device property: Introduce device_for_each_child_node_scoped()")
to remove the need for manual calling of fwnode_handle_put() in the
paths where the code exits the loop early.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240412-input_device_for_each_child_node_scoped-v1-5-dbad1bc7ea84@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 17:02:13 -07:00
Javier Carrasco
1102db75c5 Input: gpio_keys_polled - use device_for_each_child_node_scoped()
Switch to the _scoped() version introduced in commit 365130fd47
("device property: Introduce device_for_each_child_node_scoped()")
to remove the need for manual calling of fwnode_handle_put() in the
paths where the code exits the loop early.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240412-input_device_for_each_child_node_scoped-v1-4-dbad1bc7ea84@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 17:02:13 -07:00
Javier Carrasco
c90a851974 Input: gpio_keys - use device_for_each_child_node_scoped()
Switch to the _scoped() version introduced in commit 365130fd47
("device property: Introduce device_for_each_child_node_scoped()")
to remove the need for manual calling of fwnode_handle_put() in the
paths where the code exits the loop early.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240412-input_device_for_each_child_node_scoped-v1-3-dbad1bc7ea84@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 17:02:13 -07:00
Javier Carrasco
4f210af5eb Input: qt1050 - use device_for_each_child_node_scoped()
Switch to the _scoped() version introduced in commit 365130fd47
("device property: Introduce device_for_each_child_node_scoped()")
to remove the need for manual calling of fwnode_handle_put() in the
paths where the code exits the loop early.

In this case the err label was no longer necessary and EINVAL is
returned directly.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240412-input_device_for_each_child_node_scoped-v1-2-dbad1bc7ea84@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 17:02:13 -07:00
Dmitry Torokhov
2d7877d797 Input: omap-keypad - use driver core to instantiate device attributes
Instead of manually creating driver-specific device attributes
set struct driver->dev_groups pointer to have the driver core
do it.

This also fixes issue with the attribute not being deleted on driver
unbind.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/Zo9nofWJ1xg9MgKs@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-12 17:15:29 -07:00
Javier Carrasco
366d586684 Input: qt1050 - constify struct regmap_config
`qt1050_regmap_config` is not modified and can be declared as const to
move its data to a read-only section.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240705-input-const-regmap_config-v1-1-f712a4494883@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 10:01:18 -07:00
Andrei Lalaev
866a5c7e27 Input: qt1050 - handle CHIP_ID reading error
If the device is missing, we get the following error:

  qt1050 3-0041: ID -1340767592 not supported

Let's handle this situation and print more informative error
when reading of CHIP_ID fails:

  qt1050 3-0041: Failed to read chip ID: -6

Fixes: cbebf5adde ("Input: qt1050 - add Microchip AT42QT1050 support")
Signed-off-by: Andrei Lalaev <andrei.lalaev@anton-paar.com>
Reviewed-by: Marco Felsch <m.felsch@pengutronix.de>
Link: https://lore.kernel.org/r/20240617183018.916234-1-andrey.lalaev@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-25 09:13:08 -07:00
Dmitry Torokhov
f4c7fa7c05 Input: cap11xx - stop using chip ID when configuring it
struct cap11xx_hw_model is supposed to describe the chip capabilities,
however later code changes introduced checks against chip ID.

Introduce new capabilities in cap11xx_hw_model and use them when applying
chip configuration, and remove the enum for chip ID. While at it, rename
no_gain to has_gain to match the rest of the new capabilities.

Reviewed-by: Jiri Valek - 2N <jiriv@axis.com>
Link: https://lore.kernel.org/r/ZXlCRsnOu_L8xeTC@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-07 12:32:31 -07:00