Javier Carrasco [Sun, 20 Oct 2024 04:18:57 +0000 (21:18 -0700)]
Input: ts4800-ts - use cleanup facility for device_node
Use the '__free(device_node)' macro to automatically free the device
node, removing the need for explicit calls to 'of_node_put()' to
decrement its refcount.
Javier Carrasco [Sun, 20 Oct 2024 04:18:30 +0000 (21:18 -0700)]
Input: raspberrypi-ts - use cleanup facility for device_node
Use the '__free(device_node)' macro to automatically free the device
node, removing the need for explicit calls to 'of_node_put()' to
decrement its refcount.
Javier Carrasco [Sun, 20 Oct 2024 04:15:41 +0000 (21:15 -0700)]
Input: i8042 - use cleanup facility for device_node
Use the '__free(device_node)' macro to automatically free the device
node, removing the need for explicit calls to 'of_node_put()' to
decrement its refcount.
Javier Carrasco [Sun, 20 Oct 2024 04:14:57 +0000 (21:14 -0700)]
Input: 88pm860x - use cleanup facility for device_node
Use the '__free(device_node)' macro to simplify the code and error
handling. This makes the code more robust by ensuring that the device
node is always freed.
Drop the first assignment to 'pdev->dev.parent->of_node', as it was only
a shortcut, and tie 'np' to its usage as a child node.
Javier Carrasco [Sun, 20 Oct 2024 04:07:19 +0000 (21:07 -0700)]
Input: twl6040-vibra - use cleanup facility for device_node
Use the '__free(device_node)' macro to simplify the code and error
handling. This makes the error handling more robust by ensuring that the
device node is always freed.
Javier Carrasco [Sun, 20 Oct 2024 04:01:07 +0000 (21:01 -0700)]
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.
Javier Carrasco [Sun, 20 Oct 2024 03:59:49 +0000 (20:59 -0700)]
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.
Javier Carrasco [Sun, 20 Oct 2024 03:59:02 +0000 (20:59 -0700)]
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.
Dmitry Torokhov [Sat, 19 Oct 2024 21:07:42 +0000 (14:07 -0700)]
Input: gscps2 - fix compilation error introduced with switch to guards
Change 44f920069911 ("Input: gscps2 - use guard notation when acquiring
spinlock") introduced typos resulting in compile errors noticed by the
kernel test robot. Fix them.
Reported-by: kernel test robot <lkp@intel.com> Closes: https://lore.kernel.org/oe-kbuild-all/202410192242.GL0CoAbv-lkp@intel.com/ Fixes: 44f920069911 ("Input: gscps2 - use guard notation when acquiring spinlock") Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Uwe Kleine-König [Tue, 8 Oct 2024 09:00:10 +0000 (11:00 +0200)]
Input: switch back to struct platform_driver::remove()
After commit 0edb555a65d1 ("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.
Input: xilinx_ps2 - 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.
Input: sun4i-ps2 - 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.
Input: serio-raw - fix potential serio port name truncation
When compiling with W=1 the following warnings are triggered:
drivers/input/serio/serio_raw.c: In function ‘serio_raw_connect’:
drivers/input/serio/serio_raw.c:303:28: error: ‘%ld’ directive output may be truncated writing between 1 and 11 bytes into a region of size 7 [-Werror=format-truncation=]
303 | "serio_raw%ld", (long)atomic_inc_return(&serio_raw_no));
atomic_inc_return() returns an int, so there is no reason to cast it
to long and print as such. Fix the issue by removing the cast,
printing it as unsigned decimal, and expanding the name from 16 to 20
bytes to accommodate the largest possible port number.
Input: serio_raw - use guard notation for locks and other resources
Use guard notation when acquiring mutexes and spinlocks, and when
pausing and resuming serio port. Such 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.
Input: serio - use guard notation when acquiring mutexes and spinlocks
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.
Input: serport - 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.
Input: sa1111ps2 - 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.
Input: q40kbd - 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.
Input: ps2mult - 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.
Input: ps2-gpio - 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.
Input: i8042 - 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.
Input: hyperv-keyboard - 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.
Input: gscps2 - 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.
Input: elo - 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.
Input: synaptics-rmi4 - use guard notation when pausing serio port in F03
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.
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.
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.
Input: synaptics - 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.
Input: byd - 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.
Input: alps - 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.
Input: libps2 - use guard notation when temporarily pausing serio ports
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.
Input: serio - define serio_pause_rx guard to pause and resume serio ports
serio_pause_rx() and serio_continue_rx() are usually used together to
temporarily stop receiving interrupts/data for a given serio port.
Define "serio_pause_rx" guard for this so that the port is always
resumed once critical section is over.
Input: sparcspkr - 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.
Input: rotary_encoder - 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.
Input: regulator-haptic - 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.
Input: pwm-beeper - 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.
Input: powermate - 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.
Input: pegasus_notetaker - 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.
Input: max8997_haptic - 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.
Input: iqs269a - 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.
Input: ibm-panel - 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.
Input: ideapad_slidebar - 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.
Input: drv2667 - 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.
Input: drv2665 - 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.
Input: drv260x - 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.
Input: kxtj9 - use guard notation when acquiring mutex/disabling irq
Using guard notation makes the code more compact and error handling
more robust by ensuring that mutexes are released and interrupts are
re-enabled in all code paths when control leaves critical section.
Input: da7280 - use guard notation when acquiring mutex and 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.
Input: cma3000_d0x - 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.
Input: cm109 - use guard notation when acquiring mutex and 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.
Input: ati_remote2 - 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.
Input: ad714x - 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.
Input: xpad - use guard notation when acquiring mutex and 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.
Input: turbografx - 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.
Input: n64joy - 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.
Input: iforce - use guard notation when acquiring mutex and 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.
Input: gamecon - 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.
Input: db9 - 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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:20 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:19 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:18 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:17 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:16 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:15 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:14 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:13 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:11 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:10 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:08 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:06 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:16:05 +0000 (22:16 -0700)]
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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:28:43 +0000 (22:28 -0700)]
Input: elan_i2c - 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.
Dmitry Torokhov [Sun, 25 Aug 2024 05:26:03 +0000 (22:26 -0700)]
Input: psmouse-smbus - 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.
Joel Selvaraj [Sat, 1 Jun 2024 20:44:45 +0000 (15:44 -0500)]
Input: novatek-nvt-ts - add support for NT36672A touchscreen
Extend the novatek touchscreen driver to support NT36672A chip which
is found in phones like qcom/sdm845-xiaomi-beryllium-tianma.dts.
Added devicetree support for the driver and used i2c chip data to handle
the variation in chip id and wake type. Also added vcc and iovcc
regulators which are used to power the touchscreen hardware.
Document the Novatek NVT touchscreen controller present in devices like
qcom/sdm845-xiaomi-beryllium-tianma.dts. Also, include the devictree
binding file in the MAINTAINERS file.
To ensure code clarity and prevent potential errors, it's advisable
to employ the ';' as a statement separator, except when ',' are
intentionally used for specific purposes.
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.
Input: ps2-gpio - use IRQF_NO_AUTOEN flag in request_irq()
disable_irq() after request_irq() still has a time gap in which
interrupts can come. request_irq() with IRQF_NO_AUTOEN flag will
disable IRQ auto-enable when request IRQ.
Dmitry Torokhov [Sat, 24 Aug 2024 05:50:42 +0000 (22:50 -0700)]
Input: zforce_ts - switch to using asynchronous probing
The driver waits for the device to boot, which can be a lengthy
process. Switch it to asynchronous probing to allow more devices
to be probed simultaneously.
Dmitry Torokhov [Sat, 24 Aug 2024 05:50:38 +0000 (22:50 -0700)]
Input: zforce_ts - stop treating VDD regulator as optional
This regulator is not optional from the controller point of view,
so stop treating it as such. For hard-wired designs that omit the
regulator from their device trees regulator subsystem will create
a dummy instance.
This may introduce unnecessary delay of 100us in case of dummy
regulator, but if it is important the driver should be marked as
using asynchronous probing to avoid even longer delays waiting for
the command completions.
Also use usleep_range() instead of udelay() to avoid spinning.
Dmitry Torokhov [Sat, 24 Aug 2024 05:50:35 +0000 (22:50 -0700)]
Input: zforce_ts - do not ignore errors when acquiring regulator
We should abort probe on any error besides -ENOENT which signifies that
the regulator is not defined in device tree or elsewhere, not only
when we see -EPROBE_DEFER.
Dmitry Torokhov [Sat, 24 Aug 2024 05:50:34 +0000 (22:50 -0700)]
Input: zforce_ts - make parsing of contacts less confusing
Zforce touch data packet consists of a byte representing number of
contacts followed by several chunks with length of 9 bytes representing
each contact. Instead of accounting for the leading byte by increasing
offset of each field in contacts by one introduce a pointer to contact
data and point it appropriately. This avoids awkward constructs like:
point.prblty = payload[9 * i + 9];
which makes it seem like there is off-by-one error, in favor of more
straightforward: