Linux Input/HID development
 help / color / mirror / Atom feed
* [PATCH 01/10] HID: bpf: Add support for the Inspiroy 2M
From: Benjamin Tissoires @ 2025-11-18 17:16 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: linux-kernel, linux-input, Benjamin Tissoires, Peter Hutterer,
	Benjamin Tissoires
In-Reply-To: <20251118-wip-sync-udev-hid-bpf-v1-0-0f8105c54835@kernel.org>

There are a differences in the report descriptor to the existing
Inspiroy 2S which makes having this as separate file a more efficient
approach than merging them together.

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Link: https://gitlab.freedesktop.org/libevdev/udev-hid-bpf/-/merge_requests/167
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
---
 drivers/hid/bpf/progs/Huion__Inspiroy-2-M.bpf.c | 563 ++++++++++++++++++++++++
 1 file changed, 563 insertions(+)

diff --git a/drivers/hid/bpf/progs/Huion__Inspiroy-2-M.bpf.c b/drivers/hid/bpf/progs/Huion__Inspiroy-2-M.bpf.c
new file mode 100644
index 0000000000000000000000000000000000000000..183d408d893a2adde7f12e8028449c491f4942a2
--- /dev/null
+++ b/drivers/hid/bpf/progs/Huion__Inspiroy-2-M.bpf.c
@@ -0,0 +1,563 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/* Copyright (c) 2024 Red Hat, Inc
+ */
+
+#include "vmlinux.h"
+#include "hid_bpf.h"
+#include "hid_bpf_helpers.h"
+#include "hid_report_helpers.h"
+#include <bpf/bpf_tracing.h>
+
+#define VID_HUION 0x256C
+#define PID_INSPIROY_2_M 0x0067
+
+HID_BPF_CONFIG(
+	HID_DEVICE(BUS_USB, HID_GROUP_GENERIC, VID_HUION, PID_INSPIROY_2_M),
+);
+
+/* Filled in by udev-hid-bpf */
+char UDEV_PROP_HUION_FIRMWARE_ID[64];
+
+/* The prefix of the firmware ID we expect for this device. The full firmware
+ * string has a date suffix, e.g. HUION_T21j_221221
+ */
+char EXPECTED_FIRMWARE_ID[] = "HUION_T21k_";
+
+/* How this BPF program works: the tablet has two modes, firmware mode and
+ * tablet mode. In firmware mode (out of the box) the tablet sends button events
+ * and the dial as keyboard combinations. In tablet mode it uses a vendor specific
+ * hid report to report everything instead.
+ * Depending on the mode some hid reports are never sent and the corresponding
+ * devices are mute.
+ *
+ * To switch the tablet use e.g.  https://github.com/whot/huion-switcher
+ * or one of the tools from the digimend project
+ *
+ * This BPF works for both modes. The huion-switcher tool sets the
+ * HUION_FIRMWARE_ID udev property - if that is set then we disable the firmware
+ * pad and pen reports (by making them vendor collections that are ignored).
+ * If that property is not set we fix all hidraw nodes so the tablet works in
+ * either mode though the drawback is that the device will show up twice if
+ * you bind it to all event nodes
+ *
+ * Default report descriptor for the first exposed hidraw node:
+ *
+ * # HUION Huion Tablet_H641P
+ * # Report descriptor length: 18 bytes
+ * # 0x06, 0x00, 0xff,              // Usage Page (Vendor Defined Page 0xFF00)   0
+ * # 0x09, 0x01,                    // Usage (Vendor Usage 0x01)                 3
+ * # 0xa1, 0x01,                    // Collection (Application)                  5
+ * # 0x85, 0x08,                    //   Report ID (8)                           7
+ * # 0x75, 0x58,                    //   Report Size (88)                        9
+ * # 0x95, 0x01,                    //   Report Count (1)                        11
+ * # 0x09, 0x01,                    //   Usage (Vendor Usage 0x01)               13
+ * # 0x81, 0x02,                    //   Input (Data,Var,Abs)                    15
+ * # 0xc0,                          // End Collection                            17
+ * R: 18 06 00 ff 09 01 a1 01 85 08 75 58 95 01 09 01 81 02 c0
+ *
+ * This rdesc does nothing until the tablet is switched to raw mode, see
+ * https://github.com/whot/huion-switcher
+ *
+ *
+ * Second hidraw node is the Pen. This one sends events until the tablet is
+ * switched to raw mode, then it's mute.
+ *
+ * # Report descriptor length: 93 bytes
+ * # 0x05, 0x0d,          // Usage Page (Digitizers)                   0
+ * # 0x09, 0x02,          // Usage (Pen)                               2
+ * # 0xa1, 0x01,          // Collection (Application)                  4
+ * # 0x85, 0x0a,          //   Report ID (10)                          6
+ * # 0x09, 0x20,          //   Usage (Stylus)                          8
+ * # 0xa1, 0x01,          //   Collection (Application)                10
+ * # 0x09, 0x42,          //     Usage (Tip Switch)                    12
+ * # 0x09, 0x44,          //     Usage (Barrel Switch)                 14
+ * # 0x09, 0x45,          //     Usage (Eraser)                        16
+ * # 0x09, 0x3c,          //     Usage (Invert)                        18 <-- has no Invert eraser
+ * # 0x15, 0x00,          //     Logical Minimum (0)                   20
+ * # 0x25, 0x01,          //     Logical Maximum (1)                   22
+ * # 0x75, 0x01,          //     Report Size (1)                       24
+ * # 0x95, 0x06,          //     Report Count (6)                      26
+ * # 0x81, 0x02,          //     Input (Data,Var,Abs)                  28
+ * # 0x09, 0x32,          //     Usage (In Range)                      30
+ * # 0x75, 0x01,          //     Report Size (1)                       32
+ * # 0x95, 0x01,          //     Report Count (1)                      34
+ * # 0x81, 0x02,          //     Input (Data,Var,Abs)                  36
+ * # 0x81, 0x03,          //     Input (Cnst,Var,Abs)                  38
+ * # 0x05, 0x01,          //     Usage Page (Generic Desktop)          40
+ * # 0x09, 0x30,          //     Usage (X)                             42
+ * # 0x09, 0x31,          //     Usage (Y)                             44
+ * # 0x55, 0x0d,          //     Unit Exponent (-3)                    46 <-- change to -2
+ * # 0x65, 0x33,          //     Unit (EnglishLinear: in³)             48 <-- change in³ to in
+ * # 0x26, 0xff, 0x7f,    //     Logical Maximum (32767)               50
+ * # 0x35, 0x00,          //     Physical Minimum (0)                  53
+ * # 0x46, 0x00, 0x08,    //     Physical Maximum (2048)               55 <-- invalid size
+ * # 0x75, 0x10,          //     Report Size (16)                      58
+ * # 0x95, 0x02,          //     Report Count (2)                      60
+ * # 0x81, 0x02,          //     Input (Data,Var,Abs)                  62
+ * # 0x05, 0x0d,          //     Usage Page (Digitizers)               64
+ * # 0x09, 0x30,          //     Usage (Tip Pressure)                  66
+ * # 0x26, 0xff, 0x1f,    //     Logical Maximum (8191)                68
+ * # 0x75, 0x10,          //     Report Size (16)                      71
+ * # 0x95, 0x01,          //     Report Count (1)                      73
+ * # 0x81, 0x02,          //     Input (Data,Var,Abs)                  75
+ * # 0x09, 0x3d,          //     Usage (X Tilt)                        77 <-- No tilt reported
+ * # 0x09, 0x3e,          //     Usage (Y Tilt)                        79
+ * # 0x15, 0x81,          //     Logical Minimum (-127)                81
+ * # 0x25, 0x7f,          //     Logical Maximum (127)                 83
+ * # 0x75, 0x08,          //     Report Size (8)                       85
+ * # 0x95, 0x02,          //     Report Count (2)                      87
+ * # 0x81, 0x02,          //     Input (Data,Var,Abs)                  89
+ * # 0xc0,                //   End Collection                          91
+ * # 0xc0,                // End Collection                            92
+ * R: 93 05 0d 09 02 a1 01 85 0a 09 20 a1 01 09 42 09 44 09 45 09 3c 15 00 25 01 7501 95 06 81 02 09 32 75 01 95 01 81 02 81 03 05 01 09 30 09 31 55 0d 65 33 26 ff7f 35 00 46 00 08 75 10 95 02 81 02 05 0d 09 30 26 ff 1f 75 10 95 01 81 02 09 3d09 3e 15 81 25 7f 75 08 95 02 81 02 c0 c0
+ *
+ * Third hidraw node is the pad which sends a combination of keyboard shortcuts until
+ * the tablet is switched to raw mode, then it's mute:
+ *
+ * # Report descriptor length: 65 bytes
+ * # 0x05, 0x01,          // Usage Page (Generic Desktop)              0
+ * # 0x09, 0x06,          // Usage (Keyboard)                          2
+ * # 0xa1, 0x01,          // Collection (Application)                  4
+ * # 0x85, 0x03,          //   Report ID (3)                           6
+ * # 0x05, 0x07,          //   Usage Page (Keyboard/Keypad)            8
+ * # 0x19, 0xe0,          //   UsageMinimum (224)                      10
+ * # 0x29, 0xe7,          //   UsageMaximum (231)                      12
+ * # 0x15, 0x00,          //   Logical Minimum (0)                     14
+ * # 0x25, 0x01,          //   Logical Maximum (1)                     16
+ * # 0x75, 0x01,          //   Report Size (1)                         18
+ * # 0x95, 0x08,          //   Report Count (8)                        20
+ * # 0x81, 0x02,          //   Input (Data,Var,Abs)                    22
+ * # 0x05, 0x07,          //   Usage Page (Keyboard/Keypad)            24
+ * # 0x19, 0x00,          //   UsageMinimum (0)                        26
+ * # 0x29, 0xff,          //   UsageMaximum (255)                      28
+ * # 0x26, 0xff, 0x00,    //   Logical Maximum (255)                   30
+ * # 0x75, 0x08,          //   Report Size (8)                         33
+ * # 0x95, 0x06,          //   Report Count (6)                        35
+ * # 0x81, 0x00,          //   Input (Data,Arr,Abs)                    37
+ * # 0xc0,                // End Collection                            39
+ * # 0x05, 0x0c,          // Usage Page (Consumer)                     40
+ * # 0x09, 0x01,          // Usage (Consumer Control)                  42
+ * # 0xa1, 0x01,          // Collection (Application)                  44
+ * # 0x85, 0x04,          //   Report ID (4)                           46
+ * # 0x19, 0x00,          //   UsageMinimum (0)                        48
+ * # 0x2a, 0x3c, 0x02,    //   UsageMaximum (572)                      50
+ * # 0x15, 0x00,          //   Logical Minimum (0)                     53
+ * # 0x26, 0x3c, 0x02,    //   Logical Maximum (572)                   55
+ * # 0x95, 0x01,          //   Report Count (1)                        58
+ * # 0x75, 0x10,          //   Report Size (16)                        60
+ * # 0x81, 0x00,          //   Input (Data,Arr,Abs)                    62
+ * # 0xc0,                // End Collection                            64
+ * R: 65 05 01 09 06 a1 01 85 03 05 07 19 e0 29 e7 15 00 25 01 75 01 95 08 81 02 0507 19 00 29 ff 26 ff 00 75 08 95 06 81 00 c0 05 0c 09 01 a1 01 85 04 19 00 2a 3c02 15 00 26 3c 02 95 01 75 10 81 00 c0
+ * N: HUION Huion Tablet_H641P
+ */
+
+#define PAD_REPORT_DESCRIPTOR_LENGTH 133
+#define PEN_REPORT_DESCRIPTOR_LENGTH 93
+#define VENDOR_REPORT_DESCRIPTOR_LENGTH 36
+#define PAD_REPORT_ID 3
+#define PEN_REPORT_ID 10
+#define VENDOR_REPORT_ID 8
+#define PAD_REPORT_LENGTH 8
+#define PEN_REPORT_LENGTH 10
+#define VENDOR_REPORT_LENGTH 12
+
+
+__u16 last_button_state;
+
+static const __u8 fixed_rdesc_pad[] = {
+	UsagePage_GenericDesktop
+	Usage_GD_Keypad
+	CollectionApplication(
+		// -- Byte 0 in report
+		ReportId(PAD_REPORT_ID)
+		LogicalMinimum_i8(0)
+		LogicalMaximum_i8(1)
+		UsagePage_Digitizers
+		Usage_Dig_TabletFunctionKeys
+		CollectionPhysical(
+			// Byte 1 in report - just exists so we get to be a tablet pad
+			Usage_Dig_BarrelSwitch // BTN_STYLUS
+			ReportCount(1)
+			ReportSize(1)
+			Input(Var|Abs)
+			ReportCount(7) // padding
+			Input(Const)
+			// Bytes 2/3 in report - just exists so we get to be a tablet pad
+			UsagePage_GenericDesktop
+			Usage_GD_X
+			Usage_GD_Y
+			ReportCount(2)
+			ReportSize(8)
+			Input(Var|Abs)
+			// Byte 4 in report is the wheel
+			Usage_GD_Wheel
+			LogicalMinimum_i8(-1)
+			LogicalMaximum_i8(1)
+			ReportCount(1)
+			ReportSize(8)
+			Input(Var|Rel)
+			// Byte 5 is the button state
+			UsagePage_Button
+			UsageMinimum_i8(0x1)
+			UsageMaximum_i8(0x8)
+			LogicalMinimum_i8(0x1)
+			LogicalMaximum_i8(0x8)
+			ReportCount(1)
+			ReportSize(8)
+			Input(Arr|Abs)
+		)
+		// Make sure we match our original report length
+		FixedSizeVendorReport(PAD_REPORT_LENGTH)
+	)
+};
+
+static const __u8 fixed_rdesc_pen[] = {
+	UsagePage_Digitizers
+	Usage_Dig_Pen
+	CollectionApplication(
+		// -- Byte 0 in report
+		ReportId(PEN_REPORT_ID)
+		Usage_Dig_Pen
+		CollectionPhysical(
+			// -- Byte 1 in report
+			Usage_Dig_TipSwitch
+			Usage_Dig_BarrelSwitch
+			Usage_Dig_SecondaryBarrelSwitch // maps eraser to BTN_STYLUS2
+			LogicalMinimum_i8(0)
+			LogicalMaximum_i8(1)
+			ReportSize(1)
+			ReportCount(3)
+			Input(Var|Abs)
+			ReportCount(4)  // Padding
+			Input(Const)
+			Usage_Dig_InRange
+			ReportCount(1)
+			Input(Var|Abs)
+			ReportSize(16)
+			ReportCount(1)
+			PushPop(
+				UsagePage_GenericDesktop
+				Unit(cm)
+				UnitExponent(-1)
+				PhysicalMinimum_i16(0)
+				PhysicalMaximum_i16(160)
+				LogicalMinimum_i16(0)
+				LogicalMaximum_i16(32767)
+				Usage_GD_X
+				Input(Var|Abs) // Bytes 2+3
+				PhysicalMinimum_i16(0)
+				PhysicalMaximum_i16(100)
+				LogicalMinimum_i16(0)
+				LogicalMaximum_i16(32767)
+				Usage_GD_Y
+				Input(Var|Abs) // Bytes 4+5
+			)
+			UsagePage_Digitizers
+			Usage_Dig_TipPressure
+			LogicalMinimum_i16(0)
+			LogicalMaximum_i16(8191)
+			Input(Var|Abs) // Byte 6+7
+			// Two bytes padding so we don't need to change the report at all
+			ReportSize(8)
+			ReportCount(2)
+			Input(Const) // Byte 6+7
+		)
+	)
+};
+
+static const __u8 fixed_rdesc_vendor[] = {
+	UsagePage_Digitizers
+	Usage_Dig_Pen
+	CollectionApplication(
+		// Byte 0
+		// We leave the pen on the vendor report ID
+		ReportId(VENDOR_REPORT_ID)
+		Usage_Dig_Pen
+		CollectionPhysical(
+			// Byte 1 are the buttons
+			LogicalMinimum_i8(0)
+			LogicalMaximum_i8(1)
+			ReportSize(1)
+			Usage_Dig_TipSwitch
+			Usage_Dig_BarrelSwitch
+			Usage_Dig_SecondaryBarrelSwitch
+			ReportCount(3)
+			Input(Var|Abs)
+			ReportCount(4) // Padding
+			Input(Const)
+			Usage_Dig_InRange
+			ReportCount(1)
+			Input(Var|Abs)
+			ReportSize(16)
+			ReportCount(1)
+			PushPop(
+				UsagePage_GenericDesktop
+				Unit(cm)
+				UnitExponent(-1)
+				// Note: reported logical range differs
+				// from the pen report ID for x and y
+				LogicalMinimum_i16(0)
+				LogicalMaximum_i16(32000)
+				PhysicalMinimum_i16(0)
+				PhysicalMaximum_i16(160)
+				// Bytes 2/3 in report
+				Usage_GD_X
+				Input(Var|Abs)
+				LogicalMinimum_i16(0)
+				LogicalMaximum_i16(20000)
+				PhysicalMinimum_i16(0)
+				PhysicalMaximum_i16(100)
+				// Bytes 4/5 in report
+				Usage_GD_Y
+				Input(Var|Abs)
+			)
+			// Bytes 6/7 in report
+			LogicalMinimum_i16(0)
+			LogicalMaximum_i16(8192)
+			Usage_Dig_TipPressure
+			Input(Var|Abs)
+		)
+	)
+	UsagePage_GenericDesktop
+	Usage_GD_Keypad
+	CollectionApplication(
+		// Byte 0
+		ReportId(PAD_REPORT_ID)
+		LogicalMinimum_i8(0)
+		LogicalMaximum_i8(1)
+		UsagePage_Digitizers
+		Usage_Dig_TabletFunctionKeys
+		CollectionPhysical(
+			// Byte 1 are the buttons
+			Usage_Dig_BarrelSwitch	 // BTN_STYLUS, needed so we get to be a tablet pad
+			ReportCount(1)
+			ReportSize(1)
+			Input(Var|Abs)
+			ReportCount(7) // Padding
+			Input(Const)
+			// Bytes 2/3 - x/y just exist so we get to be a tablet pad
+			UsagePage_GenericDesktop
+			Usage_GD_X
+			Usage_GD_Y
+			ReportCount(2)
+			ReportSize(8)
+			Input(Var|Abs)
+			// Bytes 4 and 5 are the button state
+			UsagePage_Button
+			UsageMinimum_i8(0x1)
+			UsageMaximum_i8(0xa)
+			LogicalMinimum_i8(0x0)
+			LogicalMaximum_i8(0x1)
+			ReportCount(10)
+			ReportSize(1)
+			Input(Var|Abs)
+			Usage_i8(0x31) // maps to BTN_SOUTH
+			ReportCount(1)
+			Input(Var|Abs)
+			ReportCount(5)
+			Input(Const)
+			// Byte 6 is the wheel
+			UsagePage_GenericDesktop
+			Usage_GD_Wheel
+			LogicalMinimum_i8(-1)
+			LogicalMaximum_i8(1)
+			ReportCount(1)
+			ReportSize(8)
+			Input(Var|Rel)
+		)
+		// Make sure we match our original report length
+		FixedSizeVendorReport(VENDOR_REPORT_LENGTH)
+	)
+};
+
+static const __u8 disabled_rdesc_pen[] = {
+	FixedSizeVendorReport(PEN_REPORT_LENGTH)
+};
+
+static const __u8 disabled_rdesc_pad[] = {
+	FixedSizeVendorReport(PAD_REPORT_LENGTH)
+};
+
+SEC(HID_BPF_RDESC_FIXUP)
+int BPF_PROG(hid_fix_rdesc, struct hid_bpf_ctx *hctx)
+{
+	__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, HID_MAX_DESCRIPTOR_SIZE /* size */);
+	__s32 rdesc_size = hctx->size;
+	__u8 have_fw_id;
+
+	if (!data)
+		return 0; /* EPERM check */
+
+	/* If we have a firmware ID and it matches our expected prefix, we
+	 * disable the default pad/pen nodes. They won't send events
+	 * but cause duplicate devices.
+	 */
+	have_fw_id = __builtin_memcmp(UDEV_PROP_HUION_FIRMWARE_ID,
+				      EXPECTED_FIRMWARE_ID,
+				      sizeof(EXPECTED_FIRMWARE_ID) - 1) == 0;
+	if (rdesc_size == PAD_REPORT_DESCRIPTOR_LENGTH) {
+		if (have_fw_id) {
+			__builtin_memcpy(data, disabled_rdesc_pad, sizeof(disabled_rdesc_pad));
+			return sizeof(disabled_rdesc_pad);
+		}
+
+		__builtin_memcpy(data, fixed_rdesc_pad, sizeof(fixed_rdesc_pad));
+		return sizeof(fixed_rdesc_pad);
+	}
+	if (rdesc_size == PEN_REPORT_DESCRIPTOR_LENGTH) {
+		if (have_fw_id) {
+			__builtin_memcpy(data, disabled_rdesc_pen, sizeof(disabled_rdesc_pen));
+			return sizeof(disabled_rdesc_pen);
+		}
+
+		__builtin_memcpy(data, fixed_rdesc_pen, sizeof(fixed_rdesc_pen));
+		return sizeof(fixed_rdesc_pen);
+	}
+	/* Always fix the vendor mode so the tablet will work even if nothing sets
+	 * the udev property (e.g. huion-switcher run manually)
+	 */
+	if (rdesc_size == VENDOR_REPORT_DESCRIPTOR_LENGTH) {
+		__builtin_memcpy(data, fixed_rdesc_vendor, sizeof(fixed_rdesc_vendor));
+		return sizeof(fixed_rdesc_vendor);
+	}
+	return 0;
+}
+
+SEC(HID_BPF_DEVICE_EVENT)
+int BPF_PROG(inspiroy_2_fix_events, struct hid_bpf_ctx *hctx)
+{
+	__u8 *data = hid_bpf_get_data(hctx, 0 /* offset */, 10 /* size */);
+
+	if (!data)
+		return 0; /* EPERM check */
+
+	/* Only sent if tablet is in default mode */
+	if (data[0] == PAD_REPORT_ID) {
+		/* Nicely enough, this device only supports one button down at a time so
+		 * the reports are easy to match. Buttons numbered from the top
+		 *   Button released: 03 00 00 00 00 00 00 00
+		 *   Button 1: 03 00 05 00 00 00 00 00 -> b
+		 *   Button 2: 03 07 11 00 00 00 00 00 -> Ctrl Shift N
+		 *   Button 3: 03 00 08 00 00 00 00 00 -> e
+		 *   Button 4: 03 00 0c 00 00 00 00 00 -> i
+		 *   Button 5: 03 00 2c 00 00 00 00 00 -> space
+		 *   Button 6: 03 01 08 00 00 00 00 00 -> Ctrl E
+		 *   Button 7: 03 01 16 00 00 00 00 00 -> Ctrl S
+		 *   Button 8: 03 05 1d 00 00 00 00 00 -> Ctrl Alt Z
+		 *
+		 *   Wheel down: 03 01 2d 00 00 00 00 00 -> Ctrl -
+		 *   Wheel up:   03 01 2e 00 00 00 00 00 -> Ctrl =
+		 */
+		__u8 button = 0;
+		__u8 wheel = 0;
+
+		switch (data[1] << 8 | data[2]) {
+		case 0x0000:
+			break;
+		case 0x0005:
+			button = 1;
+			break;
+		case 0x0711:
+			button = 2;
+			break;
+		case 0x0008:
+			button = 3;
+			break;
+		case 0x000c:
+			button = 4;
+			break;
+		case 0x002c:
+			button = 5;
+			break;
+		case 0x0108:
+			button = 6;
+			break;
+		case 0x0116:
+			button = 7;
+			break;
+		case 0x051d:
+			button = 8;
+			break;
+		case 0x012d:
+			wheel = -1;
+			break;
+		case 0x012e:
+			wheel = 1;
+			break;
+		}
+
+		__u8 report[6] = {PAD_REPORT_ID, 0x0, 0x0, 0x0, wheel, button};
+
+		__builtin_memcpy(data, report, sizeof(report));
+		return sizeof(report);
+	}
+
+	/* Nothing to do for the PEN_REPORT_ID, it's already mapped */
+
+	/* Only sent if tablet is in raw mode */
+	if (data[0] == VENDOR_REPORT_ID) {
+		/* Pad reports */
+		if (data[1] & 0x20) {
+			/* See fixed_rdesc_pad */
+			struct pad_report {
+				__u8 report_id;
+				__u8 btn_stylus;
+				__u8 x;
+				__u8 y;
+				__u16 buttons;
+				__u8 wheel;
+			} __attribute__((packed)) *pad_report;
+			__u8 wheel = 0;
+
+			/* Wheel report */
+			if (data[1] == 0xf1) {
+				if (data[5] == 2)
+					wheel = 0xff;
+				else
+					wheel = data[5];
+			} else {
+				/* data[4] and data[5] are the buttons, mapped correctly */
+				last_button_state = data[4] | (data[5] << 8);
+				wheel = 0; // wheel
+			}
+
+			pad_report = (struct pad_report *)data;
+
+			pad_report->report_id = PAD_REPORT_ID;
+			pad_report->btn_stylus = 0;
+			pad_report->x = 0;
+			pad_report->y = 0;
+			pad_report->buttons = last_button_state;
+			pad_report->wheel = wheel;
+
+			return sizeof(struct pad_report);
+		}
+
+		/* Pen reports need nothing done */
+	}
+
+	return 0;
+}
+
+HID_BPF_OPS(inspiroy_2) = {
+	.hid_device_event = (void *)inspiroy_2_fix_events,
+	.hid_rdesc_fixup = (void *)hid_fix_rdesc,
+};
+
+SEC("syscall")
+int probe(struct hid_bpf_probe_args *ctx)
+{
+	switch (ctx->rdesc_size) {
+	case PAD_REPORT_DESCRIPTOR_LENGTH:
+	case PEN_REPORT_DESCRIPTOR_LENGTH:
+	case VENDOR_REPORT_DESCRIPTOR_LENGTH:
+		ctx->retval = 0;
+		break;
+	default:
+		ctx->retval = -EINVAL;
+	}
+
+	return 0;
+}
+
+char _license[] SEC("license") = "GPL";

-- 
2.51.1


^ permalink raw reply related

* [PATCH 00/10] HID: bpf: sync up with current udev-hid-bpf programs
From: Benjamin Tissoires @ 2025-11-18 17:16 UTC (permalink / raw)
  To: Jiri Kosina
  Cc: linux-kernel, linux-input, Benjamin Tissoires, Peter Hutterer,
	Nicholas LaPointe, Higgins Dragon, Curran Muhlberger,
	Jan Felix Langenbach, Hannah Pittman, Colin Ian King,
	Benjamin Tissoires

As I need to get a new release of udev-hid-bpf, it would be good to
mark the currently "testing" HID-BPF programs into stable.

So I've taken all of them, formatted them to the LKML format and sent
here.

Again, no need to backport any of those into stable, we are putting them
here mostly for code archiving purpose and have a public central point
for them.

Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
---
Benjamin Tissoires (10):
      HID: bpf: Add support for the Inspiroy 2M
      HID: bpf: add support for Huion Kamvas 13 (Gen 3) (model GS1333)
      HID: bpf: support for Huion Kamvas 16 Gen 3
      HID: bpf: Add fixup for Logitech SpaceNavigator variants
      HID: bpf: Add support for the Waltop Batteryless Tablet
      HID: bpf: Add support for the XP-Pen Deco 01 V3
      HID: bpf: Add support for XP-Pen Deco02
      HID: bpf: add heuristics to the Huion Inspiroy 2S eraser button
      HID: bpf: add the Huion Kamvas 27 Pro
      HID: bpf: fix typo in HID usage table

 drivers/hid/bpf/progs/Huion__Inspiroy-2-M.bpf.c    |  563 ++++++++
 drivers/hid/bpf/progs/Huion__Inspiroy-2-S.bpf.c    |   29 +-
 drivers/hid/bpf/progs/Huion__Kamvas-Pro-19.bpf.c   |    6 +-
 drivers/hid/bpf/progs/Huion__Kamvas13Gen3.bpf.c    | 1395 ++++++++++++++++++++
 drivers/hid/bpf/progs/Huion__Kamvas16Gen3.bpf.c    |  724 ++++++++++
 .../hid/bpf/progs/Logitech__SpaceNavigator.bpf.c   |   86 ++
 .../hid/bpf/progs/WALTOP__Batteryless-Tablet.bpf.c |  321 +++++
 drivers/hid/bpf/progs/XPPen__Deco01V3.bpf.c        |  305 +++++
 drivers/hid/bpf/progs/XPPen__Deco02.bpf.c          |  359 +++++
 drivers/hid/bpf/progs/hid_report_helpers.h         |   10 +-
 10 files changed, 3792 insertions(+), 6 deletions(-)
---
base-commit: 2953fb65481b262514ac13f24ffbc70eeace68c6
change-id: 20251118-wip-sync-udev-hid-bpf-03b7c1469de9

Best regards,
-- 
Benjamin Tissoires <bentiss@kernel.org>


^ permalink raw reply

* Re: [PATCH] HID: uclogic: Fix potential memory leak in error path
From: Jiri Kosina @ 2025-11-18 17:08 UTC (permalink / raw)
  To: Abdun Nihaal; +Cc: bentiss, linux-input, linux-kernel
In-Reply-To: <20251110172943.99887-1-nihaal@cse.iitm.ac.in>

On Mon, 10 Nov 2025, Abdun Nihaal wrote:

> In uclogic_params_ugee_v2_init_event_hooks(), the memory allocated for
> event_hook is not freed in the next error path. Fix that by freeing it.
> 
> Fixes: a251d6576d2a ("HID: uclogic: Handle wireless device reconnection")
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply

* Re: [PATCH] HID: playstation: Fix memory leak in dualshock4_get_calibration_data()
From: Jiri Kosina @ 2025-11-18 17:07 UTC (permalink / raw)
  To: Abdun Nihaal; +Cc: roderick.colenbrander, bentiss, linux-input, linux-kernel
In-Reply-To: <20251110171552.95466-1-nihaal@cse.iitm.ac.in>

On Mon, 10 Nov 2025, Abdun Nihaal wrote:

> The memory allocated for buf is not freed in the error paths when
> ps_get_report() fails. Free buf before jumping to transfer_failed label
> 
> Fixes: 947992c7fa9e ("HID: playstation: DS4: Fix calibration workaround for clone devices")
> Signed-off-by: Abdun Nihaal <nihaal@cse.iitm.ac.in>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply

* Re: [PATCH] HID: pidff: Fix needs_playback check
From: Jiri Kosina @ 2025-11-18 17:05 UTC (permalink / raw)
  To: Tomasz Pakuła; +Cc: bentiss, oleg, linux-input
In-Reply-To: <20251103200243.1154544-1-tomasz.pakula.oficjalny@gmail.com>

On Mon, 3 Nov 2025, Tomasz Pakuła wrote:

> Urgent for 6.18 rc period

Applied, but please always put these meta-comments away from the proper 
changelog that will end up in git (below the '---' mark ideally).

Thanks,

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply

* Re: [PATCH] HID: mcp2221: fix slab out-of-bounds in mcp2221_raw_event
From: Jiri Kosina @ 2025-11-18 17:03 UTC (permalink / raw)
  To: Atharv Dubey
  Cc: bentiss, linux-input, linux-kernel, syzbot+1018672fe70298606e5f
In-Reply-To: <20251103182543.42451-2-atharvd440@gmail.com>

On Mon, 3 Nov 2025, Atharv Dubey wrote:

> Fixes an out-of-bounds read triggered by malformed HID input reports.
> 
> Fixes: 3a8660878839 ("HID: mcp2221: add support for MCP2221 HID adapter")

The commit hash and the commit name don't match.

3a8660878839 is a Makefile update to reflect new kernel version, and 
commit with shortlog "HID: mcp2221: add support for MCP2221 HID adapter" 
doesn't seem to exist ...

> Reported-by: syzbot+1018672fe70298606e5f@syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=1018672fe70298606e5f
> Signed-off-by: Atharv Dubey <atharvd440@gmail.com>
> ---
>  drivers/hid/hid-mcp2221.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/hid/hid-mcp2221.c b/drivers/hid/hid-mcp2221.c
> index a9fd7648515d..c97f0acbac8b 100644
> --- a/drivers/hid/hid-mcp2221.c
> +++ b/drivers/hid/hid-mcp2221.c
> @@ -945,7 +945,7 @@ static int mcp2221_raw_event(struct hid_device *hdev,
>  		switch (data[1]) {
>  		case MCP2221_SUCCESS:
>  			if ((data[mcp->gp_idx] == MCP2221_ALT_F_NOT_GPIOV) ||
> -				(mcp->gp_idx > 0 &&data[mcp->gp_idx - 1] == MCP2221_ALT_F_NOT_GPIOV)) {

... nor does this code.

What tree is this patch against?

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply

* Re: [PATCH] HID: corsair-void: Use %pe for printing PTR_ERR
From: Jiri Kosina @ 2025-11-18 16:58 UTC (permalink / raw)
  To: Stuart Hayhurst
  Cc: Benjamin Tissoires, linux-input, linux-kernel, kernel test robot,
	Julia Lawall
In-Reply-To: <20251103142120.29446-2-stuart.a.hayhurst@gmail.com>

On Mon, 3 Nov 2025, Stuart Hayhurst wrote:

> Use %pe to print a PTR_ERR to silence a cocci warning
> 
> Reported-by: kernel test robot <lkp@intel.com>
> Reported-by: Julia Lawall <julia.lawall@inria.fr>
> Closes: https://lore.kernel.org/r/202510300342.WtPn2jF3-lkp@intel.com/
> Signed-off-by: Stuart Hayhurst <stuart.a.hayhurst@gmail.com>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply

* Re: [PATCH] HID: elecom: Add support for ELECOM M-XT3URBK (018F)
From: Jiri Kosina @ 2025-11-18 16:54 UTC (permalink / raw)
  To: Naoki Ueki; +Cc: Benjamin Tissoires, linux-input, linux-kernel
In-Reply-To: <20251103121646.202256-1-naoki25519@gmail.com>

On Mon, 3 Nov 2025, Naoki Ueki wrote:

> The ELECOM M-XT3URBK trackball has an additional device ID (0x018F), which
> shares the same report descriptor as the existing device (0x00FB). However,
> the driver does not currently recognize this new ID, resulting in only five
> buttons being functional.
> 
> This patch adds the new device ID so that all six buttons work properly.
> 
> Signed-off-by: Naoki Ueki <naoki25519@gmail.com>

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply

* Re: [PATCH 0/2] hid-alps docs heading cleanup
From: Jiri Kosina @ 2025-11-18 16:53 UTC (permalink / raw)
  To: Bagas Sanjaya
  Cc: Linux Kernel Mailing List, Linux Documentation,
	Linux Input Devices, Benjamin Tissoires, Jonathan Corbet,
	Masaki Ota, George Anthony Vernon
In-Reply-To: <20251024103934.20019-1-bagasdotme@gmail.com>

On Fri, 24 Oct 2025, Bagas Sanjaya wrote:

> Here are two section headings cleanup patches for Alps HID documentation.
> Enjoy!
> 
> Bagas Sanjaya (2):
>   Documentation: hid-alps: Fix packet format section headings
>   Documentation: hid-alps: Format DataByte* subsection headings
> 
>  Documentation/hid/hid-alps.rst | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)

Applied, thanks.

-- 
Jiri Kosina
SUSE Labs


^ permalink raw reply

* Re: [PATCH v8 01/10] HID: asus: simplify RGB init sequence
From: Antheas Kapenekakis @ 2025-11-18 13:07 UTC (permalink / raw)
  To: Ilpo Järvinen
  Cc: platform-driver-x86, linux-input, LKML, Jiri Kosina,
	Benjamin Tissoires, Corentin Chary, Luke D . Jones, Hans de Goede,
	Denis Benato
In-Reply-To: <3018f443-e1af-7a93-f0f2-558364ecb9eb@linux.intel.com>

On Tue, 18 Nov 2025 at 13:23, Ilpo Järvinen
<ilpo.jarvinen@linux.intel.com> wrote:
>
> On Sat, 1 Nov 2025, Antheas Kapenekakis wrote:
>
> > Currently, RGB initialization forks depending on whether a device is
> > NKEY. Then, NKEY devices are initialized using 0x5a, 0x5d, 0x5e
> > endpoints, and non-NKEY devices with 0x5a and then a
> > backlight check, which is omitted for NKEY devices.
> >
> > Remove the fork, using a common initialization sequence for both,
> > where they are both only initialized with 0x5a, then checked for
> > backlight support. This patch should not affect existing functionality.
> >
> > 0x5d and 0x5e endpoint initializations are performed by Windows
> > userspace programs associated with different usages that reside under
> > the vendor HID. Specifically, 0x5d is used by Armoury Crate, which
> > controls RGB and 0x5e by an animation program for certain Asus laptops.
> > Neither is used currently in the driver.
> >
> > Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> > ---
> >  drivers/hid/hid-asus.c | 56 ++++++++++++++----------------------------
> >  1 file changed, 19 insertions(+), 37 deletions(-)
> >
> > diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> > index a444d41e53b6..7ea1037c3979 100644
> > --- a/drivers/hid/hid-asus.c
> > +++ b/drivers/hid/hid-asus.c
> > @@ -638,50 +638,32 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
> >       unsigned char kbd_func;
> >       int ret;
> >
> > -     if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) {
> > -             /* Initialize keyboard */
> > -             ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);
> > -             if (ret < 0)
> > -                     return ret;
> > -
> > -             /* The LED endpoint is initialised in two HID */
> > -             ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID1);
> > -             if (ret < 0)
> > -                     return ret;
> > -
> > -             ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID2);
> > -             if (ret < 0)
> > -                     return ret;
>
> This removal of FEATURE_KBD_LED_REPORT_ID2 should definitely be in own
> patch so a focused changelog can be written to it (who said it's
> acceptable, etc. included) and it can be pinpointed with bisect if it
> causes any issues (but I'm not entirely sure what Denis' stance is on this
> removal so it's going to be subject to some further scrunity, but in any
> case it must be in own patch if to be accepted).

Yeah this is a fair approach.

> I'm wondering though if QUIRK_ROG_NKEY_LEGACY could also cover this? At
> least it would look a path of less resistance when it comes to Denis'
> stance and would decouple the remove or not controversy from acceptance of
> this series.

So a way forward would be on the simplify patch, to use an if rog
statement to do ID1 and ID2 and then on the next patch replace the
quirk in the if check with the legacy quirk. This is ok with me, as
those are older devices.

Antheas

> --
>  i.
>
> > -             if (dmi_match(DMI_PRODUCT_FAMILY, "ProArt P16")) {
> > -                     ret = asus_kbd_disable_oobe(hdev);
> > -                     if (ret < 0)
> > -                             return ret;
> > -             }
> > -
> > -             if (drvdata->quirks & QUIRK_ROG_ALLY_XPAD) {
> > -                     intf = to_usb_interface(hdev->dev.parent);
> > -                     udev = interface_to_usbdev(intf);
> > -                     validate_mcu_fw_version(hdev,
> > -                             le16_to_cpu(udev->descriptor.idProduct));
> > -             }
> > +     ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);
> > +     if (ret < 0)
> > +             return ret;
> >
> > -     } else {
> > -             /* Initialize keyboard */
> > -             ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);
> > -             if (ret < 0)
> > -                     return ret;
> > +     /* Get keyboard functions */
> > +     ret = asus_kbd_get_functions(hdev, &kbd_func, FEATURE_KBD_REPORT_ID);
> > +     if (ret < 0)
> > +             return ret;
> >
> > -             /* Get keyboard functions */
> > -             ret = asus_kbd_get_functions(hdev, &kbd_func, FEATURE_KBD_REPORT_ID);
> > +     if (dmi_match(DMI_PRODUCT_FAMILY, "ProArt P16")) {
> > +             ret = asus_kbd_disable_oobe(hdev);
> >               if (ret < 0)
> >                       return ret;
> > +     }
> >
> > -             /* Check for backlight support */
> > -             if (!(kbd_func & SUPPORT_KBD_BACKLIGHT))
> > -                     return -ENODEV;
> > +     if (drvdata->quirks & QUIRK_ROG_ALLY_XPAD) {
> > +             intf = to_usb_interface(hdev->dev.parent);
> > +             udev = interface_to_usbdev(intf);
> > +             validate_mcu_fw_version(
> > +                     hdev, le16_to_cpu(udev->descriptor.idProduct));
> >       }
> >
> > +     /* Check for backlight support */
> > +     if (!(kbd_func & SUPPORT_KBD_BACKLIGHT))
> > +             return -ENODEV;
> > +
> >       drvdata->kbd_backlight = devm_kzalloc(&hdev->dev,
> >                                             sizeof(struct asus_kbd_leds),
> >                                             GFP_KERNEL);
> >
>


^ permalink raw reply

* Re: [PATCH v8 01/10] HID: asus: simplify RGB init sequence
From: Ilpo Järvinen @ 2025-11-18 12:23 UTC (permalink / raw)
  To: Antheas Kapenekakis
  Cc: platform-driver-x86, linux-input, LKML, Jiri Kosina,
	Benjamin Tissoires, Corentin Chary, Luke D . Jones, Hans de Goede,
	Denis Benato
In-Reply-To: <20251101104712.8011-2-lkml@antheas.dev>

On Sat, 1 Nov 2025, Antheas Kapenekakis wrote:

> Currently, RGB initialization forks depending on whether a device is
> NKEY. Then, NKEY devices are initialized using 0x5a, 0x5d, 0x5e
> endpoints, and non-NKEY devices with 0x5a and then a
> backlight check, which is omitted for NKEY devices.
> 
> Remove the fork, using a common initialization sequence for both,
> where they are both only initialized with 0x5a, then checked for
> backlight support. This patch should not affect existing functionality.
> 
> 0x5d and 0x5e endpoint initializations are performed by Windows
> userspace programs associated with different usages that reside under
> the vendor HID. Specifically, 0x5d is used by Armoury Crate, which
> controls RGB and 0x5e by an animation program for certain Asus laptops.
> Neither is used currently in the driver.
> 
> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> ---
>  drivers/hid/hid-asus.c | 56 ++++++++++++++----------------------------
>  1 file changed, 19 insertions(+), 37 deletions(-)
> 
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index a444d41e53b6..7ea1037c3979 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -638,50 +638,32 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
>  	unsigned char kbd_func;
>  	int ret;
>  
> -	if (drvdata->quirks & QUIRK_ROG_NKEY_KEYBOARD) {
> -		/* Initialize keyboard */
> -		ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);
> -		if (ret < 0)
> -			return ret;
> -
> -		/* The LED endpoint is initialised in two HID */
> -		ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID1);
> -		if (ret < 0)
> -			return ret;
> -
> -		ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID2);
> -		if (ret < 0)
> -			return ret;

This removal of FEATURE_KBD_LED_REPORT_ID2 should definitely be in own 
patch so a focused changelog can be written to it (who said it's 
acceptable, etc. included) and it can be pinpointed with bisect if it 
causes any issues (but I'm not entirely sure what Denis' stance is on this 
removal so it's going to be subject to some further scrunity, but in any 
case it must be in own patch if to be accepted).

I'm wondering though if QUIRK_ROG_NKEY_LEGACY could also cover this? At 
least it would look a path of less resistance when it comes to Denis' 
stance and would decouple the remove or not controversy from acceptance of 
this series.

-- 
 i.

> -		if (dmi_match(DMI_PRODUCT_FAMILY, "ProArt P16")) {
> -			ret = asus_kbd_disable_oobe(hdev);
> -			if (ret < 0)
> -				return ret;
> -		}
> -
> -		if (drvdata->quirks & QUIRK_ROG_ALLY_XPAD) {
> -			intf = to_usb_interface(hdev->dev.parent);
> -			udev = interface_to_usbdev(intf);
> -			validate_mcu_fw_version(hdev,
> -				le16_to_cpu(udev->descriptor.idProduct));
> -		}
> +	ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);
> +	if (ret < 0)
> +		return ret;
>  
> -	} else {
> -		/* Initialize keyboard */
> -		ret = asus_kbd_init(hdev, FEATURE_KBD_REPORT_ID);
> -		if (ret < 0)
> -			return ret;
> +	/* Get keyboard functions */
> +	ret = asus_kbd_get_functions(hdev, &kbd_func, FEATURE_KBD_REPORT_ID);
> +	if (ret < 0)
> +		return ret;
>  
> -		/* Get keyboard functions */
> -		ret = asus_kbd_get_functions(hdev, &kbd_func, FEATURE_KBD_REPORT_ID);
> +	if (dmi_match(DMI_PRODUCT_FAMILY, "ProArt P16")) {
> +		ret = asus_kbd_disable_oobe(hdev);
>  		if (ret < 0)
>  			return ret;
> +	}
>  
> -		/* Check for backlight support */
> -		if (!(kbd_func & SUPPORT_KBD_BACKLIGHT))
> -			return -ENODEV;
> +	if (drvdata->quirks & QUIRK_ROG_ALLY_XPAD) {
> +		intf = to_usb_interface(hdev->dev.parent);
> +		udev = interface_to_usbdev(intf);
> +		validate_mcu_fw_version(
> +			hdev, le16_to_cpu(udev->descriptor.idProduct));
>  	}
>  
> +	/* Check for backlight support */
> +	if (!(kbd_func & SUPPORT_KBD_BACKLIGHT))
> +		return -ENODEV;
> +
>  	drvdata->kbd_backlight = devm_kzalloc(&hdev->dev,
>  					      sizeof(struct asus_kbd_leds),
>  					      GFP_KERNEL);
> 

^ permalink raw reply

* Re: [PATCH v8 05/10] HID: asus: initialize LED endpoint early for old NKEY keyboards
From: Ilpo Järvinen @ 2025-11-18 12:10 UTC (permalink / raw)
  To: Antheas Kapenekakis
  Cc: platform-driver-x86, linux-input, LKML, Jiri Kosina,
	Benjamin Tissoires, Corentin Chary, Luke D . Jones, Hans de Goede,
	Denis Benato
In-Reply-To: <20251101104712.8011-6-lkml@antheas.dev>

On Sat, 1 Nov 2025, Antheas Kapenekakis wrote:

> These keyboards have always had initialization in the kernel for 0x5d.
> At this point, it is hard to verify again and we risk regressions by
> removing this. Therefore, initialize with 0x5d as well.
> 
> Signed-off-by: Antheas Kapenekakis <lkml@antheas.dev>
> ---
>  drivers/hid/hid-asus.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/hid/hid-asus.c b/drivers/hid/hid-asus.c
> index 726f5d8e22d1..221c7195e885 100644
> --- a/drivers/hid/hid-asus.c
> +++ b/drivers/hid/hid-asus.c
> @@ -91,6 +91,7 @@ MODULE_DESCRIPTION("Asus HID Keyboard and TouchPad");
>  #define QUIRK_ROG_CLAYMORE_II_KEYBOARD BIT(12)
>  #define QUIRK_ROG_ALLY_XPAD		BIT(13)
>  #define QUIRK_SKIP_REPORT_FIXUP		BIT(14)
> +#define QUIRK_ROG_NKEY_LEGACY		BIT(15)
>  
>  #define I2C_KEYBOARD_QUIRKS			(QUIRK_FIX_NOTEBOOK_REPORT | \
>  						 QUIRK_NO_INIT_REPORTS | \
> @@ -669,6 +670,16 @@ static int asus_kbd_register_leds(struct hid_device *hdev)
>  	if (ret < 0)
>  		return ret;
>  
> +	if (drvdata->quirks & QUIRK_ROG_NKEY_LEGACY) {
> +		/*
> +		 * These keyboards might need 0x5d for shortcuts to work.
> +		 * As it has been more than 5 years, it is hard to verify.
> +		 */
> +		ret = asus_kbd_init(hdev, FEATURE_KBD_LED_REPORT_ID1);
> +		if (ret < 0)
> +			return ret;
> +	}
> +
>  	/* Get keyboard functions */
>  	ret = asus_kbd_get_functions(hdev, &kbd_func, FEATURE_KBD_REPORT_ID);
>  	if (ret < 0)
> @@ -1409,10 +1420,10 @@ static const struct hid_device_id asus_devices[] = {
>  	  QUIRK_USE_KBD_BACKLIGHT },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
>  	    USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD),
> -	  QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },
> +	  QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD | QUIRK_ROG_NKEY_LEGACY },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
>  	    USB_DEVICE_ID_ASUSTEK_ROG_NKEY_KEYBOARD2),
> -	  QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },
> +	  QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD | QUIRK_ROG_NKEY_LEGACY },
>  	{ HID_USB_DEVICE(USB_VENDOR_ID_ASUSTEK,
>  	    USB_DEVICE_ID_ASUSTEK_ROG_Z13_LIGHTBAR),
>  	  QUIRK_USE_KBD_BACKLIGHT | QUIRK_ROG_NKEY_KEYBOARD },

You should do FEATURE_KBD_LED_REPORT_ID1 refactoring together, not remove 
+ add back in different patches.

I suppose the cleanest would be to add a new patch as first which moves
asus_kbd_init() outside of if/else so you can make this refactoring of 
FEATURE_KBD_LED_REPORT_ID1 in the 2nd patch.

I note there's still contention with this series overall.

-- 
 i.


^ permalink raw reply

* Re: [PATCH v3 05/11] drm/panel: ronbo-rb070d30: fix warning with gpio controllers that sleep
From: Neil Armstrong @ 2025-11-18  8:44 UTC (permalink / raw)
  To: Josua Mayer, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Shawn Guo, Jessica Zhang, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Dmitry Torokhov, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Laurent Pinchart, Lad Prabhakar, Thierry Reding
  Cc: Jon Nettleton, Mikhail Anikin, Yazan Shhady, devicetree,
	linux-kernel, dri-devel, linux-input, imx, linux-arm-kernel
In-Reply-To: <20251117-imx8mp-hb-iiot-v3-5-bf1a4cf5fa8e@solid-run.com>

On 11/17/25 13:28, Josua Mayer wrote:
> The ronbo-rb070d30 controles the various gpios for reset, standby,
> vertical and horizontal flip using the non-sleeping gpiod_set_value()
> function.
> 
> Switch to using gpiod_set_value_cansleep() when controlling reset_gpio to
> support GPIO providers that may sleep, such as I2C GPIO expanders.
> 
> This fixes noisy complaints in kernel log for gpio providers that do
> sleep.
> 
> Signed-off-by: Josua Mayer <josua@solid-run.com>
> ---
>   drivers/gpu/drm/panel/panel-ronbo-rb070d30.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c b/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c
> index ad35d0fb0a167..c3fbc459c7e0d 100644
> --- a/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c
> +++ b/drivers/gpu/drm/panel/panel-ronbo-rb070d30.c
> @@ -54,9 +54,9 @@ static int rb070d30_panel_prepare(struct drm_panel *panel)
>   	}
>   
>   	msleep(20);
> -	gpiod_set_value(ctx->gpios.power, 1);
> +	gpiod_set_value_cansleep(ctx->gpios.power, 1);
>   	msleep(20);
> -	gpiod_set_value(ctx->gpios.reset, 1);
> +	gpiod_set_value_cansleep(ctx->gpios.reset, 1);
>   	msleep(20);
>   	return 0;
>   }
> @@ -65,8 +65,8 @@ static int rb070d30_panel_unprepare(struct drm_panel *panel)
>   {
>   	struct rb070d30_panel *ctx = panel_to_rb070d30_panel(panel);
>   
> -	gpiod_set_value(ctx->gpios.reset, 0);
> -	gpiod_set_value(ctx->gpios.power, 0);
> +	gpiod_set_value_cansleep(ctx->gpios.reset, 0);
> +	gpiod_set_value_cansleep(ctx->gpios.power, 0);
>   	regulator_disable(ctx->supply);
>   
>   	return 0;
> 

Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>

^ permalink raw reply

* Re: [PATCH] input: touchscreen: Add ilitek touchscreen driver support
From: Dmitry Torokhov @ 2025-11-18  7:43 UTC (permalink / raw)
  To: 2724853925; +Cc: Henrik Rydberg, linux-input, linux-kernel, linux-gpio
In-Reply-To: <tencent_995E6FC62EDBC1EED14E6052847F270F6406@qq.com>

Hi,

On Sun, Nov 16, 2025 at 09:49:24PM +0800, 2724853925@qq.com wrote:
> +/* i2c clock rate for rk3288 */
> +#if ILITEK_PLAT == ILITEK_PLAT_ROCKCHIP && \
> +	KERNEL_VERSION(4, 0, 0) > LINUX_VERSION_CODE
> +#define SCL_RATE(rate)	.scl_rate = (rate),
> +#else
> +#define SCL_RATE(rate)
> +#endif
> +
> +/* netlink */
> +#if KERNEL_VERSION(3, 6, 0) <= LINUX_VERSION_CODE
> +#define NETLINK_KERNEL_CFG_DECLARE(cfg, func)	\
> +	struct netlink_kernel_cfg cfg = {	\
> +		.groups = 0,			\
> +		.input = func,			\
> +	}
> +#if KERNEL_VERSION(3, 7, 0) <= LINUX_VERSION_CODE
> +#define NETLINK_KERNEL_CREATE(unit, cfg_ptr, func)	\
> +	netlink_kernel_create(&init_net, (unit), (cfg_ptr))
> +#else
> +#define NETLINK_KERNEL_CREATE(unit, cfg_ptr, func)	\
> +	netlink_kernel_create(&init_net, (unit), THIS_MODULE, (cfg_ptr))
> +#endif
> +#else
> +#define NETLINK_KERNEL_CFG_DECLARE(cfg, func)
> +#define NETLINK_KERNEL_CREATE(unit, cfg_ptr, func)	\
> +	netlink_kernel_create(&init_net, (unit), 0, (func), NULL, THIS_MODULE)
> +#endif
> +
> +/* input_dev */
> +#if KERNEL_VERSION(3, 7, 0) <= LINUX_VERSION_CODE
> +#define INPUT_MT_INIT_SLOTS(dev, num)	\
> +		input_mt_init_slots((dev), (num), INPUT_MT_DIRECT)
> +#else
> +#define INPUT_MT_INIT_SLOTS(dev, num)	input_mt_init_slots((dev), (num))
> +#endif
> +
> +/* file_operations ioctl */
> +#if KERNEL_VERSION(2, 6, 36) <= LINUX_VERSION_CODE
> +#define FOPS_IOCTL	unlocked_ioctl
> +#define FOPS_IOCTL_FUNC(func, cmd, arg) \
> +		long func(struct file *fp, cmd, arg)
> +#else
> +#define FOPS_IOCTL	ioctl
> +#define FOPS_IOCTL_FUNC(func, cmd, arg) \
> +		s32 func(struct inode *np, struct file *fp,	cmd, arg)
> +
> +#endif
> +
> +#if KERNEL_VERSION(6, 3, 0) > LINUX_VERSION_CODE
> +#define I2C_PROBE_FUNC(func, client_arg)	\
> +	int func(client_arg, const struct i2c_device_id *id)
> +#else
> +#define I2C_PROBE_FUNC(func, client_arg)	int func(client_arg)
> +#endif
> +
> +#if KERNEL_VERSION(6, 1, 0) > LINUX_VERSION_CODE
> +#define REMOVE_FUNC(func, client_arg)	int func(client_arg)
> +#define REMOVE_RETURN(val)		({ __typeof__(val) _val = (val); return _val; })
> +#else
> +#define REMOVE_FUNC(func, client_arg)	void func(client_arg)
> +#define REMOVE_RETURN(val)		(val)
> +#endif
> +
> +#if KERNEL_VERSION(6, 4, 0) > LINUX_VERSION_CODE
> +#define CLASS_CREATE(name)	class_create(THIS_MODULE, (name))
> +#else
> +#define CLASS_CREATE(name)	class_create((name))
> +#endif
> +
> +/* procfs */
> +#if KERNEL_VERSION(5, 6, 0) > LINUX_VERSION_CODE
> +#define PROC_FOPS_T	file_operations
> +#define PROC_READ	read
> +#define PROC_WRITE	write
> +#define PROC_IOCTL		FOPS_IOCTL
> +#define PROC_COMPAT_IOCTL	compat_ioctl
> +#define PROC_OPEN	open
> +#define PROC_RELEASE	release
> +#else
> +#define PROC_FOPS_T	proc_ops
> +#define PROC_READ	proc_read
> +#define PROC_WRITE	proc_write
> +#define PROC_IOCTL		proc_ioctl
> +#define PROC_COMPAT_IOCTL	proc_compat_ioctl
> +#define PROC_OPEN	proc_open
> +#define PROC_RELEASE	proc_release
> +#endif

Please prepare the driver properly for the upstream submission. This
means removing compatibility code for older kernel version, adopting to
the new/latest APIs, etc.

Thanks.

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH v3] Input: rename INPUT_PROP_HAPTIC_TOUCHPAD to INPUT_PROP_PRESSUREPAD
From: Dmitry Torokhov @ 2025-11-18  7:38 UTC (permalink / raw)
  To: Peter Hutterer
  Cc: Jonathan Denose, Jiri Kosina, Benjamin Tissoires, Jonathan Corbet,
	Henrik Rydberg, linux-input, linux-kernel, linux-doc,
	Angela Czubak, Sean O'Brien, Randy Dunlap
In-Reply-To: <20251106114534.GA405512@tassie>

On Thu, Nov 06, 2025 at 09:45:34PM +1000, Peter Hutterer wrote:
> And expand it to encompass all pressure pads.
> 
> Definition: "pressure pad" as used here as includes all touchpads that
> use physical pressure to convert to click, without physical hinges. Also
> called haptic touchpads in general parlance, Synaptics calls them
> ForcePads.
> 
> Most (all?) pressure pads are currently advertised as
> INPUT_PROP_BUTTONPAD. The suggestion to identify them as pressure pads
> by defining the resolution on ABS_MT_PRESSURE has been in the docs since
> commit 20ccc8dd38a3 ("Documentation: input: define
> ABS_PRESSURE/ABS_MT_PRESSURE resolution as grams") but few devices
> provide this information.
> 
> In userspace it's thus impossible to determine whether a device is a
> true pressure pad (pressure equals pressure) or a normal clickpad with
> (pressure equals finger size).
> 
> Commit 7075ae4ac9db ("Input: add INPUT_PROP_HAPTIC_TOUCHPAD") introduces
> INPUT_PROP_HAPTIC_TOUCHPAD but restricted it to those touchpads that
> have support for userspace-controlled effects. Let's expand and rename
> that definition to include all pressure pad touchpads since those that
> do support FF effects can be identified by the presence of the
> FF_HAPTIC bit.
> 
> This means:
> - clickpad: INPUT_PROP_BUTTONPAD
> - pressurepad: INPUT_PROP_BUTTONPAD + INPUT_PROP_PRESSUREPAD
> - pressurepad with configurable haptics:
>   INPUT_PROP_BUTTONPAD + INPUT_PROP_PRESSUREPAD + FF_HAPTIC
> 
> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

Applied, thank you.

-- 
Dmitry

^ permalink raw reply

* Re: [PATCH v2 2/2] HID: multitouch: Toggle touch surface on Elan touchpad on lid event
From: Dmitry Torokhov @ 2025-11-18  7:12 UTC (permalink / raw)
  To: Jonathan Denose
  Cc: Jiri Kosina, Benjamin Tissoires, linux-input, linux-kernel
In-Reply-To: <CAMCVhVMPuoaEzTthmaOBR+YbT3AN2YPKRv3XAw_r4owUvSRCKQ@mail.gmail.com>

On Wed, Nov 12, 2025 at 05:49:53PM -0600, Jonathan Denose wrote:
> Hi Dmitry,
> 
> Thanks for your review.
> 
> On Tue, Nov 11, 2025 at 4:37 PM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > Hi Jonathan,
> >
> > On Tue, Nov 11, 2025 at 09:34:07PM +0000, Jonathan Denose wrote:
> > > Many touchpad modules have a pin which is expected to be connected to the
> > > lid angle sensor in laptops. The pin sends a signal to the touchpad module
> > > about the lid state and each touchpad vendor handles this notification in
> > > their firmware.
> > >
> > > The Elan touchpad with VID 323b does not always have this aforementioned
> > > pin, which then causes interference between the lid and the touchpad when
> > > the lid is closed. This interference causes a few seconds delay before the
> > > touchpad works again, or it causes it to be come completely unresponsive.
> > > To circumvent this hardware issue in software, implement a device quirk
> > > which will allow the hid-multitouch driver to register a notifier_block
> > > to listen for lid switch events. When the lid switch closes, the
> > > touchpad surface will be turned off and when the lid switch opens, the
> > > touchpad surgace will be turned on. This triggers recalibration which
> > > resolves interference issues when the lid is closed.
> > >
> > > Signed-off-by: Jonathan Denose <jdenose@google.com>
> > > ---
> > >  drivers/hid/hid-multitouch.c | 32 +++++++++++++++++++++++++++++++-
> > >  1 file changed, 31 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
> > > index 2879e65cf303b1456311ac06115adda5a78a2600..9a89913c193bc110a0a821a901aebd97892c66bd 100644
> > > --- a/drivers/hid/hid-multitouch.c
> > > +++ b/drivers/hid/hid-multitouch.c
> > > @@ -35,6 +35,7 @@
> > >  #include <linux/device.h>
> > >  #include <linux/hid.h>
> > >  #include <linux/module.h>
> > > +#include <linux/notifier.h>
> > >  #include <linux/slab.h>
> > >  #include <linux/input/mt.h>
> > >  #include <linux/jiffies.h>
> > > @@ -76,6 +77,7 @@ MODULE_LICENSE("GPL");
> > >  #define MT_QUIRK_DISABLE_WAKEUP              BIT(21)
> > >  #define MT_QUIRK_ORIENTATION_INVERT  BIT(22)
> > >  #define MT_QUIRK_APPLE_TOUCHBAR              BIT(23)
> > > +#define MT_QUIRK_REGISTER_LID_NOTIFIER BIT(24)
> > >
> > >  #define MT_INPUTMODE_TOUCHSCREEN     0x02
> > >  #define MT_INPUTMODE_TOUCHPAD                0x03
> > > @@ -183,6 +185,8 @@ struct mt_device {
> > >       struct list_head reports;
> > >  };
> > >
> > > +static struct hid_device *lid_notify_hdev;
> >
> > This should really be per-device.
> 
> Just to be sure I'm following correctly, the initialization of
> lid_notify_hdev should be per-device?

Yes. I believe this is the best practice.

Thanks.

-- 
Dmitry

^ permalink raw reply

* [PATCH] HID: multitouch: add quirks for Lenovo Yoga Book 9i
From: Brian Howard @ 2025-11-18  2:07 UTC (permalink / raw)
  Cc: blhoward2, Andrei Shumailov, Jiri Kosina, Benjamin Tissoires,
	linux-input, linux-kernel

Add required quirks for Lenovo Yoga Book 9i Gen 8 to Gen 10 models, 
including a new quirk providing for custom input device naming and 
dropping erroneous InRange reports.

The Lenovo Yoga Book 9i is a dual-screen laptop, with a single composite
USB device providing both touch and tablet interfaces for both screens.
All inputs report through a single device, differentiated solely by report
numbers. As there is no way for udev to differentiate the inputs based on
USB vendor/product ID or interface numbers, custom naming is required to
match against for downstream configuration. A firmware bug also results
in an erroneous InRange message report (with everything other than X/Y 
as 0) being received after the stylus leaves proximity, blocking later 
touch events. 

Signed-off-by: Brian Howard <blhoward2@gmail.com>
Tested-by: Brian Howard <blhoward2@gmail.com>
Reported-by: Andrei Shumailov <gentoo1993@gmail.com>
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=220386
---
 drivers/hid/hid-ids.h        |  1 +
 drivers/hid/hid-multitouch.c | 73 ++++++++++++++++++++++++++++++++++++
 2 files changed, 74 insertions(+)

diff --git a/drivers/hid/hid-ids.h b/drivers/hid/hid-ids.h
index 0723b4b1c9ec..e896a6310bb2 100644
--- a/drivers/hid/hid-ids.h
+++ b/drivers/hid/hid-ids.h
@@ -833,6 +833,7 @@
 #define USB_DEVICE_ID_LENOVO_X1_TAB3	0x60b5
 #define USB_DEVICE_ID_LENOVO_X12_TAB	0x60fe
 #define USB_DEVICE_ID_LENOVO_X12_TAB2	0x61ae
+#define USB_DEVICE_ID_LENOVO_YOGABOOK9I	0x6161
 #define USB_DEVICE_ID_LENOVO_OPTICAL_USB_MOUSE_600E	0x600e
 #define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_608D	0x608d
 #define USB_DEVICE_ID_LENOVO_PIXART_USB_MOUSE_6019	0x6019
diff --git a/drivers/hid/hid-multitouch.c b/drivers/hid/hid-multitouch.c
index 179dc316b4b5..a828aac59cb2 100644
--- a/drivers/hid/hid-multitouch.c
+++ b/drivers/hid/hid-multitouch.c
@@ -76,6 +76,7 @@ MODULE_LICENSE("GPL");
 #define MT_QUIRK_DISABLE_WAKEUP		BIT(21)
 #define MT_QUIRK_ORIENTATION_INVERT	BIT(22)
 #define MT_QUIRK_APPLE_TOUCHBAR		BIT(23)
+#define MT_QUIRK_YOGABOOK9I		BIT(24)
 
 #define MT_INPUTMODE_TOUCHSCREEN	0x02
 #define MT_INPUTMODE_TOUCHPAD		0x03
@@ -229,6 +230,7 @@ static void mt_post_parse(struct mt_device *td, struct mt_application *app);
 #define MT_CLS_RAZER_BLADE_STEALTH		0x0112
 #define MT_CLS_SMART_TECH			0x0113
 #define MT_CLS_APPLE_TOUCHBAR			0x0114
+#define MT_CLS_YOGABOOK9I			0x0115
 #define MT_CLS_SIS				0x0457
 
 #define MT_DEFAULT_MAXCONTACT	10
@@ -424,6 +426,14 @@ static const struct mt_class mt_classes[] = {
 		.quirks = MT_QUIRK_NOT_SEEN_MEANS_UP |
 			MT_QUIRK_ALWAYS_VALID |
 			MT_QUIRK_CONTACT_CNT_ACCURATE,
+	},
+	{ .name = MT_CLS_YOGABOOK9I,
+		.quirks = MT_QUIRK_ALWAYS_VALID |
+			MT_QUIRK_FORCE_MULTI_INPUT |
+			MT_QUIRK_SEPARATE_APP_REPORT |
+			MT_QUIRK_HOVERING |
+			MT_QUIRK_YOGABOOK9I,
+		.export_all_inputs = true
 	},
 	{ }
 };
@@ -1557,6 +1567,7 @@ static void mt_report(struct hid_device *hid, struct hid_report *report)
 	struct mt_device *td = hid_get_drvdata(hid);
 	struct hid_field *field = report->field[0];
 	struct mt_report_data *rdata;
+	int f, i;
 
 	if (!(hid->claimed & HID_CLAIMED_INPUT))
 		return;
@@ -1565,6 +1576,38 @@ static void mt_report(struct hid_device *hid, struct hid_report *report)
 	if (rdata && rdata->is_mt_collection)
 		return mt_touch_report(hid, rdata);
 
+	/* Lenovo Yoga Book 9i requires consuming and dropping certain bogus reports */
+	if (rdata && rdata->application &&
+		(rdata->application->quirks & MT_QUIRK_YOGABOOK9I)) {
+
+		bool all_zero_report = true;
+
+		for (f = 0; f < report->maxfield && all_zero_report; f++) {
+			struct hid_field *fld = report->field[f];
+
+			for (i = 0; i < fld->report_count; i++) {
+				unsigned int usage = fld->usage[i].hid;
+
+				if (usage == HID_DG_INRANGE ||
+					usage == HID_DG_TIPSWITCH ||
+					usage == HID_DG_BARRELSWITCH ||
+					usage == HID_DG_BARRELSWITCH2 ||
+					usage == HID_DG_CONTACTID ||
+					usage == HID_DG_TILT_X ||
+					usage == HID_DG_TILT_Y) {
+
+					if (fld->value[i] != 0) {
+						all_zero_report = false;
+						break;
+					}
+				}
+			}
+		}
+
+		if (all_zero_report)
+			return;
+	}
+
 	if (field && field->hidinput && field->hidinput->input)
 		input_sync(field->hidinput->input);
 }
@@ -1761,6 +1804,30 @@ static int mt_input_configured(struct hid_device *hdev, struct hid_input *hi)
 		break;
 	}
 
+	/* Lenovo Yoga Book 9i requires custom naming to allow differentiation in udev */
+	if (hi->report && td->mtclass.quirks & MT_QUIRK_YOGABOOK9I) {
+		switch (hi->report->id) {
+		case 48:
+			suffix = "Touchscreen Top";
+			break;
+		case 56:
+			suffix = "Touchscreen Bottom";
+			break;
+		case 20:
+			suffix = "Stylus Top";
+			break;
+		case 40:
+			suffix = "Stylus Bottom";
+			break;
+		case 80:
+			suffix = "Emulated Touchpad";
+			break;
+		default:
+			suffix = "";
+			break;
+		}
+	}
+
 	if (suffix) {
 		hi->input->name = devm_kasprintf(&hdev->dev, GFP_KERNEL,
 						 "%s %s", hdev->name, suffix);
@@ -2266,6 +2333,12 @@ static const struct hid_device_id mt_devices[] = {
 			   USB_VENDOR_ID_LENOVO,
 			   USB_DEVICE_ID_LENOVO_X12_TAB2) },
 
+	/* Lenovo Yoga Book 9i */
+	{ .driver_data = MT_CLS_YOGABOOK9I,
+		HID_DEVICE(BUS_USB, HID_GROUP_MULTITOUCH_WIN_8,
+			   USB_VENDOR_ID_LENOVO,
+			   USB_DEVICE_ID_LENOVO_YOGABOOK9I) },
+
 	/* Logitech devices */
 	{ .driver_data = MT_CLS_NSMU,
 		HID_DEVICE(BUS_BLUETOOTH, HID_GROUP_MULTITOUCH_WIN_8,
-- 
2.49.0


^ permalink raw reply related

* Re: [PATCH] input: touchscreen: Add ilitek touchscreen driver support
From: kernel test robot @ 2025-11-17 21:36 UTC (permalink / raw)
  To: 2724853925, Dmitry Torokhov, Henrik Rydberg
  Cc: oe-kbuild-all, linux-input, linux-kernel, linux-gpio, 2724853925
In-Reply-To: <tencent_995E6FC62EDBC1EED14E6052847F270F6406@qq.com>

Hi,

kernel test robot noticed the following build warnings:

[auto build test WARNING on dtor-input/next]
[also build test WARNING on dtor-input/for-linus linus/master v6.18-rc6 next-20251117]
[If your patch is applied to the wrong git tree, kindly drop us a note.
And when submitting patch, we suggest to use '--base' as documented in
https://git-scm.com/docs/git-format-patch#_base_tree_information]

url:    https://github.com/intel-lab-lkp/linux/commits/2724853925-qq-com/input-touchscreen-Add-ilitek-touchscreen-driver-support/20251116-215220
base:   https://git.kernel.org/pub/scm/linux/kernel/git/dtor/input.git next
patch link:    https://lore.kernel.org/r/tencent_995E6FC62EDBC1EED14E6052847F270F6406%40qq.com
patch subject: [PATCH] input: touchscreen: Add ilitek touchscreen driver support
config: riscv-randconfig-r133-20251118 (https://download.01.org/0day-ci/archive/20251118/202511180542.hR4anHLj-lkp@intel.com/config)
compiler: riscv32-linux-gcc (GCC) 8.5.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251118/202511180542.hR4anHLj-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/202511180542.hR4anHLj-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> drivers/input/touchscreen/ilitek/ilitek_tool.c:93:38: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got char const *buf @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:93:38: sparse:     expected void const [noderef] __user *from
   drivers/input/touchscreen/ilitek/ilitek_tool.c:93:38: sparse:     got char const *buf
>> drivers/input/touchscreen/ilitek/ilitek_tool.c:239:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got unsigned char [usertype] * @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:239:45: sparse:     expected void const [noderef] __user *from
   drivers/input/touchscreen/ilitek/ilitek_tool.c:239:45: sparse:     got unsigned char [usertype] *
>> drivers/input/touchscreen/ilitek/ilitek_tool.c:268:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got unsigned char [usertype] * @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:268:35: sparse:     expected void [noderef] __user *to
   drivers/input/touchscreen/ilitek/ilitek_tool.c:268:35: sparse:     got unsigned char [usertype] *
   drivers/input/touchscreen/ilitek/ilitek_tool.c:279:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got unsigned char [usertype] * @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:279:35: sparse:     expected void [noderef] __user *to
   drivers/input/touchscreen/ilitek/ilitek_tool.c:279:35: sparse:     got unsigned char [usertype] *
   drivers/input/touchscreen/ilitek/ilitek_tool.c:286:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got unsigned char [usertype] * @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:286:35: sparse:     expected void [noderef] __user *to
   drivers/input/touchscreen/ilitek/ilitek_tool.c:286:35: sparse:     got unsigned char [usertype] *
>> drivers/input/touchscreen/ilitek/ilitek_tool.c:307:21: sparse: sparse: incorrect type in initializer (different address spaces) @@     expected void [noderef] __user *__p @@     got signed int [usertype] * @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:307:21: sparse:     expected void [noderef] __user *__p
   drivers/input/touchscreen/ilitek/ilitek_tool.c:307:21: sparse:     got signed int [usertype] *
   drivers/input/touchscreen/ilitek/ilitek_tool.c:312:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got unsigned char [usertype] * @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:312:45: sparse:     expected void const [noderef] __user *from
   drivers/input/touchscreen/ilitek/ilitek_tool.c:312:45: sparse:     got unsigned char [usertype] *
   drivers/input/touchscreen/ilitek/ilitek_tool.c:324:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got unsigned char [usertype] * @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:324:45: sparse:     expected void const [noderef] __user *from
   drivers/input/touchscreen/ilitek/ilitek_tool.c:324:45: sparse:     got unsigned char [usertype] *
   drivers/input/touchscreen/ilitek/ilitek_tool.c:340:45: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got unsigned char [usertype] * @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:340:45: sparse:     expected void const [noderef] __user *from
   drivers/input/touchscreen/ilitek/ilitek_tool.c:340:45: sparse:     got unsigned char [usertype] *
   drivers/input/touchscreen/ilitek/ilitek_tool.c:365:35: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got unsigned char [usertype] * @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:365:35: sparse:     expected void [noderef] __user *to
   drivers/input/touchscreen/ilitek/ilitek_tool.c:365:35: sparse:     got unsigned char [usertype] *
>> drivers/input/touchscreen/ilitek/ilitek_tool.c:416:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got char *buf @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:416:26: sparse:     expected void [noderef] __user *to
   drivers/input/touchscreen/ilitek/ilitek_tool.c:416:26: sparse:     got char *buf
>> drivers/input/touchscreen/ilitek/ilitek_tool.c:444:17: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected int ( *read )( ... ) @@     got int ( * )( ... ) @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:444:17: sparse:     expected int ( *read )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:444:17: sparse:     got int ( * )( ... )
>> drivers/input/touchscreen/ilitek/ilitek_tool.c:445:18: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected int ( *write )( ... ) @@     got int ( * )( ... ) @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:445:18: sparse:     expected int ( *write )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:445:18: sparse:     got int ( * )( ... )
>> drivers/input/touchscreen/ilitek/ilitek_tool.c:457:22: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected int ( *proc_read )( ... ) @@     got int ( * )( ... ) @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:457:22: sparse:     expected int ( *proc_read )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:457:22: sparse:     got int ( * )( ... )
>> drivers/input/touchscreen/ilitek/ilitek_tool.c:458:23: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected int ( *proc_write )( ... ) @@     got int ( * )( ... ) @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:458:23: sparse:     expected int ( *proc_write )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:458:23: sparse:     got int ( * )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:571:37: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got char const *buf @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:571:37: sparse:     expected void const [noderef] __user *from
   drivers/input/touchscreen/ilitek/ilitek_tool.c:571:37: sparse:     got char const *buf
   drivers/input/touchscreen/ilitek/ilitek_tool.c:610:23: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected int ( *proc_write )( ... ) @@     got int ( * )( ... ) @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:610:23: sparse:     expected int ( *proc_write )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:610:23: sparse:     got int ( * )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:622:33: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got char const *buf @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:622:33: sparse:     expected void const [noderef] __user *from
   drivers/input/touchscreen/ilitek/ilitek_tool.c:622:33: sparse:     got char const *buf
   drivers/input/touchscreen/ilitek/ilitek_tool.c:684:23: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected int ( *proc_write )( ... ) @@     got int ( * )( ... ) @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:684:23: sparse:     expected int ( *proc_write )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:684:23: sparse:     got int ( * )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:693:36: sparse: sparse: incorrect type in argument 2 (different address spaces) @@     expected void const [noderef] __user *from @@     got char const *buf @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:693:36: sparse:     expected void const [noderef] __user *from
   drivers/input/touchscreen/ilitek/ilitek_tool.c:693:36: sparse:     got char const *buf
   drivers/input/touchscreen/ilitek/ilitek_tool.c:731:23: sparse: sparse: incorrect type in initializer (incompatible argument 2 (different address spaces)) @@     expected int ( *proc_write )( ... ) @@     got int ( * )( ... ) @@
   drivers/input/touchscreen/ilitek/ilitek_tool.c:731:23: sparse:     expected int ( *proc_write )( ... )
   drivers/input/touchscreen/ilitek/ilitek_tool.c:731:23: sparse:     got int ( * )( ... )
--
>> drivers/input/touchscreen/ilitek/ilitek_main.c:971:5: sparse: sparse: symbol 'event_spacing' was not declared. Should it be static?
>> drivers/input/touchscreen/ilitek/ilitek_main.c:981:15: sparse: sparse: symbol 'start_event_time_jiffies' was not declared. Should it be static?
>> drivers/input/touchscreen/ilitek/ilitek_main.c:1398:31: sparse: sparse: symbol 'update_cb' was not declared. Should it be static?
>> drivers/input/touchscreen/ilitek/ilitek_main.c:2060:27: sparse: sparse: symbol 'dev_cb' was not declared. Should it be static?
--
>> drivers/input/touchscreen/ilitek/ilitek_protocol.c:37:21: sparse: sparse: symbol 'protocol_maps' was not declared. Should it be static?

vim +93 drivers/input/touchscreen/ilitek/ilitek_tool.c

    78	
    79	static ssize_t ilitek_file_write(struct file *filp,
    80					 const char *buf, size_t size, loff_t *f_pos)
    81	{
    82		s32 ret = 0, count = 0;
    83		u8 buffer[512];
    84		u32 *data;
    85		char *token = NULL, *cur = NULL;
    86	
    87		if (size > sizeof(buffer)) {
    88			TP_ERR(NULL, "invalid buf len: %zu > %zu too large\n",
    89				size, sizeof(buffer));
    90			return -EINVAL;
    91		}
    92	
  > 93		ret = copy_from_user(buffer, buf, size);
    94		if (ret < 0) {
    95			TP_ERR(NULL, "copy data from user space, failed");
    96			return -1;
    97		}
    98	
    99		token = cur = buffer;
   100	
   101		data = kcalloc(size, sizeof(u32), GFP_KERNEL);
   102	
   103		while ((token = strsep(&cur, ",")) != NULL) {
   104			//data[count] = str2hex(token);
   105			sscanf(token, "%x", &data[count]);
   106			TP_MSG(NULL, "data[%d] = %x\n", count, data[count]);
   107			count++;
   108		}
   109	
   110		if (buffer[size - 2] == 'I' && (size == 20 || size == 52) && buffer[0] == 0x77 && buffer[1] == 0x77) {
   111	
   112			TP_MSG(NULL, "IOCTL_WRITE CMD = %d\n", buffer[2]);
   113			switch (buffer[2]) {
   114			case 13:
   115				//ilitek_irq_enable();
   116				TP_MSG(NULL, "ilitek_irq_enable. do nothing\n");
   117				break;
   118			case 12:
   119				//ilitek_irq_disable();
   120				TP_MSG(NULL, "ilitek_irq_disable. do nothing\n");
   121				break;
   122			case 19:
   123				ilitek_reset(ts->dev->reset_time);
   124				break;
   125	#ifdef ILITEK_TUNING_MESSAGE
   126			case 21:
   127				TP_MSG(NULL, "ilitek The ilitek_debug_flag = %d.\n", buffer[3]);
   128				if (buffer[3] == 0) {
   129					ilitek_debug_flag = false;
   130				} else if (buffer[3] == 1) {
   131					ilitek_debug_flag = true;
   132				}
   133				break;
   134	#endif
   135			case 15:
   136				if (buffer[3] == 0)
   137					ilitek_irq_disable();
   138				else
   139					ilitek_irq_enable();
   140	
   141				break;
   142			case 16:
   143				ts->operation_protection = buffer[3];
   144				TP_MSG(NULL, "ts->operation_protection = %d\n", ts->operation_protection);
   145				break;
   146			case 18:
   147				ilitek_irq_disable();
   148				mutex_lock(&ts->ilitek_mutex);
   149				ret = ilitek_write(&buffer[3], 33);
   150				mutex_unlock(&ts->ilitek_mutex);
   151				ilitek_irq_enable();
   152				if (ret < 0)
   153					TP_ERR(NULL, "i2c write error, ret %d\n", ret);
   154	
   155				return ret;
   156				break;
   157			default:
   158				return -1;
   159			}
   160		}
   161	
   162		if (buffer[size - 2] == 'W') {
   163			ilitek_irq_disable();
   164			mutex_lock(&ts->ilitek_mutex);
   165			ret = ilitek_write(buffer, size - 2);
   166			mutex_unlock(&ts->ilitek_mutex);
   167			ilitek_irq_enable();
   168			if (ret < 0) {
   169				TP_ERR(NULL, "i2c write error, ret %d\n", ret);
   170				return ret;
   171			}
   172		} else if (!strncmp(buffer, "unhandle_irq", strlen("unhandle_irq"))) {
   173			ts->unhandle_irq = !ts->unhandle_irq;
   174			TP_MSG(NULL, "ts->unhandle_irq = %d.\n", ts->unhandle_irq);
   175		} else if (!strncmp(buffer, "dbg_pkt", strlen("dbg_pkt"))) {
   176			set_log_level(log_level_pkt);
   177			TP_MSG(NULL, "ilitek_log_level_value = %d.\n", log_level_pkt);
   178		} else if (!strncmp(buffer, "dbg_debug", strlen("dbg_debug"))) {
   179			set_log_level(log_level_dbg);
   180			TP_MSG(NULL, "ilitek_log_level_value = %d.\n", log_level_dbg);
   181		} else if (!strncmp(buffer, "dbg_info", strlen("dbg_info"))) {
   182			set_log_level(log_level_msg);
   183			TP_MSG(NULL, "ilitek_log_level_value = %d.\n", log_level_msg);
   184		} else if (!strncmp(buffer, "dbg_err", strlen("dbg_err"))) {
   185			set_log_level(log_level_err);
   186			TP_MSG(NULL, "ilitek_log_level_value = %d.\n", log_level_err);
   187		} else if (!strncmp(buffer, "dbg_num", strlen("dbg_num"))) {
   188			TP_MSG(NULL, "ilitek_log_level_value = %d.\n", tp_log_level);
   189		}
   190	#ifdef ILITEK_TUNING_MESSAGE
   191		else if (!strncmp(buffer, "truning_dbg_flag", strlen("truning_dbg_flag"))) {
   192			ilitek_debug_flag = !ilitek_debug_flag;
   193			TP_MSG(NULL, " %s debug_flag message(%X).\n", ilitek_debug_flag ? "Enabled" : "Disabled", ilitek_debug_flag);
   194		}
   195	#endif
   196		else if (!strncmp(buffer, "irq_status", strlen("irq_status"))) {
   197			TP_MSG(NULL, "gpio_get_value(i2c.irq_gpio) = %d.\n", gpio_get_value(ts->irq_gpio));
   198		} else if (!strncmp(buffer, "enable", strlen("enable"))) {
   199			ilitek_irq_enable();
   200			TP_MSG(NULL, "irq enable\n");
   201		} else if (!strncmp(buffer, "disable", strlen("disable"))) {
   202			ilitek_irq_disable();
   203			TP_MSG(NULL, "irq disable\n");
   204		} else if (!strncmp(buffer, "info", strlen("info"))) {
   205			ilitek_irq_disable();
   206			mutex_lock(&ts->ilitek_mutex);
   207			api_update_ts_info(ts->dev);
   208			mutex_unlock(&ts->ilitek_mutex);
   209			ilitek_irq_enable();
   210		} else if (!strncmp(buffer, "reset", strlen("reset"))) {
   211			ilitek_reset(ts->dev->reset_time);
   212		}
   213	
   214		TP_DBG(NULL, "ilitek return count = %zu\n", size);
   215		kfree(data);
   216		return size;
   217	}
   218	
   219	static FOPS_IOCTL_FUNC(ilitek_file_ioctl, uint32_t cmd, unsigned long arg)
   220	{
   221		static u8 *buffer;
   222		static unsigned long len;
   223		s32 ret = 0;
   224		int tmp;
   225	
   226		buffer = kmalloc(ILITEK_IOCTL_MAX_TRANSFER, GFP_KERNEL);
   227		memset(buffer, 0, ILITEK_IOCTL_MAX_TRANSFER);
   228	
   229		switch (cmd) {
   230		case ILITEK_IOCTL_I2C_WRITE_DATA:
   231		case ILITEK_IOCTL_I2C_WRITE_DATA_COMPAT:
   232			if (len > ILITEK_IOCTL_MAX_TRANSFER) {
   233				TP_ERR(NULL, "invalid write len: %lu > %lu too large\n",
   234					len, ILITEK_IOCTL_MAX_TRANSFER);
   235				ret = -EINVAL;
   236				break;
   237			}
   238	
 > 239			if (copy_from_user(buffer, (u8 *)arg, len)) {
   240				TP_ERR(NULL, "copy data from user space, failed\n");
   241				ret = -EFAULT;
   242				break;
   243			}
   244	
   245			mutex_lock(&ts->ilitek_mutex);
   246			ret = ilitek_write_and_read(buffer, len, 0, NULL, 0);
   247			mutex_unlock(&ts->ilitek_mutex);
   248			if (ret < 0)
   249				TP_ERR(NULL, "i2c write failed, cmd: %x\n", buffer[0]);
   250			break;
   251		case ILITEK_IOCTL_I2C_READ_DATA:
   252		case ILITEK_IOCTL_I2C_READ_DATA_COMPAT:
   253			if (len > ILITEK_IOCTL_MAX_TRANSFER) {
   254				TP_ERR(NULL, "invalid read len: %lu > %lu too large\n",
   255					len, ILITEK_IOCTL_MAX_TRANSFER);
   256				ret = -EINVAL;
   257				break;
   258			}
   259	
   260			mutex_lock(&ts->ilitek_mutex);
   261			ret = ilitek_write_and_read(NULL, 0, 0, buffer, len);
   262			mutex_unlock(&ts->ilitek_mutex);
   263			if (ret < 0) {
   264				TP_ERR(NULL, "i2c read failed, buf: %x\n", buffer[0]);
   265				break;
   266			}
   267	
 > 268			if (copy_to_user((u8 *)arg, buffer, len)) {
   269				ret = -EFAULT;
   270				TP_ERR(NULL, "copy data to user space, failed\n");
   271			}
   272			break;
   273		case ILITEK_IOCTL_I2C_WRITE_LENGTH:
   274		case ILITEK_IOCTL_I2C_READ_LENGTH:
   275			len = arg;
   276			break;
   277		case ILITEK_IOCTL_DRIVER_INFORMATION:
   278			memcpy(buffer, driver_ver, 7);
   279			if (copy_to_user((u8 *)arg, buffer, 7))
   280				ret = -EFAULT;
   281			break;
   282		case ILITEK_IOCTL_I2C_UPDATE:
   283			break;
   284		case ILITEK_IOCTL_I2C_INT_FLAG:
   285			buffer[0] = !(gpio_get_value(ts->irq_gpio));
   286			if (copy_to_user((u8 *)arg, buffer, 1)) {
   287				TP_ERR(NULL, "copy data to user space, failed\n");
   288				ret = -EFAULT;
   289				break;
   290			}
   291			TP_DBG(NULL, "ILITEK_IOCTL_I2C_INT_FLAG = %d.\n", buffer[0]);
   292			break;
   293		case ILITEK_IOCTL_START_READ_DATA:
   294			ilitek_irq_enable();
   295			ts->unhandle_irq = false;
   296			TP_MSG(NULL, "enable_irq and ts->unhandle_irq = false.\n");
   297			break;
   298		case ILITEK_IOCTL_STOP_READ_DATA:
   299			ilitek_irq_disable();
   300			ts->unhandle_irq = true;
   301			TP_MSG(NULL, "disable_irq and ts->unhandle_irq = true.\n");
   302			break;
   303		case ILITEK_IOCTL_RESET:
   304			ilitek_reset(ts->dev->reset_time);
   305			break;
   306		case ILITEK_IOCTL_INT_STATUS:
   307			if (put_user(gpio_get_value(ts->irq_gpio), (s32 *)arg))
   308				ret = -EFAULT;
   309			break;
   310	#ifdef ILITEK_TUNING_MESSAGE
   311		case ILITEK_IOCTL_DEBUG_SWITCH:
   312			if (copy_from_user(buffer, (u8 *)arg, 1)) {
   313				ret = -EFAULT;
   314				break;
   315			}
   316			TP_MSG(NULL, "ilitek The debug_flag = %d.\n", buffer[0]);
   317			if (buffer[0] == 0)
   318				ilitek_debug_flag = false;
   319			else if (buffer[0] == 1)
   320				ilitek_debug_flag = true;
   321			break;
   322	#endif
   323		case ILITEK_IOCTL_I2C_SWITCH_IRQ:
   324			if (copy_from_user(buffer, (u8 *)arg, 1)) {
   325				ret = -EFAULT;
   326				break;
   327			}
   328	
   329			if (buffer[0] == 0)
   330				ilitek_irq_disable();
   331			else
   332				ilitek_irq_enable();
   333	
   334			break;
   335		case ILITEK_IOCTL_UPDATE_FLAG:
   336			ts->operation_protection = arg;
   337			TP_MSG(NULL, "operation_protection = %d\n", ts->operation_protection);
   338			break;
   339		case ILITEK_IOCTL_I2C_UPDATE_FW:
   340			if (copy_from_user(buffer, (u8 *)arg, 35)) {
   341				TP_ERR(NULL, "copy data from user space, failed\n");
   342				ret = -EFAULT;
   343				break;
   344			}
   345	
   346			ilitek_irq_disable();
   347			mutex_lock(&ts->ilitek_mutex);
   348			ret = ilitek_write_and_read(buffer, buffer[34], 0, NULL, 0);
   349			mutex_unlock(&ts->ilitek_mutex);
   350			ilitek_irq_enable();
   351	
   352			if (ret < 0)
   353				TP_ERR(NULL, "i2c write, failed\n");
   354	
   355			break;
   356		case ILITEK_IOCTL_I2C_INT_CLR:
   357			TP_DBG(NULL, "ILITEK_IOCTL_I2C_INT_CLR, set get_INT false\n");
   358			atomic_set(&ts->get_INT, 0);
   359			break;
   360		case ILITEK_IOCTL_I2C_INT_POLL:
   361		case ILITEK_IOCTL_I2C_INT_POLL_COMPAT:
   362			tmp = atomic_read(&ts->get_INT);
   363			TP_DBG(NULL, "ILITEK_IOCTL_I2C_INT_POLL, get_INT: %d\n", tmp);
   364	
   365			if (copy_to_user((u8 *)arg, &tmp, 1)) {
   366				TP_ERR(NULL, "copy data to user space, failed\n");
   367				ret = -EFAULT;
   368			}
   369			break;
   370		case ILITEK_IOCTL_I2C_ISR_TYPE:
   371			TP_MSG(NULL, "ILITEK_IOCTL_I2C_ISR_TYPE, set ISR type: %lu\n", arg);
   372			ts->irq_handle_type = (arg >> 16);
   373			ts->irq_read_len = arg & 0xFFFF;
   374			break;
   375		case ILITEK_IOCTL_I2C_NETLINK:
   376			TP_MSG(NULL, "ILITEK_IOCTL_I2C_NETLINK, set netlink: %s with ETH: %hhu\n",
   377				(arg >> 8) ? "ON" : "OFF", (u8)(arg & 0xFF));
   378	
   379			if (arg >> 8)
   380				ret = ilitek_netlink_init(arg & 0xFF);
   381			else
   382				ilitek_netlink_exit();
   383	
   384			break;
   385		default:
   386			TP_ERR(NULL, "unrecognized ioctl cmd: 0x%04x\n", cmd);
   387			ret = -EINVAL;
   388			break;
   389		}
   390	
   391		kfree(buffer);
   392		return (ret < 0) ? ret : 0;
   393	}
   394	

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply

* Re: [BUG] Side buttons not detected on Telink 2.4G mouse (ID 320f:226f)
From: Terry Junge @ 2025-11-17 21:34 UTC (permalink / raw)
  To: Artem; +Cc: linux-input@vger.kernel.org
In-Reply-To: <CADYkRmoNpF03Mk7fGgT48pS0daW=h79-87yURqrkgOwxZXjgnw@mail.gmail.com>

On 11/15/2025 7:33 AM, Artem wrote:
> Hello Terry, sorry for the wait.
> 
> Yes, I am happy to test the patch once it is ready.
> 
> I also discovered that the side buttons work correctly when the mouse
> is connected directly via a USB-C cable (wired). The issue is
> definitely specific to the wireless receiver.
> 
> You asked for the Configuration, Device, and Report Descriptors. Sorry
> if something is wrong, I'm not an advanced user, but I believe this is
> what you asked for. The lsusb command should provide the Device and
> Configuration descriptors, but fails to get the Report Descriptors. so
> I used usbhid-dump to get the raw Report Descriptors.

Perfect, thanks...

As I suspected the Report Descriptor declares 5 buttons
but only declares 3 usages.

> 
> 007:002:000:DESCRIPTOR         1763220717.146252

05 01 Desktop Page
09 06 Keyboard Usage
A1 01 Application Collection
85 06 Report ID 6
05 07 Keyboard/Keypad Page
19 E0 Usage Min Keyboard Left Control
29 E7 Usage Max Keyboard Right GUI
15 00 Logical Min 0
25 01 Logical Max 1
75 01 Report Size 1
95 08 Report Count 8
81 02 Input
95 06 Report Count 6
75 08 Report Size 8
15 00 Logical Min 0
26 FF 00 Logical Max 255
05 07 Keyboard/Keypad Page
19 00 Usage Min 0
2A 65 00 Usage Max Keyboard Application
81 00 Input
C0 End Collection
05 01 Desktop Page
09 02 Mouse Usage
A1 01 Application Collection
85 01 Report ID 1
09 01 Usage Pointer
A1 00 Physical Collection
05 09 Button Page
19 01 Usage Min Button 1
29 03 Usage Max Button 3 -- only 3 usages - change to 5
15 00 Logical Min 0
25 01 Logical Max 1
75 01 Report Size 1
95 05 Report Count 5 -- 5 buttons
81 02 Input
75 03 Report Size 3
95 01 Report Count 1
81 01 Input
05 01 Desktop Page
09 30 Usage X
09 31 Usage Y
16 01 80 Logical Min -32767
26 FF 7F Logical Max 32767
75 10 Report Size 16
95 02 Report Count 2
81 06 Input
09 38 Usage Wheel
15 81 Logical Min -127
25 7F Logical Max 127
75 08 Report Size 8
95 01 Report Count 1
81 06 Input
05 0C Consumer Page
0A 38 02 Usage AC Pan
15 81 Logical Min -127
25 7F Logical Max 127
75 08 Report Size 8
95 01 Report Count 1
81 06 Input
C0 End Collection
C0 End Collection
05 0C Consumer Page
09 01 Usage Consumer Control
A1 01 Application Collection
85 02 Report ID 2
75 10 Report Size 16
95 01 Report Count 1
15 01 Logical Min 1
26 8C 02 Logical Max 0x28c
19 01 Usage Min Consumer Control
2A 8C 02 Usage Max AC Send
81 00 Input
C0 End Collection
05 01 Desktop Page
09 80 System Control Usage
A1 01 Application Collection
85 03 Report ID 3
09 82 Usage System Sleep
09 83 Usage System Wake Up
09 81 Usage System Power Down
15 00 Logical Min 0
25 01 Logical Max 1
19 01 Usage Min 1
29 03 Usage Max 3
75 01 Report Size 1
95 03 Report Count 3
81 02 Input
95 05 Report Count 5
81 01 Input
C0 End Collection
06 00 FF Vendor Page 0xff00
09 00 Usage 0
A1 01 Application Collection
85 05 Report ID 5
09 00 Usage 0
15 00 Logical Min 0
26 FF 00 Logical Max 255
75 08 Report Size 8
95 07 Report Count 7
81 02 Input
09 01 Usage 1
91 02 Output
09 02 Usage 2
B1 02 Feature
C0 End Collection
06 01 FF Vendor Page 0xff01
09 00 Usage 0
A1 01 Application Collection
85 04 Report ID 4
09 01 Usage 1
15 00 Logical Min 0
26 FF 00 Logical Max 255
75 08 Report Size 8
95 07 Report Count 7
B1 02 Feature
C0 End Collection

> 
> I believe this is all the information you requested. Please let me
> know if there's anything else I can do.
> 

I'll send out a patch in the next day or two.
If you could test it and let me know how it goes, it would be great.

Thanks,
Terry

> Best regards,
> Btema2

^ permalink raw reply

* Re: [PATCH v3 02/11] dt-bindings: display: panel: ronbo,rb070d30: panel-common ref
From: Conor Dooley @ 2025-11-17 19:24 UTC (permalink / raw)
  To: Josua Mayer
  Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Neil Armstrong, Jessica Zhang, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Dmitry Torokhov, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Laurent Pinchart, Lad Prabhakar, Thierry Reding,
	Jon Nettleton, Mikhail Anikin, Yazan Shhady, devicetree,
	linux-kernel, dri-devel, linux-input, imx, linux-arm-kernel
In-Reply-To: <20251117-imx8mp-hb-iiot-v3-2-bf1a4cf5fa8e@solid-run.com>

[-- Attachment #1: Type: text/plain, Size: 2221 bytes --]

On Mon, Nov 17, 2025 at 01:28:44PM +0100, Josua Mayer wrote:
> Add missing ref on panel-common.yaml for this dsi panel so that common
> properties can be shared.
> 
> Drop reset-gpios and backlight as they are already in panel-common.
> 
> Switch from additionalProperties to unevaluatedProperties so that common
> panel properties are available without repeating them in this binding.
> 
> Notably panel-common defines the "port" property for linking panels to a
> source - which was missing from this panel. Mark it as required.
> 
> Signed-off-by: Josua Mayer <josua@solid-run.com>

Forgot my tag I think.
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable

> ---
>  .../devicetree/bindings/display/panel/ronbo,rb070d30.yaml  | 14 +++++---------
>  1 file changed, 5 insertions(+), 9 deletions(-)
> 
> diff --git a/Documentation/devicetree/bindings/display/panel/ronbo,rb070d30.yaml b/Documentation/devicetree/bindings/display/panel/ronbo,rb070d30.yaml
> index 04f86e0cbac91..6940373015833 100644
> --- a/Documentation/devicetree/bindings/display/panel/ronbo,rb070d30.yaml
> +++ b/Documentation/devicetree/bindings/display/panel/ronbo,rb070d30.yaml
> @@ -9,6 +9,9 @@ title: Ronbo RB070D30 DSI Display Panel
>  maintainers:
>    - Maxime Ripard <mripard@kernel.org>
>  
> +allOf:
> +  - $ref: panel-common.yaml#
> +
>  properties:
>    compatible:
>      const: ronbo,rb070d30
> @@ -20,10 +23,6 @@ properties:
>      description: GPIO used for the power pin
>      maxItems: 1
>  
> -  reset-gpios:
> -    description: GPIO used for the reset pin
> -    maxItems: 1
> -
>    shlr-gpios:
>      description: GPIO used for the shlr pin (horizontal flip)
>      maxItems: 1
> @@ -35,10 +34,6 @@ properties:
>    vcc-lcd-supply:
>      description: Power regulator
>  
> -  backlight:
> -    description: Backlight used by the panel
> -    $ref: /schemas/types.yaml#/definitions/phandle
> -
>  required:
>    - compatible
>    - power-gpios
> @@ -47,5 +42,6 @@ required:
>    - shlr-gpios
>    - updn-gpios
>    - vcc-lcd-supply
> +  - port
>  
> -additionalProperties: false
> +unevaluatedProperties: false
> 
> -- 
> 2.51.0
> 

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]

^ permalink raw reply

* Re: [PATCH v5 06/11] hwmon: Add Apple Silicon SMC hwmon driver
From: Guenter Roeck @ 2025-11-17 19:00 UTC (permalink / raw)
  To: James Calligeros
  Cc: Sven Peter, Janne Grunau, Alyssa Rosenzweig, Neal Gompa,
	Lee Jones, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Alexandre Belloni, Jean Delvare, Dmitry Torokhov, Jonathan Corbet,
	asahi, linux-arm-kernel, devicetree, linux-kernel, linux-rtc,
	linux-hwmon, linux-input, linux-doc
In-Reply-To: <20251112-macsmc-subdevs-v5-6-728e4b91fe81@gmail.com>

On Wed, Nov 12, 2025 at 09:16:52PM +1000, James Calligeros wrote:
> The System Management Controller on Apple Silicon devices is responsible
> for integrating and exposing the data reported by the vast array of
> hardware monitoring sensors present on these devices. It is also
> responsible for fan control, and allows users to manually set fan
> speeds if they so desire. Add a hwmon driver to expose current,
> power, temperature, and voltage monitoring sensors, as well as
> fan speed monitoring and control via the SMC on Apple Silicon devices.
> 
> The SMC firmware has no consistency between devices, even when they
> share an SoC. The FourCC keys used to access sensors are almost
> random. An M1 Mac mini will have different FourCCs for its CPU core
> temperature sensors to an M1 MacBook Pro, for example. For this
> reason, the valid sensors for a given device are specified in a
> child of the SMC Devicetree node. The driver uses this information
> to determine which sensors to make available at runtime.
> 
> Reviewed-by: Neal Gompa <neal@gompa.dev>
> Acked-by: Guenter Roeck <linux@roeck-us.net>
> Co-developed-by: Janne Grunau <j@jannau.net>
> Signed-off-by: Janne Grunau <j@jannau.net>
> Signed-off-by: James Calligeros <jcalligeros99@gmail.com>

Applied to hwmon-next.

Note that I can not apply the devicetree patch (2/11), presumably since it depends
on the first patch of the series.

Guenter

^ permalink raw reply

* Re: [PATCH v6 2/2] HID: i2c-hid: Add FocalTech FT8112
From: Doug Anderson @ 2025-11-17 16:17 UTC (permalink / raw)
  To: daniel_peng
  Cc: Dmitry Torokhov, linux-input, LKML, Benjamin Tissoires,
	Jiri Kosina, Pin-yen Lin
In-Reply-To: <20251117094041.300083-2-Daniel_Peng@pegatron.corp-partner.google.com>

Hi,

On Mon, Nov 17, 2025 at 1:40 AM
<daniel_peng@pegatron.corp-partner.google.com> wrote:
>
> From: Daniel Peng <Daniel_Peng@pegatron.corp-partner.google.com>
>
> Information for touchscreen model HKO/RB116AS01-2 as below:
> - HID :FTSC1000
> - slave address:0X38
> - Interface:HID over I2C
> - Touch control lC:FT8112
> - I2C ID: PNP0C50
>
> Signed-off-by: Daniel Peng <Daniel_Peng@pegatron.corp-partner.google.com>
> ---
>
> Changes in v6:
> - No changed with the v5 due to relation chain.
>
>  drivers/hid/i2c-hid/i2c-hid-of-elan.c | 8 ++++++++
>  1 file changed, 8 insertions(+)

There are no differences between this patch and previous versions that
I gave my Reviewed-by on. You should be carrying my Reviewed-by: tag
so I don't need to keep replying. In any case:

Reviewed-by: Douglas Anderson <dianders@chromium.org>

-Doug

^ permalink raw reply

* Re: [PATCH v6 1/2] dt-bindings: input: i2c-hid: Introduce FocalTech FT8112
From: Rob Herring (Arm) @ 2025-11-17 15:46 UTC (permalink / raw)
  To: daniel_peng
  Cc: LKML, linux-input, Daniel Peng, Conor Dooley, Dmitry Torokhov,
	Krzysztof Kozlowski, devicetree
In-Reply-To: <20251117094041.300083-1-Daniel_Peng@pegatron.corp-partner.google.com>


On Mon, 17 Nov 2025 17:40:40 +0800, daniel_peng@pegatron.corp-partner.google.com wrote:
> From: Daniel Peng <Daniel_Peng@pegatron.corp-partner.google.com>
> 
> Create new binding file for the FocalTech FT8112 due to
> new touchscreen chip. Confirm its compatible, reg for the
> device via vendor, and set the interrupt and reset gpio
> to map for Skywalker platform.
> FocalTech FT8112 also uses vcc33/vccio power supply.
> 
> Signed-off-by: Daniel Peng <Daniel_Peng@pegatron.corp-partner.google.com>
> ---
> 
> Changes in v6:
> - Remove the commit description for the incorrect section.
> 
>  .../bindings/input/focaltech,ft8112.yaml      | 66 +++++++++++++++++++
>  1 file changed, 66 insertions(+)
>  create mode 100644 Documentation/devicetree/bindings/input/focaltech,ft8112.yaml
> 

Reviewed-by: Rob Herring (Arm) <robh@kernel.org>


^ permalink raw reply

* Re: [PATCH] HID: playstation: Add missing check for input_ff_create_memless
From: Markus Elfring @ 2025-11-17 14:37 UTC (permalink / raw)
  To: vulab, linux-input
  Cc: LKML, Benjamin Tissoires, Jiri Kosina, Roderick Colenbrander
In-Reply-To: <20251117082808.1492-1-vulab@iscas.ac.cn>

> The ps_gamepad_create() function calls input_ff_create_memless()
> without verifying its return value,  which can lead to incorrect
> behavior or potential crashes when FF effects are triggered.

You may occasionally put more than 64 characters into text lines
of such a change description.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/Documentation/process/submitting-patches.rst?h=v6.18-rc5#n658


> Add a check for the return value of input_ff_create_memless().

Would it be helpful to append parentheses also to the function name
in the summary phrase?

Regards,
Markus

^ permalink raw reply

* [PATCH v3 11/11] arm64: dts: add description for solidrun i.mx8mm som and evb
From: Josua Mayer @ 2025-11-17 12:28 UTC (permalink / raw)
  To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Shawn Guo,
	Neil Armstrong, Jessica Zhang, David Airlie, Simona Vetter,
	Maarten Lankhorst, Maxime Ripard, Thomas Zimmermann,
	Dmitry Torokhov, Sascha Hauer, Pengutronix Kernel Team,
	Fabio Estevam, Laurent Pinchart, Lad Prabhakar, Thierry Reding
  Cc: Jon Nettleton, Mikhail Anikin, Yazan Shhady, devicetree,
	linux-kernel, dri-devel, linux-input, imx, linux-arm-kernel,
	Josua Mayer
In-Reply-To: <20251117-imx8mp-hb-iiot-v3-0-bf1a4cf5fa8e@solid-run.com>

Add description for the SolidRun i.MX8M Mini SoM on HummingBoard Ripple.

The SoM features:
- 1Gbps Ethernet with PHY
- eMMC
- 1/2GB DDR
- NPU (assembly option)
- WiFi + Bluetooth

The HummingBoard Ripple features:
- 2x USB-2.0 Type-A connector
- 1Gbps RJ45 Ethernet with PoE
- microSD connector
- microHDMI connector
- mpcie connector with USB-2.0 interface + SIM card holder
- microUSB connector for console (using fdtdi chip)
- RTC with backup battery

Signed-off-by: Josua Mayer <josua@solid-run.com>
---
 arch/arm64/boot/dts/freescale/Makefile             |   2 +
 .../dts/freescale/imx8mm-hummingboard-ripple.dts   | 335 +++++++++++++++++
 arch/arm64/boot/dts/freescale/imx8mm-sr-som.dtsi   | 395 +++++++++++++++++++++
 3 files changed, 732 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/Makefile b/arch/arm64/boot/dts/freescale/Makefile
index c56137097da3b..3fbc8a1a1bf6e 100644
--- a/arch/arm64/boot/dts/freescale/Makefile
+++ b/arch/arm64/boot/dts/freescale/Makefile
@@ -124,6 +124,8 @@ imx8mm-evk-pcie-ep-dtbs += imx8mm-evk.dtb imx-pcie0-ep.dtbo
 imx8mm-evkb-pcie-ep-dtbs += imx8mm-evkb.dtb imx-pcie0-ep.dtbo
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-evk-pcie-ep.dtb imx8mm-evkb-pcie-ep.dtb
 
+dtb-$(CONFIG_ARCH_MXC) += imx8mm-hummingboard-ripple.dtb
+DTC_FLAGS_imx8mm-hummingboard-ripple += -@
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-icore-mx8mm-ctouch2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-icore-mx8mm-edimm2.2.dtb
 dtb-$(CONFIG_ARCH_MXC) += imx8mm-iot-gateway.dtb
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-hummingboard-ripple.dts b/arch/arm64/boot/dts/freescale/imx8mm-hummingboard-ripple.dts
new file mode 100644
index 0000000000000..110e7ff1ff135
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/imx8mm-hummingboard-ripple.dts
@@ -0,0 +1,335 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2025 Josua Mayer <josua@solid-run.com>
+ */
+
+/dts-v1/;
+
+#include <dt-bindings/leds/common.h>
+
+#include "imx8mm-sr-som.dtsi"
+
+/ {
+	model = "SolidRun i.MX8MM HummingBoard Ripple";
+	compatible = "solidrun,imx8mm-hummingboard-ripple",
+		     "solidrun,imx8mm-sr-som", "fsl,imx8mm";
+
+	aliases {
+		rtc0 = &carrier_rtc;
+		rtc1 = &snvs_rtc;
+	};
+
+	hdmi-connector {
+		compatible = "hdmi-connector";
+		label = "hdmi";
+		type = "c";
+
+		port {
+			hdmi_connector_in: endpoint {
+				remote-endpoint = <&adv7535_out>;
+			};
+		};
+	};
+
+	leds {
+		compatible = "gpio-leds";
+		pinctrl-names = "default";
+		pinctrl-0 = <&led_pins>;
+
+		led-0 {
+			label = "D30";
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio5 29 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		led-1 {
+			label = "D31";
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio5 9 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		led-2 {
+			label = "D32";
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio5 8 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		led-3 {
+			label = "D33";
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio5 7 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+
+		led-4 {
+			label = "D34";
+			color = <LED_COLOR_ID_GREEN>;
+			gpios = <&gpio5 6 GPIO_ACTIVE_LOW>;
+			default-state = "on";
+		};
+	};
+
+	rfkill-mpcie-wifi {
+		compatible = "rfkill-gpio";
+		pinctrl-names = "default";
+		pinctrl-0 = <&pcie_rfkill_pins>;
+		label = "mpcie WiFi";
+		radio-type = "wlan";
+		/* rfkill-gpio inverts internally */
+		shutdown-gpios = <&gpio2 20 GPIO_ACTIVE_HIGH>;
+	};
+
+	vmmc: regulator-mmc {
+		compatible = "regulator-fixed";
+		pinctrl-names = "default";
+		pinctrl-0 = <&vmmc_pins>;
+		regulator-name = "vmmc";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+		gpio = <&gpio2 19 GPIO_ACTIVE_LOW>;
+		startup-delay-us = <250>;
+	};
+
+	vbus1: regulator-vbus-1 {
+		compatible = "regulator-fixed";
+		regulator-name = "vbus1";
+		gpio = <&gpio2 11 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		pinctrl-names = "default";
+		pinctrl-0 = <&vbus1_pins>;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+	};
+
+	vbus2: regulator-vbus-2 {
+		compatible = "regulator-fixed";
+		regulator-name = "vbus2";
+		gpio = <&gpio4 21 GPIO_ACTIVE_HIGH>;
+		enable-active-high;
+		pinctrl-names = "default";
+		pinctrl-0 = <&vbus2_pins>;
+		regulator-min-microvolt = <5000000>;
+		regulator-max-microvolt = <5000000>;
+	};
+
+	v_1_2: regulator-1-2 {
+		compatible = "regulator-fixed";
+		regulator-name = "1v2";
+		regulator-min-microvolt = <1200000>;
+		regulator-max-microvolt = <1200000>;
+	};
+};
+
+&i2c3 {
+	clock-frequency = <100000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c3_pins>;
+	status = "okay";
+
+	carrier_rtc: rtc@69 {
+		compatible = "abracon,ab1805";
+		reg = <0x69>;
+		abracon,tc-diode = "schottky";
+		abracon,tc-resistor = <3>;
+	};
+
+	carrier_eeprom: eeprom@57{
+		compatible = "st,24c02", "atmel,24c02";
+		reg = <0x57>;
+		pagesize = <16>;
+	};
+
+	hdmi@3d {
+		compatible = "adi,adv7535";
+		reg = <0x3d>, <0x3f>, <0x3c>, <0x38>;
+		reg-names = "main", "edid", "cec", "packet";
+		adi,dsi-lanes = <4>;
+		avdd-supply = <&v_1_8>;
+		dvdd-supply = <&v_1_8>;
+		pvdd-supply = <&v_1_8>;
+		a2vdd-supply = <&v_1_8>;
+		v3p3-supply = <&v_3_3>;
+		pinctrl-names = "default";
+		pinctrl-0 = <&hdmi_pins>;
+		interrupt-parent = <&gpio1>;
+		interrupts = <7 IRQ_TYPE_EDGE_FALLING>;
+		pd-gpios = <&gpio3 22 GPIO_ACTIVE_LOW>;
+
+		ports {
+			#address-cells = <1>;
+			#size-cells = <0>;
+
+			port@0 {
+				reg = <0>;
+
+				adv7535_from_dsim: endpoint {
+					remote-endpoint = <&mipi_dsi_out>;
+				};
+			};
+
+			port@1 {
+				reg = <1>;
+
+				adv7535_out: endpoint {
+					remote-endpoint = <&hdmi_connector_in>;
+				};
+			};
+		};
+	};
+};
+
+&iomuxc {
+	hdmi_pins: pinctrl-hdmi-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_GPIO1_IO07_GPIO1_IO7	0x0
+			MX8MM_IOMUXC_SAI5_RXD1_GPIO3_IO22	0x0
+		>;
+	};
+
+	i2c3_pins: pinctrl-i2c3-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_I2C3_SCL_I2C3_SCL		0x400001c3
+			MX8MM_IOMUXC_I2C3_SDA_I2C3_SDA		0x400001c3
+		>;
+	};
+
+	led_pins: pinctrl-led-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_UART4_TXD_GPIO5_IO29	0x0
+			MX8MM_IOMUXC_ECSPI1_SS0_GPIO5_IO9	0x0
+			MX8MM_IOMUXC_ECSPI1_MISO_GPIO5_IO8	0x0
+			MX8MM_IOMUXC_ECSPI1_MOSI_GPIO5_IO7	0x0
+			MX8MM_IOMUXC_ECSPI1_SCLK_GPIO5_IO6	0x0
+		>;
+	};
+
+	pcie_rfkill_pins: pinctrl-pcie-rfkill-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SD2_WP_GPIO2_IO20		0x0
+		>;
+	};
+
+	usb_hub_pins: pinctrl-usb-hub-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SAI3_RXD_GPIO4_IO30	0x0
+		>;
+	};
+
+	usdhc2_pins: pinctrl-usdhc2-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK		0x190
+			MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD		0x1d0
+			MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0	0x1d0
+			MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1	0x1d0
+			MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2	0x1d0
+			MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3	0x1d0
+			MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT	0x140
+			MX8MM_IOMUXC_SD2_CD_B_USDHC2_CD_B	0x0
+		>;
+	};
+
+	usdhc2_100mhz_pins: pinctrl-usdhc2-100mhz-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK		0x194
+			MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD		0x1d4
+			MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0	0x1d4
+			MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1	0x1d4
+			MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2	0x1d4
+			MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3	0x1d4
+			MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT	0x140
+			MX8MM_IOMUXC_SD2_CD_B_USDHC2_CD_B	0x0
+		>;
+	};
+
+	usdhc2_200mhz_pins: pinctrl-usdhc2-100mhz-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SD2_CLK_USDHC2_CLK		0x196
+			MX8MM_IOMUXC_SD2_CMD_USDHC2_CMD		0x1d6
+			MX8MM_IOMUXC_SD2_DATA0_USDHC2_DATA0	0x1d6
+			MX8MM_IOMUXC_SD2_DATA1_USDHC2_DATA1	0x1d6
+			MX8MM_IOMUXC_SD2_DATA2_USDHC2_DATA2	0x1d6
+			MX8MM_IOMUXC_SD2_DATA3_USDHC2_DATA3	0x1d6
+			MX8MM_IOMUXC_GPIO1_IO04_USDHC2_VSELECT	0x140
+			MX8MM_IOMUXC_SD2_CD_B_USDHC2_CD_B	0x0
+		>;
+	};
+
+	vbus1_pins: pinctrl-vbus-1-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SD1_STROBE_GPIO2_IO11	0x20
+		>;
+	};
+
+	vbus2_pins: pinctrl-vbus-2-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SAI2_RXFS_GPIO4_IO21	0x20
+		>;
+	};
+
+	vmmc_pins: pinctrl-vmmc-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SD2_RESET_B_GPIO2_IO19	0x41
+		>;
+	};
+};
+
+&lcdif {
+	status = "okay";
+};
+
+&mipi_dsi {
+	samsung,esc-clock-frequency = <10000000>;
+	status = "okay";
+};
+
+&mipi_dsi_out {
+	remote-endpoint = <&adv7535_from_dsim>;
+};
+
+&usbotg1 {
+	dr_mode = "host";
+	vbus-supply = <&vbus2>;
+	status = "okay";
+};
+
+&usbotg2 {
+	status = "okay";
+	dr_mode = "host";
+	vbus-supply = <&vbus1>;
+	#address-cells = <1>;
+	#size-cells = <0>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&usb_hub_pins>;
+
+	hub_2_0: hub@1 {
+		compatible = "usb4b4,6502", "usb4b4,6506";
+		reg = <1>;
+		peer-hub = <&hub_3_0>;
+		reset-gpios = <&gpio4 30 GPIO_ACTIVE_LOW>;
+		vdd-supply = <&v_1_2>;
+		vdd2-supply = <&v_3_3>;
+	};
+
+	/* this device is not visible because host supports 2.0 only */
+	hub_3_0: hub@2 {
+		compatible = "usb4b4,6500", "usb4b4,6504";
+		reg = <2>;
+		peer-hub = <&hub_2_0>;
+		reset-gpios = <&gpio4 30 GPIO_ACTIVE_LOW>;
+		vdd-supply = <&v_1_2>;
+		vdd2-supply = <&v_3_3>;
+	};
+};
+
+&usdhc2 {
+	pinctrl-names = "default", "state_100mhz", "state_200mhz";
+	pinctrl-0 = <&usdhc2_pins>;
+	pinctrl-1 = <&usdhc2_100mhz_pins>;
+	pinctrl-2 = <&usdhc2_200mhz_pins>;
+	vmmc-supply = <&vmmc>;
+	bus-width = <4>;
+	status = "okay";
+};
diff --git a/arch/arm64/boot/dts/freescale/imx8mm-sr-som.dtsi b/arch/arm64/boot/dts/freescale/imx8mm-sr-som.dtsi
new file mode 100644
index 0000000000000..04c16475e64a8
--- /dev/null
+++ b/arch/arm64/boot/dts/freescale/imx8mm-sr-som.dtsi
@@ -0,0 +1,395 @@
+// SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+/*
+ * Copyright 2025 Josua Mayer <josua@solid-run.com>
+ */
+
+#include <dt-bindings/phy/phy-imx8-pcie.h>
+
+#include "imx8mm.dtsi"
+
+/ {
+	model = "SolidRun i.MX8MM SoM";
+	compatible = "solidrun,imx8mm-sr-som", "fsl,imx8mm";
+
+	chosen {
+		bootargs = "earlycon=ec_imx6q,0x30890000,115200";
+		stdout-path = &uart2;
+	};
+
+	memory@40000000 {
+		device_type = "memory";
+		reg = <0x0 0x40000000 0 0x80000000>;
+	};
+
+	usdhc1_pwrseq: usdhc1-pwrseq {
+		compatible = "mmc-pwrseq-simple";
+		reset-gpios = <&gpio2 10 GPIO_ACTIVE_LOW>;
+	};
+
+	v_1_8: regulator-1-8 {
+		compatible = "regulator-fixed";
+		regulator-name = "1v8";
+		regulator-min-microvolt = <1800000>;
+		regulator-max-microvolt = <1800000>;
+	};
+
+	v_3_3: regulator-3-3 {
+		compatible = "regulator-fixed";
+		regulator-name = "3v3";
+		regulator-min-microvolt = <3300000>;
+		regulator-max-microvolt = <3300000>;
+	};
+};
+
+&fec1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&fec1_pins>;
+	phy-mode = "rgmii-id";
+	phy = <&phy0>;
+	fsl,magic-packet;
+	status = "okay";
+
+	mdio {
+		#address-cells = <1>;
+		#size-cells = <0>;
+
+		phy0: ethernet-phy@4 {
+			compatible = "ethernet-phy-ieee802.3-c22";
+			reg = <0x4>;
+			reset-gpios = <&gpio4 22 GPIO_ACTIVE_LOW>;
+			phy-reset-duration = <10>;
+			qca,smarteee-tw-us-1g = <24>;
+			vddio-supply = <&vddio>;
+
+			vddio: vddio-regulator {
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <1800000>;
+			};
+		};
+	};
+};
+
+&i2c1 {
+	clock-frequency = <400000>;
+	pinctrl-names = "default";
+	pinctrl-0 = <&i2c1_pins>;
+	status = "okay";
+
+	som_eeprom: eeprom@50{
+		compatible = "st,24c01", "atmel,24c01";
+		reg = <0x50>;
+		pagesize = <16>;
+	};
+
+	pmic@4b {
+		compatible = "rohm,bd71847";
+		reg = <0x4b>;
+		pinctrl-0 = <&pmic_pins>;
+		pinctrl-names = "default";
+		interrupt-parent = <&gpio1>;
+		interrupts = <3 IRQ_TYPE_LEVEL_LOW>;
+		rohm,reset-snvs-powered;
+
+		#clock-cells = <0>;
+		clocks = <&osc_32k>;
+		clock-output-names = "clk-32k-out";
+
+		regulators {
+			buck1_reg: BUCK1 {
+				regulator-name = "buck1";
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1300000>;
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-ramp-delay = <1250>;
+			};
+
+			buck2_reg: BUCK2 {
+				regulator-name = "buck2";
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1300000>;
+				regulator-boot-on;
+				regulator-always-on;
+				regulator-ramp-delay = <1250>;
+				rohm,dvs-run-voltage = <1000000>;
+				rohm,dvs-idle-voltage = <900000>;
+			};
+
+			buck3_reg: BUCK3 {
+				// BUCK5 in datasheet
+				regulator-name = "buck3";
+				regulator-min-microvolt = <700000>;
+				regulator-max-microvolt = <1350000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			buck4_reg: BUCK4 {
+				// BUCK6 in datasheet
+				regulator-name = "buck4";
+				regulator-min-microvolt = <3000000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			buck5_reg: BUCK5 {
+				// BUCK7 in datasheet
+				regulator-name = "buck5";
+				regulator-min-microvolt = <1605000>;
+				regulator-max-microvolt = <1995000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			buck6_reg: BUCK6 {
+				// BUCK8 in datasheet
+				regulator-name = "buck6";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <1400000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo1_reg: LDO1 {
+				regulator-name = "ldo1";
+				regulator-min-microvolt = <1600000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo2_reg: LDO2 {
+				regulator-name = "ldo2";
+				regulator-min-microvolt = <800000>;
+				regulator-max-microvolt = <900000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo3_reg: LDO3 {
+				regulator-name = "ldo3";
+				regulator-min-microvolt = <1800000>;
+				regulator-max-microvolt = <3300000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo4_reg: LDO4 {
+				regulator-name = "ldo4";
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+
+			ldo6_reg: LDO6 {
+				regulator-name = "ldo6";
+				regulator-min-microvolt = <900000>;
+				regulator-max-microvolt = <1800000>;
+				regulator-boot-on;
+				regulator-always-on;
+			};
+		};
+	};
+};
+
+&iomuxc {
+	fec1_pins: pinctrl-fec1-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_ENET_MDC_ENET1_MDC			0x3
+			MX8MM_IOMUXC_ENET_MDIO_ENET1_MDIO		0x3
+			MX8MM_IOMUXC_ENET_TD3_ENET1_RGMII_TD3		0x1f
+			MX8MM_IOMUXC_ENET_TD2_ENET1_RGMII_TD2		0x1f
+			MX8MM_IOMUXC_ENET_TD1_ENET1_RGMII_TD1		0x1f
+			MX8MM_IOMUXC_ENET_TD0_ENET1_RGMII_TD0		0x1f
+			MX8MM_IOMUXC_ENET_RD3_ENET1_RGMII_RD3		0x91
+			MX8MM_IOMUXC_ENET_RD2_ENET1_RGMII_RD2		0x91
+			MX8MM_IOMUXC_ENET_RD1_ENET1_RGMII_RD1		0x91
+			MX8MM_IOMUXC_ENET_RD0_ENET1_RGMII_RD0		0x91
+			MX8MM_IOMUXC_ENET_TXC_ENET1_RGMII_TXC		0x1f
+			MX8MM_IOMUXC_ENET_RXC_ENET1_RGMII_RXC		0x91
+			MX8MM_IOMUXC_ENET_RX_CTL_ENET1_RGMII_RX_CTL	0x91
+			MX8MM_IOMUXC_ENET_TX_CTL_ENET1_RGMII_TX_CTL	0x1f
+			MX8MM_IOMUXC_SAI2_RXC_GPIO4_IO22		0x19
+		>;
+	};
+
+	i2c1_pins: pinctrl-i2c1-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_I2C1_SCL_I2C1_SCL			0x400001c3
+			MX8MM_IOMUXC_I2C1_SDA_I2C1_SDA			0x400001c3
+		>;
+	};
+
+	pcie_pins: pinctrl-pcie-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_GPIO1_IO15_GPIO1_IO15		0x0
+		>;
+	};
+
+	pmic_pins: pinctrl-pmic-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_GPIO1_IO03_GPIO1_IO3		0x140
+		>;
+	};
+
+	uart1_pins: pinctrl-uart1-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_UART1_RXD_UART1_DCE_RX	0x140
+			MX8MM_IOMUXC_UART1_TXD_UART1_DCE_TX	0x140
+			MX8MM_IOMUXC_UART3_RXD_UART1_DCE_CTS_B	0x140
+			MX8MM_IOMUXC_UART3_TXD_UART1_DCE_RTS_B	0x140
+			/* BT_REG_ON */
+			MX8MM_IOMUXC_SD1_DATA4_GPIO2_IO6	0x0
+			/* BT_WAKE_DEV */
+			MX8MM_IOMUXC_SD1_DATA5_GPIO2_IO7	0x0
+			/* BT_WAKE_HOST */
+			MX8MM_IOMUXC_SD1_DATA6_GPIO2_IO8	0x100
+		>;
+	};
+
+	uart2_pins: pinctrl-uart2-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_UART2_RXD_UART2_DCE_RX		0x140
+			MX8MM_IOMUXC_UART2_TXD_UART2_DCE_TX		0x140
+		>;
+	};
+
+	usdhc1_pins: pinctrl-usdhc1-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_SD1_CLK_USDHC1_CLK			0x190
+			MX8MM_IOMUXC_SD1_CMD_USDHC1_CMD			0x1d0
+			MX8MM_IOMUXC_SD1_DATA0_USDHC1_DATA0		0x1d0
+			MX8MM_IOMUXC_SD1_DATA1_USDHC1_DATA1		0x1d0
+			MX8MM_IOMUXC_SD1_DATA2_USDHC1_DATA2		0x1d0
+			MX8MM_IOMUXC_SD1_DATA3_USDHC1_DATA3		0x1d0
+			/* wifi refclk */
+			MX8MM_IOMUXC_GPIO1_IO00_ANAMIX_REF_CLK_32K	0x0
+			/* WL_REG_ON */
+			MX8MM_IOMUXC_SD1_RESET_B_GPIO2_IO10		0x0
+			/* WL_WAKE_HOST */
+			MX8MM_IOMUXC_SD1_DATA7_GPIO2_IO9		0x100
+		>;
+	};
+
+	usdhc3_pins: pinctrl-usdhc3-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK		0x190
+			MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD		0x1d0
+			MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0		0x1d0
+			MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1		0x1d0
+			MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2		0x1d0
+			MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3		0x1d0
+			MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4		0x1d0
+			MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5		0x1d0
+			MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6		0x1d0
+			MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7		0x1d0
+			MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE		0x190
+		>;
+	};
+
+	usdhc3_100mhz_pins: pinctrl-usdhc3-100mhz-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK		0x194
+			MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD		0x1d4
+			MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0		0x1d4
+			MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1		0x1d4
+			MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2		0x1d4
+			MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3		0x1d4
+			MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4		0x1d4
+			MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5		0x1d4
+			MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6		0x1d4
+			MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7		0x1d4
+			MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE		0x194
+		>;
+	};
+
+	usdhc3_200mhz_pins: pinctrl-usdhc3-200mhz-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_NAND_WE_B_USDHC3_CLK		0x196
+			MX8MM_IOMUXC_NAND_WP_B_USDHC3_CMD		0x1d6
+			MX8MM_IOMUXC_NAND_DATA04_USDHC3_DATA0		0x1d6
+			MX8MM_IOMUXC_NAND_DATA05_USDHC3_DATA1		0x1d6
+			MX8MM_IOMUXC_NAND_DATA06_USDHC3_DATA2		0x1d6
+			MX8MM_IOMUXC_NAND_DATA07_USDHC3_DATA3		0x1d6
+			MX8MM_IOMUXC_NAND_RE_B_USDHC3_DATA4		0x1d6
+			MX8MM_IOMUXC_NAND_CE2_B_USDHC3_DATA5		0x1d6
+			MX8MM_IOMUXC_NAND_CE3_B_USDHC3_DATA6		0x1d6
+			MX8MM_IOMUXC_NAND_CLE_USDHC3_DATA7		0x1d6
+			MX8MM_IOMUXC_NAND_CE1_B_USDHC3_STROBE		0x196
+		>;
+	};
+
+	wdog1_pins: pinctrl-wdog1-grp {
+		fsl,pins = <
+			MX8MM_IOMUXC_GPIO1_IO02_WDOG1_WDOG_B	0x140
+		>;
+	};
+};
+
+&pcie_phy {
+	fsl,clkreq-unsupported;
+	fsl,refclk-pad-mode = <IMX8_PCIE_REFCLK_PAD_OUTPUT>;
+	status = "okay";
+};
+
+/* assembly-option for AI accelerator on SoM, otherwise routed to carrier */
+&pcie0 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&pcie_pins>;
+	reset-gpios = <&gpio1 15 (GPIO_ACTIVE_HIGH|GPIO_OPEN_DRAIN)>;
+	status = "okay";
+};
+
+&uart1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart1_pins>;
+	uart-has-rtscts;
+	/* select 80MHz parent clock to support maximum baudrate 4Mbps */
+	assigned-clocks = <&clk IMX8MM_CLK_UART1>;
+	assigned-clock-parents = <&clk IMX8MM_SYS_PLL1_80M>;
+	status = "okay";
+
+	bluetooth {
+		compatible = "brcm,bcm4330-bt";
+		device-wakeup-gpios = <&gpio2 7 GPIO_ACTIVE_HIGH>;
+		host-wakeup-gpios = <&gpio2 8 GPIO_ACTIVE_HIGH>;
+		shutdown-gpios = <&gpio2 6 GPIO_ACTIVE_HIGH>;
+		max-speed = <3000000>;
+	};
+};
+
+&uart2 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&uart2_pins>;
+	status = "okay";
+};
+
+&usdhc1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&usdhc1_pins>;
+	vmmc-supply = <&v_3_3>;
+	vqmmc-supply = <&v_1_8>;
+	bus-width = <4>;
+	mmc-pwrseq = <&usdhc1_pwrseq>;
+	status = "okay";
+};
+
+&usdhc3 {
+	pinctrl-names = "default", "state_100mhz", "state_200mhz";
+	pinctrl-0 = <&usdhc3_pins>;
+	pinctrl-1 = <&usdhc3_100mhz_pins>;
+	pinctrl-2 = <&usdhc3_200mhz_pins>;
+	vmmc-supply = <&v_3_3>;
+	vqmmc-supply = <&v_1_8>;
+	bus-width = <8>;
+	non-removable;
+	status = "okay";
+};
+
+&wdog1 {
+	pinctrl-names = "default";
+	pinctrl-0 = <&wdog1_pins>;
+	status = "okay";
+};

-- 
2.51.0


^ permalink raw reply related


This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox