]> www.infradead.org Git - linux.git/log
linux.git
8 months agoInput: cypress_ps2 - fix waiting for command response
Dmitry Torokhov [Thu, 29 Aug 2024 15:38:54 +0000 (08:38 -0700)]
Input: cypress_ps2 - fix waiting for command response

Commit 8bccf667f62a ("Input: cypress_ps2 - report timeouts when reading
command status") uncovered an existing problem with cypress_ps2 driver:
it tries waiting on a PS/2 device waitqueue without using the rest of
libps2. Unfortunately without it nobody signals wakeup for the
waiting process, and each "extended" command was timing out. But the
rest of the code simply did not notice it.

Fix this by switching from homegrown way of sending request to get
command response and reading it to standard ps2_command() which does
the right thing.

Reported-by: Woody Suwalski <terraluna977@gmail.com>
Tested-by: Woody Suwalski <terraluna977@gmail.com>
Fixes: 8bccf667f62a ("Input: cypress_ps2 - report timeouts when reading command status")
Link: https://lore.kernel.org/r/a8252e0f-dab4-ef5e-2aa1-407a6f4c7204@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: himax_hx83112b - fix incorrect size when reading product ID
Dmitry Torokhov [Tue, 20 Aug 2024 00:04:42 +0000 (17:04 -0700)]
Input: himax_hx83112b - fix incorrect size when reading product ID

We need to read a u32 value (4 bytes), not size of a pointer to that
value.

Also, himax_read_mcu() wrapper is an overkill, remove it and use
himax_bus_read() directly.

Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202408200301.Ujpj7Vov-lkp@intel.com/
Fixes: 0944829d491e ("Input: himax_hx83112b - implement MCU register reading")
Tested-by: Felix Kaechele <felix@kaechele.ca>
Link: https://lore.kernel.org/r/ZsPdmtfC54R7JVxR@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: i8042 - use new forcenorestore quirk to replace old buggy quirk combination
Werner Sembach [Thu, 4 Jan 2024 18:31:18 +0000 (19:31 +0100)]
Input: i8042 - use new forcenorestore quirk to replace old buggy quirk combination

The old quirk combination sometimes cause a laggy keyboard after boot. With
the new quirk the initial issue of an unresponsive keyboard after s3 resume
is also fixed, but it doesn't have the negative side effect of the
sometimes laggy keyboard.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Cc: stable@vger.kernel.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240104183118.779778-3-wse@tuxedocomputers.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: i8042 - add forcenorestore quirk to leave controller untouched even on s3
Werner Sembach [Thu, 4 Jan 2024 18:31:17 +0000 (19:31 +0100)]
Input: i8042 - add forcenorestore quirk to leave controller untouched even on s3

On s3 resume the i8042 driver tries to restore the controller to a known
state by reinitializing things, however this can confuse the controller
with different effects. Mostly occasionally unresponsive keyboards after
resume.

These issues do not rise on s0ix resume as here the controller is assumed
to preserved its state from before suspend.

This patch adds a quirk for devices where the reinitialization on s3 resume
is not needed and might be harmful as described above. It does this by
using the s0ix resume code path at selected locations.

This new quirk goes beyond what the preexisting reset=never quirk does,
which only skips some reinitialization steps.

Signed-off-by: Werner Sembach <wse@tuxedocomputers.com>
Cc: stable@vger.kernel.org
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/20240104183118.779778-2-wse@tuxedocomputers.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table
Takashi Iwai [Wed, 14 Aug 2024 10:06:19 +0000 (12:06 +0200)]
Input: i8042 - add Fujitsu Lifebook E756 to i8042 quirk table

Yet another quirk entry for Fujitsu laptop.  Lifebook E756 requires
i8041.nomux for keeping the touchpad working after suspend/resume.

Link: https://bugzilla.suse.com/show_bug.cgi?id=1229056
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/r/20240814100630.2048-1-tiwai@suse.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: uinput - reject requests with unreasonable number of slots
Dmitry Torokhov [Mon, 5 Aug 2024 00:50:25 +0000 (17:50 -0700)]
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>
8 months agoInput: edt-ft5x06 - add support for FocalTech FT8201
Felix Kaechele [Sun, 4 Aug 2024 03:13:10 +0000 (23:13 -0400)]
Input: edt-ft5x06 - add support for FocalTech FT8201

The driver supports the FT8201 chip as well. It registers up to 10 touch
points.

Tested on: Lenovo ThinkSmart View (CD-18781Y), LCM: BOE TV080WXM-LL4

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Link: https://lore.kernel.org/r/20240804031310.331871-3-felix@kaechele.ca
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agodt-bindings: input: touchscreen: edt-ft5x06: Document FT8201 support
Felix Kaechele [Sun, 4 Aug 2024 03:13:09 +0000 (23:13 -0400)]
dt-bindings: input: touchscreen: edt-ft5x06: Document FT8201 support

Document FocalTech FT8201 support by adding the compatible.

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240804031310.331871-2-felix@kaechele.ca
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
8 months agoInput: adc-joystick - fix optional value handling
John Keeping [Wed, 31 Jul 2024 09:33:09 +0000 (10:33 +0100)]
Input: adc-joystick - fix optional value handling

The abs-fuzz and abs-flat properties are documented as optional.  When
these are absent, fwnode_property_read_u32() will leave the input
unchanged, meaning that an axis either picks up the value for the
previous axis or an uninitialized value.

Explicitly set these values to zero when they are unspecified to match
the documented behaviour in the device tree bindings.

Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
Link: https://lore.kernel.org/r/20240731093310.3696919-1-jkeeping@inmusicbrands.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: synaptics - enable SMBus for HP Elitebook 840 G2
Jonathan Denose [Wed, 24 Jul 2024 04:33:30 +0000 (21:33 -0700)]
Input: synaptics - enable SMBus for HP Elitebook 840 G2

The kernel reports that the touchpad for this device can support a
different bus.

With SMBus enabled the touchpad movement is smoother and three-finger
gestures are recognized.

Signed-off-by: Jonathan Denose <jdenose@google.com>
Link: https://lore.kernel.org/r/20240719180612.1.Ib652dd808c274076f32cd7fc6c1160d2cf71753b@changeid
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: ads7846 - ratelimit the spi_sync error message
Marek Vasut [Mon, 8 Jul 2024 21:18:57 +0000 (23:18 +0200)]
Input: ads7846 - ratelimit the spi_sync error message

In case the touch controller is not connected, this message keeps scrolling
on the console indefinitelly. Ratelimit it to avoid filling kernel logs.

"
ads7846 spi2.1: spi_sync --> -22
"

Signed-off-by: Marek Vasut <marex@denx.de>
Link: https://lore.kernel.org/r/20240708211913.171243-1-marex@denx.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoMerge branch 'next' into for-linus
Dmitry Torokhov [Mon, 15 Jul 2024 21:03:44 +0000 (14:03 -0700)]
Merge branch 'next' into for-linus

Prepare input updates for 6.11 merge window.

9 months agoInput: yealink - simplify locking in sysfs attribute handling
Dmitry Torokhov [Wed, 10 Jul 2024 23:48:54 +0000 (16:48 -0700)]
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>
9 months agoInput: yealink - use driver core to instantiate device attributes
Dmitry Torokhov [Wed, 10 Jul 2024 23:48:53 +0000 (16:48 -0700)]
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>
9 months agoInput: ati-remote2 - use driver core to instantiate device attributes
Dmitry Torokhov [Wed, 10 Jul 2024 23:59:36 +0000 (16:59 -0700)]
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>
9 months agoInput: omap-keypad - use driver core to instantiate device attributes
Dmitry Torokhov [Thu, 11 Jul 2024 05:03:29 +0000 (22:03 -0700)]
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>
9 months agoInput: atmel_mxt_ts - use driver core to instantiate device attributes
Dmitry Torokhov [Thu, 11 Jul 2024 04:49:12 +0000 (21:49 -0700)]
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>
9 months agoInput: exc3000 - add EXC81W32 support
Philipp Zabel [Wed, 10 Jul 2024 10:28:32 +0000 (12:28 +0200)]
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>
9 months agodt-bindings: input: touchscreen: exc3000: add EXC81W32
Philipp Zabel [Wed, 10 Jul 2024 10:28:31 +0000 (12:28 +0200)]
dt-bindings: input: touchscreen: exc3000: add EXC81W32

Add compatible for EXC81W32 touchscreen controllers.
They use the same protocol and have the same resolution as EXC80H84.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240710-input-exc3000-exc81w32-v3-1-4272183628b4@pengutronix.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: twl4030-pwrbutton - fix kernel-doc warning
Dmitry Torokhov [Wed, 10 Jul 2024 00:04:35 +0000 (17:04 -0700)]
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>
9 months agoInput: himax_hx83112b - add support for HX83100A
Felix Kaechele [Thu, 20 Jun 2024 14:50:06 +0000 (10:50 -0400)]
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>
9 months agoInput: himax_hx83112b - add himax_chip struct for multi-chip support
Felix Kaechele [Thu, 20 Jun 2024 14:50:05 +0000 (10:50 -0400)]
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>
9 months agoInput: himax_hx83112b - implement MCU register reading
Felix Kaechele [Thu, 20 Jun 2024 14:50:04 +0000 (10:50 -0400)]
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>
9 months agoInput: himax_hx83112b - use more descriptive register defines
Felix Kaechele [Thu, 20 Jun 2024 14:50:03 +0000 (10:50 -0400)]
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>
9 months agodt-bindings: input: touchscreen: himax,hx83112b: add HX83100A
Felix Kaechele [Thu, 20 Jun 2024 14:50:02 +0000 (10:50 -0400)]
dt-bindings: input: touchscreen: himax,hx83112b: add HX83100A

Add a compatible string for the Himax HX83100A touch controller.

The HX83100A presents touch events on the internal bus rather than
offering a dedicated event register like the other chips in this family
do.

Signed-off-by: Felix Kaechele <felix@kaechele.ca>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240620145019.156187-2-felix@kaechele.ca
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: do not check number of events in input_pass_values()
Dmitry Torokhov [Wed, 3 Jul 2024 21:37:54 +0000 (14:37 -0700)]
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>
9 months agoInput: preallocate memory to hold event values
Dmitry Torokhov [Wed, 3 Jul 2024 21:37:53 +0000 (14:37 -0700)]
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>
9 months agoInput: rearrange input_alloc_device() to prepare for preallocating of vals
Dmitry Torokhov [Wed, 3 Jul 2024 21:37:52 +0000 (14:37 -0700)]
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>
9 months agoInput: simplify event handling logic
Dmitry Torokhov [Wed, 3 Jul 2024 21:37:51 +0000 (14:37 -0700)]
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>
9 months agoInput: make events() method return number of events processed
Dmitry Torokhov [Wed, 3 Jul 2024 21:37:50 +0000 (14:37 -0700)]
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>
9 months agoInput: make sure input handlers define only one processing method
Dmitry Torokhov [Wed, 3 Jul 2024 21:37:49 +0000 (14:37 -0700)]
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>
9 months agoInput: evdev - remove ->event() method
Dmitry Torokhov [Wed, 3 Jul 2024 21:37:48 +0000 (14:37 -0700)]
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>
9 months agoInput: imagis - add supports for Imagis IST3038
Raymond Hackley [Thu, 13 Jun 2024 02:57:11 +0000 (02:57 +0000)]
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>
9 months agodt-bindings: input/touchscreen: imagis: Document ist3038
Raymond Hackley [Thu, 13 Jun 2024 02:57:03 +0000 (02:57 +0000)]
dt-bindings: input/touchscreen: imagis: Document ist3038

Imagis IST3038 is a variant of Imagis touchscreen IC. Document it in
imagis,ist3038c bindings.

Signed-off-by: Raymond Hackley <raymondhackley@protonmail.com>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240613025631.5425-3-raymondhackley@protonmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: imagis - clarify the usage of protocol_b
Raymond Hackley [Thu, 13 Jun 2024 02:56:54 +0000 (02:56 +0000)]
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>
9 months agodt-bindings: input: ti,nspire-keypad: convert to YAML format
Andrew Davis [Wed, 12 Jun 2024 15:07:11 +0000 (10:07 -0500)]
dt-bindings: input: ti,nspire-keypad: convert to YAML format

Convert TI-NSPIRE Keypad controller bindings to DT schema.

Signed-off-by: Andrew Davis <afd@ti.com>
Reviewed-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240612150711.26706-1-afd@ti.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
9 months agoInput: fsl-imx25-tcq - constify struct regmap_config
Javier Carrasco [Fri, 5 Jul 2024 17:38:51 +0000 (19:38 +0200)]
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>
9 months agoInput: qt1050 - constify struct regmap_config
Javier Carrasco [Fri, 5 Jul 2024 17:38:50 +0000 (19:38 +0200)]
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>
9 months agoInput: cypress_ps2 - use u8 when dealing with byte data
Dmitry Torokhov [Fri, 28 Jun 2024 22:47:27 +0000 (15:47 -0700)]
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>
9 months agoInput: cypress_ps2 - propagate errors from lower layers
Dmitry Torokhov [Fri, 28 Jun 2024 22:47:26 +0000 (15:47 -0700)]
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>
9 months agoInput: cypress_ps2 - report timeouts when reading command status
Dmitry Torokhov [Fri, 28 Jun 2024 22:47:25 +0000 (15:47 -0700)]
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>
9 months agoInput: cypress_ps2 - fix error handling when sending command fails
Dmitry Torokhov [Fri, 28 Jun 2024 22:47:24 +0000 (15:47 -0700)]
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>
9 months agoInput: cypress_ps2 - clean up setting reporting rate
Dmitry Torokhov [Fri, 28 Jun 2024 22:47:23 +0000 (15:47 -0700)]
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>
9 months agoInput: elan_i2c - do not leave interrupt disabled on suspend failure
Dmitry Torokhov [Fri, 7 Jun 2024 06:02:48 +0000 (23:02 -0700)]
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: 6696777c6506 ("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>
10 months agoInput: ili210x - use guard notation when disabling and reenabling IRQ
Dmitry Torokhov [Sun, 9 Jun 2024 23:47:55 +0000 (16:47 -0700)]
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>
10 months agoInput: ili210x - switch to using cleanup functions in firmware code
Dmitry Torokhov [Sun, 9 Jun 2024 23:47:54 +0000 (16:47 -0700)]
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>
10 months agoInput: ili210x - use kvmalloc() to allocate buffer for firmware update
Dmitry Torokhov [Sun, 9 Jun 2024 23:47:53 +0000 (16:47 -0700)]
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>
10 months agoInput: rohm_bu21023 - switch to using cleanup functions
Dmitry Torokhov [Sun, 9 Jun 2024 23:51:32 +0000 (16:51 -0700)]
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>
10 months agoInput: rohm_bu21023 - switch to using sysfs_emit()
Dmitry Torokhov [Sun, 9 Jun 2024 23:51:31 +0000 (16:51 -0700)]
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>
10 months agoInput: rohm_bu21023 - factor out settings update code
Dmitry Torokhov [Sun, 9 Jun 2024 23:51:30 +0000 (16:51 -0700)]
Input: rohm_bu21023 - factor out settings update code

The code to toggle axis swapping and inversion is repetitive and can
be factored out.

Link: https://lore.kernel.org/r/20240609235134.614592-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: goodix_berlin - use __free() cleanup in SPI transport
Dmitry Torokhov [Wed, 12 Jun 2024 05:42:32 +0000 (22:42 -0700)]
Input: goodix_berlin - use __free() cleanup in SPI transport

Switch the driver to use __free(kfree) cleanup facility instead of
freeing memory by hand.

Link: https://lore.kernel.org/r/Zmk1SGwVt3rIbbMU@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: wacom_w8001 - use "guard" notation when acquiring mutex
Dmitry Torokhov [Wed, 12 Jun 2024 05:31:42 +0000 (22:31 -0700)]
Input: wacom_w8001 - use "guard" notation when acquiring mutex

Switch the driver to use guard notation when acquiring mutex to
have it released automatically.

Link: https://lore.kernel.org/r/Zmkyvkr9AFyywy1V@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoMerge branch 'ib/ads7846-hsync' into next
Dmitry Torokhov [Thu, 27 Jun 2024 17:17:15 +0000 (10:17 -0700)]
Merge branch 'ib/ads7846-hsync' into next

Bring in ADS7846 hsync changes.

10 months agoInput: qt1050 - handle CHIP_ID reading error
Andrei Lalaev [Mon, 17 Jun 2024 18:30:18 +0000 (20:30 +0200)]
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: cbebf5addec1 ("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>
10 months agoInput: edt-ft5x06 - add ft5426
Andreas Kemnade [Wed, 1 May 2024 20:47:58 +0000 (22:47 +0200)]
Input: edt-ft5x06 - add ft5426

As ft5426 seems to be compatible with this driver, add it.
Debug output during identification: Model "generic ft5x06 (79)", Rev. "

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Oliver Graute <oliver.graute@kococonnector.com>
Link: https://lore.kernel.org/r/20240501204758.758537-3-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agodt-bindings: input: touchscreen: edt-ft5x06: Add ft5426
Andreas Kemnade [Wed, 1 May 2024 20:47:57 +0000 (22:47 +0200)]
dt-bindings: input: touchscreen: edt-ft5x06: Add ft5426

Add compatible for ft5426.
Searches for documentation reveal neither edt nor evervision
as some related company, only FocalTech.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Reviewed-by: Oliver Graute <oliver.graute@kococonnector.com>
Link: https://lore.kernel.org/r/20240501204758.758537-2-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: ektf2127 - add ektf2232 support
Andreas Kemnade [Fri, 21 Jun 2024 22:40:22 +0000 (00:40 +0200)]
Input: ektf2127 - add ektf2232 support

The chip is similar, but has status bits at different positions,
so use the correct bits.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Link: https://lore.kernel.org/r/20240621224022.1620897-4-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agodt-bindings: touchscreen: elan,ektf2127: Add EKTF2232
Andreas Kemnade [Fri, 21 Jun 2024 22:40:21 +0000 (00:40 +0200)]
dt-bindings: touchscreen: elan,ektf2127: Add EKTF2232

Add a compatible for the EKTF2232, which is similar to other chips in this
document.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240621224022.1620897-3-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agodt-bindings: touchscreen: convert elan,ektf2127 to json-schema
Andreas Kemnade [Fri, 21 Jun 2024 22:40:20 +0000 (00:40 +0200)]
dt-bindings: touchscreen: convert elan,ektf2127 to json-schema

Convert EKTF2127 infrared touchscreen controller binding to DT schema
and add ektf2232 compatible.

Signed-off-by: Andreas Kemnade <andreas@kemnade.info>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240621224022.1620897-2-andreas@kemnade.info
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: ads7846 - handle HSYNC GPIO
Linus Walleij [Fri, 21 Jun 2024 20:35:52 +0000 (13:35 -0700)]
Input: ads7846 - handle HSYNC GPIO

Add handling of HSYNC signal emitted by the TI ADS7846 if it is hooked
up to a GPIO.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20240430-gpio-leds-miscarm-v1-3-9c94d7711f6c@linaro.org
[dtor: dropped Spitz changes, kept platform data wait_for_sync option]
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agodt-bindings: ads7846: Add hsync-gpios
Linus Walleij [Fri, 21 Jun 2024 20:34:44 +0000 (13:34 -0700)]
dt-bindings: ads7846: Add hsync-gpios

The TI ADS7846 emits a horizontal sync signal that is usually
connected to a GPIO for polling. Add a binding for this.

Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Conor Dooley <conor.dooley@microchip.com>
Link: https://lore.kernel.org/r/20240430-gpio-leds-miscarm-v1-2-9c94d7711f6c@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: adc-joystick - move axes data into the main structure
Dmitry Torokhov [Fri, 21 Jun 2024 00:38:55 +0000 (17:38 -0700)]
Input: adc-joystick - move axes data into the main structure

There is no need to allocate axes information separately from the main
joystick structure so let's fold the allocation and also drop members
(such as range, flat and fuzz) that are only used during initialization
of the device.

Acked-by: Artur Rojek <contact@artur-rojek.eu>
Link: https://lore.kernel.org/r/ZmkrgTlxNwm_oHxv@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: ims-pcu - switch to using cleanup functions
Dmitry Torokhov [Mon, 10 Jun 2024 04:18:11 +0000 (21:18 -0700)]
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>
10 months agoInput: ims-pcu - use driver core to instantiate device attributes
Dmitry Torokhov [Mon, 10 Jun 2024 04:18:10 +0000 (21:18 -0700)]
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>
10 months agoInput: ims-pcu - drop repeated "input" in error message
Javier Carrasco [Wed, 19 Jun 2024 21:13:22 +0000 (23:13 +0200)]
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>
10 months agoInput: ims-pcu - annotate struct ims_pcu_flash_fmt with __counted_by
Javier Carrasco [Wed, 19 Jun 2024 21:13:21 +0000 (23:13 +0200)]
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>
10 months agoInput: ads7846 - use spi_device_id table
Alexander Stein [Wed, 19 Jun 2024 12:27:02 +0000 (14:27 +0200)]
Input: ads7846 - use spi_device_id table

As the driver supports more devices over time the single MODULE_ALIAS
is complete and raises several warnings:
SPI driver ads7846 has no spi_device_id for ti,tsc2046
SPI driver ads7846 has no spi_device_id for ti,ads7843
SPI driver ads7846 has no spi_device_id for ti,ads7845
SPI driver ads7846 has no spi_device_id for ti,ads7873

Fix this by adding a spi_device_id table and removing the manual
MODULE_ALIAS.

Signed-off-by: Alexander Stein <alexander.stein@ew.tq-group.com>
Link: https://lore.kernel.org/r/20240619122703.2081476-1-alexander.stein@ew.tq-group.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: adxl34x - switch to using "guard" notation
Dmitry Torokhov [Mon, 10 Jun 2024 16:43:00 +0000 (09:43 -0700)]
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>
10 months agoInput: adxl34x - switch to using managed resources
Dmitry Torokhov [Mon, 10 Jun 2024 16:42:59 +0000 (09:42 -0700)]
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>
10 months agoInput: adxl34x - use input_set_capability()
Dmitry Torokhov [Mon, 10 Jun 2024 16:42:58 +0000 (09:42 -0700)]
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>
10 months agoInput: adxl34x - use device core to create driver-specific device attributes
Dmitry Torokhov [Mon, 10 Jun 2024 16:42:57 +0000 (09:42 -0700)]
Input: adxl34x - use device core to create driver-specific device attributes

Instead of creating driver-specific device attributes with
sysfs_create_group() have device core do this by setting up dev_groups
pointer in the driver structure.

Reviewed-by: Nuno Sa <nuno.sa@analog.com>
Acked-by: Michael Hennerich <michael.hennerich@analog.com>
Link: https://lore.kernel.org/r/20240610164301.1048482-1-dmitry.torokhov@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: add missing MODULE_DESCRIPTION() macros
Jeff Johnson [Sun, 9 Jun 2024 20:03:30 +0000 (13:03 -0700)]
Input: add missing MODULE_DESCRIPTION() macros

On x86, make allmodconfig && make W=1 C=1 reports:
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/touchscreen/cyttsp_i2c_common.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/misc/soc_button_array.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/matrix-keymap.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/vivaldi-fmap.o
WARNING: modpost: missing MODULE_DESCRIPTION() in drivers/input/tests/input_test.o

Add the missing invocation of the MODULE_DESCRIPTION() macro to all
files which have a MODULE_LICENSE().

This includes drivers/input/misc/sgi_btns.c which, although it did not
produce a warning with the x86 allmodconfig configuration, may cause
this warning with other configurations when either CONFIG_SGI_IP22 or
CONFIG_SGI_IP32 is enabled.

Signed-off-by: Jeff Johnson <quic_jjohnson@quicinc.com>
Link: https://lore.kernel.org/r/20240609-md-drivers-input-v1-1-a2f394e0f9d8@quicinc.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: joystick - use sizeof(*pointer) instead of sizeof(type)
Erick Archer [Sat, 8 Jun 2024 15:13:57 +0000 (17:13 +0200)]
Input: joystick - use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter).

At the same time refactor the code to not use assignment in "if"
conditions.

This patch has no effect on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Link: https://lore.kernel.org/r/AS8PR02MB7237FEA55FAC8A9453F2DA6F8BC42@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: touchscreen - use sizeof(*pointer) instead of sizeof(type)
Erick Archer [Sat, 8 Jun 2024 14:34:49 +0000 (16:34 +0200)]
Input: touchscreen - use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter).

The refactoring is mostly trivial except for "usbtouchscreen.c"
file. Here, in the "mtouch_alloc" and "nexio_alloc" functions,
it is necessary to use a variable with a predefined type instead
of the "usbtouch->priv" variable (void * type). This way, the
"sizeof" operator can now know the correct size. Moreover, we
need to set the "usbtouch->priv" pointer after the memory
allocation since now the "kmalloc" return value is not assigned
directly.

This patch has no effect on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Link: https://lore.kernel.org/r/AS8PR02MB723708364CC0DF2EAAFEE5968BC42@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: xpad - add support for ASUS ROG RAIKIRI PRO
Luke D. Jones [Fri, 7 Jun 2024 23:37:48 +0000 (16:37 -0700)]
Input: xpad - add support for ASUS ROG RAIKIRI PRO

Add the VID/PID for ASUS ROG RAIKIRI PRO to the list of known devices.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Link: https://lore.kernel.org/r/20240607223722.1170776-1-luke@ljones.dev
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: ili210x - fix ili251x_read_touch_data() return value
John Keeping [Thu, 23 May 2024 08:56:24 +0000 (09:56 +0100)]
Input: ili210x - fix ili251x_read_touch_data() return value

The caller of this function treats all non-zero values as an error, so
the return value of i2c_master_recv() cannot be returned directly.

This fixes touch reporting when there are more than 6 active touches.

Fixes: ef536abd3afd1 ("Input: ili210x - define and use chip operations structure")
Signed-off-by: John Keeping <jkeeping@inmusicbrands.com>
Link: https://lore.kernel.org/r/20240523085624.2295988-1-jkeeping@inmusicbrands.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: cap11xx - stop using chip ID when configuring it
Dmitry Torokhov [Wed, 13 Dec 2023 05:33:58 +0000 (21:33 -0800)]
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>
10 months agoInput: adc-joystick - handle inverted axes
Chris Morgan [Fri, 19 Jan 2024 08:19:08 +0000 (00:19 -0800)]
Input: adc-joystick - handle inverted axes

When one or more axes are inverted, (where min > max), normalize the
data so that min < max and invert the values reported to the input
stack.

This ensures we can continue defining the device correctly in the
device tree while not breaking downstream assumptions that min is
always less than max.

Signed-off-by: Chris Morgan <macromorgan@hotmail.com>
Acked-by: Artur Rojek <contact@artur-rojek.eu>
Link: https://lore.kernel.org/r/20240115192752.266367-1-macroalpha82@gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: gameport - use sizeof(*pointer) instead of sizeof(type)
Erick Archer [Fri, 7 Jun 2024 17:17:55 +0000 (19:17 +0200)]
Input: gameport - use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Link: https://lore.kernel.org/r/PAXPR02MB72483F512F863C74A4AECA2B8BFB2@PAXPR02MB7248.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: serio - use sizeof(*pointer) instead of sizeof(type)
Erick Archer [Fri, 7 Jun 2024 17:04:23 +0000 (19:04 +0200)]
Input: serio - use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Link: https://lore.kernel.org/r/AS8PR02MB7237D3D898CCC9C50C18DE078BFB2@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoMerge branch 'ib/6.9-disable-irq-guard' into next
Dmitry Torokhov [Thu, 6 Jun 2024 21:39:44 +0000 (14:39 -0700)]
Merge branch 'ib/6.9-disable-irq-guard' into next

This brings in support for guard(disable_irq)(...);

10 months agolinux/interrupt.h: allow "guard" notation to disable and reenable IRQ
Dmitry Torokhov [Thu, 30 May 2024 18:07:19 +0000 (11:07 -0700)]
linux/interrupt.h: allow "guard" notation to disable and reenable IRQ

Drivers often need to first disable an interrupt, carry out some
action, and then reenable the interrupt. Introduce support for the
"guard" notation for this so that the following is possible:

...

scoped_cond_guard(mutex_intr, return -EINTR, &data->sysfs_mutex) {
guard(disable_irq)(&client->irq);

error = elan_acquire_baseline(data);
if (error)
return error;
}

...

Reviewed-by: Thomas Gleixner <tglx@linutronix.de>
Link: https://lore.kernel.org/r/ZljAV6HjkPSEhWSw@google.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: wacom_w8001 - correct device name generation
Jason Gerecke [Thu, 6 Jun 2024 20:41:01 +0000 (13:41 -0700)]
Input: wacom_w8001 - correct device name generation

Fixes: 6c7cc1a29d1e ("Input: wacom_w8001 - simplify device name generation")
Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Link: https://lore.kernel.org/r/20240605164656.61623-1-jason.gerecke@wacom.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: tablet - use sizeof(*pointer) instead of sizeof(type)
Erick Archer [Mon, 3 Jun 2024 04:30:48 +0000 (21:30 -0700)]
Input: tablet - use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Link: https://lore.kernel.org/r/AS8PR02MB7237B05083487507CFAF96B08BFE2@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: mouse - use sizeof(*pointer) instead of sizeof(type)
Erick Archer [Mon, 3 Jun 2024 04:30:36 +0000 (21:30 -0700)]
Input: mouse - use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Link: https://lore.kernel.org/r/AS8PR02MB7237FB736DBF67A58798FDF38BFE2@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: misc - use sizeof(*pointer) instead of sizeof(type)
Erick Archer [Mon, 3 Jun 2024 04:26:14 +0000 (21:26 -0700)]
Input: misc - use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Link: https://lore.kernel.org/r/AS8PR02MB7237884EB989EFF55D1BEF8B8BFE2@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: keyboard - use sizeof(*pointer) instead of sizeof(type)
Erick Archer [Mon, 3 Jun 2024 04:29:43 +0000 (21:29 -0700)]
Input: keyboard - use sizeof(*pointer) instead of sizeof(type)

It is preferred to use sizeof(*pointer) instead of sizeof(type)
due to the type of the variable can change and one needs not
change the former (unlike the latter). This patch has no effect
on runtime behavior.

Signed-off-by: Erick Archer <erick.archer@outlook.com>
Link: https://lore.kernel.org/r/AS8PR02MB7237277464F23CA168BFB3B18BF52@AS8PR02MB7237.eurprd02.prod.outlook.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
10 months agoInput: i8042 - add Ayaneo Kun to i8042 quirk table
Tobias Jakobi [Fri, 31 May 2024 22:43:07 +0000 (15:43 -0700)]
Input: i8042 - add Ayaneo Kun to i8042 quirk table

See the added comment for details. Also fix a typo in the
quirk's define.

Signed-off-by: Tobias Jakobi <tjakobi@math.uni-bielefeld.de>
Link: https://lore.kernel.org/r/20240531190100.3874731-1-tjakobi@math.uni-bielefeld.de
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
11 months agoInput: wacom_w8001 - simplify device name generation
Jason Gerecke [Thu, 30 May 2024 20:51:32 +0000 (13:51 -0700)]
Input: wacom_w8001 - simplify device name generation

Replace pairs of strscpy/strlcat calls with snprintf.

Signed-off-by: Jason Gerecke <jason.gerecke@wacom.com>
Link: https://lore.kernel.org/r/CANRwn3SuTjdCCK4YH1ObvsC_gZuythAQ7kSHJP-CiAFw9h5Qcw@mail.gmail.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
11 months agoInput: elantech - fix touchpad state on resume for Lenovo N24
Jonathan Denose [Fri, 3 May 2024 16:12:07 +0000 (16:12 +0000)]
Input: elantech - fix touchpad state on resume for Lenovo N24

The Lenovo N24 on resume becomes stuck in a state where it
sends incorrect packets, causing elantech_packet_check_v4 to fail.
The only way for the device to resume sending the correct packets is for
it to be disabled and then re-enabled.

This change adds a dmi check to trigger this behavior on resume.

Signed-off-by: Jonathan Denose <jdenose@google.com>
Link: https://lore.kernel.org/r/20240503155020.v2.1.Ifa0e25ebf968d8f307f58d678036944141ab17e6@changeid
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
11 months agoMerge tag 'v6.9' into next
Dmitry Torokhov [Tue, 28 May 2024 04:37:18 +0000 (21:37 -0700)]
Merge tag 'v6.9' into next

Sync up with the mainline to bring in the new cleanup API.

11 months agoMerge branch 'next' into for-linus
Dmitry Torokhov [Thu, 23 May 2024 00:39:34 +0000 (17:39 -0700)]
Merge branch 'next' into for-linus

Prepare input updates for 6.10 merge window.

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

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

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

Document FocalTech FT5452 and FT8719 support by adding their compatibles.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

So, remove them.

Found with cppcheck, unusedStructMember.

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

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

So, remove it.

Found with cppcheck, unusedStructMember.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Link: https://lore.kernel.org/r/37443a675ca07c91c5f0118ce255406e6e3c08f5.1715502304.git.christophe.jaillet@wanadoo.fr
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
11 months agoLinux 6.9
Linus Torvalds [Sun, 12 May 2024 21:12:29 +0000 (14:12 -0700)]
Linux 6.9