* [PATCH 3/4] HID: hid-oxp: Add Second Generation Takeover Mode
From: Derek J. Clark @ 2026-03-22 3:16 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: Pierre-Loup A . Griffais, Lambert Fan, Derek J . Clark,
linux-input, linux-doc, linux-kernel
In-Reply-To: <20260322031615.1524307-1-derekjohn.clark@gmail.com>
Adds "takeover_enabled" attribute to second generation OneXPlayer
configuration HID devices. This attribute initiates a mode shift in the
device MCU that puts it into a state where all events are routed to an
hidraw interface instead of the xpad evdev interface. This allows for
debugging the hardware input mapping, and allows some userspace tools to
consume the interface to add support for features that are unable to be
exposed through the evdev, such as treating the M1 and M2 accessory
buttons as unique inputs.
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
---
drivers/hid/hid-oxp.c | 81 +++++++++++++++++++++++++++++++++++++++++++
1 file changed, 81 insertions(+)
diff --git a/drivers/hid/hid-oxp.c b/drivers/hid/hid-oxp.c
index 587e0d57c85f..5fed2799a2ad 100644
--- a/drivers/hid/hid-oxp.c
+++ b/drivers/hid/hid-oxp.c
@@ -32,6 +32,7 @@
enum oxp_function_index {
OXP_FID_GEN1_RGB_SET = 0x07,
OXP_FID_GEN1_RGB_REPLY = 0x0f,
+ OXP_FID_GEN2_TOGGLE_MODE = 0xb2,
OXP_FID_GEN2_RGB_EVENT = 0xb8,
};
@@ -39,12 +40,15 @@ static struct oxp_hid_cfg {
struct led_classdev_mc *led_mc;
struct hid_device *hdev;
struct mutex cfg_mutex; /*ensure single synchronous output report*/
+ u8 takeover_enabled;
u8 rgb_brightness;
u8 rgb_effect;
u8 rgb_speed;
u8 rgb_en;
} drvdata;
+#define OXP_TAKEOVER_ENABLED_TRUE 0x03
+
enum oxp_feature_en_index {
OXP_FEAT_DISABLED,
OXP_FEAT_ENABLED,
@@ -289,6 +293,74 @@ static int oxp_gen_2_property_out(enum oxp_function_index fid, u8 *data,
footer_size);
}
+static ssize_t button_takeover_store(struct device *dev,
+ struct device_attribute *attr, const char *buf,
+ size_t count)
+{
+ u16 up = get_usage_page(drvdata.hdev);
+ u8 data[3] = { 0x00, 0x01, 0x02 };
+ u8 val = 0;
+ int ret;
+
+ if (up != GEN2_USAGE_PAGE)
+ return -EINVAL;
+
+ ret = sysfs_match_string(oxp_feature_en_text, buf);
+ if (ret < 0)
+ return ret;
+ val = ret;
+
+ switch (val) {
+ case OXP_FEAT_DISABLED:
+ break;
+ case OXP_FEAT_ENABLED:
+ data[0] = OXP_TAKEOVER_ENABLED_TRUE;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ ret = oxp_gen_2_property_out(OXP_FID_GEN2_TOGGLE_MODE, data, 3);
+ if (ret)
+ return ret;
+
+ return count;
+}
+
+static ssize_t button_takeover_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ return sysfs_emit(buf, "%s\n", oxp_feature_en_text[drvdata.takeover_enabled]);
+}
+static DEVICE_ATTR_RW(button_takeover);
+
+static ssize_t button_takeover_index_show(struct device *dev,
+ struct device_attribute *attr,
+ char *buf)
+{
+ ssize_t count = 0;
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(oxp_feature_en_text); i++)
+ count += sysfs_emit_at(buf, count, "%s ", oxp_feature_en_text[i]);
+
+ if (count)
+ buf[count - 1] = '\n';
+
+ return count;
+}
+static DEVICE_ATTR_RO(button_takeover_index);
+
+static struct attribute *oxp_cfg_attrs[] = {
+ &dev_attr_button_takeover.attr,
+ &dev_attr_button_takeover_index.attr,
+ NULL,
+};
+
+static const struct attribute_group oxp_cfg_attrs_group = {
+ .attrs = oxp_cfg_attrs,
+};
+
static int oxp_rgb_status_store(u8 enabled, u8 speed, u8 brightness)
{
u16 up = get_usage_page(drvdata.hdev);
@@ -680,6 +752,15 @@ static int oxp_cfg_probe(struct hid_device *hdev, u16 up)
dev_warn(drvdata.led_mc->led_cdev.dev,
"Failed to query RGB initial state: %i\n", ret);
+ /* Below features are only implemented in gen 2 */
+ if (up != GEN2_USAGE_PAGE)
+ return 0;
+
+ ret = devm_device_add_group(&hdev->dev, &oxp_cfg_attrs_group);
+ if (ret)
+ return dev_err_probe(&hdev->dev, ret,
+ "Failed to attach configuration attributes\n");
+
return 0;
}
--
2.53.0
^ permalink raw reply related
* [PATCH 4/4] HID: hid-oxp: Add Button Mapping Interface
From: Derek J. Clark @ 2026-03-22 3:16 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: Pierre-Loup A . Griffais, Lambert Fan, Derek J . Clark,
linux-input, linux-doc, linux-kernel
In-Reply-To: <20260322031615.1524307-1-derekjohn.clark@gmail.com>
Adds button mapping interface for second generation OneXPlayer
configuration HID interfaces. This interface allows the MCU to swap
button mappings at the hardware level. The current state cannot be
retrieved, and the mappings may have been modified in Windows prior, so
we reset the button mapping at init and expose an attribute to allow
userspace to do this again at any time.
The interface requires two pages of button mapping data to be sent
before the settings will take place. Since the MCU requires a 200ms
delay after each message (total 400ms for these attributes) use the same
debounce work queue method we used for RGB. This will allow for
userspace or udev rules to rapidly map all buttons. The values will
be cached before the final write is finally sent to the device.
Signed-off-by: Derek J. Clark <derekjohn.clark@gmail.com>
---
drivers/hid/hid-oxp.c | 510 ++++++++++++++++++++++++++++++++++++++++++
1 file changed, 510 insertions(+)
diff --git a/drivers/hid/hid-oxp.c b/drivers/hid/hid-oxp.c
index 5fed2799a2ad..915c17b97db0 100644
--- a/drivers/hid/hid-oxp.c
+++ b/drivers/hid/hid-oxp.c
@@ -33,10 +33,126 @@ enum oxp_function_index {
OXP_FID_GEN1_RGB_SET = 0x07,
OXP_FID_GEN1_RGB_REPLY = 0x0f,
OXP_FID_GEN2_TOGGLE_MODE = 0xb2,
+ OXP_FID_GEN2_KEY_STATE = 0xb4,
OXP_FID_GEN2_RGB_EVENT = 0xb8,
};
+enum oxp_joybutton_index {
+ BUTTON_A = 0x01,
+ BUTTON_B,
+ BUTTON_X,
+ BUTTON_Y,
+ BUTTON_LB,
+ BUTTON_RB,
+ BUTTON_LT,
+ BUTTON_RT,
+ BUTTON_START,
+ BUTTON_SELECT,
+ BUTTON_L3,
+ BUTTON_R3,
+ BUTTON_DUP,
+ BUTTON_DDOWN,
+ BUTTON_DLEFT,
+ BUTTON_DRIGHT,
+ JOY_L_UP,
+ JOY_L_UP_RIGHT,
+ JOY_L_RIGHT,
+ JOY_L_DOWN_RIGHT,
+ JOY_L_DOWN,
+ JOY_L_DOWN_LEFT,
+ JOY_L_LEFT,
+ JOY_L_UP_LEFT,
+ JOY_R_UP,
+ JOY_R_UP_RIGHT,
+ JOY_R_RIGHT,
+ JOY_R_DOWN_RIGHT,
+ JOY_R_DOWN,
+ JOY_R_DOWN_LEFT,
+ JOY_R_LEFT,
+ JOY_R_UP_LEFT,
+ BUTTON_GUIDE = 0x22,
+};
+
+static const char *const oxp_joybutton_text[] = {
+ [BUTTON_A] = "a",
+ [BUTTON_B] = "b",
+ [BUTTON_X] = "x",
+ [BUTTON_Y] = "y",
+ [BUTTON_LB] = "lb",
+ [BUTTON_RB] = "rb",
+ [BUTTON_LT] = "lt",
+ [BUTTON_RT] = "rt",
+ [BUTTON_START] = "start",
+ [BUTTON_SELECT] = "select",
+ [BUTTON_L3] = "l3",
+ [BUTTON_R3] = "r3",
+ [BUTTON_DUP] = "d_up",
+ [BUTTON_DDOWN] = "d_down",
+ [BUTTON_DLEFT] = "d_left",
+ [BUTTON_DRIGHT] = "d_right",
+ [JOY_L_UP] = "joy_l_up",
+ [JOY_L_UP_RIGHT] = "joy_l_up_right",
+ [JOY_L_RIGHT] = "joy_l_right",
+ [JOY_L_DOWN_RIGHT] = "joy_l_down_right",
+ [JOY_L_DOWN] = "joy_l_down",
+ [JOY_L_DOWN_LEFT] = "joy_l_down_left",
+ [JOY_L_LEFT] = "joy_l_left",
+ [JOY_L_UP_LEFT] = "joy_l_up_left",
+ [JOY_R_UP] = "joy_r_up",
+ [JOY_R_UP_RIGHT] = "joy_r_up_right",
+ [JOY_R_RIGHT] = "joy_r_right",
+ [JOY_R_DOWN_RIGHT] = "joy_r_down_right",
+ [JOY_R_DOWN] = "joy_r_down",
+ [JOY_R_DOWN_LEFT] = "joy_r_down_left",
+ [JOY_R_LEFT] = "joy_r_left",
+ [JOY_R_UP_LEFT] = "joy_r_up_left",
+ [BUTTON_GUIDE] = "guide",
+};
+
+enum oxp_custom_button_index {
+ BUTTON_M1 = 0x22,
+ BUTTON_M2,
+ /* These are unused currently, reserved for future devices */
+ BUTTON_M3,
+ BUTTON_M4,
+ BUTTON_M5,
+ BUTTON_M6,
+};
+
+struct oxp_button {
+ u8 index;
+ u8 mode;
+ u8 mapping;
+ u8 padding[3];
+} __packed;
+
+struct oxp_bmap_page_1 {
+ struct oxp_button btn_a;
+ struct oxp_button btn_b;
+ struct oxp_button btn_x;
+ struct oxp_button btn_y;
+ struct oxp_button btn_lb;
+ struct oxp_button btn_rb;
+ struct oxp_button btn_lt;
+ struct oxp_button btn_rt;
+ struct oxp_button btn_start;
+} __packed;
+
+struct oxp_bmap_page_2 {
+ struct oxp_button btn_select;
+ struct oxp_button btn_l3;
+ struct oxp_button btn_r3;
+ struct oxp_button btn_dup;
+ struct oxp_button btn_ddown;
+ struct oxp_button btn_dleft;
+ struct oxp_button btn_dright;
+ struct oxp_button btn_m1;
+ struct oxp_button btn_m2;
+} __packed;
+
static struct oxp_hid_cfg {
+ struct oxp_bmap_page_1 *bmap_1;
+ struct oxp_bmap_page_2 *bmap_2;
struct led_classdev_mc *led_mc;
struct hid_device *hdev;
struct mutex cfg_mutex; /*ensure single synchronous output report*/
@@ -144,6 +260,10 @@ struct oxp_gen_2_rgb_report {
u8 effect;
} __packed;
+struct oxp_button_attr {
+ u8 index;
+};
+
static u16 get_usage_page(struct hid_device *hdev)
{
return hdev->collection[0].usage >> 16;
@@ -351,9 +471,380 @@ static ssize_t button_takeover_index_show(struct device *dev,
}
static DEVICE_ATTR_RO(button_takeover_index);
+static void oxp_set_defaults_bmap_1(struct oxp_bmap_page_1 *bmap)
+{
+ bmap->btn_a.index = BUTTON_A;
+ bmap->btn_a.mode = 0x01;
+ bmap->btn_a.mapping = BUTTON_A;
+ bmap->btn_b.index = BUTTON_B;
+ bmap->btn_b.mode = 0x01;
+ bmap->btn_b.mapping = BUTTON_B;
+ bmap->btn_x.index = BUTTON_X;
+ bmap->btn_x.mode = 0x01;
+ bmap->btn_x.mapping = BUTTON_X;
+ bmap->btn_y.index = BUTTON_Y;
+ bmap->btn_y.mode = 0x01;
+ bmap->btn_y.mapping = BUTTON_Y;
+ bmap->btn_lb.index = BUTTON_LB;
+ bmap->btn_lb.mode = 0x01;
+ bmap->btn_lb.mapping = BUTTON_LB;
+ bmap->btn_rb.index = BUTTON_RB;
+ bmap->btn_rb.mode = 0x01;
+ bmap->btn_rb.mapping = BUTTON_RB;
+ bmap->btn_lt.index = BUTTON_LT;
+ bmap->btn_lt.mode = 0x01;
+ bmap->btn_lt.mapping = BUTTON_LT;
+ bmap->btn_rt.index = BUTTON_RT;
+ bmap->btn_rt.mode = 0x01;
+ bmap->btn_rt.mapping = BUTTON_RT;
+ bmap->btn_start.index = BUTTON_START;
+ bmap->btn_start.mode = 0x01;
+ bmap->btn_start.mapping = BUTTON_START;
+}
+
+static void oxp_set_defaults_bmap_2(struct oxp_bmap_page_2 *bmap)
+{
+ bmap->btn_select.index = BUTTON_SELECT;
+ bmap->btn_select.mode = 0x01;
+ bmap->btn_select.mapping = BUTTON_SELECT;
+ bmap->btn_l3.index = BUTTON_L3;
+ bmap->btn_l3.mode = 0x01;
+ bmap->btn_l3.mapping = BUTTON_L3;
+ bmap->btn_r3.index = BUTTON_R3;
+ bmap->btn_r3.mode = 0x01;
+ bmap->btn_r3.mapping = BUTTON_R3;
+ bmap->btn_dup.index = BUTTON_DUP;
+ bmap->btn_dup.mode = 0x01;
+ bmap->btn_dup.mapping = BUTTON_DUP;
+ bmap->btn_ddown.index = BUTTON_DDOWN;
+ bmap->btn_ddown.mode = 0x01;
+ bmap->btn_ddown.mapping = BUTTON_DDOWN;
+ bmap->btn_dleft.index = BUTTON_DLEFT;
+ bmap->btn_dleft.mode = 0x01;
+ bmap->btn_dleft.mapping = BUTTON_DLEFT;
+ bmap->btn_dright.index = BUTTON_DRIGHT;
+ bmap->btn_dright.mode = 0x01;
+ bmap->btn_dright.mapping = BUTTON_DRIGHT;
+ bmap->btn_m1.index = BUTTON_M1;
+ bmap->btn_m1.mode = 0x01;
+ bmap->btn_m1.mapping = BUTTON_LT;
+ bmap->btn_m2.index = BUTTON_M2;
+ bmap->btn_m2.mode = 0x01;
+ bmap->btn_m2.mapping = BUTTON_RT;
+}
+
+static int oxp_set_buttons(void)
+{
+ u8 data[59] = { 0x02, 0x00, 0x00, 0x00, 0x01 };
+ u16 up = get_usage_page(drvdata.hdev);
+ int ret;
+
+ if (up != GEN2_USAGE_PAGE)
+ return -EINVAL;
+
+ memcpy(data + 5, drvdata.bmap_1, sizeof(struct oxp_bmap_page_1));
+ ret = oxp_gen_2_property_out(OXP_FID_GEN2_KEY_STATE, data, ARRAY_SIZE(data));
+ if (ret)
+ return ret;
+
+ memcpy(data + 5, drvdata.bmap_2, sizeof(struct oxp_bmap_page_2));
+ return oxp_gen_2_property_out(OXP_FID_GEN2_KEY_STATE, data, ARRAY_SIZE(data));
+}
+
+static int oxp_reset_buttons(void)
+{
+ oxp_set_defaults_bmap_1(drvdata.bmap_1);
+ oxp_set_defaults_bmap_2(drvdata.bmap_2);
+ return oxp_set_buttons();
+}
+
+static ssize_t reset_buttons_store(struct device *dev,
+ struct device_attribute *attr, const char *buf,
+ size_t count)
+{
+ int val, ret;
+
+ ret = kstrtoint(buf, 10, &val);
+ if (ret)
+ return ret;
+
+ if (val != 1)
+ return -EINVAL;
+
+ ret = oxp_reset_buttons();
+ if (ret)
+ return ret;
+
+ return count;
+}
+static DEVICE_ATTR_WO(reset_buttons);
+
+static void oxp_btn_queue_fn(struct work_struct *work)
+{
+ int ret;
+
+ ret = oxp_set_buttons();
+ if (ret)
+ dev_err(&drvdata.hdev->dev,
+ "Error: Failed to write button mapping: %i\n", ret);
+}
+
+static DECLARE_DELAYED_WORK(oxp_btn_queue, oxp_btn_queue_fn);
+
+static ssize_t map_button_store(struct device *dev,
+ struct device_attribute *attr, const char *buf,
+ size_t count, u8 index)
+{
+ int ret;
+ u8 val;
+
+ ret = sysfs_match_string(oxp_joybutton_text, buf);
+ if (ret < 0)
+ return ret;
+
+ val = ret;
+
+ switch (index) {
+ case BUTTON_A:
+ drvdata.bmap_1->btn_a.mapping = val;
+ break;
+ case BUTTON_B:
+ drvdata.bmap_1->btn_b.mapping = val;
+ break;
+ case BUTTON_X:
+ drvdata.bmap_1->btn_x.mapping = val;
+ break;
+ case BUTTON_Y:
+ drvdata.bmap_1->btn_y.mapping = val;
+ break;
+ case BUTTON_LB:
+ drvdata.bmap_1->btn_lb.mapping = val;
+ break;
+ case BUTTON_RB:
+ drvdata.bmap_1->btn_rb.mapping = val;
+ break;
+ case BUTTON_LT:
+ drvdata.bmap_1->btn_lt.mapping = val;
+ break;
+ case BUTTON_RT:
+ drvdata.bmap_1->btn_rt.mapping = val;
+ break;
+ case BUTTON_START:
+ drvdata.bmap_1->btn_start.mapping = val;
+ break;
+ case BUTTON_SELECT:
+ drvdata.bmap_2->btn_select.mapping = val;
+ break;
+ case BUTTON_L3:
+ drvdata.bmap_2->btn_l3.mapping = val;
+ break;
+ case BUTTON_R3:
+ drvdata.bmap_2->btn_r3.mapping = val;
+ break;
+ case BUTTON_DUP:
+ drvdata.bmap_2->btn_dup.mapping = val;
+ break;
+ case BUTTON_DDOWN:
+ drvdata.bmap_2->btn_ddown.mapping = val;
+ break;
+ case BUTTON_DLEFT:
+ drvdata.bmap_2->btn_dleft.mapping = val;
+ break;
+ case BUTTON_DRIGHT:
+ drvdata.bmap_2->btn_dright.mapping = val;
+ break;
+ case BUTTON_M1:
+ drvdata.bmap_2->btn_m1.mapping = val;
+ break;
+ case BUTTON_M2:
+ drvdata.bmap_2->btn_m2.mapping = val;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ mod_delayed_work(system_wq, &oxp_btn_queue, msecs_to_jiffies(50));
+ return count;
+}
+
+static ssize_t map_button_show(struct device *dev,
+ struct device_attribute *attr, char *buf,
+ u8 index)
+{
+ u8 i;
+
+ switch (index) {
+ case BUTTON_A:
+ i = drvdata.bmap_1->btn_a.mapping;
+ break;
+ case BUTTON_B:
+ i = drvdata.bmap_1->btn_b.mapping;
+ break;
+ case BUTTON_X:
+ i = drvdata.bmap_1->btn_x.mapping;
+ break;
+ case BUTTON_Y:
+ i = drvdata.bmap_1->btn_y.mapping;
+ break;
+ case BUTTON_LB:
+ i = drvdata.bmap_1->btn_lb.mapping;
+ break;
+ case BUTTON_RB:
+ i = drvdata.bmap_1->btn_rb.mapping;
+ break;
+ case BUTTON_LT:
+ i = drvdata.bmap_1->btn_lt.mapping;
+ break;
+ case BUTTON_RT:
+ i = drvdata.bmap_1->btn_rt.mapping;
+ break;
+ case BUTTON_START:
+ i = drvdata.bmap_1->btn_start.mapping;
+ break;
+ case BUTTON_SELECT:
+ i = drvdata.bmap_2->btn_select.mapping;
+ break;
+ case BUTTON_L3:
+ i = drvdata.bmap_2->btn_l3.mapping;
+ break;
+ case BUTTON_R3:
+ i = drvdata.bmap_2->btn_r3.mapping;
+ break;
+ case BUTTON_DUP:
+ i = drvdata.bmap_2->btn_dup.mapping;
+ break;
+ case BUTTON_DDOWN:
+ i = drvdata.bmap_2->btn_ddown.mapping;
+ break;
+ case BUTTON_DLEFT:
+ i = drvdata.bmap_2->btn_dleft.mapping;
+ break;
+ case BUTTON_DRIGHT:
+ i = drvdata.bmap_2->btn_dright.mapping;
+ break;
+ case BUTTON_M1:
+ i = drvdata.bmap_2->btn_m1.mapping;
+ break;
+ case BUTTON_M2:
+ i = drvdata.bmap_2->btn_m2.mapping;
+ break;
+ default:
+ return -EINVAL;
+ }
+
+ if (i >= ARRAY_SIZE(oxp_joybutton_text))
+ return -EINVAL;
+
+ return sysfs_emit(buf, "%s\n", oxp_joybutton_text[i]);
+}
+
+static ssize_t button_mapping_options_show(struct device *dev,
+ struct device_attribute *attr, char *buf)
+{
+ ssize_t count = 0;
+ unsigned int i;
+
+ for (i = 0; i < ARRAY_SIZE(oxp_joybutton_text); i++)
+ count += sysfs_emit_at(buf, count, "%s ", oxp_joybutton_text[i]);
+
+ if (count)
+ buf[count - 1] = '\n';
+
+ return count;
+}
+static DEVICE_ATTR_RO(button_mapping_options);
+
+#define OXP_DEVICE_ATTR_RW(_name, _group) \
+ static ssize_t _name##_store(struct device *dev, \
+ struct device_attribute *attr, \
+ const char *buf, size_t count) \
+ { \
+ return _group##_store(dev, attr, buf, count, _name.index); \
+ } \
+ static ssize_t _name##_show(struct device *dev, \
+ struct device_attribute *attr, char *buf) \
+ { \
+ return _group##_show(dev, attr, buf, _name.index); \
+ } \
+ static DEVICE_ATTR_RW(_name)
+
+static struct oxp_button_attr button_a = { BUTTON_A };
+OXP_DEVICE_ATTR_RW(button_a, map_button);
+
+static struct oxp_button_attr button_b = { BUTTON_B };
+OXP_DEVICE_ATTR_RW(button_b, map_button);
+
+static struct oxp_button_attr button_x = { BUTTON_X };
+OXP_DEVICE_ATTR_RW(button_x, map_button);
+
+static struct oxp_button_attr button_y = { BUTTON_Y };
+OXP_DEVICE_ATTR_RW(button_y, map_button);
+
+static struct oxp_button_attr button_lb = { BUTTON_LB };
+OXP_DEVICE_ATTR_RW(button_lb, map_button);
+
+static struct oxp_button_attr button_rb = { BUTTON_RB };
+OXP_DEVICE_ATTR_RW(button_rb, map_button);
+
+static struct oxp_button_attr button_lt = { BUTTON_LT };
+OXP_DEVICE_ATTR_RW(button_lt, map_button);
+
+static struct oxp_button_attr button_rt = { BUTTON_RT };
+OXP_DEVICE_ATTR_RW(button_rt, map_button);
+
+static struct oxp_button_attr button_start = { BUTTON_START };
+OXP_DEVICE_ATTR_RW(button_start, map_button);
+
+static struct oxp_button_attr button_select = { BUTTON_SELECT };
+OXP_DEVICE_ATTR_RW(button_select, map_button);
+
+static struct oxp_button_attr button_l3 = { BUTTON_L3 };
+OXP_DEVICE_ATTR_RW(button_l3, map_button);
+
+static struct oxp_button_attr button_r3 = { BUTTON_R3 };
+OXP_DEVICE_ATTR_RW(button_r3, map_button);
+
+static struct oxp_button_attr button_d_up = { BUTTON_DUP };
+OXP_DEVICE_ATTR_RW(button_d_up, map_button);
+
+static struct oxp_button_attr button_d_down = { BUTTON_DDOWN };
+OXP_DEVICE_ATTR_RW(button_d_down, map_button);
+
+static struct oxp_button_attr button_d_left = { BUTTON_DLEFT };
+OXP_DEVICE_ATTR_RW(button_d_left, map_button);
+
+static struct oxp_button_attr button_d_right = { BUTTON_DRIGHT };
+OXP_DEVICE_ATTR_RW(button_d_right, map_button);
+
+static struct oxp_button_attr button_m1 = { BUTTON_M1 };
+OXP_DEVICE_ATTR_RW(button_m1, map_button);
+
+static struct oxp_button_attr button_m2 = { BUTTON_M2 };
+OXP_DEVICE_ATTR_RW(button_m2, map_button);
+
static struct attribute *oxp_cfg_attrs[] = {
+ &dev_attr_button_a.attr,
+ &dev_attr_button_b.attr,
+ &dev_attr_button_d_down.attr,
+ &dev_attr_button_d_left.attr,
+ &dev_attr_button_d_right.attr,
+ &dev_attr_button_d_up.attr,
+ &dev_attr_button_l3.attr,
+ &dev_attr_button_lb.attr,
+ &dev_attr_button_lt.attr,
+ &dev_attr_button_m1.attr,
+ &dev_attr_button_m2.attr,
+ &dev_attr_button_mapping_options.attr,
+ &dev_attr_button_r3.attr,
+ &dev_attr_button_rb.attr,
+ &dev_attr_button_rt.attr,
+ &dev_attr_button_select.attr,
+ &dev_attr_button_start.attr,
&dev_attr_button_takeover.attr,
&dev_attr_button_takeover_index.attr,
+ &dev_attr_button_x.attr,
+ &dev_attr_button_y.attr,
+ &dev_attr_reset_buttons.attr,
NULL,
};
@@ -729,6 +1220,8 @@ static struct led_classdev_mc oxp_cdev_rgb = {
static int oxp_cfg_probe(struct hid_device *hdev, u16 up)
{
+ struct oxp_bmap_page_1 *bmap_1;
+ struct oxp_bmap_page_2 *bmap_2;
int ret;
hid_set_drvdata(hdev, &drvdata);
@@ -756,6 +1249,23 @@ static int oxp_cfg_probe(struct hid_device *hdev, u16 up)
if (up != GEN2_USAGE_PAGE)
return 0;
+ bmap_1 = devm_kzalloc(&hdev->dev, sizeof(struct oxp_bmap_page_1), GFP_KERNEL);
+ if (!bmap_1)
+ return dev_err_probe(&hdev->dev, -ENOMEM,
+ "Unable to allocate button map page 1\n");
+
+ bmap_2 = devm_kzalloc(&hdev->dev, sizeof(struct oxp_bmap_page_2), GFP_KERNEL);
+ if (!bmap_2)
+ return dev_err_probe(&hdev->dev, -ENOMEM,
+ "Unable to allocate button map page 2\n");
+
+ drvdata.bmap_1 = bmap_1;
+ drvdata.bmap_2 = bmap_2;
+ ret = oxp_reset_buttons();
+ if (ret)
+ return dev_err_probe(&hdev->dev, ret,
+ "Failed to reset button mapping\n");
+
ret = devm_device_add_group(&hdev->dev, &oxp_cfg_attrs_group);
if (ret)
return dev_err_probe(&hdev->dev, ret,
--
2.53.0
^ permalink raw reply related
* Re: [PATCH 0/4] Add OneXPlayer Configuration HID Driver
From: Derek John Clark @ 2026-03-22 3:20 UTC (permalink / raw)
To: Jiri Kosina, Benjamin Tissoires
Cc: Pierre-Loup A . Griffais, Lambert Fan, linux-input, linux-doc,
linux-kernel
In-Reply-To: <20260322031615.1524307-1-derekjohn.clark@gmail.com>
On Sat, Mar 21, 2026 at 8:16 PM Derek J. Clark
<derekjohn.clark@gmail.com> wrote:
>
> Adds an HID driver for OneXPlayer HID configuration devices. There are
> currently 2 generations of OneXPlayer HID protocol. The first generation
> (OneXPlayer F1 series) only provides an RGB control interface over HID.
> The Second generation (X1 mini series, G1 series, AOKZOE A1X) also
> includes a hardware level button mapping interface, as well as a
> "takeover" mode that was added by the ODM for debugging the button map.
> This takeover mode can be useful for exposing the M1 and M2 accessory
> buttons as unique inputs with some userspace tools that can consume it.
>
> Signed-off-by: Derel J. Clark <derekjohn.clark@gmail.com>
>
> Derek J. Clark (4):
> HID: hid-oxp: Add OneXPlayer configuration driver
> HID: hid-oxp: Add Second Generation RGB Control
> HID: hid-oxp: Add Second Generation Takeover Mode
> HID: hid-oxp: Add Button Mapping Interface
>
> MAINTAINERS | 6 +
> drivers/hid/Kconfig | 12 +
> drivers/hid/Makefile | 1 +
> drivers/hid/hid-ids.h | 6 +
> drivers/hid/hid-oxp.c | 1340 +++++++++++++++++++++++++++++++++++++++++
> 5 files changed, 1365 insertions(+)
> create mode 100644 drivers/hid/hid-oxp.c
>
> --
> 2.53.0
>
Note to everyone: I forgot to rebase to a clean for-next branch before
sending this so build bots will likely fail. I'll be sure to update
the source branch to the appropriate branch for v2 after a few days to
allow time for comments on the patch substance. Sorry about the extra
churn here.
Thanks,
Derek
^ permalink raw reply
* Re: [PATCH 08/10] dt-bindings: input: touchscreen: st,stmfts: Introduce STM FTS5
From: Krzysztof Kozlowski @ 2026-03-22 10:16 UTC (permalink / raw)
To: David Heidelberg, Dmitry Baryshkov
Cc: Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Henrik Rydberg,
Bjorn Andersson, Konrad Dybcio, Petr Hodina, linux-input,
linux-stm32, linux-arm-kernel, linux-kernel, devicetree,
linux-arm-msm, phone-devel
In-Reply-To: <4b8c8d8c-d2f3-4938-a451-e8e9524d40c3@ixit.cz>
On 15/03/2026 18:09, David Heidelberg wrote:
> On 01/03/2026 23:40, Dmitry Baryshkov wrote:
>
> [...]
>
>>> + then:
>>> + properties:
>>> + switch-gpio:
>>> + description: Switch between SLPI and AP mode.
>>
>> This doesn't sounds like the GPIO on the touchscreen, more like the
>> external schematic component. If it need sto be turned to one position,
>> it might be better to use GPIO hog for that.
>
> Right now yes, but the GPIO serves to switching between SLPI and AP mode at
> runtime, see [1]
>
> The driver lack supports for SLPI, but at moment when SLPI support lands, we
> should be able do something like:
>
> -> device starts, touchscreen works
> -> screen goes to sleep, but instead of powering off touchscreen, it switches to
> SLPI mode
> -> user taps at touchscreen, device wakes up
>
> Thus I think we need to support this GPIO in the driver.
But that's not role of this device. You cannot just hook random GPIOs
into this device node, just because you want some use-case in the driver.
Best regards,
Krzysztof
^ permalink raw reply
* Re: [PATCH WIP v2 09/11] dt-bindings: input: touchscreen: st,stmfts: Introduce STM FTS5
From: Krzysztof Kozlowski @ 2026-03-22 10:17 UTC (permalink / raw)
To: david, Dmitry Torokhov, Maxime Coquelin, Alexandre Torgue,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Henrik Rydberg,
Bjorn Andersson, Konrad Dybcio
Cc: Petr Hodina, linux-input, linux-stm32, linux-arm-kernel,
linux-kernel, devicetree, linux-arm-msm, phone-devel
In-Reply-To: <20260315-stmfts5-v2-9-70bc83ee9591@ixit.cz>
On 15/03/2026 19:52, David Heidelberg via B4 Relay wrote:
> From: David Heidelberg <david@ixit.cz>
>
> Introduce more recent STM FTS5 touchscreen support.
>
> Signed-off-by: David Heidelberg <david@ixit.cz>
> ---
> .../devicetree/bindings/input/touchscreen/st,stmfts.yaml | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/st,stmfts.yaml b/Documentation/devicetree/bindings/input/touchscreen/st,stmfts.yaml
> index 64c4f24ea3dd0..66255893a99fb 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/st,stmfts.yaml
> +++ b/Documentation/devicetree/bindings/input/touchscreen/st,stmfts.yaml
> @@ -16,10 +16,23 @@ description:
>
> allOf:
> - $ref: touchscreen.yaml#
> + - if:
> + properties:
> + compatible:
> + const: st,stmfts5
> + then:
> + properties:
> + switch-gpios:
> + description: Switch between SLPI and AP mode.
Do not define properties in if:then: branches. Anyway, not a property of
this device.
Best regards,
Krzysztof
^ permalink raw reply
* [PATCH v2 0/3] Input: gpio-keys - add full support of EV_REL and EV_ABS
From: Xiong Nandi @ 2026-03-22 11:35 UTC (permalink / raw)
To: dmitry.torokhov
Cc: linux-input, linux-kernel, Xiong Nandi, Fabrice Gasnier,
Gatien Chevallier, Ingo Molnar, Marco Crivellari, Thomas Gleixner
In-Reply-To: <ab5CXO6Fk7lhGazv@google.com>
This series add full support of EV_REL and EV_ABS
v2: Split into 3 patches as requested. (In reply to ab5CXO6Fk7lhGazv@google.com)
Xiong Nandi (3):
Input: gpio-keys - set EV_ABS axis parameters at setup time
Input: gpio-keys - use shared axis counter for EV_ABS events
Input: gpio-keys - add EV_REL event type support
drivers/input/keyboard/gpio_keys.c | 65 +++++++++++++++++++++++++++++-
include/linux/gpio_keys.h | 4 +-
2 files changed, 65 insertions(+), 4 deletions(-)
--
2.25.1
^ permalink raw reply
* [PATCH v2 1/3] Input: gpio-keys - set EV_ABS axis parameters at setup time
From: Xiong Nandi @ 2026-03-22 11:35 UTC (permalink / raw)
To: dmitry.torokhov
Cc: linux-input, linux-kernel, Xiong Nandi, Gatien Chevallier,
Marco Crivellari, Thomas Gleixner, Fabrice Gasnier
In-Reply-To: <ab5CXO6Fk7lhGazv@google.com>
The driver calls input_set_capability() for EV_ABS axes but never
sets the actual axis parameters, so the input subsystem sees
unbounded ranges.
Add a helper that scans buttons sharing the same axis code, works
out the min/max values, and calls input_set_abs_params().
Signed-off-by: Xiong Nandi <xndchn@gmail.com>
---
drivers/input/keyboard/gpio_keys.c | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index e19617485679..f97ca8dd073a 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -493,6 +493,27 @@ static irqreturn_t gpio_keys_irq_isr(int irq, void *dev_id)
return IRQ_HANDLED;
}
+static void gpio_keys_set_abs_params(struct input_dev *input,
+ struct gpio_keys_drvdata *ddata,
+ unsigned int code)
+{
+ int i, min = 0, max = 0;
+
+ for (i = 0; i < ddata->pdata->nbuttons; i++) {
+ const struct gpio_keys_button *button = &ddata->pdata->buttons[i];
+
+ if (button->type != EV_ABS || button->code != code)
+ continue;
+
+ if (button->value < min)
+ min = button->value;
+ if (button->value > max)
+ max = button->value;
+ }
+
+ input_set_abs_params(input, code, min, max, 0, 0);
+}
+
static int gpio_keys_setup_key(struct platform_device *pdev,
struct input_dev *input,
struct gpio_keys_drvdata *ddata,
@@ -651,6 +672,8 @@ static int gpio_keys_setup_key(struct platform_device *pdev,
bdata->code = &ddata->keymap[idx];
*bdata->code = button->code;
input_set_capability(input, button->type ?: EV_KEY, *bdata->code);
+ if ((button->type ?: EV_KEY) == EV_ABS)
+ gpio_keys_set_abs_params(input, ddata, button->code);
/*
* Install custom action to cancel release timer and
--
2.25.1
^ permalink raw reply related
* [PATCH v2 2/3] Input: gpio-keys - use shared axis counter for EV_ABS events
From: Xiong Nandi @ 2026-03-22 11:35 UTC (permalink / raw)
To: dmitry.torokhov
Cc: linux-input, linux-kernel, Xiong Nandi, Gatien Chevallier,
Marco Crivellari, Ingo Molnar, Fabrice Gasnier, Thomas Gleixner
In-Reply-To: <ab5CXO6Fk7lhGazv@google.com>
When two buttons share an EV_ABS axis code, releasing one button
zeroes the axis while the other is still held.
Add a shared atomic counter per (type, code) pair so the axis only
resets to zero when the last button on it is released.
Signed-off-by: Xiong Nandi <xndchn@gmail.com>
---
drivers/input/keyboard/gpio_keys.c | 40 +++++++++++++++++++++++++++++-
1 file changed, 39 insertions(+), 1 deletion(-)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index f97ca8dd073a..4cbfd5a273bd 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -51,8 +51,10 @@ struct gpio_button_data {
spinlock_t lock;
bool disabled;
bool key_pressed;
+ bool axis_active;
bool suspended;
bool debounce_use_hrtimer;
+ atomic_t *axis_count;
};
struct gpio_keys_drvdata {
@@ -374,8 +376,15 @@ static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
}
if (type == EV_ABS) {
- if (state)
+ if (state && !bdata->axis_active) {
+ bdata->axis_active = true;
+ atomic_inc(bdata->axis_count);
input_event(input, type, button->code, button->value);
+ } else if (!state && bdata->axis_active) {
+ bdata->axis_active = false;
+ if (atomic_dec_and_test(bdata->axis_count))
+ input_event(input, type, button->code, 0);
+ }
} else {
input_event(input, type, *bdata->code, state);
}
@@ -951,6 +960,35 @@ static int gpio_keys_probe(struct platform_device *pdev)
fwnode_handle_put(child);
+ /* Allocate shared axis counters for EV_ABS buttons */
+ for (i = 0; i < pdata->nbuttons; i++) {
+ struct gpio_button_data *bdata = &ddata->data[i];
+ unsigned int type = bdata->button->type ?: EV_KEY;
+ int j;
+
+ if (type != EV_ABS)
+ continue;
+
+ /* Reuse counter from an earlier button with same (type, code) */
+ for (j = 0; j < i; j++) {
+ struct gpio_button_data *prev = &ddata->data[j];
+ unsigned int prev_type = prev->button->type ?: EV_KEY;
+
+ if (prev_type == type &&
+ prev->button->code == bdata->button->code) {
+ bdata->axis_count = prev->axis_count;
+ break;
+ }
+ }
+
+ if (!bdata->axis_count) {
+ bdata->axis_count = devm_kzalloc(dev,
+ sizeof(*bdata->axis_count), GFP_KERNEL);
+ if (!bdata->axis_count)
+ return -ENOMEM;
+ }
+ }
+
error = input_register_device(input);
if (error) {
dev_err(dev, "Unable to register input device, error: %d\n",
--
2.25.1
^ permalink raw reply related
* [PATCH v2 3/3] Input: gpio-keys - add EV_REL event type support
From: Xiong Nandi @ 2026-03-22 11:35 UTC (permalink / raw)
To: dmitry.torokhov
Cc: linux-input, linux-kernel, Xiong Nandi, Gatien Chevallier,
Thomas Gleixner, Fabrice Gasnier, Marco Crivellari
In-Reply-To: <ab5CXO6Fk7lhGazv@google.com>
The polled path handles EV_REL but the interrupt path silently
ignores it. Widen the type check so EV_REL goes through the same
reporting and shared-counter logic as EV_ABS.
Signed-off-by: Xiong Nandi <xndchn@gmail.com>
---
drivers/input/keyboard/gpio_keys.c | 6 +++---
include/linux/gpio_keys.h | 4 ++--
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c
index 4cbfd5a273bd..652a6932c52f 100644
--- a/drivers/input/keyboard/gpio_keys.c
+++ b/drivers/input/keyboard/gpio_keys.c
@@ -375,7 +375,7 @@ static void gpio_keys_gpio_report_event(struct gpio_button_data *bdata)
return;
}
- if (type == EV_ABS) {
+ if (type == EV_ABS || type == EV_REL) {
if (state && !bdata->axis_active) {
bdata->axis_active = true;
atomic_inc(bdata->axis_count);
@@ -960,13 +960,13 @@ static int gpio_keys_probe(struct platform_device *pdev)
fwnode_handle_put(child);
- /* Allocate shared axis counters for EV_ABS buttons */
+ /* Allocate shared axis counters for EV_ABS/EV_REL buttons */
for (i = 0; i < pdata->nbuttons; i++) {
struct gpio_button_data *bdata = &ddata->data[i];
unsigned int type = bdata->button->type ?: EV_KEY;
int j;
- if (type != EV_ABS)
+ if (type != EV_ABS && type != EV_REL)
continue;
/* Reuse counter from an earlier button with same (type, code) */
diff --git a/include/linux/gpio_keys.h b/include/linux/gpio_keys.h
index 80fa930b04c6..75a745a32fe1 100644
--- a/include/linux/gpio_keys.h
+++ b/include/linux/gpio_keys.h
@@ -13,13 +13,13 @@ struct device;
* @active_low: %true indicates that button is considered
* depressed when gpio is low
* @desc: label that will be attached to button's gpio
- * @type: input event type (%EV_KEY, %EV_SW, %EV_ABS)
+ * @type: input event type (%EV_KEY, %EV_SW, %EV_ABS, %EV_REL)
* @wakeup: configure the button as a wake-up source
* @wakeup_event_action: event action to trigger wakeup
* @debounce_interval: debounce ticks interval in msecs
* @can_disable: %true indicates that userspace is allowed to
* disable button via sysfs
- * @value: axis value for %EV_ABS
+ * @value: axis value for %EV_ABS/%EV_REL
* @irq: Irq number in case of interrupt keys
* @wakeirq: Optional dedicated wake-up interrupt
*/
--
2.25.1
^ permalink raw reply related
* Re: [PATCH v2 2/2] iio: inkern: Use namespaced exports
From: Jonathan Cameron @ 2026-03-22 12:25 UTC (permalink / raw)
To: Romain Gantois
Cc: MyungJoo Ham, Chanwoo Choi, Guenter Roeck, Peter Rosin,
David Lechner, Nuno Sá, Andy Shevchenko, Lars-Peter Clausen,
Michael Hennerich, Mariel Tinaco, Kevin Tsai, Linus Walleij,
Dmitry Torokhov, Eugen Hristev, Vinod Koul,
Kishon Vijay Abraham I, Sebastian Reichel, Chen-Yu Tsai,
Hans de Goede, Support Opensource, Paul Cercueil, Iskren Chernev,
Krzysztof Kozlowski, Marek Szyprowski, Matheus Castello,
Saravanan Sekar, Matthias Brugger, AngeloGioacchino Del Regno,
Casey Connolly, Pali Rohár, Orson Zhai, Baolin Wang,
Chunyan Zhang, Amit Kucheria, Thara Gopinath, Rafael J. Wysocki,
Daniel Lezcano, Zhang Rui, Lukasz Luba, Claudiu Beznea,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Sylwester Nawrocki, Olivier Moysan, Arnaud Pouliquen,
Maxime Coquelin, Alexandre Torgue, Thomas Petazzoni, linux-kernel,
linux-hwmon, linux-iio, linux-input, linux-phy, linux-pm,
linux-mips, linux-mediatek, linux-arm-msm, linux-sound,
linux-stm32, Sebastian Reichel, Andy Shevchenko
In-Reply-To: <20260111170222.43aee69a@jic23-huawei>
On Sun, 11 Jan 2026 17:02:22 +0000
Jonathan Cameron <jic23@kernel.org> wrote:
> On Tue, 09 Dec 2025 09:25:56 +0100
> Romain Gantois <romain.gantois@bootlin.com> wrote:
>
> > Use namespaced exports for IIO consumer API functions.
> >
> > This will make it easier to manage the IIO export surface. Consumer drivers
> > will only be provided access to a specific set of functions, thereby
> > restricting usage of internal IIO functions by other parts of the kernel.
> >
> > This change cannot be split into several parts without breaking
> > bisectability, thus all of the affected drivers are modified at once.
> >
> > Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for power-supply
> > Acked-by: Guenter Roeck <linux@roeck-us.net>
> > Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> > Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
> Ideally looking for a couple more Acks.
>
> If any of the maintainers of other trees who haven't already replied
> have time for a quick glance that would be great. I'll spin an
> immutable branch but I'm not really expecting any non trivial
> conflicts unless there is a new user in flight that I've forgotten
> about.
At this stage, given I'm still waiting on replies from a couple of
subsystem maintainers, I'm thinking we'll do this next cycle and I'll
provide an immutable branch based on rc1 for anyone to grab if they
run into merge conflicts in linux-next.
Thanks,
Jonathan
>
> Jonathan
>
> > ---
> > drivers/extcon/extcon-adc-jack.c | 1 +
> > drivers/hwmon/iio_hwmon.c | 1 +
> > drivers/hwmon/ntc_thermistor.c | 1 +
> > drivers/iio/adc/envelope-detector.c | 1 +
> > drivers/iio/afe/iio-rescale.c | 1 +
> > drivers/iio/buffer/industrialio-buffer-cb.c | 1 +
> > drivers/iio/buffer/industrialio-hw-consumer.c | 1 +
> > drivers/iio/dac/ad8460.c | 1 +
> > drivers/iio/dac/dpot-dac.c | 1 +
> > drivers/iio/inkern.c | 54 ++++++++++++-------------
> > drivers/iio/light/cm3605.c | 1 +
> > drivers/iio/light/gp2ap002.c | 1 +
> > drivers/iio/multiplexer/iio-mux.c | 1 +
> > drivers/iio/potentiostat/lmp91000.c | 1 +
> > drivers/input/joystick/adc-joystick.c | 1 +
> > drivers/input/keyboard/adc-keys.c | 1 +
> > drivers/input/touchscreen/colibri-vf50-ts.c | 1 +
> > drivers/input/touchscreen/resistive-adc-touch.c | 1 +
> > drivers/phy/motorola/phy-cpcap-usb.c | 1 +
> > drivers/power/supply/ab8500_btemp.c | 1 +
> > drivers/power/supply/ab8500_charger.c | 1 +
> > drivers/power/supply/ab8500_fg.c | 1 +
> > drivers/power/supply/axp20x_ac_power.c | 1 +
> > drivers/power/supply/axp20x_battery.c | 1 +
> > drivers/power/supply/axp20x_usb_power.c | 1 +
> > drivers/power/supply/axp288_fuel_gauge.c | 1 +
> > drivers/power/supply/cpcap-battery.c | 1 +
> > drivers/power/supply/cpcap-charger.c | 1 +
> > drivers/power/supply/da9150-charger.c | 1 +
> > drivers/power/supply/generic-adc-battery.c | 1 +
> > drivers/power/supply/ingenic-battery.c | 1 +
> > drivers/power/supply/intel_dc_ti_battery.c | 1 +
> > drivers/power/supply/lego_ev3_battery.c | 1 +
> > drivers/power/supply/lp8788-charger.c | 1 +
> > drivers/power/supply/max17040_battery.c | 1 +
> > drivers/power/supply/mp2629_charger.c | 1 +
> > drivers/power/supply/mt6370-charger.c | 1 +
> > drivers/power/supply/qcom_smbx.c | 1 +
> > drivers/power/supply/rn5t618_power.c | 1 +
> > drivers/power/supply/rx51_battery.c | 1 +
> > drivers/power/supply/sc27xx_fuel_gauge.c | 1 +
> > drivers/power/supply/twl4030_charger.c | 1 +
> > drivers/power/supply/twl4030_madc_battery.c | 1 +
> > drivers/power/supply/twl6030_charger.c | 1 +
> > drivers/thermal/qcom/qcom-spmi-adc-tm5.c | 1 +
> > drivers/thermal/qcom/qcom-spmi-temp-alarm.c | 1 +
> > drivers/thermal/renesas/rzg3s_thermal.c | 1 +
> > drivers/thermal/thermal-generic-adc.c | 1 +
> > sound/soc/codecs/audio-iio-aux.c | 1 +
> > sound/soc/samsung/aries_wm8994.c | 1 +
> > sound/soc/samsung/midas_wm1811.c | 1 +
> > sound/soc/stm/stm32_adfsdm.c | 1 +
> > 52 files changed, 78 insertions(+), 27 deletions(-)
> >
> > diff --git a/drivers/extcon/extcon-adc-jack.c b/drivers/extcon/extcon-adc-jack.c
> > index 7e3c9f38297b..e735f43dcdeb 100644
> > --- a/drivers/extcon/extcon-adc-jack.c
> > +++ b/drivers/extcon/extcon-adc-jack.c
> > @@ -210,3 +210,4 @@ module_platform_driver(adc_jack_driver);
> > MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
> > MODULE_DESCRIPTION("ADC Jack extcon driver");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/hwmon/iio_hwmon.c b/drivers/hwmon/iio_hwmon.c
> > index e376d4cde5ad..4c7843fbcc50 100644
> > --- a/drivers/hwmon/iio_hwmon.c
> > +++ b/drivers/hwmon/iio_hwmon.c
> > @@ -222,3 +222,4 @@ module_platform_driver(iio_hwmon_driver);
> > MODULE_AUTHOR("Jonathan Cameron <jic23@kernel.org>");
> > MODULE_DESCRIPTION("IIO to hwmon driver");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/hwmon/ntc_thermistor.c b/drivers/hwmon/ntc_thermistor.c
> > index d21f7266c411..417807fad80b 100644
> > --- a/drivers/hwmon/ntc_thermistor.c
> > +++ b/drivers/hwmon/ntc_thermistor.c
> > @@ -706,3 +706,4 @@ MODULE_DESCRIPTION("NTC Thermistor Driver");
> > MODULE_AUTHOR("MyungJoo Ham <myungjoo.ham@samsung.com>");
> > MODULE_LICENSE("GPL");
> > MODULE_ALIAS("platform:ntc-thermistor");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/adc/envelope-detector.c b/drivers/iio/adc/envelope-detector.c
> > index 5b16fe737659..fea20e7e6cd9 100644
> > --- a/drivers/iio/adc/envelope-detector.c
> > +++ b/drivers/iio/adc/envelope-detector.c
> > @@ -406,3 +406,4 @@ module_platform_driver(envelope_detector_driver);
> > MODULE_DESCRIPTION("Envelope detector using a DAC and a comparator");
> > MODULE_AUTHOR("Peter Rosin <peda@axentia.se>");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/afe/iio-rescale.c b/drivers/iio/afe/iio-rescale.c
> > index ecaf59278c6f..d7f55109af3e 100644
> > --- a/drivers/iio/afe/iio-rescale.c
> > +++ b/drivers/iio/afe/iio-rescale.c
> > @@ -609,3 +609,4 @@ module_platform_driver(rescale_driver);
> > MODULE_DESCRIPTION("IIO rescale driver");
> > MODULE_AUTHOR("Peter Rosin <peda@axentia.se>");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/buffer/industrialio-buffer-cb.c b/drivers/iio/buffer/industrialio-buffer-cb.c
> > index 3e27385069ed..608ea9afc15a 100644
> > --- a/drivers/iio/buffer/industrialio-buffer-cb.c
> > +++ b/drivers/iio/buffer/industrialio-buffer-cb.c
> > @@ -153,3 +153,4 @@ EXPORT_SYMBOL_GPL(iio_channel_cb_get_iio_dev);
> > MODULE_AUTHOR("Jonathan Cameron <jic23@kernel.org>");
> > MODULE_DESCRIPTION("Industrial I/O callback buffer");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/buffer/industrialio-hw-consumer.c b/drivers/iio/buffer/industrialio-hw-consumer.c
> > index 526b2a8d725d..d7ff086ed783 100644
> > --- a/drivers/iio/buffer/industrialio-hw-consumer.c
> > +++ b/drivers/iio/buffer/industrialio-hw-consumer.c
> > @@ -211,3 +211,4 @@ EXPORT_SYMBOL_GPL(iio_hw_consumer_disable);
> > MODULE_AUTHOR("Lars-Peter Clausen <lars@metafoo.de>");
> > MODULE_DESCRIPTION("Hardware consumer buffer the IIO framework");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/dac/ad8460.c b/drivers/iio/dac/ad8460.c
> > index 6e45686902dd..ad654819ca22 100644
> > --- a/drivers/iio/dac/ad8460.c
> > +++ b/drivers/iio/dac/ad8460.c
> > @@ -955,3 +955,4 @@ MODULE_AUTHOR("Mariel Tinaco <mariel.tinaco@analog.com");
> > MODULE_DESCRIPTION("AD8460 DAC driver");
> > MODULE_LICENSE("GPL");
> > MODULE_IMPORT_NS("IIO_DMAENGINE_BUFFER");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/dac/dpot-dac.c b/drivers/iio/dac/dpot-dac.c
> > index d1b8441051ae..49dbdb7df955 100644
> > --- a/drivers/iio/dac/dpot-dac.c
> > +++ b/drivers/iio/dac/dpot-dac.c
> > @@ -254,3 +254,4 @@ module_platform_driver(dpot_dac_driver);
> > MODULE_DESCRIPTION("DAC emulation driver using a digital potentiometer");
> > MODULE_AUTHOR("Peter Rosin <peda@axentia.se>");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/inkern.c b/drivers/iio/inkern.c
> > index 1e5eb5a41271..c75c3a8d233f 100644
> > --- a/drivers/iio/inkern.c
> > +++ b/drivers/iio/inkern.c
> > @@ -281,7 +281,7 @@ struct iio_channel *fwnode_iio_channel_get_by_name(struct fwnode_handle *fwnode,
> >
> > return ERR_PTR(-ENODEV);
> > }
> > -EXPORT_SYMBOL_GPL(fwnode_iio_channel_get_by_name);
> > +EXPORT_SYMBOL_NS_GPL(fwnode_iio_channel_get_by_name, "IIO_CONSUMER");
> >
> > static struct iio_channel *fwnode_iio_channel_get_all(struct device *dev)
> > {
> > @@ -386,7 +386,7 @@ struct iio_channel *iio_channel_get(struct device *dev,
> >
> > return iio_channel_get_sys(name, channel_name);
> > }
> > -EXPORT_SYMBOL_GPL(iio_channel_get);
> > +EXPORT_SYMBOL_NS_GPL(iio_channel_get, "IIO_CONSUMER");
> >
> > void iio_channel_release(struct iio_channel *channel)
> > {
> > @@ -395,7 +395,7 @@ void iio_channel_release(struct iio_channel *channel)
> > iio_device_put(channel->indio_dev);
> > kfree(channel);
> > }
> > -EXPORT_SYMBOL_GPL(iio_channel_release);
> > +EXPORT_SYMBOL_NS_GPL(iio_channel_release, "IIO_CONSUMER");
> >
> > static void devm_iio_channel_free(void *iio_channel)
> > {
> > @@ -418,7 +418,7 @@ struct iio_channel *devm_iio_channel_get(struct device *dev,
> >
> > return channel;
> > }
> > -EXPORT_SYMBOL_GPL(devm_iio_channel_get);
> > +EXPORT_SYMBOL_NS_GPL(devm_iio_channel_get, "IIO_CONSUMER");
> >
> > struct iio_channel *devm_fwnode_iio_channel_get_by_name(struct device *dev,
> > struct fwnode_handle *fwnode,
> > @@ -437,7 +437,7 @@ struct iio_channel *devm_fwnode_iio_channel_get_by_name(struct device *dev,
> >
> > return channel;
> > }
> > -EXPORT_SYMBOL_GPL(devm_fwnode_iio_channel_get_by_name);
> > +EXPORT_SYMBOL_NS_GPL(devm_fwnode_iio_channel_get_by_name, "IIO_CONSUMER");
> >
> > struct iio_channel *iio_channel_get_all(struct device *dev)
> > {
> > @@ -506,7 +506,7 @@ struct iio_channel *iio_channel_get_all(struct device *dev)
> > iio_device_put(chans[i].indio_dev);
> > return ERR_PTR(ret);
> > }
> > -EXPORT_SYMBOL_GPL(iio_channel_get_all);
> > +EXPORT_SYMBOL_NS_GPL(iio_channel_get_all, "IIO_CONSUMER");
> >
> > void iio_channel_release_all(struct iio_channel *channels)
> > {
> > @@ -518,7 +518,7 @@ void iio_channel_release_all(struct iio_channel *channels)
> > }
> > kfree(channels);
> > }
> > -EXPORT_SYMBOL_GPL(iio_channel_release_all);
> > +EXPORT_SYMBOL_NS_GPL(iio_channel_release_all, "IIO_CONSUMER");
> >
> > static void devm_iio_channel_free_all(void *iio_channels)
> > {
> > @@ -541,7 +541,7 @@ struct iio_channel *devm_iio_channel_get_all(struct device *dev)
> >
> > return channels;
> > }
> > -EXPORT_SYMBOL_GPL(devm_iio_channel_get_all);
> > +EXPORT_SYMBOL_NS_GPL(devm_iio_channel_get_all, "IIO_CONSUMER");
> >
> > static int iio_channel_read(struct iio_channel *chan, int *val, int *val2,
> > enum iio_chan_info_enum info)
> > @@ -585,7 +585,7 @@ int iio_read_channel_raw(struct iio_channel *chan, int *val)
> >
> > return iio_channel_read(chan, val, NULL, IIO_CHAN_INFO_RAW);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_channel_raw);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_channel_raw, "IIO_CONSUMER");
> >
> > int iio_read_channel_average_raw(struct iio_channel *chan, int *val)
> > {
> > @@ -597,7 +597,7 @@ int iio_read_channel_average_raw(struct iio_channel *chan, int *val)
> >
> > return iio_channel_read(chan, val, NULL, IIO_CHAN_INFO_AVERAGE_RAW);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_channel_average_raw);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_channel_average_raw, "IIO_CONSUMER");
> >
> > int iio_multiply_value(int *result, s64 multiplier,
> > unsigned int type, int val, int val2)
> > @@ -701,7 +701,7 @@ int iio_convert_raw_to_processed(struct iio_channel *chan, int raw,
> > return iio_convert_raw_to_processed_unlocked(chan, raw, processed,
> > scale);
> > }
> > -EXPORT_SYMBOL_GPL(iio_convert_raw_to_processed);
> > +EXPORT_SYMBOL_NS_GPL(iio_convert_raw_to_processed, "IIO_CONSUMER");
> >
> > int iio_read_channel_attribute(struct iio_channel *chan, int *val, int *val2,
> > enum iio_chan_info_enum attribute)
> > @@ -714,13 +714,13 @@ int iio_read_channel_attribute(struct iio_channel *chan, int *val, int *val2,
> >
> > return iio_channel_read(chan, val, val2, attribute);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_channel_attribute);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_channel_attribute, "IIO_CONSUMER");
> >
> > int iio_read_channel_offset(struct iio_channel *chan, int *val, int *val2)
> > {
> > return iio_read_channel_attribute(chan, val, val2, IIO_CHAN_INFO_OFFSET);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_channel_offset);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_channel_offset, "IIO_CONSUMER");
> >
> > int iio_read_channel_processed_scale(struct iio_channel *chan, int *val,
> > unsigned int scale)
> > @@ -748,20 +748,20 @@ int iio_read_channel_processed_scale(struct iio_channel *chan, int *val,
> > scale);
> > }
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_channel_processed_scale);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_channel_processed_scale, "IIO_CONSUMER");
> >
> > int iio_read_channel_processed(struct iio_channel *chan, int *val)
> > {
> > /* This is just a special case with scale factor 1 */
> > return iio_read_channel_processed_scale(chan, val, 1);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_channel_processed);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_channel_processed, "IIO_CONSUMER");
> >
> > int iio_read_channel_scale(struct iio_channel *chan, int *val, int *val2)
> > {
> > return iio_read_channel_attribute(chan, val, val2, IIO_CHAN_INFO_SCALE);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_channel_scale);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_channel_scale, "IIO_CONSUMER");
> >
> > static int iio_channel_read_avail(struct iio_channel *chan,
> > const int **vals, int *type, int *length,
> > @@ -790,7 +790,7 @@ int iio_read_avail_channel_attribute(struct iio_channel *chan,
> >
> > return iio_channel_read_avail(chan, vals, type, length, attribute);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_avail_channel_attribute);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_avail_channel_attribute, "IIO_CONSUMER");
> >
> > int iio_read_avail_channel_raw(struct iio_channel *chan,
> > const int **vals, int *length)
> > @@ -807,7 +807,7 @@ int iio_read_avail_channel_raw(struct iio_channel *chan,
> >
> > return ret;
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_avail_channel_raw);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_avail_channel_raw, "IIO_CONSUMER");
> >
> > static int iio_channel_read_max(struct iio_channel *chan,
> > int *val, int *val2, int *type,
> > @@ -863,7 +863,7 @@ int iio_read_max_channel_raw(struct iio_channel *chan, int *val)
> >
> > return iio_channel_read_max(chan, val, NULL, &type, IIO_CHAN_INFO_RAW);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_max_channel_raw);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_max_channel_raw, "IIO_CONSUMER");
> >
> > static int iio_channel_read_min(struct iio_channel *chan,
> > int *val, int *val2, int *type,
> > @@ -919,7 +919,7 @@ int iio_read_min_channel_raw(struct iio_channel *chan, int *val)
> >
> > return iio_channel_read_min(chan, val, NULL, &type, IIO_CHAN_INFO_RAW);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_min_channel_raw);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_min_channel_raw, "IIO_CONSUMER");
> >
> > int iio_get_channel_type(struct iio_channel *chan, enum iio_chan_type *type)
> > {
> > @@ -933,7 +933,7 @@ int iio_get_channel_type(struct iio_channel *chan, enum iio_chan_type *type)
> >
> > return 0;
> > }
> > -EXPORT_SYMBOL_GPL(iio_get_channel_type);
> > +EXPORT_SYMBOL_NS_GPL(iio_get_channel_type, "IIO_CONSUMER");
> >
> > static int iio_channel_write(struct iio_channel *chan, int val, int val2,
> > enum iio_chan_info_enum info)
> > @@ -957,13 +957,13 @@ int iio_write_channel_attribute(struct iio_channel *chan, int val, int val2,
> >
> > return iio_channel_write(chan, val, val2, attribute);
> > }
> > -EXPORT_SYMBOL_GPL(iio_write_channel_attribute);
> > +EXPORT_SYMBOL_NS_GPL(iio_write_channel_attribute, "IIO_CONSUMER");
> >
> > int iio_write_channel_raw(struct iio_channel *chan, int val)
> > {
> > return iio_write_channel_attribute(chan, val, 0, IIO_CHAN_INFO_RAW);
> > }
> > -EXPORT_SYMBOL_GPL(iio_write_channel_raw);
> > +EXPORT_SYMBOL_NS_GPL(iio_write_channel_raw, "IIO_CONSUMER");
> >
> > unsigned int iio_get_channel_ext_info_count(struct iio_channel *chan)
> > {
> > @@ -978,7 +978,7 @@ unsigned int iio_get_channel_ext_info_count(struct iio_channel *chan)
> >
> > return i;
> > }
> > -EXPORT_SYMBOL_GPL(iio_get_channel_ext_info_count);
> > +EXPORT_SYMBOL_NS_GPL(iio_get_channel_ext_info_count, "IIO_CONSUMER");
> >
> > static const struct iio_chan_spec_ext_info *
> > iio_lookup_ext_info(const struct iio_channel *chan, const char *attr)
> > @@ -1013,7 +1013,7 @@ ssize_t iio_read_channel_ext_info(struct iio_channel *chan,
> > return ext_info->read(chan->indio_dev, ext_info->private,
> > chan->channel, buf);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_channel_ext_info);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_channel_ext_info, "IIO_CONSUMER");
> >
> > ssize_t iio_write_channel_ext_info(struct iio_channel *chan, const char *attr,
> > const char *buf, size_t len)
> > @@ -1027,7 +1027,7 @@ ssize_t iio_write_channel_ext_info(struct iio_channel *chan, const char *attr,
> > return ext_info->write(chan->indio_dev, ext_info->private,
> > chan->channel, buf, len);
> > }
> > -EXPORT_SYMBOL_GPL(iio_write_channel_ext_info);
> > +EXPORT_SYMBOL_NS_GPL(iio_write_channel_ext_info, "IIO_CONSUMER");
> >
> > ssize_t iio_read_channel_label(struct iio_channel *chan, char *buf)
> > {
> > @@ -1038,4 +1038,4 @@ ssize_t iio_read_channel_label(struct iio_channel *chan, char *buf)
> >
> > return do_iio_read_channel_label(chan->indio_dev, chan->channel, buf);
> > }
> > -EXPORT_SYMBOL_GPL(iio_read_channel_label);
> > +EXPORT_SYMBOL_NS_GPL(iio_read_channel_label, "IIO_CONSUMER");
> > diff --git a/drivers/iio/light/cm3605.c b/drivers/iio/light/cm3605.c
> > index 0c17378e27d1..1bd11292d005 100644
> > --- a/drivers/iio/light/cm3605.c
> > +++ b/drivers/iio/light/cm3605.c
> > @@ -325,3 +325,4 @@ module_platform_driver(cm3605_driver);
> > MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>");
> > MODULE_DESCRIPTION("CM3605 ambient light and proximity sensor driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/light/gp2ap002.c b/drivers/iio/light/gp2ap002.c
> > index a0d8a58f2704..04b1f6eade0e 100644
> > --- a/drivers/iio/light/gp2ap002.c
> > +++ b/drivers/iio/light/gp2ap002.c
> > @@ -717,3 +717,4 @@ module_i2c_driver(gp2ap002_driver);
> > MODULE_AUTHOR("Linus Walleij <linus.walleij@linaro.org>");
> > MODULE_DESCRIPTION("GP2AP002 ambient light and proximity sensor driver");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/multiplexer/iio-mux.c b/drivers/iio/multiplexer/iio-mux.c
> > index b742ca9a99d1..e193913f5af7 100644
> > --- a/drivers/iio/multiplexer/iio-mux.c
> > +++ b/drivers/iio/multiplexer/iio-mux.c
> > @@ -464,3 +464,4 @@ module_platform_driver(mux_driver);
> > MODULE_DESCRIPTION("IIO multiplexer driver");
> > MODULE_AUTHOR("Peter Rosin <peda@axentia.se>");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/iio/potentiostat/lmp91000.c b/drivers/iio/potentiostat/lmp91000.c
> > index eccc2a34358f..7d993f2acda4 100644
> > --- a/drivers/iio/potentiostat/lmp91000.c
> > +++ b/drivers/iio/potentiostat/lmp91000.c
> > @@ -423,3 +423,4 @@ module_i2c_driver(lmp91000_driver);
> > MODULE_AUTHOR("Matt Ranostay <matt.ranostay@konsulko.com>");
> > MODULE_DESCRIPTION("LMP91000 digital potentiostat");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/input/joystick/adc-joystick.c b/drivers/input/joystick/adc-joystick.c
> > index ff44f9978b71..4fa42f88bcfa 100644
> > --- a/drivers/input/joystick/adc-joystick.c
> > +++ b/drivers/input/joystick/adc-joystick.c
> > @@ -329,3 +329,4 @@ module_platform_driver(adc_joystick_driver);
> > MODULE_DESCRIPTION("Input driver for joysticks connected over ADC");
> > MODULE_AUTHOR("Artur Rojek <contact@artur-rojek.eu>");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/input/keyboard/adc-keys.c b/drivers/input/keyboard/adc-keys.c
> > index f1753207429d..d687459a0c80 100644
> > --- a/drivers/input/keyboard/adc-keys.c
> > +++ b/drivers/input/keyboard/adc-keys.c
> > @@ -202,3 +202,4 @@ module_platform_driver(adc_keys_driver);
> > MODULE_AUTHOR("Alexandre Belloni <alexandre.belloni@free-electrons.com>");
> > MODULE_DESCRIPTION("Input driver for resistor ladder connected on ADC");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/input/touchscreen/colibri-vf50-ts.c b/drivers/input/touchscreen/colibri-vf50-ts.c
> > index 98d5b2ba63fb..89c4d7b2b89e 100644
> > --- a/drivers/input/touchscreen/colibri-vf50-ts.c
> > +++ b/drivers/input/touchscreen/colibri-vf50-ts.c
> > @@ -372,3 +372,4 @@ module_platform_driver(vf50_touch_driver);
> > MODULE_AUTHOR("Sanchayan Maity");
> > MODULE_DESCRIPTION("Colibri VF50 Touchscreen driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/input/touchscreen/resistive-adc-touch.c b/drivers/input/touchscreen/resistive-adc-touch.c
> > index 7e761ec73273..2fefd652864c 100644
> > --- a/drivers/input/touchscreen/resistive-adc-touch.c
> > +++ b/drivers/input/touchscreen/resistive-adc-touch.c
> > @@ -301,3 +301,4 @@ module_platform_driver(grts_driver);
> > MODULE_AUTHOR("Eugen Hristev <eugen.hristev@microchip.com>");
> > MODULE_DESCRIPTION("Generic ADC Resistive Touch Driver");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/phy/motorola/phy-cpcap-usb.c b/drivers/phy/motorola/phy-cpcap-usb.c
> > index 7cb020dd3423..9591672b0511 100644
> > --- a/drivers/phy/motorola/phy-cpcap-usb.c
> > +++ b/drivers/phy/motorola/phy-cpcap-usb.c
> > @@ -717,3 +717,4 @@ MODULE_ALIAS("platform:cpcap_usb");
> > MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
> > MODULE_DESCRIPTION("CPCAP usb phy driver");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/ab8500_btemp.c b/drivers/power/supply/ab8500_btemp.c
> > index e5202a7b6209..36b0c52a4b8b 100644
> > --- a/drivers/power/supply/ab8500_btemp.c
> > +++ b/drivers/power/supply/ab8500_btemp.c
> > @@ -829,3 +829,4 @@ MODULE_LICENSE("GPL v2");
> > MODULE_AUTHOR("Johan Palsson, Karl Komierowski, Arun R Murthy");
> > MODULE_ALIAS("platform:ab8500-btemp");
> > MODULE_DESCRIPTION("AB8500 battery temperature driver");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/ab8500_charger.c b/drivers/power/supply/ab8500_charger.c
> > index 5f4537766e5b..6e49d1b28254 100644
> > --- a/drivers/power/supply/ab8500_charger.c
> > +++ b/drivers/power/supply/ab8500_charger.c
> > @@ -3751,3 +3751,4 @@ MODULE_LICENSE("GPL v2");
> > MODULE_AUTHOR("Johan Palsson, Karl Komierowski, Arun R Murthy");
> > MODULE_ALIAS("platform:ab8500-charger");
> > MODULE_DESCRIPTION("AB8500 charger management driver");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/ab8500_fg.c b/drivers/power/supply/ab8500_fg.c
> > index 9dd99722667a..5fa559f796aa 100644
> > --- a/drivers/power/supply/ab8500_fg.c
> > +++ b/drivers/power/supply/ab8500_fg.c
> > @@ -3252,3 +3252,4 @@ MODULE_LICENSE("GPL v2");
> > MODULE_AUTHOR("Johan Palsson, Karl Komierowski");
> > MODULE_ALIAS("platform:ab8500-fg");
> > MODULE_DESCRIPTION("AB8500 Fuel Gauge driver");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/axp20x_ac_power.c b/drivers/power/supply/axp20x_ac_power.c
> > index 5f6ea416fa30..e9049d6229df 100644
> > --- a/drivers/power/supply/axp20x_ac_power.c
> > +++ b/drivers/power/supply/axp20x_ac_power.c
> > @@ -421,3 +421,4 @@ module_platform_driver(axp20x_ac_power_driver);
> > MODULE_AUTHOR("Quentin Schulz <quentin.schulz@free-electrons.com>");
> > MODULE_DESCRIPTION("AXP20X and AXP22X PMICs' AC power supply driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/axp20x_battery.c b/drivers/power/supply/axp20x_battery.c
> > index 50ca8e110085..ee8701a6e907 100644
> > --- a/drivers/power/supply/axp20x_battery.c
> > +++ b/drivers/power/supply/axp20x_battery.c
> > @@ -1155,3 +1155,4 @@ module_platform_driver(axp20x_batt_driver);
> > MODULE_DESCRIPTION("Battery power supply driver for AXP20X and AXP22X PMICs");
> > MODULE_AUTHOR("Quentin Schulz <quentin.schulz@free-electrons.com>");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/axp20x_usb_power.c b/drivers/power/supply/axp20x_usb_power.c
> > index e75d1e377ac1..599adcf84968 100644
> > --- a/drivers/power/supply/axp20x_usb_power.c
> > +++ b/drivers/power/supply/axp20x_usb_power.c
> > @@ -1080,3 +1080,4 @@ module_platform_driver(axp20x_usb_power_driver);
> > MODULE_AUTHOR("Hans de Goede <hdegoede@redhat.com>");
> > MODULE_DESCRIPTION("AXP20x PMIC USB power supply status driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/axp288_fuel_gauge.c b/drivers/power/supply/axp288_fuel_gauge.c
> > index a3d71fc72064..c6897dd808fc 100644
> > --- a/drivers/power/supply/axp288_fuel_gauge.c
> > +++ b/drivers/power/supply/axp288_fuel_gauge.c
> > @@ -817,3 +817,4 @@ MODULE_AUTHOR("Ramakrishna Pallala <ramakrishna.pallala@intel.com>");
> > MODULE_AUTHOR("Todd Brandt <todd.e.brandt@linux.intel.com>");
> > MODULE_DESCRIPTION("Xpower AXP288 Fuel Gauge Driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/cpcap-battery.c b/drivers/power/supply/cpcap-battery.c
> > index 8106d1edcbc2..542c3c70e3cb 100644
> > --- a/drivers/power/supply/cpcap-battery.c
> > +++ b/drivers/power/supply/cpcap-battery.c
> > @@ -1176,3 +1176,4 @@ module_platform_driver(cpcap_battery_driver);
> > MODULE_LICENSE("GPL v2");
> > MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
> > MODULE_DESCRIPTION("CPCAP PMIC Battery Driver");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/cpcap-charger.c b/drivers/power/supply/cpcap-charger.c
> > index d0c3008db534..89bc0fc3c9f8 100644
> > --- a/drivers/power/supply/cpcap-charger.c
> > +++ b/drivers/power/supply/cpcap-charger.c
> > @@ -977,3 +977,4 @@ MODULE_AUTHOR("Tony Lindgren <tony@atomide.com>");
> > MODULE_DESCRIPTION("CPCAP Battery Charger Interface driver");
> > MODULE_LICENSE("GPL v2");
> > MODULE_ALIAS("platform:cpcap-charger");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/da9150-charger.c b/drivers/power/supply/da9150-charger.c
> > index 27f36ef5b88d..58449df6068c 100644
> > --- a/drivers/power/supply/da9150-charger.c
> > +++ b/drivers/power/supply/da9150-charger.c
> > @@ -644,3 +644,4 @@ module_platform_driver(da9150_charger_driver);
> > MODULE_DESCRIPTION("Charger Driver for DA9150");
> > MODULE_AUTHOR("Adam Thomson <Adam.Thomson.Opensource@diasemi.com>");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/generic-adc-battery.c b/drivers/power/supply/generic-adc-battery.c
> > index f5f2566b3a32..d18c8ee40405 100644
> > --- a/drivers/power/supply/generic-adc-battery.c
> > +++ b/drivers/power/supply/generic-adc-battery.c
> > @@ -298,3 +298,4 @@ module_platform_driver(gab_driver);
> > MODULE_AUTHOR("anish kumar <yesanishhere@gmail.com>");
> > MODULE_DESCRIPTION("generic battery driver using IIO");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/ingenic-battery.c b/drivers/power/supply/ingenic-battery.c
> > index b111c7ce2be3..5be269f17bff 100644
> > --- a/drivers/power/supply/ingenic-battery.c
> > +++ b/drivers/power/supply/ingenic-battery.c
> > @@ -190,3 +190,4 @@ module_platform_driver(ingenic_battery_driver);
> > MODULE_DESCRIPTION("Battery driver for Ingenic JZ47xx SoCs");
> > MODULE_AUTHOR("Artur Rojek <contact@artur-rojek.eu>");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/intel_dc_ti_battery.c b/drivers/power/supply/intel_dc_ti_battery.c
> > index 56b0c92e9d28..1a16ded563bc 100644
> > --- a/drivers/power/supply/intel_dc_ti_battery.c
> > +++ b/drivers/power/supply/intel_dc_ti_battery.c
> > @@ -387,3 +387,4 @@ MODULE_ALIAS("platform:" DEV_NAME);
> > MODULE_AUTHOR("Hans de Goede <hansg@kernel.org>");
> > MODULE_DESCRIPTION("Intel Dollar Cove (TI) battery driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/lego_ev3_battery.c b/drivers/power/supply/lego_ev3_battery.c
> > index 28454de05761..414816662b06 100644
> > --- a/drivers/power/supply/lego_ev3_battery.c
> > +++ b/drivers/power/supply/lego_ev3_battery.c
> > @@ -231,3 +231,4 @@ module_platform_driver(lego_ev3_battery_driver);
> > MODULE_LICENSE("GPL");
> > MODULE_AUTHOR("David Lechner <david@lechnology.com>");
> > MODULE_DESCRIPTION("LEGO MINDSTORMS EV3 Battery Driver");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/lp8788-charger.c b/drivers/power/supply/lp8788-charger.c
> > index f0a680c155c4..8c6ec98362d0 100644
> > --- a/drivers/power/supply/lp8788-charger.c
> > +++ b/drivers/power/supply/lp8788-charger.c
> > @@ -727,3 +727,4 @@ MODULE_DESCRIPTION("TI LP8788 Charger Driver");
> > MODULE_AUTHOR("Milo Kim");
> > MODULE_LICENSE("GPL");
> > MODULE_ALIAS("platform:lp8788-charger");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/max17040_battery.c b/drivers/power/supply/max17040_battery.c
> > index c1640bc6accd..1fe658bfecc1 100644
> > --- a/drivers/power/supply/max17040_battery.c
> > +++ b/drivers/power/supply/max17040_battery.c
> > @@ -635,3 +635,4 @@ module_i2c_driver(max17040_i2c_driver);
> > MODULE_AUTHOR("Minkyu Kang <mk7.kang@samsung.com>");
> > MODULE_DESCRIPTION("MAX17040 Fuel Gauge");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/mp2629_charger.c b/drivers/power/supply/mp2629_charger.c
> > index d281c1059629..ed49f9a04c8c 100644
> > --- a/drivers/power/supply/mp2629_charger.c
> > +++ b/drivers/power/supply/mp2629_charger.c
> > @@ -660,3 +660,4 @@ module_platform_driver(mp2629_charger_driver);
> > MODULE_AUTHOR("Saravanan Sekar <sravanhome@gmail.com>");
> > MODULE_DESCRIPTION("MP2629 Charger driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/mt6370-charger.c b/drivers/power/supply/mt6370-charger.c
> > index e6db961d5818..2d02fdf37d70 100644
> > --- a/drivers/power/supply/mt6370-charger.c
> > +++ b/drivers/power/supply/mt6370-charger.c
> > @@ -941,3 +941,4 @@ module_platform_driver(mt6370_chg_driver);
> > MODULE_AUTHOR("ChiaEn Wu <chiaen_wu@richtek.com>");
> > MODULE_DESCRIPTION("MediaTek MT6370 Charger Driver");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/qcom_smbx.c b/drivers/power/supply/qcom_smbx.c
> > index b1cb925581ec..63b88754155c 100644
> > --- a/drivers/power/supply/qcom_smbx.c
> > +++ b/drivers/power/supply/qcom_smbx.c
> > @@ -1050,3 +1050,4 @@ module_platform_driver(qcom_spmi_smb);
> > MODULE_AUTHOR("Casey Connolly <casey.connolly@linaro.org>");
> > MODULE_DESCRIPTION("Qualcomm SMB2 Charger Driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/rn5t618_power.c b/drivers/power/supply/rn5t618_power.c
> > index 40dec55a9f73..a3f30e390c11 100644
> > --- a/drivers/power/supply/rn5t618_power.c
> > +++ b/drivers/power/supply/rn5t618_power.c
> > @@ -821,3 +821,4 @@ module_platform_driver(rn5t618_power_driver);
> > MODULE_ALIAS("platform:rn5t618-power");
> > MODULE_DESCRIPTION("Power supply driver for RICOH RN5T618");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/rx51_battery.c b/drivers/power/supply/rx51_battery.c
> > index b0220ec2d926..57266921dc8e 100644
> > --- a/drivers/power/supply/rx51_battery.c
> > +++ b/drivers/power/supply/rx51_battery.c
> > @@ -246,3 +246,4 @@ MODULE_ALIAS("platform:rx51-battery");
> > MODULE_AUTHOR("Pali Rohár <pali@kernel.org>");
> > MODULE_DESCRIPTION("Nokia RX-51 battery driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/sc27xx_fuel_gauge.c b/drivers/power/supply/sc27xx_fuel_gauge.c
> > index a7ed9de8a289..1719ec4173e6 100644
> > --- a/drivers/power/supply/sc27xx_fuel_gauge.c
> > +++ b/drivers/power/supply/sc27xx_fuel_gauge.c
> > @@ -1350,3 +1350,4 @@ module_platform_driver(sc27xx_fgu_driver);
> >
> > MODULE_DESCRIPTION("Spreadtrum SC27XX PMICs Fual Gauge Unit Driver");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/twl4030_charger.c b/drivers/power/supply/twl4030_charger.c
> > index 04216b2bfb6c..151f7b24e9b9 100644
> > --- a/drivers/power/supply/twl4030_charger.c
> > +++ b/drivers/power/supply/twl4030_charger.c
> > @@ -1144,3 +1144,4 @@ MODULE_AUTHOR("Gražvydas Ignotas");
> > MODULE_DESCRIPTION("TWL4030 Battery Charger Interface driver");
> > MODULE_LICENSE("GPL");
> > MODULE_ALIAS("platform:twl4030_bci");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/twl4030_madc_battery.c b/drivers/power/supply/twl4030_madc_battery.c
> > index 3935162e350b..9b3785d1643c 100644
> > --- a/drivers/power/supply/twl4030_madc_battery.c
> > +++ b/drivers/power/supply/twl4030_madc_battery.c
> > @@ -237,3 +237,4 @@ MODULE_LICENSE("GPL");
> > MODULE_AUTHOR("Lukas Märdian <lukas@goldelico.com>");
> > MODULE_DESCRIPTION("twl4030_madc battery driver");
> > MODULE_ALIAS("platform:twl4030_madc_battery");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/power/supply/twl6030_charger.c b/drivers/power/supply/twl6030_charger.c
> > index b4ec26ff257c..82911a811f4e 100644
> > --- a/drivers/power/supply/twl6030_charger.c
> > +++ b/drivers/power/supply/twl6030_charger.c
> > @@ -579,3 +579,4 @@ module_platform_driver(twl6030_charger_driver);
> >
> > MODULE_DESCRIPTION("TWL6030 Battery Charger Interface driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> > index d7f2e6ca92c2..bb6222c8cc5f 100644
> > --- a/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> > +++ b/drivers/thermal/qcom/qcom-spmi-adc-tm5.c
> > @@ -1069,3 +1069,4 @@ module_platform_driver(adc_tm5_driver);
> >
> > MODULE_DESCRIPTION("SPMI PMIC Thermal Monitor ADC driver");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
> > index f39ca0ddd17b..fb003ca96454 100644
> > --- a/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
> > +++ b/drivers/thermal/qcom/qcom-spmi-temp-alarm.c
> > @@ -904,3 +904,4 @@ module_platform_driver(qpnp_tm_driver);
> > MODULE_ALIAS("platform:spmi-temp-alarm");
> > MODULE_DESCRIPTION("QPNP PMIC Temperature Alarm driver");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/thermal/renesas/rzg3s_thermal.c b/drivers/thermal/renesas/rzg3s_thermal.c
> > index e25e36c99a88..7ced8f76a0ec 100644
> > --- a/drivers/thermal/renesas/rzg3s_thermal.c
> > +++ b/drivers/thermal/renesas/rzg3s_thermal.c
> > @@ -270,3 +270,4 @@ module_platform_driver(rzg3s_thermal_driver);
> > MODULE_DESCRIPTION("Renesas RZ/G3S Thermal Sensor Unit Driver");
> > MODULE_AUTHOR("Claudiu Beznea <claudiu.beznea.uj@bp.renesas.com>");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/drivers/thermal/thermal-generic-adc.c b/drivers/thermal/thermal-generic-adc.c
> > index 7c844589b153..cfdb8e674dd2 100644
> > --- a/drivers/thermal/thermal-generic-adc.c
> > +++ b/drivers/thermal/thermal-generic-adc.c
> > @@ -228,3 +228,4 @@ module_platform_driver(gadc_thermal_driver);
> > MODULE_AUTHOR("Laxman Dewangan <ldewangan@nvidia.com>");
> > MODULE_DESCRIPTION("Generic ADC thermal driver using IIO framework with DT");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/sound/soc/codecs/audio-iio-aux.c b/sound/soc/codecs/audio-iio-aux.c
> > index 588e48044c13..864a5a676495 100644
> > --- a/sound/soc/codecs/audio-iio-aux.c
> > +++ b/sound/soc/codecs/audio-iio-aux.c
> > @@ -312,3 +312,4 @@ module_platform_driver(audio_iio_aux_driver);
> > MODULE_AUTHOR("Herve Codina <herve.codina@bootlin.com>");
> > MODULE_DESCRIPTION("IIO ALSA SoC aux driver");
> > MODULE_LICENSE("GPL");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/sound/soc/samsung/aries_wm8994.c b/sound/soc/samsung/aries_wm8994.c
> > index 3723329b266d..b6f0f3c0d393 100644
> > --- a/sound/soc/samsung/aries_wm8994.c
> > +++ b/sound/soc/samsung/aries_wm8994.c
> > @@ -700,3 +700,4 @@ module_platform_driver(aries_audio_driver);
> > MODULE_DESCRIPTION("ALSA SoC ARIES WM8994");
> > MODULE_LICENSE("GPL");
> > MODULE_ALIAS("platform:aries-audio-wm8994");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/sound/soc/samsung/midas_wm1811.c b/sound/soc/samsung/midas_wm1811.c
> > index 239e958b88d3..12c4962f901d 100644
> > --- a/sound/soc/samsung/midas_wm1811.c
> > +++ b/sound/soc/samsung/midas_wm1811.c
> > @@ -773,3 +773,4 @@ module_platform_driver(midas_driver);
> > MODULE_AUTHOR("Simon Shields <simon@lineageos.org>");
> > MODULE_DESCRIPTION("ASoC support for Midas");
> > MODULE_LICENSE("GPL v2");
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> > diff --git a/sound/soc/stm/stm32_adfsdm.c b/sound/soc/stm/stm32_adfsdm.c
> > index c914d1c46850..dabcd2759187 100644
> > --- a/sound/soc/stm/stm32_adfsdm.c
> > +++ b/sound/soc/stm/stm32_adfsdm.c
> > @@ -407,3 +407,4 @@ MODULE_DESCRIPTION("stm32 DFSDM DAI driver");
> > MODULE_AUTHOR("Arnaud Pouliquen <arnaud.pouliquen@st.com>");
> > MODULE_LICENSE("GPL v2");
> > MODULE_ALIAS("platform:" STM32_ADFSDM_DRV_NAME);
> > +MODULE_IMPORT_NS("IIO_CONSUMER");
> >
>
>
^ permalink raw reply
* Re: [PATCH v2] Bluetooth: HIDP: cap report descriptor size in HID setup
From: Eric_Terminal @ 2026-03-22 15:37 UTC (permalink / raw)
To: Benjamin Tissoires
Cc: Bastien Nocera, marcel, johan.hedberg, luiz.dentz,
linux-bluetooth, linux-kernel, linux-input
In-Reply-To: <abFA9nm_fBqw8mNS@beelink>
Hi all,
Just a gentle ping on this patch.
Since Benjamin reviewed it from the input side and concluded it should
be safe, I was wondering if there are any further comments from the
Bluetooth side, or if anything else is needed from me for this to be
merged?
Thanks,
Yufan
On Wed, Mar 11, 2026 at 6:19 PM Benjamin Tissoires <bentiss@kernel.org> wrote:
>
> On Mar 01 2026, Bastien Nocera wrote:
> > On Sun, 2026-03-01 at 01:26 +0800, Eric-Terminal wrote:
> > > From: Yufan Chen <ericterminal@gmail.com>
> > >
> > > hidp_setup_hid() duplicates the report descriptor from userspace
> > > based on
> > > req->rd_size. Large values can trigger oversized copies.
> > >
> > > Do not reject the connection when rd_size exceeds
> > > HID_MAX_DESCRIPTOR_SIZE. Instead, cap rd_size in hidp_setup_hid()
> > > and use the capped value for memdup_user() and session->rd_size.
> > >
> > > This keeps compatibility with existing userspace behavior while
> > > bounding memory usage in the HID setup path.
> >
> > Cross-sending this to linux-input@ for review, they would know the best
> > way to deal with oversized HID descriptors.
>
> AFAICT the hid-core code would be fine with it (it would parse it), but
> there will be some issues (hidraw will not be able to export the entire
> rdesc, so is the sysfs).
>
> For reference, usbhid just returns -EINVAL for oversize report
> descriptors.
>
> Anyway, if the report descriptor is truncated, like in this patch, the
> hid core parse will fail if the data is not correct, so I thing this
> should be safe.
>
> Cheers,
> Benjamin
>
> >
> > >
> > > Signed-off-by: Yufan Chen <ericterminal@gmail.com>
> > > ---
> > > net/bluetooth/hidp/core.c | 7 +++++--
> > > 1 file changed, 5 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/net/bluetooth/hidp/core.c b/net/bluetooth/hidp/core.c
> > > index 6fe815241..31aeffa39 100644
> > > --- a/net/bluetooth/hidp/core.c
> > > +++ b/net/bluetooth/hidp/core.c
> > > @@ -755,13 +755,16 @@ static int hidp_setup_hid(struct hidp_session
> > > *session,
> > > const struct hidp_connadd_req *req)
> > > {
> > > struct hid_device *hid;
> > > + unsigned int rd_size;
> > > int err;
> > >
> > > - session->rd_data = memdup_user(req->rd_data, req->rd_size);
> > > + rd_size = min_t(unsigned int, req->rd_size,
> > > HID_MAX_DESCRIPTOR_SIZE);
> > > +
> > > + session->rd_data = memdup_user(req->rd_data, rd_size);
> > > if (IS_ERR(session->rd_data))
> > > return PTR_ERR(session->rd_data);
> > >
> > > - session->rd_size = req->rd_size;
> > > + session->rd_size = rd_size;
> > >
> > > hid = hid_allocate_device();
> > > if (IS_ERR(hid)) {
> >
^ permalink raw reply
* Re: [PATCH v2 2/2] iio: inkern: Use namespaced exports
From: Dmitry Torokhov @ 2026-03-22 22:24 UTC (permalink / raw)
To: Romain Gantois
Cc: MyungJoo Ham, Chanwoo Choi, Guenter Roeck, Peter Rosin,
Jonathan Cameron, David Lechner, Nuno Sá, Andy Shevchenko,
Lars-Peter Clausen, Michael Hennerich, Mariel Tinaco, Kevin Tsai,
Linus Walleij, Eugen Hristev, Vinod Koul, Kishon Vijay Abraham I,
Sebastian Reichel, Chen-Yu Tsai, Hans de Goede,
Support Opensource, Paul Cercueil, Iskren Chernev,
Krzysztof Kozlowski, Marek Szyprowski, Matheus Castello,
Saravanan Sekar, Matthias Brugger, AngeloGioacchino Del Regno,
Casey Connolly, Pali Rohár, Orson Zhai, Baolin Wang,
Chunyan Zhang, Amit Kucheria, Thara Gopinath, Rafael J. Wysocki,
Daniel Lezcano, Zhang Rui, Lukasz Luba, Claudiu Beznea,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Sylwester Nawrocki, Olivier Moysan, Arnaud Pouliquen,
Maxime Coquelin, Alexandre Torgue, Thomas Petazzoni, linux-kernel,
linux-hwmon, linux-iio, linux-input, linux-phy, linux-pm,
linux-mips, linux-mediatek, linux-arm-msm, linux-sound,
linux-stm32, Sebastian Reichel, Andy Shevchenko
In-Reply-To: <20251209-iio-inkern-use-namespaced-exports-v2-2-9799a33c4b7f@bootlin.com>
On Tue, Dec 09, 2025 at 09:25:56AM +0100, Romain Gantois wrote:
> Use namespaced exports for IIO consumer API functions.
>
> This will make it easier to manage the IIO export surface. Consumer drivers
> will only be provided access to a specific set of functions, thereby
> restricting usage of internal IIO functions by other parts of the kernel.
>
> This change cannot be split into several parts without breaking
> bisectability, thus all of the affected drivers are modified at once.
>
> Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for power-supply
> Acked-by: Guenter Roeck <linux@roeck-us.net>
> Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
For input:
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH v2 2/2] iio: inkern: Use namespaced exports
From: Dmitry Torokhov @ 2026-03-22 22:26 UTC (permalink / raw)
To: Jonathan Cameron
Cc: Romain Gantois, MyungJoo Ham, Chanwoo Choi, Guenter Roeck,
Peter Rosin, David Lechner, Nuno Sá, Andy Shevchenko,
Lars-Peter Clausen, Michael Hennerich, Mariel Tinaco, Kevin Tsai,
Linus Walleij, Eugen Hristev, Vinod Koul, Kishon Vijay Abraham I,
Sebastian Reichel, Chen-Yu Tsai, Hans de Goede,
Support Opensource, Paul Cercueil, Iskren Chernev,
Krzysztof Kozlowski, Marek Szyprowski, Matheus Castello,
Saravanan Sekar, Matthias Brugger, AngeloGioacchino Del Regno,
Casey Connolly, Pali Rohár, Orson Zhai, Baolin Wang,
Chunyan Zhang, Amit Kucheria, Thara Gopinath, Rafael J. Wysocki,
Daniel Lezcano, Zhang Rui, Lukasz Luba, Claudiu Beznea,
Liam Girdwood, Mark Brown, Jaroslav Kysela, Takashi Iwai,
Sylwester Nawrocki, Olivier Moysan, Arnaud Pouliquen,
Maxime Coquelin, Alexandre Torgue, Thomas Petazzoni, linux-kernel,
linux-hwmon, linux-iio, linux-input, linux-phy, linux-pm,
linux-mips, linux-mediatek, linux-arm-msm, linux-sound,
linux-stm32, Sebastian Reichel, Andy Shevchenko
In-Reply-To: <20260322122529.62093f12@jic23-huawei>
On Sun, Mar 22, 2026 at 12:25:29PM +0000, Jonathan Cameron wrote:
> On Sun, 11 Jan 2026 17:02:22 +0000
> Jonathan Cameron <jic23@kernel.org> wrote:
>
> > On Tue, 09 Dec 2025 09:25:56 +0100
> > Romain Gantois <romain.gantois@bootlin.com> wrote:
> >
> > > Use namespaced exports for IIO consumer API functions.
> > >
> > > This will make it easier to manage the IIO export surface. Consumer drivers
> > > will only be provided access to a specific set of functions, thereby
> > > restricting usage of internal IIO functions by other parts of the kernel.
> > >
> > > This change cannot be split into several parts without breaking
> > > bisectability, thus all of the affected drivers are modified at once.
> > >
> > > Acked-by: Sebastian Reichel <sebastian.reichel@collabora.com> # for power-supply
> > > Acked-by: Guenter Roeck <linux@roeck-us.net>
> > > Reviewed-by: Andy Shevchenko <andriy.shevchenko@intel.com>
> > > Signed-off-by: Romain Gantois <romain.gantois@bootlin.com>
> > Ideally looking for a couple more Acks.
> >
> > If any of the maintainers of other trees who haven't already replied
> > have time for a quick glance that would be great. I'll spin an
> > immutable branch but I'm not really expecting any non trivial
> > conflicts unless there is a new user in flight that I've forgotten
> > about.
>
> At this stage, given I'm still waiting on replies from a couple of
> subsystem maintainers, I'm thinking we'll do this next cycle and I'll
> provide an immutable branch based on rc1 for anyone to grab if they
> run into merge conflicts in linux-next.
Sorry, I just acked the input bits in the patch, but in general I feel
these kind of mechanical changes in consumers do not require an ack and
you can just go an apply such changes.
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: uinput - fix circular locking dependency with ff-core
From: Dmitry Torokhov @ 2026-03-23 2:47 UTC (permalink / raw)
To: Mikhail Gavrilov; +Cc: linux-input, linux-kernel
In-Reply-To: <20260228223628.472208-1-mikhail.v.gavrilov@gmail.com>
Hi Mikhail,
On Sun, Mar 01, 2026 at 03:36:28AM +0500, Mikhail Gavrilov wrote:
> A lockdep circular locking dependency warning can be triggered
> reproducibly when using a force-feedback gamepad with uinput (for
> example, playing ELDEN RING under Wine with a Flydigi Vader 5
> controller):
>
> ff->mutex -> udev->mutex -> input_mutex -> dev->mutex -> ff->mutex
>
> The cycle is caused by four lock acquisition paths:
>
> 1. ff upload: input_ff_upload() holds ff->mutex and calls
> uinput_dev_upload_effect() -> uinput_request_submit() ->
> uinput_request_send(), which acquires udev->mutex.
>
> 2. device create: uinput_ioctl_handler() holds udev->mutex and calls
> uinput_create_device() -> input_register_device(), which acquires
> input_mutex.
>
> 3. device register: input_register_device() holds input_mutex and
> calls kbd_connect() -> input_register_handle(), which acquires
> dev->mutex.
>
> 4. evdev release: evdev_release() calls input_flush_device() under
> dev->mutex, which calls input_ff_flush() acquiring ff->mutex.
>
> Fix this by replacing udev->mutex with the existing
> udev->requests_lock spinlock in uinput_request_send(). The function
> only needs to atomically check device state and queue an input event
> into the ring buffer via uinput_dev_event() -- both operations are safe
> under a spinlock (ktime_get_ts64() and wake_up_interruptible() do not
> sleep). This breaks the ff->mutex -> udev->mutex link since a spinlock
> is a leaf in the lock ordering and cannot form cycles with mutexes.
>
> To keep state transitions visible to uinput_request_send(), protect
> writes to udev->state in uinput_create_device() and
> uinput_destroy_device() with the same spinlock.
Thank you for the patch, it looks solid, however I wonder if creating a
separate "state_lock" spinlock would not be better than reusing
requests_lock?
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH 2/3] Input: adafruit-seesaw - add interrupt support
From: Dmitry Torokhov @ 2026-03-23 5:12 UTC (permalink / raw)
To: charles.embedded
Cc: Anshul Dalal, Shuah Khan, Brigham Campbell, linux-input,
linux-kernel, Charles Dias
In-Reply-To: <20260321202446.724277-3-charles.embedded@gmail.com>
Hi Charles,
On Sat, Mar 21, 2026 at 05:24:45PM -0300, charles.embedded@gmail.com wrote:
> @@ -289,6 +341,19 @@ static int seesaw_probe(struct i2c_client *client)
> input_set_max_poll_interval(seesaw->input_dev, SEESAW_GAMEPAD_POLL_MAX);
> input_set_min_poll_interval(seesaw->input_dev, SEESAW_GAMEPAD_POLL_MIN);
>
> + if (client->irq) {
> + err = seesaw_register_write_u32(client, SEESAW_GPIO_INTENSET, SEESAW_BUTTON_MASK);
> + if (err)
> + return dev_err_probe(&client->dev, err,
> + "failed to enable hardware interrupts\n");
Maybe this should be in seesaw_open()?
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: uinput - fix circular locking dependency with ff-core
From: Mikhail Gavrilov @ 2026-03-23 5:17 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel
In-Reply-To: <acCpW6McaPOE0Jq5@google.com>
On Mon, Mar 23, 2026 at 7:47 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Thank you for the patch, it looks solid, however I wonder if creating a
> separate "state_lock" spinlock would not be better than reusing
> requests_lock?
Hi Dmitry,
Thank you for the review.
A separate spinlock would certainly be cleaner from a naming
perspective. One thing I'd like to note though: the current
approach of reusing requests_lock has the benefit of atomically
checking state and queueing the event in uinput_request_send(),
and atomically changing state and flushing requests in
uinput_destroy_device(). With a separate state_lock these become
two independent locks, so the ordering between them would need to
be defined.
That said, if you prefer the cleaner separation I'm happy to make
the change. Please let me know.
--
Best Regards,
Mike Gavrilov.
^ permalink raw reply
* Re: [PATCH] Input: uinput - fix circular locking dependency with ff-core
From: Dmitry Torokhov @ 2026-03-23 5:34 UTC (permalink / raw)
To: Mikhail Gavrilov; +Cc: linux-input, linux-kernel
In-Reply-To: <CABXGCsOwJu2dw67bR38MJb5DFvGon=MUCxKcGEQYfT6qrPZU1w@mail.gmail.com>
On Mon, Mar 23, 2026 at 10:17:01AM +0500, Mikhail Gavrilov wrote:
> On Mon, Mar 23, 2026 at 7:47 AM Dmitry Torokhov
> <dmitry.torokhov@gmail.com> wrote:
> >
> > Thank you for the patch, it looks solid, however I wonder if creating a
> > separate "state_lock" spinlock would not be better than reusing
> > requests_lock?
>
> Hi Dmitry,
>
> Thank you for the review.
>
> A separate spinlock would certainly be cleaner from a naming
> perspective. One thing I'd like to note though: the current
> approach of reusing requests_lock has the benefit of atomically
> checking state and queueing the event in uinput_request_send(),
> and atomically changing state and flushing requests in
> uinput_destroy_device(). With a separate state_lock these become
> two independent locks, so the ordering between them would need to
> be defined.
Hmm, I am not sure I see the issue. We are not going to change state
back to UIST_CREATED until after uinput_destroy_device() returns so we
will not submit more requests...
What am I missing?
Thanks.
--
Dmitry
^ permalink raw reply
* Re: [PATCH] Input: uinput - fix circular locking dependency with ff-core
From: Mikhail Gavrilov @ 2026-03-23 5:39 UTC (permalink / raw)
To: Dmitry Torokhov; +Cc: linux-input, linux-kernel
In-Reply-To: <acDPeFpxX57Uu0Mm@google.com>
On Mon, Mar 23, 2026 at 10:34 AM Dmitry Torokhov
<dmitry.torokhov@gmail.com> wrote:
>
> Hmm, I am not sure I see the issue. We are not going to change state
> back to UIST_CREATED until after uinput_destroy_device() returns so we
> will not submit more requests...
>
> What am I missing?
You are right, there is no lock ordering issue since the state
transition is one-way.
The reason I reused requests_lock is that uinput_request_send()
needs to atomically check state and access udev->dev. If we use a
separate state_lock and release it before calling
uinput_dev_event(), uinput_destroy_device() could run in between,
unregister the device, and we'd hit a use-after-free on udev->dev.
A separate lock would need to be held across the same scope,
making it functionally equivalent to reusing requests_lock.
--
Best Regards,
Mike Gavrilov.
^ permalink raw reply
* [PATCH 2/7] Input: aiptek: validate macro key indices
From: Pengpeng Hou @ 2026-03-23 7:03 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, linux-kernel, pengpeng
aiptek_irq() derives macro key indices directly from tablet reports and
then uses them to index macroKeyEvents[]. Report types 4 and 5 use
(data[3] >> 1), while report type 6 reads a 16-bit macro number from the
packet body. None of those indices are checked against the array bounds
before input_report_key() dereferences them.
Reject out-of-range macro indices at each use site so malformed reports
cannot read past macroKeyEvents[].
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
drivers/input/tablet/aiptek.c | 21 ++++++++++++++-------
1 file changed, 14 insertions(+), 7 deletions(-)
diff --git a/drivers/input/tablet/aiptek.c b/drivers/input/tablet/aiptek.c
index 6df24cee3c9d..ab5886a9241d 100644
--- a/drivers/input/tablet/aiptek.c
+++ b/drivers/input/tablet/aiptek.c
@@ -676,12 +676,15 @@ static void aiptek_irq(struct urb *urb)
}
}
- if (aiptek->lastMacro != -1 && aiptek->lastMacro != macro) {
+ if (aiptek->lastMacro >= 0 &&
+ aiptek->lastMacro < ARRAY_SIZE(macroKeyEvents) &&
+ aiptek->lastMacro != macro) {
input_report_key(inputdev, macroKeyEvents[aiptek->lastMacro], 0);
aiptek->lastMacro = -1;
}
- if (macro != -1 && macro != aiptek->lastMacro) {
+ if (macro >= 0 && macro < ARRAY_SIZE(macroKeyEvents) &&
+ macro != aiptek->lastMacro) {
input_report_key(inputdev, macroKeyEvents[macro], 1);
aiptek->lastMacro = macro;
}
@@ -715,12 +718,15 @@ static void aiptek_irq(struct urb *urb)
}
}
- if (aiptek->lastMacro != -1 && aiptek->lastMacro != macro) {
+ if (aiptek->lastMacro >= 0 &&
+ aiptek->lastMacro < ARRAY_SIZE(macroKeyEvents) &&
+ aiptek->lastMacro != macro) {
input_report_key(inputdev, macroKeyEvents[aiptek->lastMacro], 0);
aiptek->lastMacro = -1;
}
- if (macro != -1 && macro != aiptek->lastMacro) {
+ if (macro >= 0 && macro < ARRAY_SIZE(macroKeyEvents) &&
+ macro != aiptek->lastMacro) {
input_report_key(inputdev, macroKeyEvents[macro], 1);
aiptek->lastMacro = macro;
}
@@ -737,11 +743,11 @@ static void aiptek_irq(struct urb *urb)
*/
else if (data[0] == 6) {
macro = get_unaligned_le16(data + 1);
- if (macro > 0) {
+ if (macro > 0 && macro - 1 < ARRAY_SIZE(macroKeyEvents)) {
input_report_key(inputdev, macroKeyEvents[macro - 1],
0);
}
- if (macro < 25) {
+ if (macro + 1 < ARRAY_SIZE(macroKeyEvents)) {
input_report_key(inputdev, macroKeyEvents[macro + 1],
0);
}
@@ -760,7 +766,8 @@ static void aiptek_irq(struct urb *urb)
aiptek->curSetting.toolMode;
}
- input_report_key(inputdev, macroKeyEvents[macro], 1);
+ if (macro < ARRAY_SIZE(macroKeyEvents))
+ input_report_key(inputdev, macroKeyEvents[macro], 1);
input_report_abs(inputdev, ABS_MISC,
1 | AIPTEK_REPORT_TOOL_UNKNOWN);
input_sync(inputdev);
--
2.50.1 (Apple Git-155)
^ permalink raw reply related
* [PATCH] Input: gf2k: clamp hat values to the lookup table
From: Pengpeng Hou @ 2026-03-23 7:45 UTC (permalink / raw)
To: dmitry.torokhov; +Cc: linux-input, linux-kernel, kees, pengpeng
gf2k_read() decodes the hat position from a 4-bit field and uses it
directly to index gf2k_hat_to_axis[]. The lookup table only has nine
entries, so malformed packets can read past the end of the fixed table.
Clamp invalid hat values to the neutral position before indexing the
lookup table.
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
drivers/input/joystick/gf2k.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/input/joystick/gf2k.c b/drivers/input/joystick/gf2k.c
index 5a1cdce0bc48..78fba36285dc 100644
--- a/drivers/input/joystick/gf2k.c
+++ b/drivers/input/joystick/gf2k.c
@@ -164,6 +164,8 @@ static void gf2k_read(struct gf2k *gf2k, unsigned char *data)
input_report_abs(dev, gf2k_abs[i], GB(i*9+60,8,0) | GB(i+54,1,9));
t = GB(40,4,0);
+ if (t >= ARRAY_SIZE(gf2k_hat_to_axis))
+ t = 0;
for (i = 0; i < gf2k_hats[gf2k->id]; i++)
input_report_abs(dev, ABS_HAT0X + i, gf2k_hat_to_axis[t][i]);
--
2.50.1 (Apple Git-155)
^ permalink raw reply related
* Re: [PATCH v6 4/4] Input: Add TouchNetix aXiom I2C Touchscreen support
From: Andrew Thomas @ 2026-03-23 9:59 UTC (permalink / raw)
To: Marco Felsch
Cc: Luis Chamberlain, Russ Weight, Greg Kroah-Hartman,
Rafael J. Wysocki, Andrew Morton, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Dmitry Torokhov, Kamel Bouhara,
Marco Felsch, Henrik Rydberg, Danilo Krummrich, linux-kernel,
devicetree, linux-input
In-Reply-To: <enyz3io3i7mzoaquexpkbsjtxmcuib7lxj334ii2yqvdgpvajb@aspqccwo7vnf>
On Fri, Mar 13, 2026 at 08:50:05PM +0100, Marco Felsch wrote:
>Hi Andrew,
>
>thanks for your feedback! Please see below.
>
>On 26-03-13, Andrew Thomas wrote:
>> On Tue, Mar 03, 2026 at 11:41:22PM +0100, Marco Felsch wrote:
>> >This adds the initial support for the TouchNetix AX54A touchcontroller
>> >which is part of TouchNetix's aXiom touchscreen controller family.
>> >
>> >The TouchNetix aXiom family provides two physical interfaces: SPI and
>> >I2C. This patch covers only the I2C interface.
>> >
>> >Apart the input event handling the driver supports firmware updates too.
>> >One firmware interface handles the touchcontroller firmware (AXFW)
>> >update the other handles the touchcontroller configuration (TH2CFGBIN)
>> >update.
>> >
>> >Signed-off-by: Marco Felsch <m.felsch@pengutronix.de>
>> >---
>
>...
>
>> >+static int axiom_u02_enter_bootloader(struct axiom_data *ts)
>> >+{
>> >+ struct axiom_u02_rev1_system_manager_msg msg = { };
>> >+ struct device *dev = ts->dev;
>> >+ unsigned int val;
>> >+ int error;
>> >+
>> >+ if (!axiom_driver_supports_usage(ts, AXIOM_U02))
>> >+ return -EINVAL;
>> >+
>> >+ /*
>> >+ * Enter the bootloader mode requires 3 consecutive messages so we can't
>> >+ * check for the response.
>> >+ * TODO: Check if it's required to add a delay between the consecutive
>> >+ * CMD_ENTERBOOTLOADER cmds.
>> >+ */
>> >+ msg.command = cpu_to_le16(AXIOM_U02_REV1_CMD_ENTERBOOTLOADER);
>> >+ msg.parameters[0] = cpu_to_le16(AXIOM_U02_REV1_PARAM0_ENTERBOOLOADER_KEY1);
>> >+ error = axiom_u02_send_msg(ts, &msg, false);
>>
>> As mentioned before the delay between commands is too short and the
>> next command is sent before u02 is ready, which means the driver fails
>> to put axiom into the bootloader.
>
>Please see my comment [1].
>
>> Have you tested with an i2c speed of 400KHz?
>
>Yes, my target platform is based on a i.MX8MP.
>
>> All you need is to put true in above to wait for the bootloader command.
>> error = axiom_u02_send_msg(ts, &msg, true);
>
>Please see my comment [1].
>
>> Just dont do it for the last command.
>
>Please see my comment [1].
>
>> I am not too sure why you are having issues with this, this is how we
>> do it for all our devices.
>
>Please see my comment [1].
>
>On what platform do you perform the tests?
>
>> >+ if (error) {
>> >+ dev_err(dev, "Failed to send bootloader-key1: %d\n", error);
>> >+ return error;
>> >+ }
>> >+
>> >+ msg.parameters[0] = cpu_to_le16(AXIOM_U02_REV1_PARAM0_ENTERBOOLOADER_KEY2);
>> >+ error = axiom_u02_send_msg(ts, &msg, false);
>>
>> Here also.
>
>Please see my comment [1].
>
>> >+ if (error) {
>> >+ dev_err(dev, "Failed to send bootloader-key2: %d\n", error);
>> >+ return error;
>> >+ }
>> >+
>> >+ msg.parameters[0] = cpu_to_le16(AXIOM_U02_REV1_PARAM0_ENTERBOOLOADER_KEY3);
>> >+ error = axiom_u02_send_msg(ts, &msg, false);
>> >+ if (error) {
>> >+ dev_err(dev, "Failed to send bootloader-key3: %d\n", error);
>> >+ return error;
>> >+ }
>> >+
>> >+ /* Sleep before the first read to give the device time */
>> >+ fsleep(250 * USEC_PER_MSEC);
>> >+
>> >+ /* Wait till the device reports it is in bootloader mode */
>> >+ error = regmap_read_poll_timeout(ts->regmap,
>> >+ AXIOM_U31_REV1_DEVICE_ID_HIGH_REG, val,
>> >+ FIELD_GET(AXIOM_U31_REV1_MODE_MASK, val) ==
>> >+ AXIOM_U31_REV1_MODE_BLP,
>> >+ 250 * USEC_PER_MSEC, USEC_PER_SEC);
>> >+ if (error)
>> >+ return error;
>> >+
>> >+ return 0;
>> >+}
>> >+
>>
>> ...
>>
>>
>> Other than the above comments I have no issues with the driver.
>
>If you're fine with the patch you could add your acked-by [2] :)
>
>> We can support more usages in a later patch.
>
>Sure :)
>
>[1] https://lore.kernel.org/all/4x3dnedfzf3rqzsy3wjdoj6yaxmy6kop37xhxeao4vjer7ifdi@35ux42ztq3eb
>[2] https://docs.kernel.org/process/submitting-patches.html#when-to-use-acked-by-cc-and-co-developed-by
>
>Regards,
> Marco
>--
>#gernperDu
>#CallMeByMyFirstName
>
>Pengutronix e.K. | |
>Steuerwalder Str. 21 | https://www.pengutronix.de |
>31137 Hildesheim, Germany | Phone: +49-5121-206917-0 |
>Amtsgericht Hildesheim, HRA 2686 | Fax: +49-5121-206917-9 |
Acked-by: Andrew Thomas <andrew.thomas@touchnetix.com>
^ permalink raw reply
* [PATCH] Input: penmount: bound packet buffer indices in IRQ path
From: Pengpeng Hou @ 2026-03-23 12:17 UTC (permalink / raw)
To: dmitry.torokhov
Cc: andriy.shevchenko, kees, linux-input, linux-kernel, pengpeng
The IRQ handler stores each incoming byte into pm->data[] before the
packet parser gets a chance to reset pm->idx. If the incoming serial
stream never matches one of the expected packet headers, pm->idx can
advance past the fixed receive buffer and the next IRQ will write beyond
PM_MAX_LENGTH.
Reset stale indices before writing the next byte so malformed packet
streams cannot walk past the end of the local packet buffer.
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
---
drivers/input/touchscreen/penmount.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/input/touchscreen/penmount.c b/drivers/input/touchscreen/penmount.c
index 4b57b6664e37..ba09096c6573 100644
--- a/drivers/input/touchscreen/penmount.c
+++ b/drivers/input/touchscreen/penmount.c
@@ -163,6 +163,9 @@ static irqreturn_t pm_interrupt(struct serio *serio,
{
struct pm *pm = serio_get_drvdata(serio);
+ if (pm->idx >= pm->packetsize || pm->idx >= PM_MAX_LENGTH)
+ pm->idx = 0;
+
pm->data[pm->idx] = data;
pm->parse_packet(pm);
--
2.50.1 (Apple Git-155)
^ permalink raw reply related
* [PATCH] HID: playstation: validate num_touch_reports in DualShock 4 reports
From: FirstName LastName @ 2026-03-23 12:47 UTC (permalink / raw)
To: Roderick Colenbrander, Jiri Kosina, Benjamin Tissoires
Cc: linux-input, linux-kernel, Benoît Sevens
From: Benoît Sevens <bsevens@google.com>
The DualShock 4 HID driver fails to validate the num_touch_reports field
received from the device in both USB and Bluetooth input reports.
A malicious device could set this field to a value larger than the
allocated size of the touch_reports array (3 for USB, 4 for Bluetooth),
leading to an out-of-bounds read in dualshock4_parse_report().
This can result in kernel memory disclosure when processing malicious
HID reports.
Validate num_touch_reports against the array size for the respective
connection types before processing the touch data.
Signed-off-by: Benoît Sevens <bsevens@google.com>
---
drivers/hid/hid-playstation.c | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/drivers/hid/hid-playstation.c b/drivers/hid/hid-playstation.c
index 3c0db8f93c82..c43caac20b61 100644
--- a/drivers/hid/hid-playstation.c
+++ b/drivers/hid/hid-playstation.c
@@ -2377,6 +2377,12 @@ static int dualshock4_parse_report(struct ps_device *ps_dev, struct hid_report *
struct dualshock4_input_report_usb *usb =
(struct dualshock4_input_report_usb *)data;
+ if (usb->num_touch_reports > ARRAY_SIZE(usb->touch_reports)) {
+ hid_err(hdev, "DualShock4 USB input report has invalid num_touch_reports=%d\n",
+ usb->num_touch_reports);
+ return -EINVAL;
+ }
+
ds4_report = &usb->common;
num_touch_reports = usb->num_touch_reports;
touch_reports = usb->touch_reports;
@@ -2391,6 +2397,12 @@ static int dualshock4_parse_report(struct ps_device *ps_dev, struct hid_report *
return -EILSEQ;
}
+ if (bt->num_touch_reports > ARRAY_SIZE(bt->touch_reports)) {
+ hid_err(hdev, "DualShock4 BT input report has invalid num_touch_reports=%d\n",
+ bt->num_touch_reports);
+ return -EINVAL;
+ }
+
ds4_report = &bt->common;
num_touch_reports = bt->num_touch_reports;
touch_reports = bt->touch_reports;
--
2.53.0.959.g497ff81fa9-goog
^ permalink raw reply related
* Re: [PATCH] Input: penmount: bound packet buffer indices in IRQ path
From: Andy Shevchenko @ 2026-03-23 13:32 UTC (permalink / raw)
To: Pengpeng Hou; +Cc: dmitry.torokhov, kees, linux-input, linux-kernel
In-Reply-To: <20260323121715.74954-1-pengpeng@iscas.ac.cn>
On Mon, Mar 23, 2026 at 08:17:15PM +0800, Pengpeng Hou wrote:
> The IRQ handler stores each incoming byte into pm->data[] before the
> packet parser gets a chance to reset pm->idx. If the incoming serial
> stream never matches one of the expected packet headers, pm->idx can
> advance past the fixed receive buffer and the next IRQ will write beyond
> PM_MAX_LENGTH.
How did you find the issue? Any assistance?
> Reset stale indices before writing the next byte so malformed packet
> streams cannot walk past the end of the local packet buffer.
Why do you think this is the best possible approach? Maybe we should
simply ignore IRQ or handle it without any further actions?
--
With Best Regards,
Andy Shevchenko
^ permalink raw reply
* [PATCH] dt-bindings: input: matrix-keymap: fix key board wording
From: Hugo Villeneuve @ 2026-03-23 14:00 UTC (permalink / raw)
To: Dmitry Torokhov, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Olof Johansson
Cc: hugo, Hugo Villeneuve, linux-input, devicetree, linux-kernel
From: Hugo Villeneuve <hvilleneuve@dimonoff.com>
The correct wording is keyboard, without a space.
Signed-off-by: Hugo Villeneuve <hvilleneuve@dimonoff.com>
---
Documentation/devicetree/bindings/input/matrix-keymap.yaml | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/input/matrix-keymap.yaml b/Documentation/devicetree/bindings/input/matrix-keymap.yaml
index a715c2a773fe..ce910e4ac823 100644
--- a/Documentation/devicetree/bindings/input/matrix-keymap.yaml
+++ b/Documentation/devicetree/bindings/input/matrix-keymap.yaml
@@ -4,13 +4,13 @@
$id: http://devicetree.org/schemas/input/matrix-keymap.yaml#
$schema: http://devicetree.org/meta-schemas/core.yaml#
-title: Common Key Matrices on Matrix-connected Key Boards
+title: Common Key Matrices on Matrix-connected Keyboards
maintainers:
- Olof Johansson <olof@lixom.net>
description: |
- A simple common binding for matrix-connected key boards. Currently targeted at
+ A simple common binding for matrix-connected keyboards. Currently targeted at
defining the keys in the scope of linux key codes since that is a stable and
standardized interface at this time.
base-commit: c369299895a591d96745d6492d4888259b004a9e
--
2.47.3
^ permalink raw reply related
page: next (older) | prev (newer) | latest
- recent:[subjects (threaded)|topics (new)|topics (active)]
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox