linux-2.6-block.git
4 months agoMerge branch 'for-6.10/sony' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:57:33 +0000 (13:57 +0200)]
Merge branch 'for-6.10/sony' into for-linus

4 months agoMerge branch 'for-6.10/playstation' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:56:51 +0000 (13:56 +0200)]
Merge branch 'for-6.10/playstation' into for-linus

- fixes for better support of 3rd party playstation DS4 controllers (Max Staudt)

4 months agoMerge branch 'for-6.10/plarform-driver-remove-new' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:55:14 +0000 (13:55 +0200)]
Merge branch 'for-6.10/plarform-driver-remove-new' into for-linus

- conversion of HID device drivers from platform_driver->remove() to
  platform_driver->remove_new() (Uwe Kleine-König)

4 months agoMerge branch 'for-6.10/nintendo' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:54:57 +0000 (13:54 +0200)]
Merge branch 'for-6.10/nintendo' into for-linus

4 months agoMerge branch 'for-6.10/kye' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:54:31 +0000 (13:54 +0200)]
Merge branch 'for-6.10/kye' into for-linus

4 months agoMerge branch 'for-6.10/intel-ish' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:53:15 +0000 (13:53 +0200)]
Merge branch 'for-6.10/intel-ish' into for-linus

- Implement loading firmware from host in intel-ish driver, needed
  to support Lunar Lake and later (Zhang Lixu)

4 months agoMerge branch 'for-6.10/i2c-hid' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:51:19 +0000 (13:51 +0200)]
Merge branch 'for-6.10/i2c-hid' into for-linus

- PM fixes for STM and Weida Tech devices (Kenny Levinsen)

4 months agoMerge branch 'for-6.10/hid-sysfs-emit' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:50:43 +0000 (13:50 +0200)]
Merge branch 'for-6.10/hid-sysfs-emit' into for-linus

- conversion from sprintf() to sysfs_emit() (Li Zhijian)

4 months agoMerge branch 'for-6.10/hid-debug' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:49:10 +0000 (13:49 +0200)]
Merge branch 'for-6.10/hid-debug' into for-linus

- support for missing mappings and codes from HUT 1.5 in
  hid-debug (Thomas Kuehne)

4 months agoMerge branch 'for-6.10/hid-bpf' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:44:49 +0000 (13:44 +0200)]
Merge branch 'for-6.10/hid-bpf' into for-linus

- updates to HID-BPF infrastructure, with some of the specific
  fixes (e.g. rdesc fixups) abstracted into separate BPF programs
  for consumption by libevdev/udev-hid-bpf (Benjamin Tissoires)

4 months agoMerge branch 'for-6.10/asus' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:41:32 +0000 (13:41 +0200)]
Merge branch 'for-6.10/asus' into for-linus

- initial support for ROG Ally and ROG X13 devices (Luke D. Jones)
- other small assorted cleanups of hid-asus driver (Luke D. Jones)

4 months agoMerge branch 'for-6.10/amd-sfh' into for-linus
Jiri Kosina [Tue, 14 May 2024 11:40:06 +0000 (13:40 +0200)]
Merge branch 'for-6.10/amd-sfh' into for-linus

- PM fix and assorted other code cleanups for amd-sfh (Basavaraj Natikar)

4 months agoselftests/hid: skip tests with HID-BPF if udev-hid-bpf is not installed
Benjamin Tissoires [Mon, 6 May 2024 14:36:12 +0000 (16:36 +0200)]
selftests/hid: skip tests with HID-BPF if udev-hid-bpf is not installed

udev-hid-bpf is still not installed everywhere, and we should probably
not assume it is installed automatically.

Link: https://lore.kernel.org/r/20240506143612.148031-1-bentiss@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoselftests/hid: add tests for the Raptor Mach 2 joystick
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:38 +0000 (19:19 +0200)]
selftests/hid: add tests for the Raptor Mach 2 joystick

The only interesting bit is the HAT switch, and we use a BPF program
to fix it. So ensure this works correctly.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-18-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoselftests/hid: move the gamepads definitions in the test file
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:37 +0000 (19:19 +0200)]
selftests/hid: move the gamepads definitions in the test file

More in line with the other test_* files.

No code change

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-17-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoselftests/hid: import base_gamepad.py from hid-tools
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:36 +0000 (19:19 +0200)]
selftests/hid: import base_gamepad.py from hid-tools

We need to slightly change base_device.py for supporting HID-BPF,
so instead of monkey patching, let's just embed it in the kernel tree.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-16-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoselftests/hid: add Huion Kamvas Pro 19 tests
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:35 +0000 (19:19 +0200)]
selftests/hid: add Huion Kamvas Pro 19 tests

This tablets gets a lot of things wrong:
- the secondary button is reported through Secondary Tip Switch
- the third button is reported through Invert

We need to add some out of proximity intermediate state when moving
back and forth with the eraser mode as it can only be triggered by
physically returning the pen, meaning that the tolerated transitions
can never happen.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-15-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoselftests/hid: tablets: also check for XP-Pen offset correction
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:34 +0000 (19:19 +0200)]
selftests/hid: tablets: also check for XP-Pen offset correction

The values are taken from the HID-BPF file.
Basically we are recomputing the array provided there.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-14-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoselftests/hid: tablets: add a couple of XP-PEN tablets
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:33 +0000 (19:19 +0200)]
selftests/hid: tablets: add a couple of XP-PEN tablets

Those tablets don't need special initialization, but are reporting
the events with the wrong usages:
- tip switch is used when the eraser should be used
- eraser is used instead of the secondary barrel switch

Add tests for those so we don't regress in the future.

Currently we set x/y tilt to 0 to not trigger the bpf program
compensate_coordinates_by_tilt()

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-13-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoselftests/hid: tablets: reduce the number of pen state
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:32 +0000 (19:19 +0200)]
selftests/hid: tablets: reduce the number of pen state

All the *_WITH*BUTTON states were almost identical except for the
button itself.

I need to add a new device with a third button, and adding a bunch of
states is going to be quite cumbersome.

So convert the `button` parameter of PenState as a boolean, and store
which button is the target as an argument to all functions that need it.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-12-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoselftests/hid: add support for HID-BPF pre-loading before starting a test
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:31 +0000 (19:19 +0200)]
selftests/hid: add support for HID-BPF pre-loading before starting a test

few required changes:
- we need to count how many times a udev 'bind' event happens
- we need to tell `udev-hid-bpf` to not automatically attach the
  provided HID-BPF objects
- we need to manually attach the ones from the kernel tree, and wait
  for the second udev 'bind' event to happen

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-11-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoselftests/hid: import base_device.py from hid-tools
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:30 +0000 (19:19 +0200)]
selftests/hid: import base_device.py from hid-tools

We need to slightly change base_device.py for supporting HID-BPF,
so instead of monkey patching, let's just embed it in the kernel tree.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-10-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: bpf: add in-tree HID-BPF fix for the Raptor Mach 2
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:29 +0000 (19:19 +0200)]
HID: bpf: add in-tree HID-BPF fix for the Raptor Mach 2

This device is already fixed by "HID: do not assume HAT Switch
logical max < 8", but for people without the fix already, having the
HID-BPF locally can fix the device while they wait for their
distribution to update.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-9-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: bpf: add in-tree HID-BPF fix for the Huion Kamvas Pro 19
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:28 +0000 (19:19 +0200)]
HID: bpf: add in-tree HID-BPF fix for the Huion Kamvas Pro 19

This tablets gets a lot of things wrong:
- the secondary button is reported through Secondary Tip Switch
- the third button is reported through Invert

Fortunately, before entering eraser mode, (so Invert = 1),
the tablet always sends an out-of-proximity event.
So we can detect that single event and:
- if there was none but the invert bit was toggled: this is the
  third button
- if there was this out-of-proximity event, we are entering
  eraser mode, and we will until the next out-of-proximity.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-8-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: bpf: add in-tree HID-BPF fix for the XBox Elite 2 over Bluetooth
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:27 +0000 (19:19 +0200)]
HID: bpf: add in-tree HID-BPF fix for the XBox Elite 2 over Bluetooth

When using the XBox Wireless Controller Elite 2 over Bluetooth,
the device exports the paddle on the back of the device as a single
bitfield value of usage "Assign Selection".

The kernel doesn't process those usages properly and report KEY_UNKNOWN
for it.

SDL doesn't know how to interprete that KEY_UNKNOWN and thus ignores the
paddles.

Given that over USB the kernel uses BTN_TRIGGER_HAPPY[5-8], we
can tweak the report descriptor to make the kernel interprete it properly:
- we need an application collection of gamepad (so we have to close the
  current Consumer Control one)
- we need to change the usage to be buttons from 0x15 to 0x18

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-7-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: bpf: add in-tree HID-BPF fix for the Wacom ArtPen
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:26 +0000 (19:19 +0200)]
HID: bpf: add in-tree HID-BPF fix for the Wacom ArtPen

This pen is compatible with multiple Wacom tablets, but we only add support
for the Intuos Pro 2 M, as this is the one our user reported the bug
against.

We can not generically add all compatible Wacom tablets as we are
writing the offsets by hand.

The point of this HID-BPF program is to work around a firmware limitation
where the pressure is repeated every other report.
Given that we know this will happen, we can change the first new pressure
information with the mean compared to the previous one. This way we
smooth the incoming pressure without losing information.

Cc: Ping Cheng <pinglinux@gmail.com>
Cc: Jason Gerecke <killertofu@gmail.com>
Cc: Aaron Armstrong Skomra <skomra@gmail.com>
Cc: Joshua Dickens <Joshua@joshua-dickens.com>
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-6-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: bpf: add in-tree HID-BPF fix for the IOGear Kaliber Gaming MMOmentum mouse
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:25 +0000 (19:19 +0200)]
HID: bpf: add in-tree HID-BPF fix for the IOGear Kaliber Gaming MMOmentum mouse

Allows to export more than 5 buttons on this 12 buttons mouse.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-5-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: bpf: add in-tree HID-BPF fix for the HP Elite Presenter Mouse
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:24 +0000 (19:19 +0200)]
HID: bpf: add in-tree HID-BPF fix for the HP Elite Presenter Mouse

Duplicate of commit 0db117359e47 ("HID: add quirk for 03f0:464a HP Elite
Presenter Mouse"), but in a slightly better way.

This time we actually change the application collection, making clearer
for userspace what the second mouse is.

Note that having both hid-quirks fix and this HID-BPF fix is not a
problem at all.

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-4-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: bpf: add in-tree HID-BPF fix for the XPPen Artist 16
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:23 +0000 (19:19 +0200)]
HID: bpf: add in-tree HID-BPF fix for the XPPen Artist 16

Same problem than the Artist 24: the second button on the pen is treated
like an eraser.
But the problem is even worse this time. There is an actual eraser at
the tail of the pen.

The compensation of the coordinates was done by Martin

Signed-off-by: Martin Sivak <mars@montik.net>
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-3-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: bpf: add first in-tree HID-BPF fix for the XPPen Artist 24
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:22 +0000 (19:19 +0200)]
HID: bpf: add first in-tree HID-BPF fix for the XPPen Artist 24

This commit adds a fix for XPPen Artist 24 where the second button on
the pen is used as an eraser.

It's a "feature" from Microsoft, but it turns out that it's actually
painful for artists. So we ship here a HID-BPF program that turns this
second button into an actual button.

Note that the HID-BPF program is not directly loaded by the kernel itself
but by udev-hid-bpf[0]. But having the sources here allows us to also
integrate tests into tools/testing/selftests/hid to ensure the HID-BPF
program are actually tested.

[0] https://gitlab.freedesktop.org/libevdev/udev-hid-bpf

Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-2-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: do not assume HAT Switch logical max < 8
Benjamin Tissoires [Wed, 10 Apr 2024 17:19:21 +0000 (19:19 +0200)]
HID: do not assume HAT Switch logical max < 8

Turns out that the code can handle a greater range, but the data stored
can not. This is problematic on the Raptor Mach 2 joystick which
logical max is 239. The kernel interprets it as `-15` and thus ignores
the Hat Switch handling.

Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/issues/17
Link: https://lore.kernel.org/r/20240410-bpf_sources-v1-1-a8bf16033ef8@kernel.org
Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
4 months agoHID: amd_sfh: Use amd_get_c2p_val() to read C2P register
Basavaraj Natikar [Tue, 7 May 2024 07:10:45 +0000 (12:40 +0530)]
HID: amd_sfh: Use amd_get_c2p_val() to read C2P register

Newer processors support various MP2 register sets. Therefore, to ensure
compatibility and obtain C2P data, use the amd_get_c2p_val().

Co-developed-by: Patil Rajesh Reddy <patreddy@amd.com>
Signed-off-by: Patil Rajesh Reddy <patreddy@amd.com>
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: amd_sfh: Handle "no sensors" in PM operations
Basavaraj Natikar [Tue, 7 May 2024 07:10:44 +0000 (12:40 +0530)]
HID: amd_sfh: Handle "no sensors" in PM operations

Resume or suspend each sensor device based on the num_hid_devices.
Therefore, add a check to handle the special case where no sensors are
present.

Fixes: 93ce5e0231d7 ("HID: amd_sfh: Implement SFH1.1 functionality")
Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: amd_sfh: Modify and log error only if case of functionality failures
Basavaraj Natikar [Tue, 7 May 2024 07:10:43 +0000 (12:40 +0530)]
HID: amd_sfh: Modify and log error only if case of functionality failures

Modify log messages, but only log errors when sensors are missing or a
true failure occurs to avoid misleading "failed" messages.

Signed-off-by: Basavaraj Natikar <Basavaraj.Natikar@amd.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: kye: Change Device Usage from Puck to Mouse
David Yang [Thu, 2 May 2024 04:23:31 +0000 (12:23 +0800)]
HID: kye: Change Device Usage from Puck to Mouse

Change device type because
a. it is exactly a mouse, with left/right buttons and scroll wheel;
b. it does not have visible marks or crosshairs, thus does not provide
higher accuracy than stylus.

Signed-off-by: David Yang <mmyangfl@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: i2c-hid: Remove unused label in i2c_hid_set_power
Kenny Levinsen [Tue, 7 May 2024 06:36:56 +0000 (08:36 +0200)]
HID: i2c-hid: Remove unused label in i2c_hid_set_power

This label was left behind when the wake-up logic was moved from
i2c_hid_set_power to i2c_hid_probe_address. Clean it up as it causes
warnings-as-errors builds to fail.

Fixes: bb1033c8a3ea ("HID: i2c-hid: Use address probe to wake on resume")
Reported-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Kenny Levinsen <kl@kl.wtf>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors
Chen Ni [Mon, 29 Apr 2024 08:54:22 +0000 (16:54 +0800)]
HID: intel-ish-hid: ipc: Add check for pci_alloc_irq_vectors

Add a check for the return value of pci_alloc_irq_vectors() and return
error if it fails.

[jkosina@suse.com: reworded changelog based on Srinivas' suggestion]
Fixes: 74fbc7d371d9 ("HID: intel-ish-hid: add MSI interrupt support")
Signed-off-by: Chen Ni <nichen@iscas.ac.cn>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: intel-ish-hid: handler multiple MNG_RESET_NOTIFY messages
Zhang Lixu [Mon, 6 May 2024 01:30:40 +0000 (09:30 +0800)]
HID: intel-ish-hid: handler multiple MNG_RESET_NOTIFY messages

This patch enhances the firmware reset handler in the Intel Integrated
Sensor Hub (ISH) driver. Previously, the ISH firmware would send a
MNG_RESET_NOTIFY message in response to an empty IPC message from the
ish_wakeup function. With the introduction of the feature to load ISH
firmware from the host on the LunarLake platform, the ISH bootloader
now involves the IPC function. This results in an additional
MNG_RESET_NOTIFY message being sent by ISH bootloader after power on.
Consequently, the driver receives two MNG_RESET_NOTIFY messages during
system boot up. This can disrupt the dev->dev_state during the first
reset flow due to the subsequent reset notify message.

To address this, the patch modifies the fw_reset_work_fn function to skip
the execution of ishtp_reset_compl_handler during the first reset flow if
a reset is pending. The ishtp_reset_compl_handler will then be executed
during the second reset flow, ensuring the dev->dev_state is not disrupted.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: intel-ish-hid: Implement loading firmware from host feature
Zhang Lixu [Mon, 6 May 2024 01:30:39 +0000 (09:30 +0800)]
HID: intel-ish-hid: Implement loading firmware from host feature

Starting from the Lunar Lake generation, the ISH firmware has been
divided into two components for better space optimization and increased
flexibility. These components include a bootloader that is integrated
into the BIOS, and a main firmware that is stored within the operating
system's file system.

Introduce support for loading ISH main firmware from host. This feature is
applicable for Lunar Lake and later generation.

Current intel-ishtp-loader, is designed for Chrome OS based systems which
uses core boot and has different firmware loading method. For non chrome
systems the ISH firmware loading uses different method.

Key differences include:
1. The new method utilizes ISHTP capability/fixed client to enumerate the
firmware loader function. It does not require a connection or flow control,
unlike the method used in Chrome OS, which is enumerated as an ISHTP
dynamic client driver, necessitating connect/disconnect operations and flow
control.

2. The new method employs a table to describe firmware fragments, which are
sent to ISH in a single operation. Conversely, the Chrome OS method sends
firmware fragments in multiple operations within a loop, sending only one
fragment at a time.

Additionally, address potential error scenarios to ensure graceful failure
handling.
- Firmware Not Found: Triggers if request_firmware() fails, leaving ISH in
  a waiting state.
  Recovery: Re-insmod the ISH drivers to retry.

- DMA Buffer Allocation Failure: Occurs during prepare_dma_bufs(), leading
  to ISH waiting state. Allocated resources are released.
  Recovery: Re-insmod the ISH drivers to retry.

- Incorrect Firmware Image: Causes ISH to refuse loading after three failed
  attempts.
  Recovery: A platform reset is required.

Please refer to the [Documentation](Documentation/hid/intel-ish-hid.rst)
for the details on flows.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: intel-ish-hid: Add driver_data for specifying the firmware filename
Zhang Lixu [Mon, 6 May 2024 01:30:38 +0000 (09:30 +0800)]
HID: intel-ish-hid: Add driver_data for specifying the firmware filename

Introduces a new structure, ishtp_driver_data, to hold driver-specific
data, including the firmware filename for different hardware variants of
the Intel Integrated Sensor Hub (ISH).

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoDocumentation: hid: intel-ish-hid: add section for firmware loading
Qianru Huang [Mon, 6 May 2024 01:30:37 +0000 (09:30 +0800)]
Documentation: hid: intel-ish-hid: add section for firmware loading

Add a section to describe the ISH firmware loading process for Lunar Lake
and later generations.

Signed-off-by: Qianru Huang <qianru.huang@intel.com>
Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoDocumentation: hid: intel-ish-hid: remove section numbering
Qianru Huang [Mon, 6 May 2024 01:30:36 +0000 (09:30 +0800)]
Documentation: hid: intel-ish-hid: remove section numbering

Remove section numbering from the Intel Integrated Sensor Hub (ISH)
documentation to simplify the structure, making it easier to maintain
and update in the future.

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Qianru Huang <qianru.huang@intel.com>
Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: playstation: DS4: Fix calibration workaround for clone devices
Max Staudt [Sat, 4 May 2024 16:55:32 +0000 (01:55 +0900)]
HID: playstation: DS4: Fix calibration workaround for clone devices

The logic in dualshock4_get_calibration_data() used uninitialised data
in case of a failed kzalloc() for the transfer buffer.

The solution is to group all business logic and all sanity checks
together, and jump only to the latter in case of an error.
While we're at it, factor out the axes' labelling, since it must happen
either way for input_report_abs() to succeed later on.

Thanks to Dan Carpenter for the Smatch static checker warning.

Fixes: a48a7cd85f55 ("HID: playstation: DS4: Don't fail on calibration data request")
Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: i2c-hid: Use address probe to wake on resume
Kenny Levinsen [Mon, 29 Apr 2024 23:33:15 +0000 (01:33 +0200)]
HID: i2c-hid: Use address probe to wake on resume

Certain devices, both from STM and Weida Tech, need to be woken up after
having entered a deeper sleep state. The relevant places to wake up such
device is during our initial HID probe, and after resuming.

A retry for power commands was previously added to i2c_hid_set_power to
wake up Weida Tech devices, but lacked sufficient sleep for STM devices.
Replace the power command retry with the same address probe we using
during our initial HID probe.

Signed-off-by: Kenny Levinsen <kl@kl.wtf>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: i2c-hid: Retry address probe after delay
Kenny Levinsen [Mon, 29 Apr 2024 23:33:14 +0000 (01:33 +0200)]
HID: i2c-hid: Retry address probe after delay

Some STM microcontrollers need 400µs after rising clock edge in order to
come out of their deep sleep state. This in turn means that our address
probe will fail as the device is not ready to service it.

Retry the probe once after a delay to see if the device came alive,
otherwise treat the device as missing.

Link: https://lore.kernel.org/all/20240405102436.3479210-1-lma@chromium.org/#t
Co-developed-by: Radoslaw Biernacki <rad@chromium.org>
Co-developed-by: Lukasz Majczak <lma@chromium.org>
Signed-off-by: Kenny Levinsen <kl@kl.wtf>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: asus: add ROG Z13 lightbar
Luke D. Jones [Tue, 16 Apr 2024 09:04:02 +0000 (21:04 +1200)]
HID: asus: add ROG Z13 lightbar

Add init of the lightbar which is a small panel on the back of the ASUS
ROG Z13 and uses the same MCU as keyboards.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: asus: add ROG Ally N-Key ID and keycodes
Luke D. Jones [Tue, 16 Apr 2024 09:04:01 +0000 (21:04 +1200)]
HID: asus: add ROG Ally N-Key ID and keycodes

A handful of buttons on the ROG Ally are not actually part of the xpad
device and are instead keyboard keys (a typical use of the MCU that asus
uses). We attach a group of F<num> key codes which aren't used much and
which the handheld community has already accepted as defaults here.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: asus: make asus_kbd_init() generic, remove rog_nkey_led_init()
Luke D. Jones [Tue, 16 Apr 2024 09:04:00 +0000 (21:04 +1200)]
HID: asus: make asus_kbd_init() generic, remove rog_nkey_led_init()

Some of the n-key stuff is old and outdated, so
make asus_kbd_init() generic to use with other
report ID and remove rog_nkey_led_init().

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: asus: fix more n-key report descriptors if n-key quirked
Luke D. Jones [Tue, 16 Apr 2024 09:03:59 +0000 (21:03 +1200)]
HID: asus: fix more n-key report descriptors if n-key quirked

Adjusts the report descriptor for N-Key devices to
make the output count 0x01 which completely avoids
the need for a block of filtering.

Signed-off-by: Luke D. Jones <luke@ljones.dev>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: logitech: add a few Logitech HID++ device IDs
Allan Sandfeld Jensen [Wed, 24 Apr 2024 11:31:30 +0000 (13:31 +0200)]
HID: logitech: add a few Logitech HID++ device IDs

Adds a few recognized Logitech HID++ capable mice over USB and Bluetooth

Signed-off-by: Allan Sandfeld Jensen <kde@carewolf.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: hid-debug: add EV_FF and FF_STATUS mappings
Thomas Kuehne [Sat, 13 Apr 2024 12:39:17 +0000 (12:39 +0000)]
HID: hid-debug: add EV_FF and FF_STATUS mappings

Currently hid-debug only output question marks for all force
feedback related input mapping making debugging gamepads
with force feedback a challenge.

This adds the necessary mapping information to output
EV_FF and FF_STATUS related information.

Signed-off-by: Thomas Kuehne <thomas.kuehne@gmx.li>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: hid-debug: more informative output for EV_KEY
Thomas Kuehne [Sat, 13 Apr 2024 12:23:30 +0000 (12:23 +0000)]
HID: hid-debug: more informative output for EV_KEY

Currently hid-debug's hid_resolv_event prints questions marks for
all entries without explicit mapping information. This makes
debugging unnecessarily complicated as multiple different
keys may simply result in the same uninformative output.

Some common event codes are deliberately not defined in
input-event-codes.h. For example the 16th gamepad key.

Instead, print the hexadecimal codes for all events without symbolic
names.

Signed-off-by: Thomas Kuehne <thomas.kuehne@gmx.li>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: hid-debug: fix Moir -> Moire typo
Thomas Kuehne [Sat, 13 Apr 2024 12:20:51 +0000 (12:20 +0000)]
HID: hid-debug: fix Moir -> Moire typo

This adds the letter "e" to fix hid_usage_table' HorizontalMoir and
VerticalMoir entries.

Signed-off-by: ThomasKuehne <2562574+ThomasKuehne@users.noreply.github.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
4 months agoHID: Add quirk for Logitech Casa touchpad
Sean O'Brien [Mon, 29 Apr 2024 18:08:05 +0000 (18:08 +0000)]
HID: Add quirk for Logitech Casa touchpad

This device sometimes doesn't send touch release signals when moving
from >=4 fingers to <4 fingers. Using MT_QUIRK_NOT_SEEN_MEANS_UP instead
of MT_QUIRK_ALWAYS_VALID makes sure that no touches become stuck.

MT_QUIRK_FORCE_MULTI_INPUT is not necessary for this device, but does no
harm.

Signed-off-by: Sean O'Brien <seobrien@chromium.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: sony: Remove usage of the deprecated ida_simple_xx() API
Christophe JAILLET [Sun, 14 Apr 2024 10:03:11 +0000 (12:03 +0200)]
HID: sony: Remove usage of the deprecated ida_simple_xx() API

ida_alloc() and ida_free() should be preferred to the deprecated
ida_simple_get() and ida_simple_remove().

This is less verbose.

Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: sony: remove redundant assignment
Colin Ian King [Thu, 28 Mar 2024 12:22:13 +0000 (12:22 +0000)]
HID: sony: remove redundant assignment

The variable ret is being assigned a value that is never read
afterwards. The assignment is redundant and can be removed.

Cleans up clang scan build warning:
drivers/hid/hid-sony.c:2020:3: warning: Value stored to 'ret'
is never read [deadcode.DeadStores]

Signed-off-by: Colin Ian King <colin.i.king@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: mcp-2221: cancel delayed_work only when CONFIG_IIO is enabled
Abdelrahman Morsy [Tue, 2 Apr 2024 12:14:06 +0000 (14:14 +0200)]
HID: mcp-2221: cancel delayed_work only when CONFIG_IIO is enabled

If the device is unplugged and CONFIG_IIO is not supported, this will
result in a warning message at kernel/workqueue.

Only cancel delayed work in mcp2221_remove(), when CONFIG_IIO is enabled.

Signed-off-by: Abdelrahman Morsy <abdelrahmanhesham94@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: nintendo: Remove unused function
Jiapeng Chong [Sun, 7 Apr 2024 02:11:00 +0000 (10:11 +0800)]
HID: nintendo: Remove unused function

The function are defined in the hid-nintendo.c file, but not called
elsewhere, so delete the unused function.

drivers/hid/hid-nintendo.c:697:20: warning: unused function 'joycon_device_has_usb'.

Reported-by: Abaci Robot <abaci@linux.alibaba.com>
Closes: https://bugzilla.openanolis.cn/show_bug.cgi?id=8704
Signed-off-by: Jiapeng Chong <jiapeng.chong@linux.alibaba.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: bpf: fix hid_bpf_input_report() when hid-core is not ready
Benjamin Tissoires [Thu, 11 Apr 2024 07:05:56 +0000 (09:05 +0200)]
HID: bpf: fix hid_bpf_input_report() when hid-core is not ready

Reported by linux-next:
After merging the hid tree, today's linux-next build (x86_64 allmodconfig)
failed like this:

x86_64-linux-gnu-ld: vmlinux.o: in function `hid_bpf_input_report':
(.text+0x1c75181): undefined reference to `hid_input_report'

Caused by commit 9be50ac30a83 ("HID: bpf: allow to inject HID event
from BPF")

I just forgot to put the indirection in place.

Link: https://lore.kernel.org/linux-kernel/20240411105131.7830f966@canb.auug.org.au/
Fixes: 9be50ac30a83 ("HID: bpf: allow to inject HID event from BPF")
Link: https://lore.kernel.org/r/20240411-fix-hid-bpf-v1-1-4ae913031a8c@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
5 months agoHID: bpf: allow to use bpf_timer_set_sleepable_cb() in tracing callbacks.
Benjamin Tissoires [Fri, 15 Mar 2024 14:44:44 +0000 (15:44 +0100)]
HID: bpf: allow to use bpf_timer_set_sleepable_cb() in tracing callbacks.

Export the sleepable kfuncs we have on HID-BPF in tracing bpf programs,
but with the condition of being used in a sleepable context.
This allows to use the bpf_timer when used in a sleepable context
through bpf_timer_set_sleepable_cb() and initiate work from a device event.

Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-7-079c282469d3@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
5 months agoselftests/hid: add tests for hid_bpf_input_report
Benjamin Tissoires [Fri, 15 Mar 2024 14:44:43 +0000 (15:44 +0100)]
selftests/hid: add tests for hid_bpf_input_report

Usual way of testing, we call the function and ensures we receive
the event

Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-6-079c282469d3@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
5 months agoHID: bpf: allow to inject HID event from BPF
Benjamin Tissoires [Fri, 15 Mar 2024 14:44:42 +0000 (15:44 +0100)]
HID: bpf: allow to inject HID event from BPF

It can be interesting to inject events from BPF as if the event were
to come from the device.
For example, some multitouch devices do not all the time send a proximity
out event, and we might want to send it for the physical device.

Compared to uhid, we can now inject events on any physical device, not
just uhid virtual ones.

Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-5-079c282469d3@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
5 months agoselftests/hid: Add test for hid_bpf_hw_output_report
Benjamin Tissoires [Fri, 15 Mar 2024 14:44:41 +0000 (15:44 +0100)]
selftests/hid: Add test for hid_bpf_hw_output_report

This time we need to ensure uhid receives it, thus the new mutex and
condition.

Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-4-079c282469d3@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
5 months agoselftests/hid: add KASAN to the VM tests
Benjamin Tissoires [Fri, 15 Mar 2024 14:44:40 +0000 (15:44 +0100)]
selftests/hid: add KASAN to the VM tests

It's always a good idea to have KASAN in tests.

Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-3-079c282469d3@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
5 months agoHID: bpf: export hid_hw_output_report as a BPF kfunc
Benjamin Tissoires [Fri, 15 Mar 2024 14:44:39 +0000 (15:44 +0100)]
HID: bpf: export hid_hw_output_report as a BPF kfunc

We currently only export hid_hw_raw_request() as a BPF kfunc.
However, some devices require an explicit write on the Output Report
instead of the use of the control channel.

So also export hid_hw_output_report to BPF

Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-2-079c282469d3@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
5 months agoHID: bpf/dispatch: regroup kfuncs definitions
Benjamin Tissoires [Fri, 15 Mar 2024 14:44:38 +0000 (15:44 +0100)]
HID: bpf/dispatch: regroup kfuncs definitions

No code change, just move down the hid_bpf_get_data() kfunc definition
so we have only one block of __bpf_kfunc_start/end_defs()

Link: https://lore.kernel.org/r/20240315-b4-hid-bpf-new-funcs-v4-1-079c282469d3@kernel.org
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
5 months agoHID: playstation: Simplify device type ID
Max Staudt [Wed, 7 Feb 2024 16:36:47 +0000 (01:36 +0900)]
HID: playstation: Simplify device type ID

Distinguish PS4/PS5 type controllers using .driver_data in
MODULE_DEVICE_TABLE rather than by VID/PID.

This allows adding compatible controllers with different VID/PID.

Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: playstation: DS4: Parse minimal report 0x01
Max Staudt [Wed, 7 Feb 2024 16:36:46 +0000 (01:36 +0900)]
HID: playstation: DS4: Parse minimal report 0x01

Some third-party controllers never switch to the full 0x11 report.

They keep sending the short 0x01 report, so let's parse that instead.

Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: playstation: DS4: Don't fail on calibration data request
Max Staudt [Wed, 7 Feb 2024 16:36:45 +0000 (01:36 +0900)]
HID: playstation: DS4: Don't fail on calibration data request

Some third-party controllers can't report calibration data for the
gyro/accelerometer.

We can still use the gamepad as-is, so let's do that.

Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: playstation: DS4: Don't fail on FW/HW version request
Max Staudt [Wed, 7 Feb 2024 16:36:44 +0000 (01:36 +0900)]
HID: playstation: DS4: Don't fail on FW/HW version request

Some third-party controllers can't report firmware/hardware version.

Unlike for the DualSense, the driver does not use these values for
anything in the DualShock 4 case, but merely exposes them via sysfs.
They will simply be 0x0.

Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: playstation: DS4: Fix LED blinking
Max Staudt [Wed, 7 Feb 2024 16:36:43 +0000 (01:36 +0900)]
HID: playstation: DS4: Fix LED blinking

There was no way to disable blinking once enabled.
Disable it on brightness = 0, as per the Linux LED spec.

The driver reports back the values it sends to the controller, but they
need to be scaled back to milliseconds. Setting the LED blinking via
sysfs works as expected now.

Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: logitech-dj: allow mice to use all types of reports
Yaraslau Furman [Wed, 3 Apr 2024 16:54:24 +0000 (19:54 +0300)]
HID: logitech-dj: allow mice to use all types of reports

You can bind whatever action you want to the mouse's reprogrammable
buttons using Windows application. Allow Linux to receive multimedia keycodes.

Fixes: 3ed224e273ac ("HID: logitech-dj: Fix 064d:c52f receiver support")
Signed-off-by: Yaraslau Furman <yaro330@gmail.com>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: i2c-hid: Revert to await reset ACK before reading report descriptor
Kenny Levinsen [Tue, 2 Apr 2024 11:10:04 +0000 (13:10 +0200)]
HID: i2c-hid: Revert to await reset ACK before reading report descriptor

In af93a167eda9, i2c_hid_parse was changed to continue with reading the
report descriptor before waiting for reset to be acknowledged.

This has lead to two regressions:

1. We fail to handle reset acknowledgment if it happens while reading
   the report descriptor. The transfer sets I2C_HID_READ_PENDING, which
   causes the IRQ handler to return without doing anything.

   This affects both a Wacom touchscreen and a Sensel touchpad.

2. On a Sensel touchpad, reading the report descriptor this quickly
   after reset results in all zeroes or partial zeroes.

The issues were observed on the Lenovo Thinkpad Z16 Gen 2.

The change in question was made based on a Microsoft article[0] stating
that Windows 8 *may* read the report descriptor in parallel with
awaiting reset acknowledgment, intended as a slight reset performance
optimization. Perhaps they only do this if reset is not completing
quickly enough for their tastes?

As the code is not currently ready to read registers in parallel with a
pending reset acknowledgment, and as reading quickly breaks the report
descriptor on the Sensel touchpad, revert to waiting for reset
acknowledgment before proceeding to read the report descriptor.

[0]: https://learn.microsoft.com/en-us/windows-hardware/drivers/hid/plug-and-play-support-and-power-management

Fixes: af93a167eda9 ("HID: i2c-hid: Move i2c_hid_finish_hwreset() to after reading the report-descriptor")
Closes: https://bugzilla.redhat.com/show_bug.cgi?id=2271136
Cc: stable@vger.kernel.org
Signed-off-by: Kenny Levinsen <kl@kl.wtf>
Link: https://lore.kernel.org/r/20240331182440.14477-1-kl@kl.wtf
[hdegoede@redhat.com Drop no longer necessary abort_reset error exit path]
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Tested-by: Mark Pearson <mpearson-lenovo@squebb.ca>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: hid-debug: add missing evdev and HID codes
Thomas Kuehne [Mon, 25 Mar 2024 01:23:15 +0000 (01:23 +0000)]
HID: hid-debug: add missing evdev and HID codes

Hid-debug's rdesc output for a game controller contained a few question
marks and numeric IDs instead of the expected descriptive names.

This happens because:
1) the mapping data is missing event codes defined in input-event-codes.h
2) HID usages aren't up to date
3) hid_resolv_usage fails to account for the sensor pages' modifiers

Add missing event codes and update HID to HUT 1.5.

Signed-off-by: Thomas Kuehne <thomas.kuehne@gmx.li>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: corsair,lenovo: Convert sprintf() family to sysfs_emit() family
Li Zhijian [Tue, 19 Mar 2024 05:45:27 +0000 (13:45 +0800)]
HID: corsair,lenovo: Convert sprintf() family to sysfs_emit() family

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() and scnprintf() will be converted as well if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Jiri Kosina <jikos@kernel.org>
CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
CC: linux-input@vger.kernel.org
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: roccat: Convert sprintf() family to sysfs_emit() family
Li Zhijian [Tue, 19 Mar 2024 05:45:26 +0000 (13:45 +0800)]
HID: roccat: Convert sprintf() family to sysfs_emit() family

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() and scnprintf() will be converted as well if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Stefan Achatz <erazor_de@users.sourceforge.net>
CC: Jiri Kosina <jikos@kernel.org>
CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
CC: linux-input@vger.kernel.org
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: hid-sensor-custom: Convert sprintf() family to sysfs_emit() family
Li Zhijian [Tue, 19 Mar 2024 05:45:25 +0000 (13:45 +0800)]
HID: hid-sensor-custom: Convert sprintf() family to sysfs_emit() family

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() and scnprintf() will be converted as well if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Jiri Kosina <jikos@kernel.org>
CC: Jonathan Cameron <jic23@kernel.org>
CC: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
CC: linux-input@vger.kernel.org
CC: linux-iio@vger.kernel.org
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: hid-picolcd*: Convert sprintf() family to sysfs_emit() family
Li Zhijian [Tue, 19 Mar 2024 05:45:24 +0000 (13:45 +0800)]
HID: hid-picolcd*: Convert sprintf() family to sysfs_emit() family

Per filesystems/sysfs.rst, show() should only use sysfs_emit()
or sysfs_emit_at() when formatting the value to be returned to user space.

coccinelle complains that there are still a couple of functions that use
snprintf(). Convert them to sysfs_emit().

sprintf() and scnprintf() will be converted as well if they have.

Generally, this patch is generated by
make coccicheck M=<path/to/file> MODE=patch \
COCCI=scripts/coccinelle/api/device_attr_show.cocci

No functional change intended

CC: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
CC: "Bruno Prémont" <bonbons@linux-vserver.org>
CC: Jiri Kosina <jikos@kernel.org>
CC: Benjamin Tissoires <benjamin.tissoires@redhat.com>
CC: linux-input@vger.kernel.org
Signed-off-by: Li Zhijian <lizhijian@fujitsu.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: nintendo: Don't fail on setting baud rate
Max Staudt [Fri, 15 Mar 2024 16:57:29 +0000 (01:57 +0900)]
HID: nintendo: Don't fail on setting baud rate

Some third-party controllers can't change the baud rate.

We can still use the gamepad as-is, so let's do that.

Signed-off-by: Max Staudt <max@enpas.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: nintendo: use ida for LED player id
Martino Fontana [Mon, 18 Mar 2024 10:36:28 +0000 (11:36 +0100)]
HID: nintendo: use ida for LED player id

Previously, the leds pattern would just increment with every controller
connected. This wouldn't take into consideration when controllers are
disconnected. The same controller could be connected and disconnected
with the pattern increasing player count each time.

This patch changes it by using an ID allocator in order to assign the
player id, the same way hid-playstation does.

Signed-off-by: Martino Fontana <tinozzo123@gmail.com>
Signed-off-by: Ryan McClelland <rymcclel@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: surface-hid: kbd: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 6 Mar 2024 17:50:50 +0000 (18:50 +0100)]
HID: surface-hid: kbd: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Reviewed-by: Maximilian Luz <luzmaximilian@gmail.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: hid-sensor-custom: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 6 Mar 2024 17:50:49 +0000 (18:50 +0100)]
HID: hid-sensor-custom: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: google: hammer: Convert to platform remove callback returning void
Uwe Kleine-König [Wed, 6 Mar 2024 17:50:48 +0000 (18:50 +0100)]
HID: google: hammer: Convert to platform remove callback returning void

The .remove() callback for a platform driver returns an int which makes
many driver authors wrongly assume it's possible to do error handling by
returning an error code. However the value returned is ignored (apart
from emitting a warning) and this typically results in resource leaks.

To improve here there is a quest to make the remove callback return
void. In the first step of this quest all drivers are converted to
.remove_new(), which already returns void. Eventually after all drivers
are converted, .remove_new() will be renamed to .remove().

Trivially convert this driver from always returning zero in the remove
callback to the void returning variant.

Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: intel-ish-hid: ipc: Add Lunar Lake-M PCI device ID
Zhang Lixu [Wed, 6 Mar 2024 00:56:38 +0000 (00:56 +0000)]
HID: intel-ish-hid: ipc: Add Lunar Lake-M PCI device ID

Add device ID of Lunar Lake-M into ishtp support list.

Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: intel-ish-hid: Use PCI_VDEVICE() and rename device ID macros
Zhang, Lixu [Wed, 6 Mar 2024 00:56:37 +0000 (00:56 +0000)]
HID: intel-ish-hid: Use PCI_VDEVICE() and rename device ID macros

Use PCI_VDEVICE() to simplify the device table, and rename these IDs to
follow the pattern PCI_DEVICE_ID_INTEL_*;

Suggested-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Signed-off-by: Zhang, Lixu <lixu.zhang@intel.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
5 months agoHID: nintendo: Fix N64 controller being identified as mouse
Nuno Pereira [Mon, 26 Feb 2024 22:39:31 +0000 (22:39 +0000)]
HID: nintendo: Fix N64 controller being identified as mouse

This patch is regarding the recent addition of support for the NSO
controllers to hid-nintendo. All controllers are working correctly with the
exception of the N64 controller, which is being identified as a mouse by
udev. This results in the joystick controlling the mouse cursor and the
controller not being detected by games.

The reason for this is because the N64's C buttons have been attributed to
BTN_FORWARD, BTN_BACK, BTN_LEFT, BTN_RIGHT, which are buttons typically
attributed to mice.

This patch changes those buttons to controller buttons, making the
controller be correctly identified as such.

Signed-off-by: Nuno Pereira <nf.pereira@outlook.pt>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
6 months agoMAINTAINERS: update Benjamin's email address
Benjamin Tissoires [Thu, 21 Mar 2024 15:19:27 +0000 (16:19 +0100)]
MAINTAINERS: update Benjamin's email address

Update my email address to the kernel.org one, as it's getting
more convenient this way.

Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
6 months agoHID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc
Zhang Lixu [Wed, 6 Mar 2024 00:44:04 +0000 (00:44 +0000)]
HID: intel-ish-hid: ipc: Fix dev_err usage with uninitialized dev->devc

The variable dev->devc in ish_dev_init was utilized by dev_err before it
was properly assigned. To rectify this, the assignment of dev->devc has
been moved to immediately follow memory allocation.

Without this change "(NULL device *)" is printed for device information.

Fixes: 8ae2f2b0a284 ("HID: intel-ish-hid: ipc: Fix potential use-after-free in work function")
Fixes: ae02e5d40d5f ("HID: intel-ish-hid: ipc layer")
Signed-off-by: Zhang Lixu <lixu.zhang@intel.com>
Acked-by: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
6 months agoHID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up
Nam Cao [Mon, 18 Mar 2024 10:59:02 +0000 (11:59 +0100)]
HID: i2c-hid: remove I2C_HID_READ_PENDING flag to prevent lock-up

The flag I2C_HID_READ_PENDING is used to serialize I2C operations.
However, this is not necessary, because I2C core already has its own
locking for that.

More importantly, this flag can cause a lock-up: if the flag is set in
i2c_hid_xfer() and an interrupt happens, the interrupt handler
(i2c_hid_irq) will check this flag and return immediately without doing
anything, then the interrupt handler will be invoked again in an
infinite loop.

Since interrupt handler is an RT task, it takes over the CPU and the
flag-clearing task never gets scheduled, thus we have a lock-up.

Delete this unnecessary flag.

Reported-and-tested-by: Eva Kurchatova <nyandarknessgirl@gmail.com>
Closes: https://lore.kernel.org/r/CA+eeCSPUDpUg76ZO8dszSbAGn+UHjcyv8F1J-CUPVARAzEtW9w@mail.gmail.com
Fixes: 4a200c3b9a40 ("HID: i2c-hid: introduce HID over i2c specification implementation")
Cc: <stable@vger.kernel.org>
Signed-off-by: Nam Cao <namcao@linutronix.de>
Signed-off-by: Jiri Kosina <jkosina@suse.com>
6 months agoMerge tag 'hid-for-linus-2024031301' of git://git.kernel.org/pub/scm/linux/kernel...
Linus Torvalds [Thu, 14 Mar 2024 16:56:15 +0000 (09:56 -0700)]
Merge tag 'hid-for-linus-2024031301' of git://git./linux/kernel/git/hid/hid

Pull HID updates from Jiri Kosina:

 - support for the following Bluetooth devices from Samsung: Samsung
   wireless {Keyboard, GamePad, Action Mouse, Book Cover, Universal
   Keyboard, HOGP Keyboard} (Sandeep C S)

 - second version of code for applying proper quirk depending on
   firmware version for lenovo/cptkbd (Mikhail Khvainitski)

 - lenovo/cptkbd firmware-dependent quirk (Mikhail Khvainitski)

 - assorted fixes and optimizations for amd-sfh (Basavaraj Natikar)

 - dead code and dead data structures removal (Jiri Slaby, Jiapeng
   Chong)

* tag 'hid-for-linus-2024031301' of git://git.kernel.org/pub/scm/linux/kernel/git/hid/hid: (25 commits)
  HID: amd_sfh: Set the AMD SFH driver to depend on x86
  HID: input: avoid polling stylus battery on Chromebook Pompom
  HID: amd_sfh: Extend MP2 register access to SFH
  HID: amd_sfh: Improve boot time when SFH is available
  HID: amd_sfh: Avoid disabling the interrupt
  HID: amd_sfh: Update HPD sensor structure elements
  HID: amd_sfh: Increase sensor command timeout
  HID: intel-ish-hid: ipc: Add Arrow Lake PCI device ID
  HID: nintendo: Remove some unused functions
  HID: hid-prodikeys: remove struct pk_device
  HID: hid-prodikeys: remove unused struct pcmidi_snd members
  HID: hid-multitouch: remove unused mt_application::dev_time
  HID: hid-lg3ff: remove unused struct lg3ff_device
  HID: protect hid_device::bpf by CONFIG_HID_BPF
  HID: wacom: remove unused hid_data::pressure
  HID: apple: remove unused members from struct apple_sc_backlight
  HID: wacom: Clean up use of struct->wacom_wac
  HID: samsung: Add Samsung wireless bookcover and universal keyboard support
  HID: samsung: Add Samsung wireless action mouse support
  HID: samsung: Add Samsung wireless gamepad support
  ...

6 months agoMerge tag 'auxdisplay-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy...
Linus Torvalds [Thu, 14 Mar 2024 16:43:51 +0000 (09:43 -0700)]
Merge tag 'auxdisplay-v6.9-1' of git://git./linux/kernel/git/andy/linux-auxdisplay

Pull auxdisplay updates from Andy Shevchenko:

 - New driver for GPIO based 7-segment LED display (Chris Packham)

 - New driver for Maxim MAX6958/6959 I²C 7-segment LED display
   controller

 - Refactor linedisp library to make the above happen

 - Update Holtek HT16k33 driver to follow the linedisp refactoring

 - Convert .remove to return void in platform drivers (Uwe Kleine-König)

 - Fix DT schemas (Krzysztof Kozlowski)

 - Refresh MAINTAINERS database

* tag 'auxdisplay-v6.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/andy/linux-auxdisplay: (27 commits)
  auxdisplay: img-ascii-lcd: Convert to platform remove callback returning void
  auxdisplay: hd44780: Convert to platform remove callback returning void
  auxdisplay: cfag12864bfb: Convert to platform remove callback returning void
  auxdisplay: seg-led-gpio: Import linedisp namespace
  dt-bindings: auxdisplay: Add bindings for generic 7-segment LED
  auxdisplay: Add 7-segment LED display driver
  auxdisplay: Add driver for MAX695x 7-segment LED controllers
  dt-bindings: auxdisplay: Add Maxim MAX6958/6959
  auxdisplay: ht16k33: Drop struct ht16k33_seg
  auxdisplay: ht16k33: Switch to use line display character mapping
  auxdisplay: ht16k33: Define a few helper macros
  auxdisplay: ht16k33: Move ht16k33_linedisp_ops down
  auxdisplay: ht16k33: Add default to switch-cases
  auxdisplay: linedisp: Allocate buffer for the string
  auxdisplay: linedisp: Add support for overriding character mapping
  auxdisplay: linedisp: Provide struct linedisp_ops for future extension
  auxdisplay: linedisp: Move exported symbols to a namespace
  auxdisplay: linedisp: Add missing header(s)
  auxdisplay: linedisp: Unshadow error codes in ->store()
  auxdisplay: linedisp: Use unique number for id
  ...

6 months agoMerge tag 'drm-next-2024-03-13' of https://gitlab.freedesktop.org/drm/kernel
Linus Torvalds [Thu, 14 Mar 2024 01:34:05 +0000 (18:34 -0700)]
Merge tag 'drm-next-2024-03-13' of https://gitlab.freedesktop.org/drm/kernel

Pull drm updates from Dave Airlie:
 "Highlights are usual, more AMD IP blocks for future hw, i915/xe
  changes, Displayport tunnelling support for i915, msm YUV over DP
  changes, new tests for ttm, but its mostly a lot of stuff all over the
  place from lots of people.

  core:
   - EDID cleanups
   - scheduler error handling fixes
   - managed: add drmm_release_action() with tests
   - add ratelimited drm debug print
   - DPCD PSR early transport macro
   - DP tunneling and bandwidth allocation helpers
   - remove built-in edids
   - dp: Avoid AUX transfers on powered-down displays
   - dp: Add VSC SDP helpers

  cross drivers:
   - use new drm print helpers
   - switch to ->read_edid callback
   - gem: add stats for shared buffers plus updates to amdgpu, i915, xe

  syncobj:
   - fixes to waiting and sleeping

  ttm:
   - add tests
   - fix errno codes
   - simply busy-placement handling
   - fix page decryption

  media:
   - tc358743: fix v4l device registration

  video:
   - move all kernel parameters for video behind CONFIG_VIDEO

  sound:
   - remove <drm/drm_edid.h> include from header

  ci:
   - add tests for msm
   - fix apq8016 runner

  efifb:
   - use copy of global screen_info state

  vesafb:
   - use copy of global screen_info state

  simplefb:
   - fix logging

  bridge:
   - ite-6505: fix DP link-training bug
   - samsung-dsim: fix error checking in probe
   - samsung-dsim: add bsh-smm-s2/pro boards
   - tc358767: fix regmap usage
   - imx: add i.MX8MP HDMI PVI plus DT bindings
   - imx: add i.MX8MP HDMI TX plus DT bindings
   - sii902x: fix probing and unregistration
   - tc358767: limit pixel PLL input range
   - switch to new drm_bridge_read_edid() interface

  panel:
   - ltk050h3146w: error-handling fixes
   - panel-edp: support delay between power-on and enable; use put_sync
     in unprepare; support Mediatek MT8173 Chromebooks, BOE NV116WHM-N49
     V8.0, BOE NV122WUM-N41, CSO MNC207QS1-1 plus DT bindings
   - panel-lvds: support EDT ETML0700Z9NDHA plus DT bindings
   - panel-novatek: FRIDA FRD400B25025-A-CTK plus DT bindings
   - add BOE TH101MB31IG002-28A plus DT bindings
   - add EDT ETML1010G3DRA plus DT bindings
   - add Novatek NT36672E LCD DSI plus DT bindings
   - nt36523: support 120Hz timings, fix includes
   - simple: fix display timings on RK32FN48H
   - visionox-vtdr6130: fix initialization
   - add Powkiddy RGB10MAX3 plus DT bindings
   - st7703: support panel rotation plus DT bindings
   - add Himax HX83112A plus DT bindings
   - ltk500hd1829: add support for ltk101b4029w and admatec 9904370
   - simple: add BOE BP082WX1-100 8.2" panel plus DT bindungs

  panel-orientation-quirks:
   - GPD Win Mini

  amdgpu:
   - Validate DMABuf imports in compute VMs
   - Add RAS ACA framework
   - PSP 13 fixes
   - Misc code cleanups
   - Replay fixes
   - Atom interpretor PS, WS bounds checking
   - DML2 fixes
   - Audio fixes
   - DCN 3.5 Z state fixes
   - Remove deprecated ida_simple usage
   - UBSAN fixes
   - RAS fixes
   - Enable seq64 infrastructure
   - DC color block enablement
   - Documentation updates
   - DC documentation updates
   - DMCUB updates
   - ATHUB 4.1 support
   - LSDMA 7.0 support
   - JPEG DPG support
   - IH 7.0 support
   - HDP 7.0 support
   - VCN 5.0 support
   - SMU 13.0.6 updates
   - NBIO 7.11 updates
   - SDMA 6.1 updates
   - MMHUB 3.3 updates
   - DCN 3.5.1 support
   - NBIF 6.3.1 support
   - VPE 6.1.1 support

  amdkfd:
   - Validate DMABuf imports in compute VMs
   - SVM fixes
   - Trap handler updates and enhancements
   - Fix cache size reporting
   - Relocate the trap handler

  radeon:
   - Atom interpretor PS, WS bounds checking
   - Misc code cleanups

  xe:
   - new query for GuC submission version
   - Remove unused persistent exec_queues
   - Add vram frequency sysfs attributes
   - Add the flag XE_VM_BIND_FLAG_DUMPABLE
   - Drop pre-production workarounds
   - Drop kunit tests for unsupported platforms
   - Start pumbling SR-IOV support with memory based interrupts for VF
   - Allow to map BO in GGTT with PAT index corresponding to XE_CACHE_UC
     to work with memory based interrupts
   - Add GuC Doorbells Manager as prep work SR-IOV
   - Implement additional workarounds for xe2 and MTL
   - Program a few registers according to perfomance guide spec for Xe2
   - Fix remaining 32b build issues and enable it back
   - Fix build with CONFIG_DEBUG_FS=n
   - Fix warnings from GuC ABI headers
   - Introduce Relay Communication for SR-IOV for VF <-> GuC <-> PF
   - Release mmap mappings on rpm suspend
   - Disable mid-thread preemption when not properly supported by
     hardware
   - Fix xe_exec by reserving extra fence slot for CPU bind
   - Fix xe_exec with full long running exec queue
   - Canonicalize addresses where needed for Xe2 and add to devcoredum
   - Toggle USM support for Xe2
   - Only allow 1 ufence per exec / bind IOCTL
   - Add GuC firmware loading for Lunar Lake
   - Add XE_VMA_PTE_64K VMA flag

  i915:
   - Add more ADL-N PCI IDs
   - Enable fastboot also on older platforms
   - Early transport for panel replay and PSR
   - New ARL PCI IDs
   - DP TPS4 PHY test pattern support
   - Unify and improve VSC SDP for PSR and non-PSR cases
   - Refactor memory regions and improve debug logging
   - Rework global state serialization
   - Remove unused CDCLK divider fields
   - Unify HDCP connector logging format
   - Use display instead of graphics version in display code
   - Move VBT and opregion debugfs next to the implementation
   - Abstract opregion interface, use opaque type
   - MTL fixes
   - HPD handling fixes
   - Add GuC submission interface version query
   - Atomically invalidate userptr on mmu-notifier
   - Update handling of MMIO triggered reports
   - Don't make assumptions about intel_wakeref_t type
   - Extend driver code of Xe_LPG to Xe_LPG+
   - Add flex arrays to struct i915_syncmap
   - Allow for very slow HuC loading
   - DP tunneling and bandwidth allocation support

  msm:
   - Correct bindings for MSM8976 and SM8650 platforms
   - Start migration of MDP5 platforms to DPU driver
   - X1E80100 MDSS support
   - DPU:
      - Improve DSC allocation, fixing several important corner cases
      - Add support for SDM630/SDM660 platforms
      - Simplify dpu_encoder_phys_ops
      - Apply fixes targeting DSC support with a single DSC encoder
      - Apply fixes for HCTL_EN timing configuration
      - X1E80100 support
      - Add support for YUV420 over DP
   - GPU:
      - fix sc7180 UBWC config
      - fix a7xx LLC config
      - new gpu support: a305B, a750, a702
      - machine support: SM7150 (different power levels than other a618)
      - a7xx devcoredump support

  habanalabs:
   - configure IRQ affinity according to NUMA node
   - move HBM MMU page tables inside the HBM
   - improve device reset
   - check extended PCIe errors

  ivpu:
   - updates to firmware API
   - refactor BO allocation

  imx:
   - use devm_ functions during init

  hisilicon:
   - fix EDID includes

  mgag200:
   - improve ioremap usage
   - convert to struct drm_edid
   - Work around PCI write bursts

  nouveau:
   - disp: use kmemdup()
   - fix EDID includes
   - documentation fixes

  qaic:
   - fixes to BO handling
   - make use of DRM managed release
   - fix order of remove operations

  rockchip:
   - analogix_dp: get encoder port from DT
   - inno_hdmi: support HDMI for RK3128
   - lvds: error-handling fixes

  ssd130x:
   - support SSD133x plus DT bindings

  tegra:
   - fix error handling

  tilcdc:
   - make use of DRM managed release

  v3d:
   - show memory stats in debugfs
   - Support display MMU page size

  vc4:
   - fix error handling in plane prepare_fb
   - fix framebuffer test in plane helpers

  virtio:
   - add venus capset defines

  vkms:
   - fix OOB access when programming the LUT
   - Kconfig improvements

  vmwgfx:
   - unmap surface before changing plane state
   - fix memory leak in error handling
   - documentation fixes
   - list command SVGA_3D_CMD_DEFINE_GB_SURFACE_V4 as invalid
   - fix null-pointer deref in execbuf
   - refactor display-mode probing
   - fix fencing for creating cursor MOBs
   - fix cursor-memory lifetime

  xlnx:
   - fix live video input for ZynqMP DPSUB

  lima:
   - fix memory leak

  loongson:
   - fail if no VRAM present

  meson:
   - switch to new drm_bridge_read_edid() interface

  renesas:
   - add RZ/G2L DU support plus DT bindings

  mxsfb:
   - Use managed mode config

  sun4i:
   - HDMI: updates to atomic mode setting

  mediatek:
   - Add display driver for MT8188 VDOSYS1
   - DSI driver cleanups
   - Filter modes according to hardware capability
   - Fix a null pointer crash in mtk_drm_crtc_finish_page_flip

  etnaviv:
   - enhancements for NPU and MRT support"

* tag 'drm-next-2024-03-13' of https://gitlab.freedesktop.org/drm/kernel: (1420 commits)
  drm/amd/display: Removed redundant @ symbol to fix kernel-doc warnings in -next repo
  drm/amd/pm: wait for completion of the EnableGfxImu message
  drm/amdgpu/soc21: add mode2 asic reset for SMU IP v14.0.1
  drm/amdgpu: add smu 14.0.1 support
  drm/amdgpu: add VPE 6.1.1 discovery support
  drm/amdgpu/vpe: add VPE 6.1.1 support
  drm/amdgpu/vpe: don't emit cond exec command under collaborate mode
  drm/amdgpu/vpe: add collaborate mode support for VPE
  drm/amdgpu/vpe: add PRED_EXE and COLLAB_SYNC OPCODE
  drm/amdgpu/vpe: add multi instance VPE support
  drm/amdgpu/discovery: add nbif v6_3_1 ip block
  drm/amdgpu: Add nbif v6_3_1 ip block support
  drm/amdgpu: Add pcie v6_1_0 ip headers (v5)
  drm/amdgpu: Add nbif v6_3_1 ip headers (v5)
  arch/powerpc: Remove <linux/fb.h> from backlight code
  macintosh/via-pmu-backlight: Include <linux/backlight.h>
  fbdev/chipsfb: Include <linux/backlight.h>
  drm/etnaviv: Restore some id values
  drm/amdkfd: make kfd_class constant
  drm/amdgpu: add ring timeout information in devcoredump
  ...

6 months agoMerge tag 'fs_for_v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack...
Linus Torvalds [Wed, 13 Mar 2024 21:30:58 +0000 (14:30 -0700)]
Merge tag 'fs_for_v6.9-rc1' of git://git./linux/kernel/git/jack/linux-fs

Pull ext2, isofs, udf, and quota updates from Jan Kara:
 "A lot of material this time:

   - removal of a lot of GFP_NOFS usage from ext2, udf, quota (either it
     was legacy or replaced with scoped memalloc_nofs_*() API)

   - removal of BUG_ONs in quota code

   - conversion of UDF to the new mount API

   - tightening quota on disk format verification

   - fix some potentially unsafe use of RCU pointers in quota code and
     annotate everything properly to make sparse happy

   - a few other small quota, ext2, udf, and isofs fixes"

* tag 'fs_for_v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs: (26 commits)
  udf: remove SLAB_MEM_SPREAD flag usage
  quota: remove SLAB_MEM_SPREAD flag usage
  isofs: remove SLAB_MEM_SPREAD flag usage
  ext2: remove SLAB_MEM_SPREAD flag usage
  ext2: mark as deprecated
  udf: convert to new mount API
  udf: convert novrs to an option flag
  MAINTAINERS: add missing git address for ext2 entry
  quota: Detect loops in quota tree
  quota: Properly annotate i_dquot arrays with __rcu
  quota: Fix rcu annotations of inode dquot pointers
  isofs: handle CDs with bad root inode but good Joliet root directory
  udf: Avoid invalid LVID used on mount
  quota: Fix potential NULL pointer dereference
  quota: Drop GFP_NOFS instances under dquot->dq_lock and dqio_sem
  quota: Set nofs allocation context when acquiring dqio_sem
  ext2: Remove GFP_NOFS use in ext2_xattr_cache_insert()
  ext2: Drop GFP_NOFS use in ext2_get_blocks()
  ext2: Drop GFP_NOFS allocation from ext2_init_block_alloc_info()
  udf: Remove GFP_NOFS allocation in udf_expand_file_adinicb()
  ...

6 months agoMerge tag 'fsnotify_for_v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git...
Linus Torvalds [Wed, 13 Mar 2024 21:27:24 +0000 (14:27 -0700)]
Merge tag 'fsnotify_for_v6.9-rc1' of git://git./linux/kernel/git/jack/linux-fs

Pull fsnotify updates from Jan Kara:

 - fsnotify optimizations to reduce cost of fsnotify when nobody is
   watching

 - fix longstanding wart that system could not be suspended when some
   process was waiting for response to fanotify permission event

 - some spelling fixes

* tag 'fsnotify_for_v6.9-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
  fanotify: allow freeze when waiting response for permission events
  fanotify: Fix misspelling of "writable"
  fsnotify: Fix misspelling of "writable"
  inotify: Fix misspelling of "writable"
  fsnotify: Add fsnotify_sb_has_watchers() helper
  fsnotify: optimize the case of no parent watcher

6 months agoMerge tag 'xfs-6.9-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux
Linus Torvalds [Wed, 13 Mar 2024 20:52:24 +0000 (13:52 -0700)]
Merge tag 'xfs-6.9-merge-8' of git://git./fs/xfs/xfs-linux

Pull xfs updates from Chandan Babu:

 - Online repair updates:
    - More ondisk structures being repaired:
        - Inode's mode field by trying to obtain file type value from
          the a directory entry
        - Quota counters
        - Link counts of inodes
        - FS summary counters
        - Support for in-memory btrees has been added to support repair
          of rmap btrees
    - Misc changes:
        - Report corruption of metadata to the health tracking subsystem
        - Enable indirect health reporting when resources are scarce
        - Reduce memory usage while repairing refcount btree
        - Extend "Bmap update" intent item to support atomic extent
          swapping on the realtime device
        - Extend "Bmap update" intent item to support extended attribute
          fork and unwritten extents
    - Code cleanups:
        - Bmap log intent
        - Btree block pointer checking
        - Btree readahead
        - Buffer target
        - Symbolic link code

 - Remove mrlock wrapper around the rwsem

 - Convert all the GFP_NOFS flag usages to use the scoped
   memalloc_nofs_save() API instead of direct calls with the GFP_NOFS

 - Refactor and simplify xfile abstraction. Lower level APIs in shmem.c
   are required to be exported in order to achieve this

 - Skip checking alignment constraints for inode chunk allocations when
   block size is larger than inode chunk size

 - Do not submit delwri buffers collected during log recovery when an
   error has been encountered

 - Fix SEEK_HOLE/DATA for file regions which have active COW extents

 - Fix lock order inversion when executing error handling path during
   shrinking a filesystem

 - Remove duplicate ifdefs

* tag 'xfs-6.9-merge-8' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux: (183 commits)
  xfs: shrink failure needs to hold AGI buffer
  mm/shmem.c: Use new form of *@param in kernel-doc
  kernel-doc: Add unary operator * to $type_param_ref
  xfs: use kvfree() in xlog_cil_free_logvec()
  xfs: xfs_btree_bload_prep_block() should use __GFP_NOFAIL
  xfs: fix scrub stats file permissions
  xfs: fix log recovery erroring out on refcount recovery failure
  xfs: move symlink target write function to libxfs
  xfs: move remote symlink target read function to libxfs
  xfs: move xfs_symlink_remote.c declarations to xfs_symlink_remote.h
  xfs: xfs_bmap_finish_one should map unwritten extents properly
  xfs: support deferred bmap updates on the attr fork
  xfs: support recovering bmap intent items targetting realtime extents
  xfs: add a realtime flag to the bmap update log redo items
  xfs: add a xattr_entry helper
  xfs: fix xfs_bunmapi to allow unmapping of partial rt extents
  xfs: move xfs_bmap_defer_add to xfs_bmap_item.c
  xfs: reuse xfs_bmap_update_cancel_item
  xfs: add a bi_entry helper
  xfs: remove xfs_trans_set_bmap_flags
  ...

6 months agoMerge branch 'for-6.9/wacom' into for-linus
Jiri Kosina [Wed, 13 Mar 2024 20:24:39 +0000 (21:24 +0100)]
Merge branch 'for-6.9/wacom' into for-linus

- small cleanup of struct->wacom_wac usage (Tatsunosuke Tobita)

6 months agoMerge branch 'for-6.9/unused-struct-removal' into for-linus
Jiri Kosina [Wed, 13 Mar 2024 20:23:58 +0000 (21:23 +0100)]
Merge branch 'for-6.9/unused-struct-removal' into for-linus

- removal of unused data structures all over the place (Jiri Slaby)

6 months agoMerge branch 'for-6.9/samsung' into for-linus
Jiri Kosina [Wed, 13 Mar 2024 20:22:11 +0000 (21:22 +0100)]
Merge branch 'for-6.9/samsung' into for-linus

- support for the following Bluetooth devices (Sandeep C S):

        Samsung wireless Keyboard
        Samsung wireless GamePad
        Samsung Wireless Action Mouse
        Samsung Wireless Book Cover
        Samsung Wireless Universal Keyboard
        Samsung Wireless HOGP Keyboard

Signed-off-by: Jiri Kosina <jkosina@suse.com>
6 months agoMerge branch 'for-6.9/nintendo' into for-linus
Jiri Kosina [Wed, 13 Mar 2024 20:21:02 +0000 (21:21 +0100)]
Merge branch 'for-6.9/nintendo' into for-linus

- dead code removal in hid-nintendo (Jiapeng Chong)

6 months agoMerge branch 'for-6.9/lenovo' into for-linus
Jiri Kosina [Wed, 13 Mar 2024 20:18:44 +0000 (21:18 +0100)]
Merge branch 'for-6.9/lenovo' into for-linus

- 2nd version of code for applying proper quirk depending on firmware version
  for lenovo/cptkbd (Mikhail Khvainitski)