Commit Graph

1458 Commits

Author SHA1 Message Date
Javier Carrasco
20d1278d4b Input: sparcspkr - use cleanup facility for device_node
Use the 'free(device_node)' macro to simplify the code by automatically
freeing the device node, which removes the need for explicit calls to
'of_node_put()'.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Chen-Yu Tsai <wens@csie.org>
Link: https://lore.kernel.org/r/20241021-input_automate_of_node_put-v3-2-cc73f636e1bc@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-22 13:58:39 -07:00
Javier Carrasco
ddefcd779e Input: sparcspkr - use device managed memory for 'state'
Use devm_kzalloc() in bbc_bee_probe() and grover_beep_probe() to
automatically free 'state' when the device is removed. Drop the
kfree(state) calls from the probe error paths and the remove functions
accordingly.

Suggested-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241021-input_automate_of_node_put-v3-1-cc73f636e1bc@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-22 13:58:39 -07:00
Javier Carrasco
d3dcadd654 Input: twl4030-vibra - use cleanup facility for device_node
Use the '__free(device_node)' macro to simplify the code by
automatically freeing the device node.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-5-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-19 21:21:40 -07:00
Javier Carrasco
0ba9d3a597 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.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20241010-input_automate_of_node_put-v1-4-ebc62138fbf8@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-19 21:21:39 -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
Dmitry Torokhov
c03dfa7fdf 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044938.1049843-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:38 -07:00
Dmitry Torokhov
868d163aec 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044929.1049700-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:38 -07:00
Dmitry Torokhov
2dc387620b 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/ZtjJKxQRRzJE0aWZ@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:38 -07:00
Dmitry Torokhov
5bd3ade121 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044914.1049280-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:37 -07:00
Dmitry Torokhov
c684921854 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044902.1049017-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:37 -07:00
Dmitry Torokhov
844111df52 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044834.1048468-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:37 -07:00
Dmitry Torokhov
452e0adff2 Input: iqs7222 - 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: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20240904044825.1048256-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:37 -07:00
Dmitry Torokhov
52776177d8 Input: iqs626a - 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>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044814.1048062-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:37 -07:00
Dmitry Torokhov
9a540b67a9 Input: iqs269a - 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>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044806.1047847-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:37 -07:00
Dmitry Torokhov
d88460e480 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.

Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Link: https://lore.kernel.org/r/20240904044756.1047629-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
543429257d 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.

Reviewed-by: Eddie James <eajames@linux.ibm.com>
Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044735.1047285-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
21f6b6b47c 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-11-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
e5aee2d894 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-10-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
cf3f3a08e1 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-9-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
0a54609a89 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-8-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
6bbf7efc40 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-7-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:36 -07:00
Dmitry Torokhov
1313f0ad81 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-6-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Dmitry Torokhov
0cc842d191 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-5-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Dmitry Torokhov
d8a43a8363 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Dmitry Torokhov
61bbcc9fa1 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Dmitry Torokhov
f9f37373ff 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.

Reviewed-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Link: https://lore.kernel.org/r/20240904044244.1042174-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-10-03 09:10:35 -07:00
Shen Lichuan
515ef92b49 Input: correct typos in multiple comments across misc drivers
Fixed some confusing typos that were currently identified witch codespell,
the details are as follows:

-in the code comments:
drivers/input/misc/drv2665.c:18: Contol ==> Control
drivers/input/misc/drv2667.c:19: Contol ==> Control
drivers/input/misc/ideapad_slidebar.c:26: meaningfull ==> meaningful
drivers/input/misc/ims-pcu.c:742: bootoloader ==> bootloader
drivers/input/misc/kxtj9.c:28: funtion ==> function
drivers/input/misc/soc_button_array.c:518: indentical ==> identical
drivers/input/misc/wistron_btns.c:274: satelite ==> satellite
drivers/input/misc/yealink.c:380: singe ==> single
drivers/input/misc/yealink.c:617: coresponding ==> corresponding

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Link: https://lore.kernel.org/r/20240926075515.10042-1-shenlichuan@vivo.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-30 08:00:16 -07:00
David Lechner
82abef590e Input: ims-pcu - fix calling interruptible mutex
Fix calling scoped_cond_guard() with mutex instead of mutex_intr.

scoped_cond_guard(mutex, ...) will call mutex_lock() instead of
mutex_lock_interruptible().

Fixes: 703f12672e ("Input: ims-pcu - switch to using cleanup functions")
Signed-off-by: David Lechner <dlechner@baylibre.com>
Link: https://lore.kernel.org/r/20240910-input-misc-ims-pcu-fix-mutex-intr-v1-1-bdd983685c43@baylibre.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-09-10 16:13:44 -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
Shen Lichuan
b7ffc98a6a Input: wistron_btns - use kmemdup_array instead of kmemdup for multiple allocation
Let the kmemdup_array() take care about multiplication
and possible overflows.

Using kmemdup_array() is more appropriate and makes the code
easier to audit.

Signed-off-by: Shen Lichuan <shenlichuan@vivo.com>
Link: https://lore.kernel.org/r/20240826045253.3503-1-shenlichuan@vivo.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-26 10:22:00 -07:00
Linus Torvalds
7eb61cc674 Input updates for v6.11-rc4
- a tweak to uinput interface to reject requests with abnormally large
   number of slots. 100 slots/contacts should be enough for real devices
 
 - support for FocalTech FT8201 added to the edt-ft5x06 driver
 
 - tweaks to i8042 to handle more devices that have issue with its
   emulation
 
 - Synaptics touchpad switched to native SMbus/RMI mode on HP Elitebook
   840 G2
 
 - other minor fixes.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQST2eWILY88ieB2DOtAj56VGEWXnAUCZsjxKQAKCRBAj56VGEWX
 nKE9APwPOZl4TldhPLG37LCvlVmgN0cSSWY+PEEqIaxmFtezjQEAr2/qs1XknZVr
 LkuhmHxng2ZI9X4HUL+h52Lha7y4UAc=
 =3Pcb
 -----END PGP SIGNATURE-----

Merge tag 'input-for-v6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input fixes from Dmitry Torokhov:

 - a tweak to uinput interface to reject requests with abnormally large
   number of slots. 100 slots/contacts should be enough for real devices

 - support for FocalTech FT8201 added to the edt-ft5x06 driver

 - tweaks to i8042 to handle more devices that have issue with its
   emulation

 - Synaptics touchpad switched to native SMbus/RMI mode on HP Elitebook
   840 G2

 - other minor fixes

* tag 'input-for-v6.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
  Input: himax_hx83112b - fix incorrect size when reading product ID
  Input: i8042 - use new forcenorestore quirk to replace old buggy quirk combination
  Input: i8042 - add forcenorestore quirk to leave controller untouched even on s3
  Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table
  Input: uinput - reject requests with unreasonable number of slots
  Input: edt-ft5x06 - add support for FocalTech FT8201
  dt-bindings: input: touchscreen: edt-ft5x06: Document FT8201 support
  Input: adc-joystick - fix optional value handling
  Input: synaptics - enable SMBus for HP Elitebook 840 G2
  Input: ads7846 - ratelimit the spi_sync error message
2024-08-24 08:15:21 +08:00
Dmitry Torokhov
206f533a0a Input: uinput - reject requests with unreasonable number of slots
From: Dmitry Torokhov <dmitry.torokhov@gmail.com>

When exercising uinput interface syzkaller may try setting up device
with a really large number of slots, which causes memory allocation
failure in input_mt_init_slots(). While this allocation failure is
handled properly and request is rejected, it results in syzkaller
reports. Additionally, such request may put undue burden on the
system which will try to free a lot of memory for a bogus request.

Fix it by limiting allowed number of slots to 100. This can easily
be extended if we see devices that can track more than 100 contacts.

Reported-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Reported-by: syzbot <syzbot+0122fa359a69694395d5@syzkaller.appspotmail.com>
Closes: https://syzkaller.appspot.com/bug?extid=0122fa359a69694395d5
Link: https://lore.kernel.org/r/Zqgi7NYEbpRsJfa2@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-08-04 18:00:46 -07:00
Linus Torvalds
8e5c0abfa0 Input updates for v6.11-rc0
- streamlined logic in input core for handling normal input handlers vs
   input filters
 
 - updates to input drivers to allocate memory with sizeof(*pointer)
   instead of sizeof(type)
 
 - change to ads7846 touchscreen driver to use hsync GPIO instead of
   requiring platform data with special method (which is not compatible
   with boards using device tree)
 
 - update to adc-joystick driver to handle inverted axes
 
 - cleanups in various drivers switching them to use the new "guard"
   and "__free()" facilities
 
 - changes to several drivers (adxl34x, atmel_mxt_ts, ati-remote2,
   omap-keypad, yealink) to stop creating driver-specific device
   attributes manually and use driver core facilities for this
 
 - update to Cypress PS/2 protocol driver to properly handle errors
   from the PS/2 transport as well as other cleanups
 
 - update to edt-ft5x06 driver to support ft5426 variant
 
 - update to ektf2127 driver to support ektf2232 variant
 
 - update to exc3000 driver to support EXC81W32 variant
 
 - update to imagis driver to support IST3038 variant
 
 - other assorted driver cleanups.
 -----BEGIN PGP SIGNATURE-----
 
 iHUEABYIAB0WIQST2eWILY88ieB2DOtAj56VGEWXnAUCZpWmqQAKCRBAj56VGEWX
 nE00AQDsikkxIpF5GJo3mhHLHQc5noEB/zwwLNTqEmV/ThdffwD/bQmr0C0M1dhz
 fOM9NqeyhwKkgGd389AIzv/dV7KIGwI=
 =rQCl
 -----END PGP SIGNATURE-----

Merge tag 'input-for-v6.11-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input

Pull input updates from Dmitry Torokhov:

 - streamlined logic in input core for handling normal input handlers vs
   input filters

 - updates to input drivers to allocate memory with sizeof(*pointer)
   instead of sizeof(type)

 - change to ads7846 touchscreen driver to use hsync GPIO instead of
   requiring platform data with special method (which is not compatible
   with boards using device tree)

 - update to adc-joystick driver to handle inverted axes

 - cleanups in various drivers switching them to use the new "guard" and
   "__free()" facilities

 - changes to several drivers (adxl34x, atmel_mxt_ts, ati-remote2,
   omap-keypad, yealink) to stop creating driver-specific device
   attributes manually and use driver core facilities for this

 - update to Cypress PS/2 protocol driver to properly handle errors from
   the PS/2 transport as well as other cleanups

 - update to edt-ft5x06 driver to support ft5426 variant

 - update to ektf2127 driver to support ektf2232 variant

 - update to exc3000 driver to support EXC81W32 variant

 - update to imagis driver to support IST3038 variant

 - other assorted driver cleanups.

* tag 'input-for-v6.11-rc0' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input: (71 commits)
  Input: yealink - simplify locking in sysfs attribute handling
  Input: yealink - use driver core to instantiate device attributes
  Input: ati-remote2 - use driver core to instantiate device attributes
  Input: omap-keypad - use driver core to instantiate device attributes
  Input: atmel_mxt_ts - use driver core to instantiate device attributes
  Input: exc3000 - add EXC81W32 support
  dt-bindings: input: touchscreen: exc3000: add EXC81W32
  Input: twl4030-pwrbutton - fix kernel-doc warning
  Input: himax_hx83112b - add support for HX83100A
  Input: himax_hx83112b - add himax_chip struct for multi-chip support
  Input: himax_hx83112b - implement MCU register reading
  Input: himax_hx83112b - use more descriptive register defines
  dt-bindings: input: touchscreen: himax,hx83112b: add HX83100A
  Input: do not check number of events in input_pass_values()
  Input: preallocate memory to hold event values
  Input: rearrange input_alloc_device() to prepare for preallocating of vals
  Input: simplify event handling logic
  Input: make events() method return number of events processed
  Input: make sure input handlers define only one processing method
  Input: evdev - remove ->event() method
  ...
2024-07-19 16:51:39 -07:00
Jacky Bai
2f99ffd8d7 Input: bbnsm_pwrkey - fix missed key press after suspend
Report input event directly on wakeup to ensure no press event is missed
when resuming from suspend.

Signed-off-by: Jacky Bai <ping.bai@nxp.com>
Reviewed-by: Peng Fan <peng.fan@nxp.com>
Acked-by: Jason Liu <jason.hui.liu@nxp.com>
Signed-off-by: Frank Li <Frank.Li@nxp.com>
Link: https://lore.kernel.org/r/20240716000721.3485597-1-Frank.Li@nxp.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-07-15 21:39:55 -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
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
Lee Jones
f5ace55524 Merge branch 'ib-mfd-input-regulator-6.11' into ibs-for-mfd-merged 2024-07-04 17:06:42 +01:00
Karel Balej
914089db30 input: Add onkey driver for Marvell 88PM886 PMIC
Marvell 88PM886 PMIC provides onkey among other things. Add client
driver to handle it. The driver currently only provides a basic support
omitting additional functions found in the vendor version, such as long
onkey and GPIO integration.

Signed-off-by: Karel Balej <balejk@matfyz.cz>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20240531175109.15599-5-balejk@matfyz.cz
Signed-off-by: Lee Jones <lee@kernel.org>
2024-06-28 15:41:20 +01:00
James Ogletree
c38fe1bb5d Input: cs40l50 - Add support for the CS40L50 haptic driver
Introduce support for Cirrus Logic Device CS40L50: a
haptic driver with waveform memory, integrated DSP,
and closed-loop algorithms.

The input driver provides the interface for control of
haptic effects through the device.

Signed-off-by: James Ogletree <jogletre@opensource.cirrus.com>
Reviewed-by: Jeff LaBundy <jeff@labundy.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Link: https://lore.kernel.org/r/20240620161745.2312359-5-jogletre@opensource.cirrus.com
Signed-off-by: Lee Jones <lee@kernel.org>
2024-06-28 15:36:11 +01:00
Dmitry Torokhov
703f12672e Input: ims-pcu - switch to using cleanup functions
Start using __free() and guard() primitives to simplify the code
and error handling.

Link: https://lore.kernel.org/r/20240610041813.722445-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-20 14:57:08 -07:00
Dmitry Torokhov
204d18a7a0 Input: ims-pcu - 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.

Link: https://lore.kernel.org/r/20240610041813.722445-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-20 14:57:08 -07:00
Javier Carrasco
daa268ae28 Input: ims-pcu - drop repeated "input" in error message
This case of the common error message upon failure of
input_allocate_device() repeats the word "input".

Drop one "input" from the error message.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Link: https://lore.kernel.org/r/20240619-ims-pcu-counted_by-v1-2-3ee0ead2e57d@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-20 08:45:12 -07:00
Javier Carrasco
e8135f9dc7 Input: ims-pcu - annotate struct ims_pcu_flash_fmt with __counted_by
Use the __counted_by compiler attribute for the data[] flexible array
member to improve the results of array bound sanitizers.

Signed-off-by: Javier Carrasco <javier.carrasco.cruz@gmail.com>
Reviewed-by: Kees Cook <kees@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://lore.kernel.org/r/20240619-ims-pcu-counted_by-v1-1-3ee0ead2e57d@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-20 08:45:12 -07:00
Dmitry Torokhov
9b9247397e Input: adxl34x - switch to using "guard" notation
Switch to using guard(mutex)() notation to acquire and automatically
release mutexes.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Link: https://lore.kernel.org/r/20240610164301.1048482-4-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-11 11:17:52 -07:00
Dmitry Torokhov
985addc133 Input: adxl34x - switch to using managed resources
Switch the driver to use managed resources to simplify error handling.

Link: https://lore.kernel.org/r/20240610164301.1048482-3-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-11 11:17:44 -07:00
Dmitry Torokhov
8f275fc73d Input: adxl34x - use input_set_capability()
Switch to using input_set_capability() instead of using __set_bit() to
make clear what exactly kinds of events (EV_KEY, EV_REL) are being
declared.

Also drop redundant calls setting EV_ABS and ABS_X|Y|Z bits as that is
taken care by input_set_abs_params().

Link: https://lore.kernel.org/r/20240610164301.1048482-2-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
2024-06-11 11:17:44 -07:00