Commit Graph

8097 Commits

Author SHA1 Message Date
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
Dmitry Torokhov
e8858fc07e Input: msc5000_ts - remove the driver
MCS-5000 belongs 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. The commit
adding the driver mentioned that the driver was tested on S3C6410 NCP
board (with Samsung S3C6410 SoC) but the touchscreen 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-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:12:23 -07:00
Dmitry Torokhov
d04f939352 Input: usbtouchscreen - switch to using __free() cleanup facility
Use __free(kfree) cleanup facility when allocating temporary buffers
for USB transfers.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240712051851.3463657-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:07:39 -07:00
Dmitry Torokhov
f784adb66d Input: usbtouchscreen - use guard notation when acquiring mutexes
This makes the code more compact and error handling more robust.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240712051851.3463657-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:07:39 -07:00
Dmitry Torokhov
7f787df1ac Input: usbtouchscreen - split device info table into individual pieces
Instead of using a single table containing information about various
touchscreens and enums to match the driver ID table data with chip
information define individual per-protocol instances of
usbtouch_device_info structure and reference them directly from
the usbtouch_devices ID table. This is simpler, safer, and uses less
memory in case some protocols are disabled.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240712051851.3463657-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:07:38 -07:00
Dmitry Torokhov
830f06c017 Input: usbtouchscreen - constify usbtouch_dev_info table
The data in this table is shared between all instances of the
touchscreens so it should not be modified.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240712051851.3463657-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:07:38 -07:00
Dmitry Torokhov
fbb1c92282 Input: usbtouchscreen - move process_pkt() into main device structure
In preparation of splitting big usbtouch_dev_info table into separate
per-protocol structures and constifying them move process_pkt() from the
device info into main drvice structure and set it up in probe().
We can derive if we should use single- or multi-packet handling based
on presence of get_pkt_len() method.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240712051851.3463657-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:07:38 -07:00
Dmitry Torokhov
ca95a47e29 Input: usbtouchscreen - move the driver ID table
Move the driver's ID table closer to where it is used in preparation
to it using pointers to device info/parameters instead of device type
enum.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240712051851.3463657-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:07:38 -07:00
Dmitry Torokhov
9f2feb0614 Input: usbtouchscreen - remove custom USB_DEVICE_HID_CLASS macro
There already exists perfectly suitable USB_DEVICE_INTERFACE_CLASS
macro, use it.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240712051851.3463657-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:07:38 -07:00
Dmitry Torokhov
6797e19d9a Input: usbtouchscreen - use driver core to instantiate device attributes
Instead of manually creating driver-specific device attributes
set struct usb_driver->dev_groups pointer to have the driver core
do it.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240712051851.3463657-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 18:07:38 -07:00
Javier Carrasco
d13df21d62 Input: adc-joystick - 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_fwnode_put label was no longer necessary and the
error code 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-6-dbad1bc7ea84@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 17:02:13 -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
Javier Carrasco
4256d47201 Input: iqs269a - 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-1-dbad1bc7ea84@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 16:45:52 -07:00
Dmitry Torokhov
3daee2e4b3 Linux 6.10
-----BEGIN PGP SIGNATURE-----
 
 iQFSBAABCAA8FiEEq68RxlopcLEwq+PEeb4+QwBBGIYFAmaUVJQeHHRvcnZhbGRz
 QGxpbnV4LWZvdW5kYXRpb24ub3JnAAoJEHm+PkMAQRiGzHQH/2lCvFWJt5sM5xrl
 16blU2fyZ0JlKuCwtIXmk67bih9SWKo9MG2PINnt5CxPlJeErE/q89OtbyccoyZ8
 KvN76ZKitUtQgETT+cQ5Qcq2N38siH3TKV4Pqvo7RZddjiJK1/I0gAfsQ+hv+Dr/
 vbLSHwrOkSvyBSTBFW1FoATTa1qyhQpSvk9ePyq7d27vLJyVnbjWN5WF96I41/yh
 oZS9gQIOKtK6zUae+DlIkeY0ViBuH5PK3KOjED81oo1I+dUwxJOeyYM/9Jvhgwk6
 9ELQU69MiWtBcqj0NWNRKpTEAGXgWCrr8juChI2SSBnJuMdFKSflt4fSfTv2qJA3
 KwYEgVY=
 =KtAj
 -----END PGP SIGNATURE-----

Merge tag 'v6.10' into next

Sync up with mainline to bring in device_for_each_child_node_scoped()
and other newer APIs.
2024-07-15 15:50:05 -07:00
Dmitry Torokhov
f3efefb6fd Input: yealink - simplify locking in sysfs attribute handling
The locking rules in the driver came from era when sysfs attributes
could live past the point of time when device would be unbound from
the driver, and so used module-global semaphore (potentially shared
between multiple yealink devices). Thankfully these times are long
gone and attributes will not be accessible once they are removed.

Simplify the logic by moving to per-device mutex, stop checking if
there is driver data instance attached to the interface, and use
guard notation to acquire the mutex.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240710234855.311366-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-12 17:15:45 -07:00
Dmitry Torokhov
295b89a631 Input: yealink - use driver core to instantiate device attributes
Instead of manually creating driver-specific device attributes
set struct usb_driver->dev_groups pointer to have the driver core
do it.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/20240710234855.311366-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-12 17:15:45 -07:00
Dmitry Torokhov
b20d6bf801 Input: ati-remote2 - use driver core to instantiate device attributes
Instead of manually creating driver-specific device attributes
set struct usb_driver->dev_groups pointer to have the driver core
do it.

Reviewed-by: Ville Syrjälä <syrjala@sci.fi>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/Zo8gaF_lKPAfcye1@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-12 17:15:38 -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
Dmitry Torokhov
a122a6fd72 Input: atmel_mxt_ts - 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.

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Link: https://lore.kernel.org/r/Zo9kSFeGOZB9b3rq@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-12 17:15:08 -07:00
Philipp Zabel
8c98dddc23 Input: exc3000 - add EXC81W32 support
Add support for EXC81W32 controllers.

Tested with firmware reported as type "PCAP81X32 Series",
model "Orion_0183_1019", fw_version "8001280G".

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Link: https://lore.kernel.org/r/20240710-input-exc3000-exc81w32-v3-2-4272183628b4@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-11 09:58:35 -07:00
Dmitry Torokhov
f48ecbd2ce Input: twl4030-pwrbutton - fix kernel-doc warning
Do not use kernel-doc style for comment describing contents of the
source file, as it trips the script:

  scripts/kernel-doc -none   drivers/input/misc/twl4030-pwrbutton.c
drivers/input/misc/twl4030-pwrbutton.c:2: info: Scanning doc for function twl4030
drivers/input/misc/twl4030-pwrbutton.c:33: warning: expecting prototype for twl4030(). Prototype was for PWR_PWRON_IRQ() instead
1 warnings

Also remove file name from the same comment - it it not the best idea
to have it as they tend to get stale when sources get moved or renamed.

Reported-by: Mirsad Todorovac <mtodorovac69@gmail.com>
Tested-by: Mirsad Todorovac <mtodorovac69@gmail.com>
Link: https://lore.kernel.org/r/Zo3QE00GqCrA3M9b@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-11 09:57:58 -07:00
Felix Kaechele
5e91cef944 Input: himax_hx83112b - add support for HX83100A
The HX83100A is a bit of an outlier in the Himax HX831xxx series of
touch controllers as it requires reading touch events through the AHB
interface of the MCU rather than providing a dedicated FIFO address like
the other chips do.
This patch implements the specific read function and introduces the
HX83100A chip with an appropriate i2c ID and DT compatible string.

The HX83100A doesn't have a straightforward way to do chip
identification, which is why it is not implemented in this patch.

Tested on: Lenovo ThinkSmart View (CD-18781Y) / Innolux P080DDD-AB2 LCM

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Tested-by: Paul Gale <paul@siliconpixel.com>
Link: https://lore.kernel.org/r/20240620145019.156187-6-felix@kaechele.ca
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:50 -07:00
Felix Kaechele
aa9007ed2d Input: himax_hx83112b - add himax_chip struct for multi-chip support
In preparation for HX83100A support allow defining separate functions
for specific chip operations.

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Link: https://lore.kernel.org/r/20240620145019.156187-5-felix@kaechele.ca
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:50 -07:00
Felix Kaechele
0944829d49 Input: himax_hx83112b - implement MCU register reading
Implement reading from the MCU in a more universal fashion. This allows
properly handling reads of more than 4 bytes using the AHB FIFO
implemented in the chip.

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Link: https://lore.kernel.org/r/20240620145019.156187-4-felix@kaechele.ca
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:50 -07:00
Felix Kaechele
05eab5456b Input: himax_hx83112b - use more descriptive register defines
Himax uses an AHB-style bus to communicate with different parts of the
display driver and touch controller system.
Use more descriptive names for the register and address defines.
The names were taken from a driver submission for the similar HX83102J
chip.

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Link: https://lore.kernel.org/all/TY0PR06MB561105A3386E9D76F429110D9E0F2@TY0PR06MB5611.apcprd06.prod.outlook.com/
Link: https://lore.kernel.org/r/20240620145019.156187-3-felix@kaechele.ca
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:50 -07:00
Dmitry Torokhov
735877fde0 Input: do not check number of events in input_pass_values()
Now that the input_dev->vals array is always there we can be assured
that input_pass_values() is always called with a non-0 number of
events. Remove the check.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Benjamin Tissoires <bentiss@kernel.org>
Link: https://lore.kernel.org/r/20240703213756.3375978-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:49 -07:00
Dmitry Torokhov
0cd5877352 Input: preallocate memory to hold event values
Preallocate memory for holding event values (input_dev->vals) so that
there is no need to check if it was allocated or not in the event
processing code.

The amount of memory will be adjusted after input device has been fully
set up upon registering device with the input core.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Benjamin Tissoires <bentiss@kernel.org>
Link: https://lore.kernel.org/r/20240703213756.3375978-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:49 -07:00
Dmitry Torokhov
3544cf574a Input: rearrange input_alloc_device() to prepare for preallocating of vals
In preparation to have dev->vals memory pre-allocated rearrange
code in input_alloc_device() so that it allows handling multiple
points of failure.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Benjamin Tissoires <bentiss@kernel.org>
Link: https://lore.kernel.org/r/20240703213756.3375978-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:49 -07:00
Dmitry Torokhov
d469647baf Input: simplify event handling logic
Streamline event handling code by providing batch implementations for
filtering and event processing and using them in place of the main
event handler, as needed, instead of having complex branching logic
in the middle of the event processing code.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Benjamin Tissoires <bentiss@kernel.org>
Link: https://lore.kernel.org/r/20240703213756.3375978-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:49 -07:00
Dmitry Torokhov
14498e993f Input: make events() method return number of events processed
In preparation to consolidating filtering and event processing in the
input core change events() method to return number of events processed
by it.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Benjamin Tissoires <bentiss@kernel.org>
Link: https://lore.kernel.org/r/20240703213756.3375978-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:49 -07:00
Dmitry Torokhov
a184cf98b1 Input: make sure input handlers define only one processing method
Input core expects input handlers to be either filters, or regular
handlers, but not both. Additionally, for regular handlers it does
not make sense to define both single event method and batch method.

Refuse registering handler if it defines more than one method.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Benjamin Tissoires <bentiss@kernel.org>
Link: https://lore.kernel.org/r/20240703213756.3375978-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:48 -07:00
Dmitry Torokhov
b3d65108ac Input: evdev - remove ->event() method
Input core favors ->events() (batch) method over ->event() method
if the former is defined, so there is no point in defining evdev_event()
as it is never called. Remove it.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Reviewed-by: Benjamin Tissoires <bentiss@kernel.org>
Link: https://lore.kernel.org/r/20240703213756.3375978-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:48 -07:00
Raymond Hackley
1e48ee99f6 Input: imagis - add supports for Imagis IST3038
Imagis IST3038 is another variant of Imagis IST3038 IC, which has
a different register interface from IST3038C (possibly firmware defined).

Unlike IST3038C/IST3032C, IST3038 has different registers for commands,
which means IST3038 doesn't use protocol B.
Similar to IST3032C and maybe the other variants, IST3038 has touch keys
support, which provides KEY_APPSELECT and KEY_BACK.

Add support for IST3038 with touch keys.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Link: https://lore.kernel.org/r/20240613025631.5425-4-raymondhackley@protonmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:48 -07:00
Raymond Hackley
ff2f28c771 Input: imagis - clarify the usage of protocol_b
protocol_b is a property, which tells Imagis panel to use a different
format for coordinates.

IST30XXC series is known for using protocol B, while the other series
aren't. Note this could be confusing, unlike the model name implies.

Adjust the usage of protocol_b to avoid confusion.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Link: https://lore.kernel.org/r/20240613025631.5425-2-raymondhackley@protonmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 16:22:41 -07:00
Javier Carrasco
f275b3ae3a Input: fsl-imx25-tcq - constify struct regmap_config
`mx25_tcq_regconfig` 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-2-f712a4494883@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-08 10:01:19 -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
Dmitry Torokhov
5e13bea78d Input: cypress_ps2 - use u8 when dealing with byte data
When dealing with byte data use u8 instead of unsigned char or int.
Stop layering error handling in cypress_ps2_sendbyte() and simply
pass on error code from ps2_sendbyte().

Additionally use u8 instead of unisgned char throughout the code.

Link: https://lore.kernel.org/r/20240628224728.2180126-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-03 13:48:53 -07:00
Dmitry Torokhov
93f25f92fc Input: cypress_ps2 - propagate errors from lower layers
Do not override errors reported by lower layers with generic "-1",
but propagate them to the callers. Change the checks for errors to be
in the form of "if (error)" to maintain consistency.

Link: https://lore.kernel.org/r/20240628224728.2180126-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-03 13:48:53 -07:00
Dmitry Torokhov
8bccf667f6 Input: cypress_ps2 - report timeouts when reading command status
Report -ETIMEDOUT error code from cypress_ps2_read_cmd_status() when
device does not send enough data within the allotted time in response
to a command.

Link: https://lore.kernel.org/r/20240628224728.2180126-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-03 13:48:53 -07:00
Dmitry Torokhov
e8688b93ce Input: cypress_ps2 - fix error handling when sending command fails
Stop layering error handling in cypress_ps2_sendbyte() and simply
pass on error code from ps2_sendbyte() and use it in the callers.

This fixes mishandling of error condition in
cypress_ps2_read_cmd_status() which expects errors to be negative.

Reported-by: Igor Artemiev <Igor.A.Artemiev@mcst.ru>
Link: https://lore.kernel.org/r/20240628224728.2180126-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-03 13:48:53 -07:00
Dmitry Torokhov
c1a3390011 Input: cypress_ps2 - clean up setting reporting rate
Casting an integer field containing desired rate to a pointer to bytes
works on little endian architectures where the driver is used, but not
a good practice. Use a temporary of proper type instead.

Link: https://lore.kernel.org/r/20240628224728.2180126-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-03 13:48:53 -07:00
Dmitry Torokhov
5f82c1e047 Input: elan_i2c - do not leave interrupt disabled on suspend failure
Make sure interrupts are not left disabled when we fail to suspend the
touch controller.

Fixes: 6696777c65 ("Input: add driver for Elan I2C/SMbus touchpad")
Link: https://lore.kernel.org/r/ZmKiiL-1wzKrhqBj@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-01 12:10:46 -07:00
Dmitry Torokhov
7c45951725 Input: ili210x - use guard notation when disabling and reenabling IRQ
This makes the code more compact and error handling more robust.

Link: https://lore.kernel.org/r/20240609234757.610273-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-28 15:15:20 -07:00
Dmitry Torokhov
ac7e0839da Input: ili210x - switch to using cleanup functions in firmware code
Start using __free() attributes to simplify the code and error handling.

Link: https://lore.kernel.org/r/20240609234757.610273-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-28 15:15:20 -07:00
Dmitry Torokhov
17f5eebf67 Input: ili210x - use kvmalloc() to allocate buffer for firmware update
Allocating a contiguous buffer of 64K may fail if memory is sufficiently
fragmented, and may cause OOM kill of an unrelated process. However we
do not need to have contiguous memory. We also do not need to zero
out the buffer since it will be overwritten with firmware data.

Switch to using kvmalloc() instead of kzalloc().

Link: https://lore.kernel.org/r/20240609234757.610273-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-28 15:15:08 -07:00
Dmitry Torokhov
f2845b4f1b Input: rohm_bu21023 - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code
and error handling.

Link: https://lore.kernel.org/r/20240609235134.614592-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-28 15:14:41 -07:00
Dmitry Torokhov
bf5cba8cf5 Input: rohm_bu21023 - switch to using sysfs_emit()
sysfs_emit() is preferred over snprintf() for sysfs attribute handling.

Link: https://lore.kernel.org/r/20240609235134.614592-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-28 15:14:41 -07:00