* [PATCH v6 0/2] Add support for sound profile switching and leverage for OnePlus 6 slider
From: David Heidelberg via B4 Relay @ 2025-07-31 21:17 UTC (permalink / raw)
To: Dmitry Torokhov, Jonathan Corbet, Jiri Kosina, Benjamin Tissoires,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-input, linux-doc, linux-kernel, linux-arm-msm, devicetree,
Gergo Koteles, David Heidelberg, Casey Connolly, Konrad Dybcio
This code was tested for two years within the downstream Snapdragon 845 tree.
It is now perfectly integrated with feedbackd in the Phosh environment.
Changes in v6:
- Rebased again next-20250731, otherwise just a resent.
- Link to v5: https://lore.kernel.org/r/20250419-op6-tri-state-v5-0-443127078517@ixit.cz
Changes in v5:
- Dropped merged
"Input: gpio-keys - add support for linux,input-value DTS property"
- Link to v4: https://lore.kernel.org/all/cover.1677022414.git.soyer@irl.hu/
Changes in v4:
- DTS: use default debounce-interval, order alphabetically
- Link to v3: https://lore.kernel.org/lkml/cover.1676850819.git.soyer@irl.hu/
Changes in v3:
- rename tri-state-key to alert-slider, fix DTS warnings,
Changes in v2:
- rebase to qcom/for-next
add SND_PROFILE_* identifiers to input-event-codes.h
base-commit: 02ac8d2a011b630481d959298a1cc76ca0717f3e
---
Gergo Koteles (2):
Input: add ABS_SND_PROFILE
arm64: dts: qcom: sdm845-oneplus: Add alert-slider
Documentation/input/event-codes.rst | 6 ++++
.../arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 39 ++++++++++++++++++++--
drivers/hid/hid-debug.c | 1 +
include/uapi/linux/input-event-codes.h | 9 +++++
4 files changed, 53 insertions(+), 2 deletions(-)
---
base-commit: 84b92a499e7eca54ba1df6f6c6e01766025943f1
change-id: 20250419-op6-tri-state-ed1a05a11125
Best regards,
--
David Heidelberg <david@ixit.cz>
^ permalink raw reply
* [PATCH v6 2/2] arm64: dts: qcom: sdm845-oneplus: Add alert-slider
From: David Heidelberg via B4 Relay @ 2025-07-31 21:17 UTC (permalink / raw)
To: Dmitry Torokhov, Jonathan Corbet, Jiri Kosina, Benjamin Tissoires,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-input, linux-doc, linux-kernel, linux-arm-msm, devicetree,
Gergo Koteles, Casey Connolly, David Heidelberg, Konrad Dybcio
In-Reply-To: <20250731-op6-tri-state-v6-0-569c25cbc8c2@ixit.cz>
From: Gergo Koteles <soyer@irl.hu>
The alert-slider is a tri-state sound profile switch found on the
OnePlus 6, Android maps the states to "silent", "vibrate" and "ring".
Expose them as ABS_SND_PROFILE events.
The previous GPIO numbers were wrong. Update them to the correct ones.
Co-developed-by: Casey Connolly <casey@connolly.tech>
Signed-off-by: Casey Connolly <casey@connolly.tech>
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org>
Signed-off-by: David Heidelberg <david@ixit.cz>
---
.../arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi | 39 ++++++++++++++++++++--
1 file changed, 37 insertions(+), 2 deletions(-)
diff --git a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
index b118d666e535a433f44b66c71b36e55df2ce5c80..242c78828992f9fbb384b690352660a496b22411 100644
--- a/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
+++ b/arch/arm64/boot/dts/qcom/sdm845-oneplus-common.dtsi
@@ -21,6 +21,41 @@
/delete-node/ &rmtfs_mem;
/ {
+ alert-slider {
+ compatible = "gpio-keys";
+ label = "Alert slider";
+
+ pinctrl-0 = <&alert_slider_default>;
+ pinctrl-names = "default";
+
+ switch-top {
+ label = "Silent";
+ linux,input-type = <EV_ABS>;
+ linux,code = <ABS_SND_PROFILE>;
+ linux,input-value = <SND_PROFILE_SILENT>;
+ gpios = <&tlmm 126 GPIO_ACTIVE_LOW>;
+ linux,can-disable;
+ };
+
+ switch-middle {
+ label = "Vibrate";
+ linux,input-type = <EV_ABS>;
+ linux,code = <ABS_SND_PROFILE>;
+ linux,input-value = <SND_PROFILE_VIBRATE>;
+ gpios = <&tlmm 52 GPIO_ACTIVE_LOW>;
+ linux,can-disable;
+ };
+
+ switch-bottom {
+ label = "Ring";
+ linux,input-type = <EV_ABS>;
+ linux,code = <ABS_SND_PROFILE>;
+ linux,input-value = <SND_PROFILE_RING>;
+ gpios = <&tlmm 24 GPIO_ACTIVE_LOW>;
+ linux,can-disable;
+ };
+ };
+
aliases {
serial0 = &uart9;
serial1 = &uart6;
@@ -799,8 +834,8 @@ hall_sensor_default: hall-sensor-default-state {
bias-disable;
};
- tri_state_key_default: tri-state-key-default-state {
- pins = "gpio40", "gpio42", "gpio26";
+ alert_slider_default: alert-slider-default-state {
+ pins = "gpio126", "gpio52", "gpio24";
function = "gpio";
drive-strength = <2>;
bias-disable;
--
2.50.1
^ permalink raw reply related
* [PATCH v6 1/2] Input: add ABS_SND_PROFILE
From: David Heidelberg via B4 Relay @ 2025-07-31 21:17 UTC (permalink / raw)
To: Dmitry Torokhov, Jonathan Corbet, Jiri Kosina, Benjamin Tissoires,
Bjorn Andersson, Konrad Dybcio, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-input, linux-doc, linux-kernel, linux-arm-msm, devicetree,
Gergo Koteles, David Heidelberg
In-Reply-To: <20250731-op6-tri-state-v6-0-569c25cbc8c2@ixit.cz>
From: Gergo Koteles <soyer@irl.hu>
ABS_SND_PROFILE used to describe the state of a multi-value sound profile
switch. This will be used for the alert-slider on OnePlus phones or other
phones.
Profile values added as SND_PROFLE_(SILENT|VIBRATE|RING) identifiers
to input-event-codes.h so they can be used from DTS.
Signed-off-by: Gergo Koteles <soyer@irl.hu>
Signed-off-by: David Heidelberg <david@ixit.cz>
---
Documentation/input/event-codes.rst | 6 ++++++
drivers/hid/hid-debug.c | 1 +
include/uapi/linux/input-event-codes.h | 9 +++++++++
3 files changed, 16 insertions(+)
diff --git a/Documentation/input/event-codes.rst b/Documentation/input/event-codes.rst
index b4557462edd7b3fef9e9cd6c2c3cb2d05bb531ab..d43336e64d6aa4fe8a41b7e9947f4f214df6e1ab 100644
--- a/Documentation/input/event-codes.rst
+++ b/Documentation/input/event-codes.rst
@@ -241,6 +241,12 @@ A few EV_ABS codes have special meanings:
emitted only when the selected profile changes, indicating the newly
selected profile value.
+* ABS_SND_PROFILE:
+
+ - Used to describe the state of a multi-value sound profile switch.
+ An event is emitted only when the selected profile changes,
+ indicating the newly selected profile value.
+
* ABS_MT_<name>:
- Used to describe multitouch input events. Please see
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 7107071c7c516af48c0c5fc1206c1e01bae3889f..c58500d8b94b581e41ae098d6ce99db7783986b7 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -3513,6 +3513,7 @@ static const char *absolutes[ABS_CNT] = {
[ABS_DISTANCE] = "Distance", [ABS_TILT_X] = "XTilt",
[ABS_TILT_Y] = "YTilt", [ABS_TOOL_WIDTH] = "ToolWidth",
[ABS_VOLUME] = "Volume", [ABS_PROFILE] = "Profile",
+ [ABS_SND_PROFILE] = "SoundProfile",
[ABS_MISC] = "Misc",
[ABS_MT_SLOT] = "MTSlot",
[ABS_MT_TOUCH_MAJOR] = "MTMajor",
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 08cb157ab59364a41ac425fc9a4ea8eb2fae0e86..f443f61f9bb8e3c212da522d9b99a386a13c4475 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -875,6 +875,7 @@
#define ABS_VOLUME 0x20
#define ABS_PROFILE 0x21
+#define ABS_SND_PROFILE 0x22
#define ABS_MISC 0x28
@@ -984,4 +985,12 @@
#define SND_MAX 0x07
#define SND_CNT (SND_MAX+1)
+/*
+ * ABS_SND_PROFILE values
+ */
+
+#define SND_PROFILE_SILENT 0x00
+#define SND_PROFILE_VIBRATE 0x01
+#define SND_PROFILE_RING 0x02
+
#endif
--
2.50.1
^ permalink raw reply related
* [PATCH] HID: Wacom: Add a new Art Pen
From: Ping Cheng @ 2025-08-01 3:09 UTC (permalink / raw)
To: linux-input; +Cc: jkosina, bentiss, Ping Cheng
Signed-off-by: Ping Cheng <ping.cheng@wacom.com>
---
drivers/hid/wacom_wac.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/wacom_wac.c b/drivers/hid/wacom_wac.c
index 955b39d22524..9b2c710f8da1 100644
--- a/drivers/hid/wacom_wac.c
+++ b/drivers/hid/wacom_wac.c
@@ -684,6 +684,7 @@ static bool wacom_is_art_pen(int tool_id)
case 0x885: /* Intuos3 Marker Pen */
case 0x804: /* Intuos4/5 13HD/24HD Marker Pen */
case 0x10804: /* Intuos4/5 13HD/24HD Art Pen */
+ case 0x204: /* Art Pen 2 */
is_art_pen = true;
break;
}
--
2.43.0
^ permalink raw reply related
* Re: [PATCH v3] platform/x86: Add WMI driver for Redmibook keyboard.
From: Armin Wolf @ 2025-08-01 6:00 UTC (permalink / raw)
To: Gladyshev Ilya
Cc: linux-input, nikita.nikita.krasnov, Hans de Goede,
Ilpo Järvinen, linux-kernel, platform-driver-x86
In-Reply-To: <20250730185619.8725-1-foxido@foxido.dev>
Am 30.07.25 um 20:56 schrieb Gladyshev Ilya:
> This driver implements support for various Fn keys (like Cut) and Xiaomi
> specific AI button.
>
> Signed-off-by: Gladyshev Ilya <foxido@foxido.dev>
> ---
> Changes since v2:
> - Fix Kconfig dependencies
> - Accept WMI buffers that are bigger than expected
>
> Link to v2: https://lore.kernel.org/platform-driver-x86/20250729190528.8446-1-foxido@foxido.dev/
> ---
> MAINTAINERS | 6 ++
> drivers/platform/x86/Kconfig | 12 +++
> drivers/platform/x86/Makefile | 1 +
> drivers/platform/x86/redmi-wmi.c | 129 +++++++++++++++++++++++++++++++
> 4 files changed, 148 insertions(+)
> create mode 100644 drivers/platform/x86/redmi-wmi.c
>
> diff --git a/MAINTAINERS b/MAINTAINERS
> index c0b444e5fd5a..eb25fb10e751 100644
> --- a/MAINTAINERS
> +++ b/MAINTAINERS
> @@ -20965,6 +20965,12 @@ S: Maintained
> T: git https://github.com/pkshih/rtw.git
> F: drivers/net/wireless/realtek/rtw89/
>
> +REDMIBOOK WMI DRIVERS
> +M: Gladyshev Ilya <foxido@foxido.dev>
> +L: platform-driver-x86@vger.kernel.org
> +S: Maintained
> +F: drivers/platform/x86/redmi-wmi.c
> +
> REDPINE WIRELESS DRIVER
> L: linux-wireless@vger.kernel.org
> S: Orphan
> diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
> index e5cbd58a99f3..9f98a7042e43 100644
> --- a/drivers/platform/x86/Kconfig
> +++ b/drivers/platform/x86/Kconfig
> @@ -109,6 +109,18 @@ config XIAOMI_WMI
> To compile this driver as a module, choose M here: the module will
> be called xiaomi-wmi.
>
> +config REDMI_WMI
> + tristate "Redmibook WMI key driver"
> + depends on ACPI_WMI
> + depends on INPUT
> + select INPUT_SPARSEKMAP
> + help
> + Say Y here if you want support for WMI-based hotkey events on
> + Xiaomi Redmibook devices.
> +
> + To compile this driver as a module, choose M here: the module will
> + be called redmi-wmi.
> +
> config GIGABYTE_WMI
> tristate "Gigabyte WMI temperature driver"
> depends on ACPI_WMI
> diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
> index bea87a85ae75..406dd0807ba7 100644
> --- a/drivers/platform/x86/Makefile
> +++ b/drivers/platform/x86/Makefile
> @@ -13,6 +13,7 @@ obj-$(CONFIG_HUAWEI_WMI) += huawei-wmi.o
> obj-$(CONFIG_MXM_WMI) += mxm-wmi.o
> obj-$(CONFIG_NVIDIA_WMI_EC_BACKLIGHT) += nvidia-wmi-ec-backlight.o
> obj-$(CONFIG_XIAOMI_WMI) += xiaomi-wmi.o
> +obj-$(CONFIG_REDMI_WMI) += redmi-wmi.o
> obj-$(CONFIG_GIGABYTE_WMI) += gigabyte-wmi.o
>
> # Acer
> diff --git a/drivers/platform/x86/redmi-wmi.c b/drivers/platform/x86/redmi-wmi.c
> new file mode 100644
> index 000000000000..3dbf4a40a4ff
> --- /dev/null
> +++ b/drivers/platform/x86/redmi-wmi.c
> @@ -0,0 +1,129 @@
> +// SPDX-License-Identifier: GPL-2.0
> +/* WMI driver for Xiaomi Redmibooks */
> +
> +#include <linux/acpi.h>
> +#include <linux/device.h>
> +#include <linux/input.h>
> +#include <linux/input/sparse-keymap.h>
> +#include <linux/module.h>
> +#include <linux/mutex.h>
> +#include <linux/unaligned.h>
> +#include <linux/wmi.h>
> +
> +#include <uapi/linux/input-event-codes.h>
> +
> +#define WMI_REDMIBOOK_KEYBOARD_EVENT_GUID "46C93E13-EE9B-4262-8488-563BCA757FEF"
> +
> +#define AI_KEY_VALUE_MASK 0x00000100
> +
> +static const struct key_entry redmi_wmi_keymap[] = {
> + {KE_KEY, 0x00000201, {KEY_SELECTIVE_SCREENSHOT}},
> + {KE_KEY, 0x00000301, {KEY_ALL_APPLICATIONS}},
> + {KE_KEY, 0x00001b01, {KEY_SETUP}},
> +
> + /* AI button has code for each position */
> + {KE_KEY, 0x00011801, {KEY_ASSISTANT}},
> + {KE_KEY, 0x00011901, {KEY_ASSISTANT}},
> +
> + /* Keyboard backlight */
> + {KE_IGNORE, 0x00000501, {}},
> + {KE_IGNORE, 0x00800501, {}},
> + {KE_IGNORE, 0x00050501, {}},
> + {KE_IGNORE, 0x000a0501, {}},
> +
> + {KE_END}
> +};
> +
> +struct redmi_wmi {
> + struct input_dev *input_dev;
> + /* Protects the key event sequence */
> + struct mutex key_lock;
> +};
> +
> +static int redmi_wmi_probe(struct wmi_device *wdev, const void *context)
> +{
> + struct redmi_wmi *data;
> + int err;
> +
> + /* Init dev */
> + data = devm_kzalloc(&wdev->dev, sizeof(*data), GFP_KERNEL);
> + if (!data)
> + return -ENOMEM;
> +
> + dev_set_drvdata(&wdev->dev, data);
> +
> + err = devm_mutex_init(&wdev->dev, &data->key_lock);
> + if (err)
> + return err;
> +
> + /* Setup input device */
> + data->input_dev = devm_input_allocate_device(&wdev->dev);
> + if (!data->input_dev)
> + return -ENOMEM;
Please leave a blank line here.
> + data->input_dev->name = "Redmibook WMI keys";
> + data->input_dev->phys = "wmi/input0";
> +
> + err = sparse_keymap_setup(data->input_dev, redmi_wmi_keymap, NULL);
> + if (err)
> + return err;
> +
> + return input_register_device(data->input_dev);
> +}
> +
> +static void redmi_wmi_notify(struct wmi_device *wdev, union acpi_object *obj)
> +{
> + struct redmi_wmi *data = dev_get_drvdata(&wdev->dev);
> + bool autorelease = true;
> + int value = 1;
> +
> + if (obj->type != ACPI_TYPE_BUFFER) {
> + dev_err(&wdev->dev, "Bad response type %u\n", obj->type);
> + return;
> + }
> +
> + if (obj->buffer.length < 32) {
> + dev_err(&wdev->dev, "Invalid buffer length %u\n", obj->buffer.length);
> + return;
> + }
> +
> + /* For linearizability */
> + guard(mutex)(&data->key_lock);
You only need to guard the actual input reporting, so please move the guard just above the call to
sparse_keymap_report_entry().
> +
> + u32 payload = get_unaligned_le32(obj->buffer.pointer);
> + struct key_entry *entry = sparse_keymap_entry_from_scancode(data->input_dev, payload);
> +
> + if (!entry) {
> + dev_dbg(&wdev->dev, "Unknown WMI event with payload %u", payload);
> + return;
> + }
> +
> + /* AI key quirk */
> + if (entry->keycode == KEY_ASSISTANT) {
> + value = !(payload & AI_KEY_VALUE_MASK);
> + autorelease = false;
> + }
> +
> + sparse_keymap_report_entry(data->input_dev, entry, value, autorelease);
> +}
> +
> +static const struct wmi_device_id redmi_wmi_id_table[] = {
> + { .guid_string = WMI_REDMIBOOK_KEYBOARD_EVENT_GUID },
Please use "{ WMI_REDMIBOOK_KEYBOARD_EVENT_GUID, NULL }," instead.
With the above issues fixed:
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
> + { }
> +};
> +
> +static struct wmi_driver redmi_wmi_driver = {
> + .driver = {
> + .name = "redmi-wmi",
> + .probe_type = PROBE_PREFER_ASYNCHRONOUS
> + },
> + .id_table = redmi_wmi_id_table,
> + .probe = redmi_wmi_probe,
> + .notify = redmi_wmi_notify,
> + .no_singleton = true,
> +};
> +module_wmi_driver(redmi_wmi_driver);
> +
> +MODULE_DEVICE_TABLE(wmi, redmi_wmi_id_table);
> +MODULE_AUTHOR("Gladyshev Ilya <foxido@foxido.dev>");
> +MODULE_DESCRIPTION("Redmibook WMI driver");
> +MODULE_LICENSE("GPL");
^ permalink raw reply
* [PATCH v2 RESEND] HID: multitouch: fix slab out-of-bounds access in mt_report_fixup()
From: Qasim Ijaz @ 2025-08-01 9:36 UTC (permalink / raw)
To: jikos, bentiss; +Cc: linux-input, linux-kernel, stable, Jiri Slaby
A malicious HID device can trigger a slab out-of-bounds during
mt_report_fixup() by passing in report descriptor smaller than
607 bytes. mt_report_fixup() attempts to patch byte offset 607
of the descriptor with 0x25 by first checking if byte offset
607 is 0x15 however it lacks bounds checks to verify if the
descriptor is big enough before conducting this check. Fix
this bug by ensuring the descriptor size is at least 608
bytes before accessing it.
Below is the KASAN splat after the out of bounds access happens:
[ 13.671954] ==================================================================
[ 13.672667] BUG: KASAN: slab-out-of-bounds in mt_report_fixup+0x103/0x110
[ 13.673297] Read of size 1 at addr ffff888103df39df by task kworker/0:1/10
[ 13.673297]
[ 13.673297] CPU: 0 UID: 0 PID: 10 Comm: kworker/0:1 Not tainted 6.15.0-00005-gec5d573d83f4-dirty #3
[ 13.673297] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/04
[ 13.673297] Call Trace:
[ 13.673297] <TASK>
[ 13.673297] dump_stack_lvl+0x5f/0x80
[ 13.673297] print_report+0xd1/0x660
[ 13.673297] kasan_report+0xe5/0x120
[ 13.673297] __asan_report_load1_noabort+0x18/0x20
[ 13.673297] mt_report_fixup+0x103/0x110
[ 13.673297] hid_open_report+0x1ef/0x810
[ 13.673297] mt_probe+0x422/0x960
[ 13.673297] hid_device_probe+0x2e2/0x6f0
[ 13.673297] really_probe+0x1c6/0x6b0
[ 13.673297] __driver_probe_device+0x24f/0x310
[ 13.673297] driver_probe_device+0x4e/0x220
[ 13.673297] __device_attach_driver+0x169/0x320
[ 13.673297] bus_for_each_drv+0x11d/0x1b0
[ 13.673297] __device_attach+0x1b8/0x3e0
[ 13.673297] device_initial_probe+0x12/0x20
[ 13.673297] bus_probe_device+0x13d/0x180
[ 13.673297] device_add+0xe3a/0x1670
[ 13.673297] hid_add_device+0x31d/0xa40
[...]
Fixes: c8000deb6836 ("HID: multitouch: Add support for GT7868Q")
Cc: stable@vger.kernel.org
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
Reviewed-by: Jiri Slaby <jirislaby@kernel.org>
---
v2:
- Simplify fix with a if-size check after discussion with Jiri Slaby
- Change explanation of bug to reflect inclusion of a if-size check
drivers/hid/hid-multitouch.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 294516a8f541..22c6314a8843 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -1503,6 +1503,14 @@ static const __u8 *mt_report_fixup(struct hid_device *hdev, __u8 *rdesc,
if (hdev->vendor == I2C_VENDOR_ID_GOODIX &&
(hdev->product == I2C_DEVICE_ID_GOODIX_01E8 ||
hdev->product == I2C_DEVICE_ID_GOODIX_01E9)) {
+ if (*size < 608) {
+ dev_info(
+ &hdev->dev,
+ "GT7868Q fixup: report descriptor is only %u bytes, skipping\n",
+ *size);
+ return rdesc;
+ }
+
if (rdesc[607] == 0x15) {
rdesc[607] = 0x25;
dev_info(
--
2.39.5
^ permalink raw reply related
* [PATCH] HID: asus: fix UAF via HID_CLAIMED_INPUT validation
From: Qasim Ijaz @ 2025-08-01 9:38 UTC (permalink / raw)
To: jikos, bentiss; +Cc: linux-input, linux-kernel, stable
After hid_hw_start() is called hidinput_connect() will eventually be
called to set up the device with the input layer since the
HID_CONNECT_DEFAULT connect mask is used. During hidinput_connect()
all input and output reports are processed and corresponding hid_inputs
are allocated and configured via hidinput_configure_usages(). This
process involves slot tagging report fields and configuring usages
by setting relevant bits in the capability bitmaps. However it is possible
that the capability bitmaps are not set at all leading to the subsequent
hidinput_has_been_populated() check to fail leading to the freeing of the
hid_input and the underlying input device.
This becomes problematic because a malicious HID device like a
ASUS ROG N-Key keyboard can trigger the above scenario via a
specially crafted descriptor which then leads to a user-after-free
when the name of the freed input device is written to later on after
hid_hw_start(). Below, report 93 intentionally utilises the
HID_UP_UNDEFINED Usage Page which is skipped during usage
configuration, leading to the frees.
0x05, 0x0D, // Usage Page (Digitizer)
0x09, 0x05, // Usage (Touch Pad)
0xA1, 0x01, // Collection (Application)
0x85, 0x0D, // Report ID (13)
0x06, 0x00, 0xFF, // Usage Page (Vendor Defined 0xFF00)
0x09, 0xC5, // Usage (0xC5)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x04, // Report Count (4)
0xB1, 0x02, // Feature (Data,Var,Abs)
0x85, 0x5D, // Report ID (93)
0x06, 0x00, 0x00, // Usage Page (Undefined)
0x09, 0x01, // Usage (0x01)
0x15, 0x00, // Logical Minimum (0)
0x26, 0xFF, 0x00, // Logical Maximum (255)
0x75, 0x08, // Report Size (8)
0x95, 0x1B, // Report Count (27)
0x81, 0x02, // Input (Data,Var,Abs)
0xC0, // End Collection
Below is the KASAN splat after triggering the UAF:
[ 21.672709] ==================================================================
[ 21.673700] BUG: KASAN: slab-use-after-free in asus_probe+0xeeb/0xf80
[ 21.673700] Write of size 8 at addr ffff88810a0ac000 by task kworker/1:2/54
[ 21.673700]
[ 21.673700] CPU: 1 UID: 0 PID: 54 Comm: kworker/1:2 Not tainted 6.16.0-rc4-g9773391cf4dd-dirty #36 PREEMPT(voluntary)
[ 21.673700] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.16.2-debian-1.16.2-1 04/01/2014
[ 21.673700] Call Trace:
[ 21.673700] <TASK>
[ 21.673700] dump_stack_lvl+0x5f/0x80
[ 21.673700] print_report+0xd1/0x660
[ 21.673700] kasan_report+0xe5/0x120
[ 21.673700] __asan_report_store8_noabort+0x1b/0x30
[ 21.673700] asus_probe+0xeeb/0xf80
[ 21.673700] hid_device_probe+0x2ee/0x700
[ 21.673700] really_probe+0x1c6/0x6b0
[ 21.673700] __driver_probe_device+0x24f/0x310
[ 21.673700] driver_probe_device+0x4e/0x220
[...]
[ 21.673700]
[ 21.673700] Allocated by task 54:
[ 21.673700] kasan_save_stack+0x3d/0x60
[ 21.673700] kasan_save_track+0x18/0x40
[ 21.673700] kasan_save_alloc_info+0x3b/0x50
[ 21.673700] __kasan_kmalloc+0x9c/0xa0
[ 21.673700] __kmalloc_cache_noprof+0x139/0x340
[ 21.673700] input_allocate_device+0x44/0x370
[ 21.673700] hidinput_connect+0xcb6/0x2630
[ 21.673700] hid_connect+0xf74/0x1d60
[ 21.673700] hid_hw_start+0x8c/0x110
[ 21.673700] asus_probe+0x5a3/0xf80
[ 21.673700] hid_device_probe+0x2ee/0x700
[ 21.673700] really_probe+0x1c6/0x6b0
[ 21.673700] __driver_probe_device+0x24f/0x310
[ 21.673700] driver_probe_device+0x4e/0x220
[...]
[ 21.673700]
[ 21.673700] Freed by task 54:
[ 21.673700] kasan_save_stack+0x3d/0x60
[ 21.673700] kasan_save_track+0x18/0x40
[ 21.673700] kasan_save_free_info+0x3f/0x60
[ 21.673700] __kasan_slab_free+0x3c/0x50
[ 21.673700] kfree+0xcf/0x350
[ 21.673700] input_dev_release+0xab/0xd0
[ 21.673700] device_release+0x9f/0x220
[ 21.673700] kobject_put+0x12b/0x220
[ 21.673700] put_device+0x12/0x20
[ 21.673700] input_free_device+0x4c/0xb0
[ 21.673700] hidinput_connect+0x1862/0x2630
[ 21.673700] hid_connect+0xf74/0x1d60
[ 21.673700] hid_hw_start+0x8c/0x110
[ 21.673700] asus_probe+0x5a3/0xf80
[ 21.673700] hid_device_probe+0x2ee/0x700
[ 21.673700] really_probe+0x1c6/0x6b0
[ 21.673700] __driver_probe_device+0x24f/0x310
[ 21.673700] driver_probe_device+0x4e/0x220
[...]
Fixes: 9ce12d8be12c ("HID: asus: Add i2c touchpad support")
Cc: stable@vger.kernel.org
Signed-off-by: Qasim Ijaz <qasdev00@gmail.com>
---
drivers/hid/hid-asus.c | 10 ++++++++--
1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
index 4b45e31f0bab..9bce9c84ab20 100644
--- a/drivers/hid/hid-asus.c
+++ b/drivers/hid/hid-asus.c
@@ -1212,8 +1212,14 @@ static int asus_probe(struct hid_device *hdev, const struct hid_device_id *id)
hid_err(hdev, "Asus hw start failed: %d\n", ret);
return ret;
}
-
- if (!drvdata->input) {
+
+ /*
+ * Check that input registration succeeded. Checking that
+ * HID_CLAIMED_INPUT is set prevents a UAF when all input devices
+ * were freed during registration due to no usages being mapped,
+ * leaving drvdata->input pointing to freed memory.
+ */
+ if (!drvdata->input || !(hdev->claimed & HID_CLAIMED_INPUT)) {
hid_err(hdev, "Asus input not registered\n");
ret = -ENOMEM;
goto err_stop_hw;
--
2.39.5
^ permalink raw reply related
* Re: [PATCH v12 04/10] pwm: max7360: Add MAX7360 PWM support
From: Uwe Kleine-König @ 2025-08-01 10:11 UTC (permalink / raw)
To: Mathieu Dubois-Briand
Cc: Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Kamel Bouhara, Linus Walleij, Bartosz Golaszewski,
Dmitry Torokhov, Michael Walle, Mark Brown, Greg Kroah-Hartman,
Rafael J. Wysocki, Danilo Krummrich, devicetree, linux-kernel,
linux-gpio, linux-input, linux-pwm, andriy.shevchenko,
Grégory Clement, Thomas Petazzoni, Andy Shevchenko
In-Reply-To: <20250722-mdb-max7360-support-v12-4-3747721a8d02@bootlin.com>
[-- Attachment #1: Type: text/plain, Size: 1288 bytes --]
On Tue, Jul 22, 2025 at 06:23:48PM +0200, Mathieu Dubois-Briand wrote:
> +static int max7360_pwm_round_waveform_tohw(struct pwm_chip *chip,
> + struct pwm_device *pwm,
> + const struct pwm_waveform *wf,
> + void *_wfhw)
> +{
> + struct max7360_pwm_waveform *wfhw = _wfhw;
> + u64 duty_steps;
> +
> + /*
> + * Ignore user provided values for period_length_ns and duty_offset_ns:
> + * we only support fixed period of MAX7360_PWM_PERIOD_NS and offset of 0.
> + * Values from 0 to 254 as duty_steps will provide duty cycles of 0/256
> + * to 254/256, while value 255 will provide a duty cycle of 100%.
> + */
> + if (wf->duty_length_ns >= MAX7360_PWM_PERIOD_NS) {
> + duty_steps = MAX7360_PWM_MAX;
> + } else {
> + duty_steps = (u32)wf->duty_length_ns * MAX7360_PWM_STEPS / MAX7360_PWM_PERIOD_NS;
> + if (duty_steps == MAX7360_PWM_MAX)
> + duty_steps = MAX7360_PWM_MAX - 1;
> + }
> +
> + wfhw->duty_steps = min(MAX7360_PWM_MAX, duty_steps);
> + wfhw->enabled = !!wf->period_length_ns;
> +
> + return 0;
The unconditional return 0 is wrong and testing with PWM_DEBUG enabled
should tell you that.
I think the right thing to do here is:
if (wf->period_length_ns > MAX7360_PWM_PERIOD_NS)
return 1;
else
return 0;
Otherwise looks fine.
Best regards
Uwe
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]
^ permalink raw reply
* Re: [PATCH 1/2] drm/panel: Allow powering on panel follower after panel is enabled
From: Pin-yen Lin @ 2025-08-01 11:04 UTC (permalink / raw)
To: Doug Anderson, Jani Nikula
Cc: Neil Armstrong, Jessica Zhang, Maarten Lankhorst, Maxime Ripard,
Thomas Zimmermann, David Airlie, Simona Vetter, Jiri Kosina,
Benjamin Tissoires, linux-kernel, linux-input, dri-devel,
Chen-Yu Tsai, Pin-Yen Lin
In-Reply-To: <CAD=FV=VBhamkffZhVuMEoiwfAoeHRzSORo+=eqMLYVsSBMO-bQ@mail.gmail.com>
Hi Doug and Jani,
Thanks for the review.
On Fri, Aug 1, 2025 at 12:38 AM Doug Anderson <dianders@chromium.org> wrote:
>
> Hi,
>
> On Thu, Jul 31, 2025 at 3:31 AM Jani Nikula <jani.nikula@linux.intel.com> wrote:
> >
> > On Thu, 31 Jul 2025, Pin-Yen Lin <treapking@chromium.org> wrote:
> > > Some touch controllers have to be powered on after the panel's backlight
> > > is enabled. To support these controllers, introduce after_panel_enabled
> > > flag to the panel follower and power on the device after the panel and
> > > its backlight are enabled.
> >
> > I think it's *very* confusing and error prone to call follower hooks at
> > different places depending on a flag. The hook names and documentation
> > say *when* they get called, and that should not change.
> >
> > I think the right approach would be to add .panel_enabled and
> > .panel_disabling hooks to struct drm_panel_follower_funcs, and have them
> > called after panel (and backlight) have been enabled and before panel
> > (and backlight) are disabled, respectively.
> >
> > In i2c-hid-core.c, you'd then have two copies of struct
> > drm_panel_follower_funcs, and use one or the other depending on the
> > quirk. You can even reuse the functions.
> >
> > I think overall it'll be be more consistent, more flexible, and probably
> > fewer lines of code too.
I was thinking that we probably will never have a device that needs to
register both .panel_prepared() and .panel_enabled(), so I implemented
it like this. I'll update this in the next version.
I'll also fix the s-o-b line. Apparently I've messed up with my local
git setting.
>
> Yes, exactly what Jani said. We've wanted to do this before, but I
> just never got around to it. There's even a (public) bug for it in the
> Google bug tracker and I've just assigned it to you. :-P
>
> https://issuetracker.google.com/305780363
So my series is not a new idea :P
>
> -Doug
Regards,
Pin-yen
^ permalink raw reply
* [PATCH v4] platform/x86: Add WMI driver for Redmibook keyboard.
From: Gladyshev Ilya @ 2025-08-01 12:03 UTC (permalink / raw)
To: foxido
Cc: w_armin, linux-input, nikita.nikita.krasnov, Armin Wolf,
Hans de Goede, Ilpo Järvinen, linux-kernel,
platform-driver-x86
This driver implements support for various Fn keys (like Cut) and Xiaomi
specific AI button.
Reviewed-by: Armin Wolf <W_Armin@gmx.de>
Signed-off-by: Gladyshev Ilya <foxido@foxido.dev>
---
Changes from v3:
- Optimize mutex scope
- Stylistic changes
- Pull Reviewed-by
Link to v3: https://lore.kernel.org/platform-driver-x86/20250730185619.8725-1-foxido@foxido.dev/
---
MAINTAINERS | 6 ++
drivers/platform/x86/Kconfig | 12 +++
drivers/platform/x86/Makefile | 1 +
drivers/platform/x86/redmi-wmi.c | 129 +++++++++++++++++++++++++++++++
4 files changed, 148 insertions(+)
create mode 100644 drivers/platform/x86/redmi-wmi.c
diff --git a/MAINTAINERS b/MAINTAINERS
index c0b444e5fd5a..eb25fb10e751 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -20965,6 +20965,12 @@ S: Maintained
T: git https://github.com/pkshih/rtw.git
F: drivers/net/wireless/realtek/rtw89/
+REDMIBOOK WMI DRIVERS
+M: Gladyshev Ilya <foxido@foxido.dev>
+L: platform-driver-x86@vger.kernel.org
+S: Maintained
+F: drivers/platform/x86/redmi-wmi.c
+
REDPINE WIRELESS DRIVER
L: linux-wireless@vger.kernel.org
S: Orphan
diff --git a/drivers/platform/x86/Kconfig b/drivers/platform/x86/Kconfig
index e5cbd58a99f3..9f98a7042e43 100644
--- a/drivers/platform/x86/Kconfig
+++ b/drivers/platform/x86/Kconfig
@@ -109,6 +109,18 @@ config XIAOMI_WMI
To compile this driver as a module, choose M here: the module will
be called xiaomi-wmi.
+config REDMI_WMI
+ tristate "Redmibook WMI key driver"
+ depends on ACPI_WMI
+ depends on INPUT
+ select INPUT_SPARSEKMAP
+ help
+ Say Y here if you want support for WMI-based hotkey events on
+ Xiaomi Redmibook devices.
+
+ To compile this driver as a module, choose M here: the module will
+ be called redmi-wmi.
+
config GIGABYTE_WMI
tristate "Gigabyte WMI temperature driver"
depends on ACPI_WMI
diff --git a/drivers/platform/x86/Makefile b/drivers/platform/x86/Makefile
index bea87a85ae75..406dd0807ba7 100644
--- a/drivers/platform/x86/Makefile
+++ b/drivers/platform/x86/Makefile
@@ -13,6 +13,7 @@ obj-$(CONFIG_HUAWEI_WMI) += huawei-wmi.o
obj-$(CONFIG_MXM_WMI) += mxm-wmi.o
obj-$(CONFIG_NVIDIA_WMI_EC_BACKLIGHT) += nvidia-wmi-ec-backlight.o
obj-$(CONFIG_XIAOMI_WMI) += xiaomi-wmi.o
+obj-$(CONFIG_REDMI_WMI) += redmi-wmi.o
obj-$(CONFIG_GIGABYTE_WMI) += gigabyte-wmi.o
# Acer
diff --git a/drivers/platform/x86/redmi-wmi.c b/drivers/platform/x86/redmi-wmi.c
new file mode 100644
index 000000000000..27f5674a2513
--- /dev/null
+++ b/drivers/platform/x86/redmi-wmi.c
@@ -0,0 +1,129 @@
+// SPDX-License-Identifier: GPL-2.0
+/* WMI driver for Xiaomi Redmibooks */
+
+#include <linux/acpi.h>
+#include <linux/device.h>
+#include <linux/input.h>
+#include <linux/input/sparse-keymap.h>
+#include <linux/module.h>
+#include <linux/mutex.h>
+#include <linux/unaligned.h>
+#include <linux/wmi.h>
+
+#include <uapi/linux/input-event-codes.h>
+
+#define WMI_REDMIBOOK_KEYBOARD_EVENT_GUID "46C93E13-EE9B-4262-8488-563BCA757FEF"
+
+#define AI_KEY_VALUE_MASK 0x00000100
+
+static const struct key_entry redmi_wmi_keymap[] = {
+ {KE_KEY, 0x00000201, {KEY_SELECTIVE_SCREENSHOT}},
+ {KE_KEY, 0x00000301, {KEY_ALL_APPLICATIONS}},
+ {KE_KEY, 0x00001b01, {KEY_SETUP}},
+
+ /* AI button has code for each position */
+ {KE_KEY, 0x00011801, {KEY_ASSISTANT}},
+ {KE_KEY, 0x00011901, {KEY_ASSISTANT}},
+
+ /* Keyboard backlight */
+ {KE_IGNORE, 0x00000501, {}},
+ {KE_IGNORE, 0x00800501, {}},
+ {KE_IGNORE, 0x00050501, {}},
+ {KE_IGNORE, 0x000a0501, {}},
+
+ {KE_END}
+};
+
+struct redmi_wmi {
+ struct input_dev *input_dev;
+ /* Protects the key event sequence */
+ struct mutex key_lock;
+};
+
+static int redmi_wmi_probe(struct wmi_device *wdev, const void *context)
+{
+ struct redmi_wmi *data;
+ int err;
+
+ /* Init dev */
+ data = devm_kzalloc(&wdev->dev, sizeof(*data), GFP_KERNEL);
+ if (!data)
+ return -ENOMEM;
+
+ dev_set_drvdata(&wdev->dev, data);
+
+ err = devm_mutex_init(&wdev->dev, &data->key_lock);
+ if (err)
+ return err;
+
+ /* Setup input device */
+ data->input_dev = devm_input_allocate_device(&wdev->dev);
+ if (!data->input_dev)
+ return -ENOMEM;
+
+ data->input_dev->name = "Redmibook WMI keys";
+ data->input_dev->phys = "wmi/input0";
+
+ err = sparse_keymap_setup(data->input_dev, redmi_wmi_keymap, NULL);
+ if (err)
+ return err;
+
+ return input_register_device(data->input_dev);
+}
+
+static void redmi_wmi_notify(struct wmi_device *wdev, union acpi_object *obj)
+{
+ struct redmi_wmi *data = dev_get_drvdata(&wdev->dev);
+ bool autorelease = true;
+ int value = 1;
+
+ if (obj->type != ACPI_TYPE_BUFFER) {
+ dev_err(&wdev->dev, "Bad response type %u\n", obj->type);
+ return;
+ }
+
+ if (obj->buffer.length < 32) {
+ dev_err(&wdev->dev, "Invalid buffer length %u\n", obj->buffer.length);
+ return;
+ }
+
+ u32 payload = get_unaligned_le32(obj->buffer.pointer);
+ struct key_entry *entry = sparse_keymap_entry_from_scancode(data->input_dev, payload);
+
+ if (!entry) {
+ dev_dbg(&wdev->dev, "Unknown WMI event with payload %u", payload);
+ return;
+ }
+
+ /* AI key quirk */
+ if (entry->keycode == KEY_ASSISTANT) {
+ value = !(payload & AI_KEY_VALUE_MASK);
+ autorelease = false;
+ }
+
+ /* For linearizability */
+ guard(mutex)(&data->key_lock);
+ sparse_keymap_report_entry(data->input_dev, entry, value, autorelease);
+}
+
+static const struct wmi_device_id redmi_wmi_id_table[] = {
+ { WMI_REDMIBOOK_KEYBOARD_EVENT_GUID, NULL },
+ { }
+};
+
+static struct wmi_driver redmi_wmi_driver = {
+ .driver = {
+ .name = "redmi-wmi",
+ .probe_type = PROBE_PREFER_ASYNCHRONOUS
+ },
+ .id_table = redmi_wmi_id_table,
+ .probe = redmi_wmi_probe,
+ .notify = redmi_wmi_notify,
+ .no_singleton = true,
+};
+module_wmi_driver(redmi_wmi_driver);
+
+MODULE_DEVICE_TABLE(wmi, redmi_wmi_id_table);
+MODULE_AUTHOR("Gladyshev Ilya <foxido@foxido.dev>");
+MODULE_DESCRIPTION("Redmibook WMI driver");
+MODULE_LICENSE("GPL");
--
2.50.0
^ permalink raw reply related
* [PATCH 0/3] Radxa NIO 12L: Add GPIO keys and LED support
From: Julien Massot @ 2025-08-01 13:16 UTC (permalink / raw)
To: kernel, Dmitry Torokhov, Matthias Brugger,
AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
devicetree, Julien Massot
This patchset adds support for the GPIO-connected red and blue LEDs, as well as the various hardware buttons present on the Radxa NIO 12L board.
It also includes a fix for the missing release (key-up) interrupt handling for PMIC-managed GPIO keys.
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
Julien Massot (3):
Input: mtk-pmic-keys - MT6359 has a specific release irq
arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support
arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs
.../boot/dts/mediatek/mt8395-radxa-nio-12l.dts | 67 ++++++++++++++++++++++
drivers/input/keyboard/mtk-pmic-keys.c | 1 +
2 files changed, 68 insertions(+)
---
base-commit: b9ddaa95fd283bce7041550ddbbe7e764c477110
change-id: 20250801-radxa-nio-12-l-gpio-54f208c25333
Best regards,
--
Julien Massot <julien.massot@collabora.com>
^ permalink raw reply
* [PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
From: Julien Massot @ 2025-08-01 13:16 UTC (permalink / raw)
To: kernel, Dmitry Torokhov, Matthias Brugger,
AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
devicetree, Julien Massot
In-Reply-To: <20250801-radxa-nio-12-l-gpio-v1-0-d0840f85d2c8@collabora.com>
A recent commit in linux-next added support for key events.
However, the key release event is not properly handled: only key press events
are generated, leaving key states stuck in "pressed".
This patch ensures that both key press and key release events are properly
emitted by handling the release logic correctly.
Note: the code was introduced in linux-next by commit
bc25e6bf032e ("Input: mtk-pmic-keys - add support for MT6359 PMIC keys")
and is not yet present in mainline.
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
drivers/input/keyboard/mtk-pmic-keys.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/input/keyboard/mtk-pmic-keys.c b/drivers/input/keyboard/mtk-pmic-keys.c
index 50e2e792c91d2626d3f282d04a1db60845827ef2..0f9a589306482265f1f65c5a100b3f4aba0a2ed3 100644
--- a/drivers/input/keyboard/mtk-pmic-keys.c
+++ b/drivers/input/keyboard/mtk-pmic-keys.c
@@ -129,6 +129,7 @@ static const struct mtk_pmic_regs mt6359_regs = {
MTK_PMIC_HOMEKEY_RST),
.pmic_rst_reg = MT6359_TOP_RST_MISC,
.rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
+ .key_release_irq = true,
};
struct mtk_pmic_keys_info {
--
2.50.1
^ permalink raw reply related
* [PATCH 2/3] arm64: dts: mediatek: mt8395-nio-12l: add PMIC and GPIO keys support
From: Julien Massot @ 2025-08-01 13:16 UTC (permalink / raw)
To: kernel, Dmitry Torokhov, Matthias Brugger,
AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
devicetree, Julien Massot
In-Reply-To: <20250801-radxa-nio-12-l-gpio-v1-0-d0840f85d2c8@collabora.com>
Add support for PMIC and GPIO keys on the Radxa NIO 12L board:
Declare a gpio-keys node for the Volume Up button using GPIO106.
Add the corresponding pin configuration in the pinctrl node.
Add a mediatek,mt6359-keys subnode under the PMIC to handle the
power and home buttons exposed by the MT6359.
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
.../boot/dts/mediatek/mt8395-radxa-nio-12l.dts | 36 ++++++++++++++++++++++
1 file changed, 36 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
index 329c60cc6a6be0b4be8c0b8bb033b32d35302804..fd596e2298285361ad7c2fb828feec598d75a73e 100644
--- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
@@ -8,6 +8,7 @@
#include "mt8195.dtsi"
#include "mt6359.dtsi"
#include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
#include <dt-bindings/pinctrl/mt8195-pinfunc.h>
#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
@@ -60,6 +61,18 @@ backlight: backlight {
status = "disabled";
};
+ keys: gpio-keys {
+ compatible = "gpio-keys";
+
+ button-volume-up {
+ wakeup-source;
+ debounce-interval = <100>;
+ gpios = <&pio 106 GPIO_ACTIVE_LOW>;
+ label = "volume_up";
+ linux,code = <KEY_VOLUMEUP>;
+ };
+ };
+
wifi_vreg: regulator-wifi-3v3-en {
compatible = "regulator-fixed";
regulator-name = "wifi_3v3_en";
@@ -626,6 +639,14 @@ pins-txd {
};
};
+ gpio_key_pins: gpio-keys-pins {
+ pins {
+ pinmux = <PINMUX_GPIO106__FUNC_GPIO106>;
+ bias-pull-up;
+ input-enable;
+ };
+ };
+
i2c2_pins: i2c2-pins {
pins-bus {
pinmux = <PINMUX_GPIO12__FUNC_SDA2>,
@@ -880,6 +901,21 @@ &pciephy {
&pmic {
interrupts-extended = <&pio 222 IRQ_TYPE_LEVEL_HIGH>;
+
+ mt6359keys: keys {
+ compatible = "mediatek,mt6359-keys";
+ mediatek,long-press-mode = <1>;
+ power-off-time-sec = <0>;
+
+ power-key {
+ linux,keycodes = <KEY_POWER>;
+ wakeup-source;
+ };
+
+ home {
+ linux,keycodes = <KEY_HOME>;
+ };
+ };
};
&scp {
--
2.50.1
^ permalink raw reply related
* [PATCH 3/3] arm64: dts: mediatek: mt8395-nio-12l: add support for blue and red LEDs
From: Julien Massot @ 2025-08-01 13:16 UTC (permalink / raw)
To: kernel, Dmitry Torokhov, Matthias Brugger,
AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: linux-input, linux-kernel, linux-arm-kernel, linux-mediatek,
devicetree, Julien Massot
In-Reply-To: <20250801-radxa-nio-12-l-gpio-v1-0-d0840f85d2c8@collabora.com>
The Radxa NIO 12L board has an RGB LED, of which only red and blue
are controllable.
Red and blue LEDs: no need to choose, both are enabled.
Signed-off-by: Julien Massot <julien.massot@collabora.com>
---
.../boot/dts/mediatek/mt8395-radxa-nio-12l.dts | 31 ++++++++++++++++++++++
1 file changed, 31 insertions(+)
diff --git a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
index fd596e2298285361ad7c2fb828feec598d75a73e..12288ad4d2932b7f78c96c0efe366a046721f919 100644
--- a/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
+++ b/arch/arm64/boot/dts/mediatek/mt8395-radxa-nio-12l.dts
@@ -10,6 +10,7 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/irq.h>
+#include <dt-bindings/leds/common.h>
#include <dt-bindings/pinctrl/mt8195-pinfunc.h>
#include <dt-bindings/regulator/mediatek,mt6360-regulator.h>
#include <dt-bindings/spmi/spmi.h>
@@ -73,6 +74,28 @@ button-volume-up {
};
};
+ gpio-leds {
+ compatible = "gpio-leds";
+ pinctrl-0 = <&gpio_leds_pins>;
+ pinctrl-names = "default";
+
+ /*
+ * This board has a RGB LED, of which only R and B
+ * are controllable.
+ */
+ led-0 {
+ label = "rgb-blue";
+ color = <LED_COLOR_ID_BLUE>;
+ gpios = <&pio 6 GPIO_ACTIVE_HIGH>;
+ };
+
+ led-1 {
+ label = "rgb-red";
+ color = <LED_COLOR_ID_RED>;
+ gpios = <&pio 7 GPIO_ACTIVE_HIGH>;
+ };
+ };
+
wifi_vreg: regulator-wifi-3v3-en {
compatible = "regulator-fixed";
regulator-name = "wifi_3v3_en";
@@ -647,6 +670,14 @@ pins {
};
};
+ gpio_leds_pins: gpio-leds-pins {
+ pins {
+ pinmux = <PINMUX_GPIO6__FUNC_GPIO6>,
+ <PINMUX_GPIO7__FUNC_GPIO7>;
+ output-low;
+ };
+ };
+
i2c2_pins: i2c2-pins {
pins-bus {
pinmux = <PINMUX_GPIO12__FUNC_SDA2>,
--
2.50.1
^ permalink raw reply related
* Re: [PATCH] Input: stmpe-keypad - add STMPE1801 support
From: Paul Sajna @ 2025-08-01 21:21 UTC (permalink / raw)
To: Sergey Larin, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue
Cc: linux-input, linux-stm32, linux-arm-kernel, linux-kernel
In-Reply-To: <20210618145149.10136-1-cerg2010cerg2010@mail.ru>
I've been heavily testing and relying on this patch for part of a
device-specific-port to BlackBerry KEY2. This patch works great. I hope
to submit my changes upstream when they are ready. Please let me know if
there's anything I can do to help move this patch forward.
https://github.com/sdm660-mainline/linux/pull/97
On 6/18/21 7:51 AM, Sergey Larin wrote:
> This chip variant differs from others - it has different register
> map and swapped rows/columns.
>
> Signed-off-by: Sergey Larin <cerg2010cerg2010@mail.ru>
> ---
> drivers/input/keyboard/stmpe-keypad.c | 108 ++++++++++++++++++++------
> 1 file changed, 85 insertions(+), 23 deletions(-)
>
> diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c
> index 7bf97285e30c..ed74578927a3 100644
> --- a/drivers/input/keyboard/stmpe-keypad.c
> +++ b/drivers/input/keyboard/stmpe-keypad.c
> @@ -13,7 +13,7 @@
> #include <linux/input/matrix_keypad.h>
> #include <linux/mfd/stmpe.h>
>
> -/* These are at the same addresses in all STMPE variants */
> +/* These are at the same addresses in all STMPE variants, except 1801 */
> #define STMPE_KPC_COL 0x60
> #define STMPE_KPC_ROW_MSB 0x61
> #define STMPE_KPC_ROW_LSB 0x62
> @@ -42,14 +42,15 @@
> #define STMPE_KEYPAD_MAX_DEBOUNCE 127
> #define STMPE_KEYPAD_MAX_SCAN_COUNT 15
>
> -#define STMPE_KEYPAD_MAX_ROWS 8
> -#define STMPE_KEYPAD_MAX_COLS 8
> +#define STMPE_KEYPAD_MAX_ROWS 10
> +#define STMPE_KEYPAD_MAX_COLS 12
> #define STMPE_KEYPAD_ROW_SHIFT 3
> #define STMPE_KEYPAD_KEYMAP_MAX_SIZE \
> (STMPE_KEYPAD_MAX_ROWS * STMPE_KEYPAD_MAX_COLS)
>
>
> #define STMPE1601_NUM_DATA 5
> +#define STMPE1801_NUM_DATA 5
> #define STMPE2401_NUM_DATA 3
> #define STMPE2403_NUM_DATA 5
>
> @@ -67,6 +68,12 @@
> * @max_rows: maximum number of rows supported
> * @col_gpios: bitmask of gpios which can be used for columns
> * @row_gpios: bitmask of gpios which can be used for rows
> + * @col_regs: registers for setting column pins
> + * @row_regs: registers for setting row pins
> + * @data_regs: registers for reading key data
> + * @ctrl_msb_reg: register for setting scan count
> + * @ctrl_lsb_reg: register for setting debounce time
> + * @cmd_reg: register for toggling scan mode
> */
> struct stmpe_keypad_variant {
> bool auto_increment;
> @@ -77,6 +84,18 @@ struct stmpe_keypad_variant {
> int max_rows;
> unsigned int col_gpios;
> unsigned int row_gpios;
> +
> +#define MAX_COL_REGS 3
> +#define MAX_ROW_REGS 3
> +#define MAX_DATA_REGS 5
> +
> + u8 col_regs[MAX_COL_REGS];
> + u8 row_regs[MAX_ROW_REGS];
> + u8 data_regs[MAX_DATA_REGS];
> + u8 ctrl_msb_reg;
> + u8 ctrl_lsb_reg;
> + u8 cmd_reg;
> + bool read_inverted;
> };
>
> static const struct stmpe_keypad_variant stmpe_keypad_variants[] = {
> @@ -88,6 +107,29 @@ static const struct stmpe_keypad_variant stmpe_keypad_variants[] = {
> .max_rows = 8,
> .col_gpios = 0x000ff, /* GPIO 0 - 7 */
> .row_gpios = 0x0ff00, /* GPIO 8 - 15 */
> + .col_regs = { 0x60 },
> + .row_regs = { 0x62, 0x61 },
> + .data_regs = { 0x68, 0x69, 0x6a, 0x6b, 0x6c },
> + .ctrl_msb_reg = 0x63,
> + .ctrl_lsb_reg = 0x64,
> + .cmd_reg = 0x64,
> + .read_inverted = 0,
> + },
> + [STMPE1801] = {
> + .auto_increment = true,
> + .num_data = STMPE1801_NUM_DATA,
> + .num_normal_data = 3,
> + .max_cols = 10,
> + .max_rows = 8,
> + .col_gpios = 0x3ff00, /* GPIO 8 - 17 */
> + .row_gpios = 0x000ff, /* GPIO 0 - 7 */
> + .col_regs = { 0x31, 0x32 },
> + .row_regs = { 0x30 },
> + .data_regs = { 0x3a, 0x3b, 0x3c, 0x3d, 0x3e },
> + .ctrl_msb_reg = 0x33,
> + .ctrl_lsb_reg = 0x34,
> + .cmd_reg = 0x36,
> + .read_inverted = 1,
> },
> [STMPE2401] = {
> .auto_increment = false,
> @@ -98,6 +140,13 @@ static const struct stmpe_keypad_variant stmpe_keypad_variants[] = {
> .max_rows = 12,
> .col_gpios = 0x0000ff, /* GPIO 0 - 7*/
> .row_gpios = 0x1f7f00, /* GPIO 8-14, 16-20 */
> + .col_regs = { 0x60 },
> + .row_regs = { 0x62, 0x61 },
> + .data_regs = { 0x68, 0x69, 0x6a, 0x6b, 0x6c },
> + .ctrl_msb_reg = 0x63,
> + .ctrl_lsb_reg = 0x64,
> + .cmd_reg = 0x64,
> + .read_inverted = 0,
> },
> [STMPE2403] = {
> .auto_increment = true,
> @@ -108,6 +157,13 @@ static const struct stmpe_keypad_variant stmpe_keypad_variants[] = {
> .max_rows = 12,
> .col_gpios = 0x0000ff, /* GPIO 0 - 7*/
> .row_gpios = 0x1fef00, /* GPIO 8-14, 16-20 */
> + .col_regs = { 0x60 },
> + .row_regs = { 0x62, 0x61 },
> + .data_regs = { 0x68, 0x69, 0x6a, 0x6b, 0x6c },
> + .ctrl_msb_reg = 0x63,
> + .ctrl_lsb_reg = 0x64,
> + .cmd_reg = 0x64,
> + .read_inverted = 0,
> },
> };
>
> @@ -145,11 +201,11 @@ static int stmpe_keypad_read_data(struct stmpe_keypad *keypad, u8 *data)
> int i;
>
> if (variant->auto_increment)
> - return stmpe_block_read(stmpe, STMPE_KPC_DATA_BYTE0,
> + return stmpe_block_read(stmpe, variant->data_regs[0],
> variant->num_data, data);
>
> for (i = 0; i < variant->num_data; i++) {
> - ret = stmpe_reg_read(stmpe, STMPE_KPC_DATA_BYTE0 + i);
> + ret = stmpe_reg_read(stmpe, variant->data_regs[i]);
> if (ret < 0)
> return ret;
>
> @@ -176,7 +232,9 @@ static irqreturn_t stmpe_keypad_irq(int irq, void *dev)
> u8 data = fifo[i];
> int row = (data & STMPE_KPC_DATA_ROW) >> 3;
> int col = data & STMPE_KPC_DATA_COL;
> - int code = MATRIX_SCAN_CODE(row, col, STMPE_KEYPAD_ROW_SHIFT);
> + int code = variant->read_inverted ?
> + MATRIX_SCAN_CODE(col, row, STMPE_KEYPAD_ROW_SHIFT)
> + : MATRIX_SCAN_CODE(row, col, STMPE_KEYPAD_ROW_SHIFT);
> bool up = data & STMPE_KPC_DATA_UP;
>
> if ((data & STMPE_KPC_DATA_NOKEY_MASK)
> @@ -265,7 +323,7 @@ static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad)
> {
> const struct stmpe_keypad_variant *variant = keypad->variant;
> struct stmpe *stmpe = keypad->stmpe;
> - int ret;
> + int ret, val, i;
>
> if (keypad->debounce_ms > STMPE_KEYPAD_MAX_DEBOUNCE)
> return -EINVAL;
> @@ -281,33 +339,37 @@ static int stmpe_keypad_chip_init(struct stmpe_keypad *keypad)
> if (ret < 0)
> return ret;
>
> - ret = stmpe_reg_write(stmpe, STMPE_KPC_COL, keypad->cols);
> - if (ret < 0)
> - return ret;
> -
> - ret = stmpe_reg_write(stmpe, STMPE_KPC_ROW_LSB, keypad->rows);
> - if (ret < 0)
> - return ret;
> + val = keypad->cols;
> + i = 0;
> + do {
> + ret = stmpe_reg_write(stmpe, variant->col_regs[i++], val & 0xff);
> + if (ret < 0)
> + return ret;
> + } while ((val >>= 8) != 0);
>
> - if (variant->max_rows > 8) {
> - ret = stmpe_set_bits(stmpe, STMPE_KPC_ROW_MSB,
> - STMPE_KPC_ROW_MSB_ROWS,
> - keypad->rows >> 8);
> + val = keypad->rows;
> + i = 0;
> + do {
> + ret = stmpe_reg_write(stmpe, variant->row_regs[i++], val & 0xff);
> if (ret < 0)
> return ret;
> - }
> + } while ((val >>= 8) != 0);
>
> - ret = stmpe_set_bits(stmpe, STMPE_KPC_CTRL_MSB,
> + ret = stmpe_set_bits(stmpe, variant->ctrl_msb_reg,
> STMPE_KPC_CTRL_MSB_SCAN_COUNT,
> keypad->scan_count << 4);
> if (ret < 0)
> return ret;
>
> - return stmpe_set_bits(stmpe, STMPE_KPC_CTRL_LSB,
> - STMPE_KPC_CTRL_LSB_SCAN |
> + ret = stmpe_set_bits(stmpe, variant->ctrl_lsb_reg,
> STMPE_KPC_CTRL_LSB_DEBOUNCE,
> - STMPE_KPC_CTRL_LSB_SCAN |
> (keypad->debounce_ms << 1));
> + if (ret < 0)
> + return ret;
> +
> + return stmpe_set_bits(stmpe, variant->cmd_reg,
> + STMPE_KPC_CTRL_LSB_SCAN,
> + STMPE_KPC_CTRL_LSB_SCAN);
> }
>
> static void stmpe_keypad_fill_used_pins(struct stmpe_keypad *keypad,
^ permalink raw reply
* Re: [PATCH 11/11] HID: multitouch: add haptic multitouch support
From: Jonathan Denose @ 2025-08-01 21:30 UTC (permalink / raw)
To: Oliver Sang
Cc: Philip Li, kernel test robot, Jiri Kosina, Benjamin Tissoires,
Dmitry Torokhov, Jonathan Corbet, Henrik Rydberg, oe-kbuild-all,
linux-input, linux-kernel, linux-doc, Angela Czubak,
Sean O'Brien
In-Reply-To: <aIrbJy7Rb6aVNOk9@xsang-OptiPlex-9020>
On Wed, Jul 30, 2025 at 9:55 PM Oliver Sang <oliver.sang@intel.com> wrote:
>
> hi, Jonathan,
>
> On Mon, Jul 21, 2025 at 11:06:33AM -0500, Jonathan Denose wrote:
> > On Thu, Jul 17, 2025 at 6:59 PM Philip Li <philip.li@intel.com> wrote:
> > >
> > > On Thu, Jul 17, 2025 at 01:43:28PM -0500, Jonathan Denose wrote:
> > > > On Tue, Jul 15, 2025 at 6:36 AM kernel test robot <lkp@intel.com> wrote:
> > > > > kernel test robot noticed the following build errors:
> > > > >
> > > > > [auto build test ERROR on 86731a2a651e58953fc949573895f2fa6d456841]
> > > > >
> > > > > url: https://github.com/intel-lab-lkp/linux/commits/Jonathan-Denose/HID-add-haptics-page-defines/20250714-231444
> > > > > base: 86731a2a651e58953fc949573895f2fa6d456841
> > > > > patch link: https://lore.kernel.org/r/20250714-support-forcepads-v1-11-71c7c05748c9%40google.com
> > > > > patch subject: [PATCH 11/11] HID: multitouch: add haptic multitouch support
> > > > > config: hexagon-randconfig-r112-20250715 (https://download.01.org/0day-ci/archive/20250715/202507151942.94dhYylY-lkp@intel.com/config)
> > > > > compiler: clang version 17.0.6 (https://github.com/llvm/llvm-project 6009708b4367171ccdbf4b5905cb6a803753fe18)
> > > > > reproduce: (https://download.01.org/0day-ci/archive/20250715/202507151942.94dhYylY-lkp@intel.com/reproduce)
> > > >
> > > > I'm having trouble reproducing this build error. I tried following the
> > >
> > > Sorry Jonathan, the reproduce step we provide is wrong, would you mind to give
> > > a try similar to the steps in [1]? We will resolve the bug as early as possible.
> > >
> > > [1] https://download.01.org/0day-ci/archive/20250717/202507170506.Wzz1lR5I-lkp@intel.com/reproduce
> > >
> > > > steps in the linked reproduce file, but when running:
> > > > COMPILER_INSTALL_PATH=$HOME/0day ~/lkp-tests/kbuild/make.cross C=1
> > > > CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__ -fmax-errors=unlimited
> > > > -fmax-warnings=unlimited' O=build_dir ARCH=hexagon olddefconfig
> > > >
> > > > I get the errors:
> > > > 0day/gcc-4.6.1-nolibc/hexagon-linux/bin/hexagon-linux-gcc: unknown C compiler
> > > > scripts/Kconfig.include:45: Sorry, this C compiler is not supported.
> > > >
> > > > It looks to me like the hexagon-linux-gcc compiler is correctly
> > > > installed at $HOME/0day so I'm not sure what to do from here. Can
> > > > someone please assist me with this?
> > > >
> > > > --
> > > > Jonathan
> > > >
> > Great! Thanks for providing the correct reproduce steps Phillip.
> >
> > I tried them and both of the make.cross steps completed successfully.
> > I am not getting the build errors that the test bot is reporting.
>
> sorry for this. just want to confirm one thing, did you follow below steps?
> (the link [1] above is just for example, we need do small modification to
> reproduce the issue in original report, there are 4 diff in below with [1],
> (1) use your commit, (2) 'wget' command to get correct config (3) change to
> use clang-17, btw, clang-20 can also reproduce the issue (4) change build
> source to 'drivers/hid')
>
> reproduce:
> git clone https://github.com/intel/lkp-tests.git ~/lkp-tests
> # https://github.com/intel-lab-lkp/linux/commit/4ccef2fdc95970f67857113edb4103d53205ac9c
> git remote add linux-review https://github.com/intel-lab-lkp/linux
> git fetch --no-tags linux-review Jonathan-Denose/HID-add-haptics-page-defines/20250714-231444
> git checkout 4ccef2fdc95970f67857113edb4103d53205ac9c
> # save the config file
> wget https://download.01.org/0day-ci/archive/20250715/202507151942.94dhYylY-lkp@intel.com/config
> mkdir build_dir && cp config build_dir/.config
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang-17 ~/lkp-tests/kbuild/make.cross W=1 O=build_dir ARCH=hexagon olddefconfig
> COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang-17 ~/lkp-tests/kbuild/make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/hid/
>
>
> I can reproduce the issue with above steps, if you still cannot reproduce,
> could you give me your full log? below is mine just FYI (this is for clang-20,
> and I use some different folders but not important)
>
> xsang@xsang-OptiPlex-9020:~/linux$ COMPILER_INSTALL_PATH=/home/xsang/cross-compiler/ COMPILER=clang-20 /home/xsang/lkp-tests/kbuild/make.cross W=1 O=build_dir ARCH=hexagon olddefconfig
> Compiler will be installed in /home/xsang/cross-compiler/
> lftpget -c https://cdn.kernel.org/pub/tools/llvm/files/./llvm-20.1.8-x86_64.tar.xz
> /home/xsang/linux
> tar Jxf /home/xsang/cross-compiler//./llvm-20.1.8-x86_64.tar.xz -C /home/xsang/cross-compiler/
> PATH=/home/xsang/cross-compiler//llvm-20.1.8-x86_64/bin:/home/xsang/.local/bin:/home/xsang/bin:/home/xsang/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/xsang/.local/bin
> make --keep-going LLVM=1 CROSS_COMPILE=hexagon-linux- --jobs=72 KCFLAGS= -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef W=1 O=build_dir ARCH=hexagon olddefconfig
> make[1]: Entering directory '/home/xsang/linux/build_dir'
> GEN Makefile
> HOSTCC scripts/basic/fixdep
> HOSTCC scripts/kconfig/conf.o
> HOSTCC scripts/kconfig/confdata.o
> HOSTCC scripts/kconfig/expr.o
> LEX scripts/kconfig/lexer.lex.c
> YACC scripts/kconfig/parser.tab.[ch]
> HOSTCC scripts/kconfig/menu.o
> HOSTCC scripts/kconfig/preprocess.o
> HOSTCC scripts/kconfig/symbol.o
> HOSTCC scripts/kconfig/util.o
> HOSTCC scripts/kconfig/lexer.lex.o
> HOSTCC scripts/kconfig/parser.tab.o
> HOSTLD scripts/kconfig/conf
> #
> # configuration written to .config
> #
> make[1]: Leaving directory '/home/xsang/linux/build_dir'
>
>
> xsang@xsang-OptiPlex-9020:~/linux$ COMPILER_INSTALL_PATH=/home/xsang/cross-compiler/ COMPILER=clang-20 /home/xsang/lkp-tests/kbuild/make.cross W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/hid/
> Compiler will be installed in /home/xsang/cross-compiler/
> PATH=/home/xsang/cross-compiler//llvm-20.1.8-x86_64/bin:/home/xsang/.local/bin:/home/xsang/bin:/home/xsang/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/home/xsang/.local/bin
> make --keep-going LLVM=1 CROSS_COMPILE=hexagon-linux- --jobs=72 KCFLAGS= -Wno-error=return-type -Wreturn-type -funsigned-char -Wundef W=1 O=build_dir ARCH=hexagon SHELL=/bin/bash drivers/hid/
> make[1]: Entering directory '/home/xsang/linux/build_dir'
> GEN Makefile
> GENSEED scripts/basic/randstruct.seed
> WRAP arch/hexagon/include/generated/uapi/asm/ucontext.h
> WRAP arch/hexagon/include/generated/uapi/asm/auxvec.h
> WRAP arch/hexagon/include/generated/uapi/asm/bitsperlong.h
> WRAP arch/hexagon/include/generated/uapi/asm/bpf_perf_event.h
> WRAP arch/hexagon/include/generated/uapi/asm/errno.h
> WRAP arch/hexagon/include/generated/uapi/asm/fcntl.h
> UPD include/generated/uapi/linux/version.h
> WRAP arch/hexagon/include/generated/uapi/asm/ioctl.h
> WRAP arch/hexagon/include/generated/uapi/asm/ipcbuf.h
> WRAP arch/hexagon/include/generated/uapi/asm/ioctls.h
> WRAP arch/hexagon/include/generated/uapi/asm/mman.h
> WRAP arch/hexagon/include/generated/uapi/asm/msgbuf.h
> WRAP arch/hexagon/include/generated/uapi/asm/poll.h
> WRAP arch/hexagon/include/generated/uapi/asm/posix_types.h
> WRAP arch/hexagon/include/generated/uapi/asm/resource.h
> WRAP arch/hexagon/include/generated/uapi/asm/sembuf.h
> WRAP arch/hexagon/include/generated/uapi/asm/shmbuf.h
> WRAP arch/hexagon/include/generated/uapi/asm/siginfo.h
> WRAP arch/hexagon/include/generated/uapi/asm/sockios.h
> WRAP arch/hexagon/include/generated/uapi/asm/socket.h
> WRAP arch/hexagon/include/generated/uapi/asm/stat.h
> WRAP arch/hexagon/include/generated/uapi/asm/statfs.h
> WRAP arch/hexagon/include/generated/uapi/asm/termbits.h
> WRAP arch/hexagon/include/generated/uapi/asm/types.h
> WRAP arch/hexagon/include/generated/uapi/asm/termios.h
> SYSHDR arch/hexagon/include/generated/uapi/asm/unistd_32.h
> UPD include/config/kernel.release
> UPD include/generated/compile.h
> HOSTCC scripts/dtc/dtc.o
> HOSTCC scripts/dtc/flattree.o
> HOSTCC scripts/dtc/fstree.o
> HOSTCC scripts/dtc/data.o
> HOSTCC scripts/dtc/livetree.o
> HOSTCC scripts/dtc/treesource.o
> HOSTCC scripts/dtc/srcpos.o
> HOSTCC scripts/dtc/checks.o
> HOSTCC scripts/dtc/util.o
> LEX scripts/dtc/dtc-lexer.lex.c
> YACC scripts/dtc/dtc-parser.tab.[ch]
> HOSTCC scripts/dtc/libfdt/fdt.o
> HOSTCC scripts/dtc/libfdt/fdt_ro.o
> UPD include/generated/utsrelease.h
> HOSTCC scripts/dtc/libfdt/fdt_wip.o
> HOSTCC scripts/dtc/libfdt/fdt_sw.o
> HOSTCC scripts/dtc/libfdt/fdt_rw.o
> HOSTCC scripts/dtc/libfdt/fdt_strerror.o
> HOSTCC scripts/dtc/libfdt/fdt_empty_tree.o
> HOSTCC scripts/dtc/libfdt/fdt_addresses.o
> HOSTCC scripts/dtc/libfdt/fdt_overlay.o
> HOSTCC scripts/dtc/fdtoverlay.o
> WRAP arch/hexagon/include/generated/asm/extable.h
> WRAP arch/hexagon/include/generated/asm/iomap.h
> WRAP arch/hexagon/include/generated/asm/kvm_para.h
> WRAP arch/hexagon/include/generated/asm/mcs_spinlock.h
> WRAP arch/hexagon/include/generated/asm/text-patching.h
> WRAP arch/hexagon/include/generated/asm/archrandom.h
> WRAP arch/hexagon/include/generated/asm/barrier.h
> WRAP arch/hexagon/include/generated/asm/bug.h
> WRAP arch/hexagon/include/generated/asm/cfi.h
> WRAP arch/hexagon/include/generated/asm/compat.h
> WRAP arch/hexagon/include/generated/asm/current.h
> WRAP arch/hexagon/include/generated/asm/device.h
> WRAP arch/hexagon/include/generated/asm/div64.h
> WRAP arch/hexagon/include/generated/asm/dma-mapping.h
> WRAP arch/hexagon/include/generated/asm/emergency-restart.h
> WRAP arch/hexagon/include/generated/asm/ftrace.h
> WRAP arch/hexagon/include/generated/asm/hardirq.h
> WRAP arch/hexagon/include/generated/asm/hw_irq.h
> WRAP arch/hexagon/include/generated/asm/irq_regs.h
> WRAP arch/hexagon/include/generated/asm/irq_work.h
> WRAP arch/hexagon/include/generated/asm/kdebug.h
> WRAP arch/hexagon/include/generated/asm/kmap_size.h
> WRAP arch/hexagon/include/generated/asm/kprobes.h
> WRAP arch/hexagon/include/generated/asm/local.h
> WRAP arch/hexagon/include/generated/asm/local64.h
> WRAP arch/hexagon/include/generated/asm/mmiowb.h
> WRAP arch/hexagon/include/generated/asm/module.h
> WRAP arch/hexagon/include/generated/asm/module.lds.h
> WRAP arch/hexagon/include/generated/asm/msi.h
> WRAP arch/hexagon/include/generated/asm/pci.h
> WRAP arch/hexagon/include/generated/asm/percpu.h
> WRAP arch/hexagon/include/generated/asm/preempt.h
> WRAP arch/hexagon/include/generated/asm/rqspinlock.h
> WRAP arch/hexagon/include/generated/asm/runtime-const.h
> WRAP arch/hexagon/include/generated/asm/rwonce.h
> WRAP arch/hexagon/include/generated/asm/sections.h
> WRAP arch/hexagon/include/generated/asm/serial.h
> WRAP arch/hexagon/include/generated/asm/shmparam.h
> WRAP arch/hexagon/include/generated/asm/simd.h
> WRAP arch/hexagon/include/generated/asm/softirq_stack.h
> WRAP arch/hexagon/include/generated/asm/topology.h
> WRAP arch/hexagon/include/generated/asm/trace_clock.h
> WRAP arch/hexagon/include/generated/asm/vga.h
> WRAP arch/hexagon/include/generated/asm/video.h
> WRAP arch/hexagon/include/generated/asm/word-at-a-time.h
> WRAP arch/hexagon/include/generated/asm/xor.h
> SYSTBL arch/hexagon/include/generated/asm/syscall_table_32.h
> HOSTCC scripts/dtc/dtc-lexer.lex.o
> HOSTCC scripts/dtc/dtc-parser.tab.o
> HOSTLD scripts/dtc/fdtoverlay
> HOSTLD scripts/dtc/dtc
> HOSTCC scripts/kallsyms
> HOSTCC scripts/asn1_compiler
> HOSTCC scripts/insert-sys-cert
> CC scripts/mod/empty.o
> HOSTCC scripts/mod/mk_elfconfig
> CC scripts/mod/devicetable-offsets.s
> UPD scripts/mod/devicetable-offsets.h
> MKELF scripts/mod/elfconfig.h
> HOSTCC scripts/mod/modpost.o
> HOSTCC scripts/mod/file2alias.o
> HOSTCC scripts/mod/sumversion.o
> HOSTCC scripts/mod/symsearch.o
> HOSTLD scripts/mod/modpost
> CC kernel/bounds.s
> CHKSHA1 ../include/linux/atomic/atomic-arch-fallback.h
> CHKSHA1 ../include/linux/atomic/atomic-instrumented.h
> CHKSHA1 ../include/linux/atomic/atomic-long.h
> UPD include/generated/timeconst.h
> UPD include/generated/bounds.h
> CC arch/hexagon/kernel/asm-offsets.s
> UPD include/generated/asm-offsets.h
> CALL ../scripts/checksyscalls.sh
> CC drivers/hid/hid-core.o
> CC drivers/hid/hid-input.o
> CC drivers/hid/hid-quirks.o
> CC drivers/hid/hid-debug.o
> CC drivers/hid/hid-haptic.o
> CC [M] drivers/hid/usbhid/hid-core.o
> CC drivers/hid/hidraw.o
> CC [M] drivers/hid/usbhid/hiddev.o
> CC [M] drivers/hid/usbhid/hid-pidff.o
> CC drivers/hid/hid-a4tech.o
> CC drivers/hid/hid-alps.o
> CC drivers/hid/hid-apple.o
> CC drivers/hid/hid-belkin.o
> CC drivers/hid/hid-cherry.o
> CC drivers/hid/hid-cmedia.o
> CC drivers/hid/hid-cougar.o
> CC drivers/hid/hid-ezkey.o
> CC drivers/hid/hid-icade.o
> CC drivers/hid/hid-ite.o
> CC drivers/hid/hid-jabra.o
> CC drivers/hid/hid-kensington.o
> CC drivers/hid/hid-ortek.o
> CC drivers/hid/hid-razer.o
> CC drivers/hid/hid-rmi.o
> CC drivers/hid/hid-saitek.o
> CC drivers/hid/hid-sjoy.o
> CC drivers/hid/hid-tivo.o
> CC drivers/hid/hid-udraw-ps3.o
> CC drivers/hid/hid-led.o
> CC drivers/hid/hid-wiimote-core.o
> CC drivers/hid/hid-wiimote-modules.o
> CC drivers/hid/hid-wiimote-debug.o
> CC [M] drivers/hid/uhid.o
> CC [M] drivers/hid/hid-generic.o
> CC [M] drivers/hid/hid-axff.o
> CC [M] drivers/hid/hid-appleir.o
> CC [M] drivers/hid/hid-asus.o
> CC [M] drivers/hid/hid-aureal.o
> CC [M] drivers/hid/hid-betopff.o
> CC [M] drivers/hid/hid-bigbenff.o
> CC [M] drivers/hid/hid-chicony.o
> CC [M] drivers/hid/hid-corsair.o
> CC [M] drivers/hid/hid-corsair-void.o
> CC [M] drivers/hid/hid-cp2112.o
> CC [M] drivers/hid/hid-cypress.o
> CC [M] drivers/hid/hid-emsff.o
> CC [M] drivers/hid/hid-elan.o
> CC [M] drivers/hid/hid-elo.o
> CC [M] drivers/hid/hid-gembird.o
> CC [M] drivers/hid/hid-gfrm.o
> CC [M] drivers/hid/hid-vivaldi-common.o
> CC [M] drivers/hid/hid-google-stadiaff.o
> CC [M] drivers/hid/hid-vivaldi.o
> CC [M] drivers/hid/hid-gt683r.o
> CC [M] drivers/hid/hid-gyration.o
> CC [M] drivers/hid/hid-holtek-kbd.o
> CC [M] drivers/hid/hid-holtek-mouse.o
> CC [M] drivers/hid/hid-holtekff.o
> CC [M] drivers/hid/hid-kye.o
> CC [M] drivers/hid/hid-kysona.o
> CC [M] drivers/hid/hid-letsketch.o
> CC [M] drivers/hid/hid-macally.o
> CC [M] drivers/hid/hid-magicmouse.o
> CC [M] drivers/hid/hid-mcp2221.o
> CC [M] drivers/hid/hid-megaworld.o
> CC [M] drivers/hid/hid-microsoft.o
> CC [M] drivers/hid/hid-nintendo.o
> CC [M] drivers/hid/hid-nti.o
> CC [M] drivers/hid/hid-pl.o
> CC [M] drivers/hid/hid-penmount.o
> CC [M] drivers/hid/hid-picolcd_core.o
> CC [M] drivers/hid/hid-picolcd_fb.o
> CC [M] drivers/hid/hid-picolcd_backlight.o
> CC [M] drivers/hid/hid-picolcd_leds.o
> CC [M] drivers/hid/hid-picolcd_cir.o
> CC [M] drivers/hid/hid-picolcd_debugfs.o
> ../drivers/hid/hid-haptic.c:13:6: error: redefinition of 'hid_haptic_feature_mapping'
> 13 | void hid_haptic_feature_mapping(struct hid_device *hdev,
> | ^
> ../drivers/hid/hid-haptic.h:83:6: note: previous definition is here
> 83 | void hid_haptic_feature_mapping(struct hid_device *hdev,
> | ^
> ../drivers/hid/hid-haptic.c:51:6: error: redefinition of 'hid_haptic_check_pressure_unit'
> 51 | bool hid_haptic_check_pressure_unit(struct hid_haptic_device *haptic,
> | ^
> ../drivers/hid/hid-haptic.h:89:6: note: previous definition is here
> 89 | bool hid_haptic_check_pressure_unit(struct hid_haptic_device *haptic,
> | ^
> ../drivers/hid/hid-haptic.c:65:5: error: redefinition of 'hid_haptic_input_mapping'
> 65 | int hid_haptic_input_mapping(struct hid_device *hdev,
> | ^
> ../drivers/hid/hid-haptic.h:95:5: note: previous definition is here
> 95 | int hid_haptic_input_mapping(struct hid_device *hdev,
> | ^
> ../drivers/hid/hid-haptic.c:81:5: error: redefinition of 'hid_haptic_input_configured'
> 81 | int hid_haptic_input_configured(struct hid_device *hdev,
> | ^
> ../drivers/hid/hid-haptic.h:104:5: note: previous definition is here
> 104 | int hid_haptic_input_configured(struct hid_device *hdev,
> | ^
> ../drivers/hid/hid-haptic.c:403:5: error: redefinition of 'hid_haptic_init'
> 403 | int hid_haptic_init(struct hid_device *hdev,
> | ^
> ../drivers/hid/hid-haptic.h:114:5: note: previous definition is here
> 114 | int hid_haptic_init(struct CC [M] drivers/hid/hid-redragon.o
> hid_device *hdev, struct hid_haptic_device **haptic_ptr)
> | ^
> ../drivers/hid/hid-haptic.c:569:6: error: redefinition of 'hid_haptic_pressure_reset'
> 569 | void hid_haptic_pressure_reset(struct hid_haptic_device *haptic)
> | ^
> ../drivers/hid/hid-haptic.h:126:6: note: previous definition is here
> 126 | void hid_haptic_pressure_reset(struct hid_haptic_device *haptic) {}
> | ^
> ../drivers/hid/hid-haptic.c:575:6: error: redefinition of 'hid_haptic_pressure_increase'
> 575 | void hid_haptic_pressure_increase(struct hid_haptic_device *haptic,
> | ^
> ../drivers/hid/hid-haptic.h:128:6: note: previous definition is here
> 128 | void hid_haptic_pressure_increase(struct hid_haptic_device *haptic,
> | CC [M] drivers/hid/hid-retrode.o
> ^
> 7 errors generated.
> make[5]: *** [../scripts/Makefile.build:287: drivers/hid/hid-haptic.o] Error 1
> CC [M] drivers/hid/hid-roccat.o
> CC [M] drivers/hid/hid-roccat-common.o
> CC [M] drivers/hid/hid-roccat-arvo.o
> CC [M] drivers/hid/hid-roccat-isku.o
> CC [M] drivers/hid/hid-roccat-kone.o
> CC [M] drivers/hid/hid-roccat-koneplus.o
> CC [M] drivers/hid/hid-roccat-konepure.o
> CC [M] drivers/hid/hid-roccat-kovaplus.o
> CC [M] drivers/hid/hid-roccat-lua.o
> CC [M] drivers/hid/hid-roccat-pyra.o
> CC [M] drivers/hid/hid-roccat-ryos.o
> CC [M] drivers/hid/hid-roccat-savu.o
> CC [M] drivers/hid/hid-samsung.o
> CC [M] drivers/hid/hid-sony.o
> CC [M] drivers/hid/hid-steam.o
> CC [M] drivers/hid/hid-sunplus.o
> CC [M] drivers/hid/hid-gaff.o
> CC [M] drivers/hid/hid-tmff.o
> CC [M] drivers/hid/hid-thrustmaster.o
> CC [M] drivers/hid/hid-uclogic-core.o
> CC [M] drivers/hid/hid-uclogic-rdesc.o
> CC [M] drivers/hid/hid-uclogic-params.o
> CC [M] drivers/hid/hid-xinmo.o
> CC [M] drivers/hid/hid-zpff.o
> CC [M] drivers/hid/hid-vrc2.o
> CC [M] drivers/hid/wacom_sys.o
> CC [M] drivers/hid/wacom_wac.o
> CC [M] drivers/hid/hid-waltop.o
> CC [M] drivers/hid/hid-winwing.o
> CC [M] drivers/hid/hid-uclogic-rdesc-test.o
> LD [M] drivers/hid/usbhid/usbhid.o
> LD [M] drivers/hid/hid-uclogic-test.o
> LD [M] drivers/hid/hid-picolcd.o
> LD [M] drivers/hid/hid-uclogic.o
> LD [M] drivers/hid/wacom.o
> make[5]: Target 'drivers/hid/' not remade because of errors.
> make[4]: *** [../scripts/Makefile.build:554: drivers/hid] Error 2
> make[4]: Target 'drivers/hid/' not remade because of errors.
> make[3]: *** [../scripts/Makefile.build:554: drivers] Error 2
> make[3]: Target 'drivers/hid/' not remade because of errors.
> make[2]: *** [/home/xsang/linux/Makefile:2003: .] Error 2
> make[2]: Target 'drivers/hid/' not remade because of errors.
> make[1]: *** [/home/xsang/linux/Makefile:248: __sub-make] Error 2
> make[1]: Target 'drivers/hid/' not remade because of errors.
> make[1]: Leaving directory '/home/xsang/linux/build_dir'
> make: *** [Makefile:248: __sub-make] Error 2
> make: Target 'drivers/hid/' not remade because of errors.
>
>
>
> > --
> > Jonathan
> >
Hi Oliver,
I think I didn't have the right config so the issue wasn't reproducing
but I'm seeing it now so I'll fix and resubmit.
Thanks!
--
Jonathan
^ permalink raw reply
* Re: [PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
From: kernel test robot @ 2025-08-02 1:02 UTC (permalink / raw)
To: Julien Massot, kernel, Dmitry Torokhov, Matthias Brugger,
AngeloGioacchino Del Regno, Rob Herring, Krzysztof Kozlowski,
Conor Dooley
Cc: oe-kbuild-all, linux-input, linux-kernel, linux-arm-kernel,
linux-mediatek, devicetree, Julien Massot
In-Reply-To: <20250801-radxa-nio-12-l-gpio-v1-1-d0840f85d2c8@collabora.com>
Hi Julien,
kernel test robot noticed the following build errors:
[auto build test ERROR on b9ddaa95fd283bce7041550ddbbe7e764c477110]
url: https://github.com/intel-lab-lkp/linux/commits/Julien-Massot/Input-mtk-pmic-keys-MT6359-has-a-specific-release-irq/20250801-211817
base: b9ddaa95fd283bce7041550ddbbe7e764c477110
patch link: https://lore.kernel.org/r/20250801-radxa-nio-12-l-gpio-v1-1-d0840f85d2c8%40collabora.com
patch subject: [PATCH 1/3] Input: mtk-pmic-keys - MT6359 has a specific release irq
config: arc-randconfig-002-20250802 (https://download.01.org/0day-ci/archive/20250802/202508020802.nZBo2mGV-lkp@intel.com/config)
compiler: arc-linux-gcc (GCC) 14.3.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20250802/202508020802.nZBo2mGV-lkp@intel.com/reproduce)
If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202508020802.nZBo2mGV-lkp@intel.com/
All error/warnings (new ones prefixed by >>):
>> drivers/input/keyboard/mtk-pmic-keys.c:132:10: error: 'const struct mtk_pmic_regs' has no member named 'key_release_irq'
132 | .key_release_irq = true,
| ^~~~~~~~~~~~~~~
>> drivers/input/keyboard/mtk-pmic-keys.c:132:28: warning: excess elements in struct initializer
132 | .key_release_irq = true,
| ^~~~
drivers/input/keyboard/mtk-pmic-keys.c:132:28: note: (near initialization for 'mt6359_regs')
vim +132 drivers/input/keyboard/mtk-pmic-keys.c
120
121 static const struct mtk_pmic_regs mt6359_regs = {
122 .keys_regs[MTK_PMIC_PWRKEY_INDEX] =
123 MTK_PMIC_KEYS_REGS(MT6359_TOPSTATUS,
124 0x2, MT6359_PSC_TOP_INT_CON0, 0x5,
125 MTK_PMIC_PWRKEY_RST),
126 .keys_regs[MTK_PMIC_HOMEKEY_INDEX] =
127 MTK_PMIC_KEYS_REGS(MT6359_TOPSTATUS,
128 0x8, MT6359_PSC_TOP_INT_CON0, 0xa,
129 MTK_PMIC_HOMEKEY_RST),
130 .pmic_rst_reg = MT6359_TOP_RST_MISC,
131 .rst_lprst_mask = MTK_PMIC_RST_DU_MASK,
> 132 .key_release_irq = true,
133 };
134
--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki
^ permalink raw reply
* [PATCH] HID: elecom: add support for ELECOM M-DT2DRBK
From: Martin Hilgendorf @ 2025-08-02 13:45 UTC (permalink / raw)
To: Jiri Kosina
Cc: Martin Hilgendorf, Benjamin Tissoires, linux-input, linux-kernel
The DT2DRBK trackball has 8 buttons, but the report descriptor only
specifies 5. This patch adds the device ID and performs a similar fixup as
for other ELECOM devices to enable the remaining 3 buttons.
Signed-off-by: Martin Hilgendorf <martin.hilgendorf@posteo.de>
---
drivers/hid/hid-elecom.c | 2 ++
drivers/hid/hid-ids.h | 1 +
drivers/hid/hid-quirks.c | 1 +
3 files changed, 4 insertions(+)
diff --git a/drivers/hid/hid-elecom.c b/drivers/hid/hid-elecom.c
index 0ad7d25d9864..69771fd35006 100644
--- a/drivers/hid/hid-elecom.c
+++ b/drivers/hid/hid-elecom.c
@@ -101,6 +101,7 @@ static const __u8 *elecom_report_fixup(struct hid_device *hdev, __u8 *rdesc,
*/
mouse_button_fixup(hdev, rdesc, *rsize, 12, 30, 14, 20, 8);
break;
+ case USB_DEVICE_ID_ELECOM_M_DT2DRBK:
case USB_DEVICE_ID_ELECOM_M_HT1DRBK_011C:
/*
* Report descriptor format:
@@ -123,6 +124,7 @@ static const struct hid_device_id elecom_devices[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT2DRBK) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK_010C) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK_019B) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D) },
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 5a1096283855..6dc797de3117 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -451,6 +451,7 @@
#define USB_DEVICE_ID_ELECOM_M_XT4DRBK 0x00fd
#define USB_DEVICE_ID_ELECOM_M_DT1URBK 0x00fe
#define USB_DEVICE_ID_ELECOM_M_DT1DRBK 0x00ff
+#define USB_DEVICE_ID_ELECOM_M_DT2DRBK 0x018d
#define USB_DEVICE_ID_ELECOM_M_HT1URBK_010C 0x010c
#define USB_DEVICE_ID_ELECOM_M_HT1URBK_019B 0x019b
#define USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D 0x010d
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index ff11f1ad344d..5c15af9afa98 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -411,6 +411,7 @@ static const struct hid_device_id hid_have_special_driver[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_XT4DRBK) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1URBK) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT1DRBK) },
+ { HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_DT2DRBK) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK_010C) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1URBK_019B) },
{ HID_USB_DEVICE(USB_VENDOR_ID_ELECOM, USB_DEVICE_ID_ELECOM_M_HT1DRBK_010D) },
--
2.50.1
^ permalink raw reply related
* Re: 转发: commit?a608dc1c06397dc50ab773498433432fb5938f92 (patch) has a bug
From: José Expósito @ 2025-08-02 16:30 UTC (permalink / raw)
To: 卢国宏
Cc: jikos@kernel.org, bentiss@kernel.org, linux-input@vger.kernel.org,
torvalds@linux-foundation.org, linus@linuxfoundation.org,
jkosina@suse.cz
In-Reply-To: <b3cf760898054fb1adb4285e84f4a702@xiaomi.com>
Hi 卢国宏,
Thanks a lot for reporting this issue.
On Sat, Aug 02, 2025 at 12:23:54PM +0000, 卢国宏 wrote:
> Hello, José and Jiri!
> I've discovered that the patch you submitted to the Linux community,
> "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?h=linux-6.3.y&id=a608dc1c06397dc50ab773498433432fb5938f92"
> contains a bug. Even with your patch, the charging status of HID
> devices is still not reported to upper layers in a timely manner.
> The reasons are as follows:
>
> [...]
>
> if function hidinput_set_battery_charge_status() return true, That is,
> the charging status of the HID device has changed,This charging status
> will not be reported,Because, only when handled is false,
> "hid input update battery(hid, value);" will be called.
I wrote this patch a while ago and I can't remember the exact reason
why hidinput_update_battery() is only called by hidinput_hid_event()
when hidinput_set_battery_charge_status() returns false.
The devices I have change their status, for example, discharging to
charging, when they are connected via Bluetooth and I switch them to
USB. This reconnection reports the status to user-space, so there is
no need for additional synchronization.
Does your device work in the same manner?
However, before we try to fix the problem, it would be nice if you
could provide a reproducer.
What device is affected by this bug?
By using "sudo hid-recorder" and selecting your device, you will be
able to capture and replay (with "hid-replay") the HID events sent
by your device.
Could you share a recording of your device changing from the charging
to discharging status and back to charging so we can reproduce the
issue, please?
If the recording is too long, please upload it to a server.
> Therefore, the function "hidinput set battery charge status" can be
> changed to the following:
>
> static bool hidinput_set_battery_charge_status(struct hid_device *dev,
> + unsigned int usage, int value)
> +{
> + switch (usage) {
> + case HID_BAT_CHARGING:
> + dev->battery_charge_status = value ?
> + POWER_SUPPLY_STATUS_CHARGING :
> + POWER_SUPPLY_STATUS_DISCHARGING;
> + power_supply_changed(dev->battery);
> + return true;
> + }
> +
> + return false;
> +}
Could you test if this patch also solves your problem, please?
diff --git a/drivers/hid/hid-input.c b/drivers/hid/hid-input.c
index 9d80635a91eb..bce580beb5c6 100644
--- a/drivers/hid/hid-input.c
+++ b/drivers/hid/hid-input.c
@@ -1515,11 +1515,8 @@ void hidinput_hid_event(struct hid_device *hid, struct hid_field *field, struct
return;
if (usage->type == EV_PWR) {
- bool handled = hidinput_set_battery_charge_status(hid, usage->hid, value);
-
- if (!handled)
- hidinput_update_battery(hid, value);
-
+ hidinput_set_battery_charge_status(hid, usage->hid, value);
+ hidinput_update_battery(hid, value);
return;
}
Thanks a lot in advance,
José Expósito
> Because we have encountered this problem in our project, and this
> method can solve it.
> I hope you can solve this problem as soon as possible, otherwise,
> we will encounter this problem again in our future projects.
>
> Thank you so much!
^ permalink raw reply related
* [PATCH 1/2] Input: Add key event code for Fn + P
From: edip @ 2025-08-02 21:21 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: jikos, bentiss, linux-input, linux-kernel, Edip Hazuri
From: Edip Hazuri <edip@medip.dev>
Newer Victus (and probably newer omen) laptops contains a "Fn + P"
Shortcut. This is intended to use with Omen Gaming Hub, Which is
changing the performance profile when this shortcut triggered. This
shortcut is shown on performance control page, see [1]
Currently there is no key definition to handle this. So add a KEY_FN_P
keycode define to be able to use this shortcut.
[1]: https://jpcdn.it/img/adadf6c927ffeb75afd8038f95db400a.png
Signed-off-by: Edip Hazuri <edip@medip.dev>
---
drivers/hid/hid-debug.c | 2 +-
include/uapi/linux/input-event-codes.h | 1 +
2 files changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/hid/hid-debug.c b/drivers/hid/hid-debug.c
index 4424c0512ba..2bcf7b24801 100644
--- a/drivers/hid/hid-debug.c
+++ b/drivers/hid/hid-debug.c
@@ -3342,7 +3342,7 @@ static const char *keys[KEY_MAX + 1] = {
[KEY_FN_1] = "Fn+1", [KEY_FN_2] = "Fn+2",
[KEY_FN_B] = "Fn+B", [KEY_FN_D] = "Fn+D",
[KEY_FN_E] = "Fn+E", [KEY_FN_F] = "Fn+F",
- [KEY_FN_S] = "Fn+S",
+ [KEY_FN_S] = "Fn+S", [KEY_FN_P] = "Fn+P",
[KEY_FN_F1] = "Fn+F1", [KEY_FN_F2] = "Fn+F2",
[KEY_FN_F3] = "Fn+F3", [KEY_FN_F4] = "Fn+F4",
[KEY_FN_F5] = "Fn+F5", [KEY_FN_F6] = "Fn+F6",
diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
index 3b2524e4b66..2fc79b32425 100644
--- a/include/uapi/linux/input-event-codes.h
+++ b/include/uapi/linux/input-event-codes.h
@@ -548,6 +548,7 @@
#define KEY_FN_S 0x1e3
#define KEY_FN_B 0x1e4
#define KEY_FN_RIGHT_SHIFT 0x1e5
+#define KEY_FN_P 0x1e6
#define KEY_BRL_DOT1 0x1f1
#define KEY_BRL_DOT2 0x1f2
--
2.50.1
^ permalink raw reply related
* [PATCH 1/2] HID: intel-thc-hid: intel-quicki2c: Fix ACPI dsd ICRS/ISUB length
From: Aaron Ma @ 2025-08-03 6:57 UTC (permalink / raw)
To: even.xu, xinpeng.sun, jikos, bentiss, linux-input, linux-kernel,
aaron.ma
The QuickI2C ACPI _DSD methods return ICRS and ISUB data with a
trailing byte, making the actual length is one more byte than the
structs defined.
It caused stack-out-of-bounds and kernel crash:
kernel: BUG: KASAN: stack-out-of-bounds in quicki2c_acpi_get_dsd_property.constprop.0+0x111/0x1b0 [intel_quicki2c]
kernel: Write of size 12 at addr ffff888106d1f900 by task kworker/u33:2/75
kernel:
kernel: CPU: 3 UID: 0 PID: 75 Comm: kworker/u33:2 Not tainted 6.16.0+ #3 PREEMPT(voluntary)
kernel: Workqueue: async async_run_entry_fn
kernel: Call Trace:
kernel: <TASK>
kernel: dump_stack_lvl+0x76/0xa0
kernel: print_report+0xd1/0x660
kernel: ? __pfx__raw_spin_lock_irqsave+0x10/0x10
kernel: ? __kasan_slab_free+0x5d/0x80
kernel: ? kasan_addr_to_slab+0xd/0xb0
kernel: kasan_report+0xe1/0x120
kernel: ? quicki2c_acpi_get_dsd_property.constprop.0+0x111/0x1b0 [intel_quicki2c]
kernel: ? quicki2c_acpi_get_dsd_property.constprop.0+0x111/0x1b0 [intel_quicki2c]
kernel: kasan_check_range+0x11c/0x200
kernel: __asan_memcpy+0x3b/0x80
kernel: quicki2c_acpi_get_dsd_property.constprop.0+0x111/0x1b0 [intel_quicki2c]
kernel: ? __pfx_quicki2c_acpi_get_dsd_property.constprop.0+0x10/0x10 [intel_quicki2c]
kernel: quicki2c_get_acpi_resources+0x237/0x730 [intel_quicki2c]
[...]
kernel: </TASK>
kernel:
kernel: The buggy address belongs to stack of task kworker/u33:2/75
kernel: and is located at offset 48 in frame:
kernel: quicki2c_get_acpi_resources+0x0/0x730 [intel_quicki2c]
kernel:
kernel: This frame has 3 objects:
kernel: [32, 36) 'hid_desc_addr'
kernel: [48, 59) 'i2c_param'
kernel: [80, 224) 'i2c_config'
ACPI DSD methods return:
\_SB.PC00.THC0.ICRS Buffer 000000003fdc947b 001 Len 0C = 0A 00 80 1A 06 00 00 00 00 00 00 00
\_SB.PC00.THC0.ISUB Buffer 00000000f2fcbdc4 001 Len 91 = 00 00 00 00 00 00 00 00 00 00 00 00
Adding reserved padding to quicki2c_subip_acpi_parameter/config.
Fixes: 5282e45ccbfa9 ("HID: intel-thc-hid: intel-quicki2c: Add THC QuickI2C ACPI interfaces")
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-dev.h | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-dev.h b/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-dev.h
index 6ddb584bd6110..97085a6a7452d 100644
--- a/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-dev.h
+++ b/drivers/hid/intel-thc-hid/intel-quicki2c/quicki2c-dev.h
@@ -71,6 +71,7 @@ struct quicki2c_subip_acpi_parameter {
u16 device_address;
u64 connection_speed;
u8 addressing_mode;
+ u8 reserved;
} __packed;
/**
@@ -120,6 +121,7 @@ struct quicki2c_subip_acpi_config {
u64 HMTD;
u64 HMRD;
u64 HMSL;
+ u8 reserved;
};
struct device;
--
2.43.0
^ permalink raw reply related
* [PATCH 2/2] HID: intel-thc-hid: intel-thc: Fix incorrect pointer arithmetic in I2C regs save
From: Aaron Ma @ 2025-08-03 6:57 UTC (permalink / raw)
To: even.xu, xinpeng.sun, jikos, bentiss, linux-input, linux-kernel,
aaron.ma
In-Reply-To: <20250803065726.2895470-1-aaron.ma@canonical.com>
Improper use of secondary pointer (&dev->i2c_subip_regs) caused
kernel crash and out-of-bounds error:
BUG: KASAN: slab-out-of-bounds in _regmap_bulk_read+0x449/0x510
Write of size 4 at addr ffff888136005dc0 by task kworker/u33:5/5107
CPU: 3 UID: 0 PID: 5107 Comm: kworker/u33:5 Not tainted 6.16.0+ #3 PREEMPT(voluntary)
Workqueue: async async_run_entry_fn
Call Trace:
<TASK>
dump_stack_lvl+0x76/0xa0
print_report+0xd1/0x660
? __pfx__raw_spin_lock_irqsave+0x10/0x10
? kasan_complete_mode_report_info+0x26/0x200
kasan_report+0xe1/0x120
? _regmap_bulk_read+0x449/0x510
? _regmap_bulk_read+0x449/0x510
__asan_report_store4_noabort+0x17/0x30
_regmap_bulk_read+0x449/0x510
? __pfx__regmap_bulk_read+0x10/0x10
regmap_bulk_read+0x270/0x3d0
pio_complete+0x1ee/0x2c0 [intel_thc]
? __pfx_pio_complete+0x10/0x10 [intel_thc]
? __pfx_pio_wait+0x10/0x10 [intel_thc]
? regmap_update_bits_base+0x13b/0x1f0
thc_i2c_subip_pio_read+0x117/0x270 [intel_thc]
thc_i2c_subip_regs_save+0xc2/0x140 [intel_thc]
? __pfx_thc_i2c_subip_regs_save+0x10/0x10 [intel_thc]
[...]
The buggy address belongs to the object at ffff888136005d00
which belongs to the cache kmalloc-rnd-12-192 of size 192
The buggy address is located 0 bytes to the right of
allocated 192-byte region [ffff888136005d00, ffff888136005dc0)
Replaced with direct array indexing (&dev->i2c_subip_regs[i]) to ensure
safe memory access.
Fixes: 4228966def884 ("HID: intel-thc-hid: intel-thc: Add THC I2C config interfaces")
Signed-off-by: Aaron Ma <aaron.ma@canonical.com>
---
drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
index c105df7f6c873..4698722e0d0a6 100644
--- a/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
+++ b/drivers/hid/intel-thc-hid/intel-thc/intel-thc-dev.c
@@ -1539,7 +1539,7 @@ int thc_i2c_subip_regs_save(struct thc_device *dev)
for (int i = 0; i < ARRAY_SIZE(i2c_subip_regs); i++) {
ret = thc_i2c_subip_pio_read(dev, i2c_subip_regs[i],
- &read_size, (u32 *)&dev->i2c_subip_regs + i);
+ &read_size, &dev->i2c_subip_regs[i]);
if (ret < 0)
return ret;
}
@@ -1562,7 +1562,7 @@ int thc_i2c_subip_regs_restore(struct thc_device *dev)
for (int i = 0; i < ARRAY_SIZE(i2c_subip_regs); i++) {
ret = thc_i2c_subip_pio_write(dev, i2c_subip_regs[i],
- write_size, (u32 *)&dev->i2c_subip_regs + i);
+ write_size, &dev->i2c_subip_regs[i]);
if (ret < 0)
return ret;
}
--
2.43.0
^ permalink raw reply related
* Re: [PATCH] Add keycode for performance mode keys
From: Marcos Alano @ 2025-08-03 12:22 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input
In-Reply-To: <20250509193708.2190586-1-marcoshalano@gmail.com>
@Dmitry,
Could you check this patch, please?
Thanks,
On 09/05/2025 16:37, Marcos Alano wrote:
> Alienware calls this key "Performance Boost". Dell calls it "G-Mode".
>
> The goal is to have a specific keycode to detect when this key is
> pressed, so userspace can act upon it and do what have to do, usually
> starting the power profile for performance.
>
> Signed-off-by: Marcos Alano <marcoshalano@gmail.com>
> ---
> include/uapi/linux/input-event-codes.h | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/include/uapi/linux/input-event-codes.h b/include/uapi/linux/input-event-codes.h
> index 5a199f3d4a26..f410394cd769 100644
> --- a/include/uapi/linux/input-event-codes.h
> +++ b/include/uapi/linux/input-event-codes.h
> @@ -765,6 +765,11 @@
> #define KEY_KBD_LCD_MENU4 0x2bb
> #define KEY_KBD_LCD_MENU5 0x2bc
>
> +/* Performance Boost key (Alienware)
> + * G-Mode key (Dell)
> + */
> +#define KEY_PERFORMANCE 0x2bd
> +
> #define BTN_TRIGGER_HAPPY 0x2c0
> #define BTN_TRIGGER_HAPPY1 0x2c0
> #define BTN_TRIGGER_HAPPY2 0x2c1
--
Marcos Alano
^ permalink raw reply
* [PATCH v1] HID: mf: add support for Legion Go dual dinput modes
From: Antheas Kapenekakis @ 2025-08-03 16:02 UTC (permalink / raw)
To: linux-input
Cc: linux-kernel, Jiri Kosina, Benjamin Tissoires,
Antheas Kapenekakis
The Legion Go features detachable controllers which support a dual
dinput mode. In this mode, the controllers appear under a single HID
device with two applications.
Currently, both controllers appear under the same event device, causing
their controls to be mixed up. This patch separates the two so that
they can be used independently.
In addition, the latest firmware update for the Legion Go swaps the IDs
to the ones used by the Legion Go 2, so add those IDs as well.
Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
---
drivers/hid/hid-ids.h | 2 ++
drivers/hid/hid-quirks.c | 2 ++
2 files changed, 4 insertions(+)
diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 5a1096283855..f849b1c2efb9 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -834,6 +834,8 @@
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019 0x6019
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_602E 0x602e
#define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6093 0x6093
+#define USB_DEVICE_ID_LENOVO_LEGION_GO_DUAL_DINPUT 0x6184
+#define USB_DEVICE_ID_LENOVO_LEGION_GO2_DUAL_DINPUT 0x61ed
#define USB_VENDOR_ID_LETSKETCH 0x6161
#define USB_DEVICE_ID_WP9620N 0x4d15
diff --git a/drivers/hid/hid-quirks.c b/drivers/hid/hid-quirks.c
index ff11f1ad344d..88c89fe91689 100644
--- a/drivers/hid/hid-quirks.c
+++ b/drivers/hid/hid-quirks.c
@@ -124,6 +124,8 @@ static const struct hid_device_id hid_quirks[] = {
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_MOUSEPEN_I608X_V2), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_KYE, USB_DEVICE_ID_KYE_PENSKETCH_T609A), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_LABTEC, USB_DEVICE_ID_LABTEC_ODDOR_HANDBRAKE), HID_QUIRK_ALWAYS_POLL },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_LEGION_GO_DUAL_DINPUT), HID_QUIRK_MULTI_INPUT },
+ { HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_LEGION_GO2_DUAL_DINPUT), HID_QUIRK_MULTI_INPUT },
{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_OPTICAL_USB_MOUSE_600E), HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D), HID_QUIRK_ALWAYS_POLL },
{ HID_USB_DEVICE(USB_VENDOR_ID_LENOVO, USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019), HID_QUIRK_ALWAYS_POLL },
base-commit: 186f3edfdd41f2ae87fc40a9ccba52a3bf930994
--
2.50.1
^ permalink raw reply related
* [PATCH 00/17] Further hid-pidff improvements and fixes
From: Tomasz Pakuła @ 2025-08-03 18:13 UTC (permalink / raw)
To: jikos, bentiss; +Cc: oleg, linux-input
Another batch of improvements/fixes/updates to the hid-pidff driver. A lot of
code quality improvements with probably more to come as we better understand the
driver and strive to simplify it's inner workings. I think we're currently past
75% of touchups + Oleg is working on some compatibility changes for Simagic
support in a "pass-through" mode.
Direction fix only for conditional effects fixes FFB in Forza games on Moza.
I removed Anssi's email from the "welcome message" that appears on succesful
PID init to make sure people will look for LKML to send in bug reports.
Tomasz Pakuła (17):
HID: pidff: Use direction fix only for conditional effects
HID: pidff: Remove unhelpful pidff_set_actuators helper
HID: pidff: Remove unneeded debug
HID: pidff: Use ARRAY_SIZE macro instead of sizeof
HID: pidff: Treat PID_REQUIRED_REPORTS as count, not max
HID: pidff: Better quirk assigment when searching for fields
HID: pidff: Simplify HID field/usage searching logic
HID: pidff: Add support for AXES_ENABLE field
HID: pidff: Update debug messages
HID: pidff: Rework pidff_upload_effect
HID: pidff: Separate check for infinite duration
HID: pidff: PERMISSIVE_CONTROL quirk autodetection
HID: pidff: Remove Anssi's email address from info msg
HID: pidff: Define all cardinal directions
HID: pidff: clang-format pass
HID: universal-pidff: clang-format pass
HID: pidff: Reduce PID_EFFECT_OPERATION spam
drivers/hid/hid-universal-pidff.c | 57 +--
drivers/hid/usbhid/hid-pidff.c | 711 +++++++++++++++++-------------
drivers/hid/usbhid/hid-pidff.h | 2 +-
3 files changed, 439 insertions(+), 331 deletions(-)
--
2.50.1
^ permalink raw reply
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox