From 5a7c42811589e2da5e7f1fcd45328e7ead70d008 Mon Sep 17 00:00:00 2001 From: bui duc phuc Date: Mon, 27 Jul 2026 17:11:24 +0700 Subject: [PATCH 01/94] Input: snvs_pwrkey - tidy up error reporting in probe Do not print the error twice when acquiring clock fails and drop the redundant error message after devm_request_irq(), as the helper already reports request failures internally. Signed-off-by: bui duc phuc Link: https://patch.msgid.link/20260727101125.28291-1-phucduc.bui@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/snvs_pwrkey.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/drivers/input/keyboard/snvs_pwrkey.c b/drivers/input/keyboard/snvs_pwrkey.c index 9d51c7ff1ebb..72d43d8deb78 100644 --- a/drivers/input/keyboard/snvs_pwrkey.c +++ b/drivers/input/keyboard/snvs_pwrkey.c @@ -179,7 +179,7 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) clk = devm_clk_get_optional_enabled(dev, NULL); if (IS_ERR(clk)) return dev_err_probe(dev, PTR_ERR(clk), - "Failed to get snvs clock (%pe)\n", clk); + "Failed to get snvs clock\n"); pdata->wakeup = of_property_read_bool(np, "wakeup-source"); @@ -236,14 +236,13 @@ static int imx_snvs_pwrkey_probe(struct platform_device *pdev) pdata->input = input; platform_set_drvdata(pdev, pdata); - error = devm_request_irq(dev, pdata->irq, - imx_snvs_pwrkey_interrupt, + error = devm_request_irq(dev, pdata->irq, imx_snvs_pwrkey_interrupt, 0, pdev->name, pdev); if (error) - return dev_err_probe(dev, error, "interrupt not available.\n"); + return error; error = input_register_device(input); - if (error < 0) + if (error) return dev_err_probe(dev, error, "failed to register input device\n"); device_init_wakeup(dev, pdata->wakeup); From fcc1d6eab4ce4ba86ae05a87ecf7ce06cd2ca4d8 Mon Sep 17 00:00:00 2001 From: bui duc phuc Date: Mon, 27 Jul 2026 17:11:25 +0700 Subject: [PATCH 02/94] Input: st-keyscan - improve probe error handling Use dev_err_probe() for devm_clk_get() to prevent log spam when probe returns -EPROBE_DEFER. Drop the redundant error message after devm_request_irq(), since the helper already reports request failures internally. Return the original error from platform_get_irq() instead of replacing it with -EINVAL. Signed-off-by: bui duc phuc Link: https://patch.msgid.link/20260727101125.28291-2-phucduc.bui@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/st-keyscan.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c index e53ef4c670e4..8e9bac339dc4 100644 --- a/drivers/input/keyboard/st-keyscan.c +++ b/drivers/input/keyboard/st-keyscan.c @@ -173,10 +173,9 @@ static int keyscan_probe(struct platform_device *pdev) return PTR_ERR(keypad_data->base); keypad_data->clk = devm_clk_get(&pdev->dev, NULL); - if (IS_ERR(keypad_data->clk)) { - dev_err(&pdev->dev, "cannot get clock\n"); - return PTR_ERR(keypad_data->clk); - } + if (IS_ERR(keypad_data->clk)) + return dev_err_probe(&pdev->dev, PTR_ERR(keypad_data->clk), + "cannot get clock\n"); error = clk_enable(keypad_data->clk); if (error) { @@ -188,14 +187,12 @@ static int keyscan_probe(struct platform_device *pdev) keypad_data->irq = platform_get_irq(pdev, 0); if (keypad_data->irq < 0) - return -EINVAL; + return keypad_data->irq; error = devm_request_irq(&pdev->dev, keypad_data->irq, keyscan_isr, 0, pdev->name, keypad_data); - if (error) { - dev_err(&pdev->dev, "failed to request IRQ\n"); + if (error) return error; - } error = input_register_device(input_dev); if (error) { From e0e8f43517dddf01c7fb82a3bd64b9096b90a3f1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C8=98tefan=20Ghe=C8=9Bu?= Date: Fri, 21 Aug 2026 16:10:39 +0300 Subject: [PATCH 03/94] dt-bindings: input: touchscreen: convert sis_i2c to DT schema MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert the SiS 9200 family I2C touchscreen binding from free-form text to DT schema format. While at it, fix the example which referenced a non-existent "irq-gpios" property; the driver looks up "attn" via devm_gpiod_get_optional(), so the correct property is "attn-gpios". Signed-off-by: Ștefan Ghețu Reviewed-by: Mika Penttilä Acked-by: Conor Dooley Link: https://patch.msgid.link/20260821131039.37525-1-stefanghetu9@gmail.com Signed-off-by: Dmitry Torokhov --- .../input/touchscreen/sis,9200-ts.yaml | 61 +++++++++++++++++++ .../bindings/input/touchscreen/sis_i2c.txt | 31 ---------- MAINTAINERS | 2 +- 3 files changed, 62 insertions(+), 32 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/sis,9200-ts.yaml delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/sis_i2c.txt diff --git a/Documentation/devicetree/bindings/input/touchscreen/sis,9200-ts.yaml b/Documentation/devicetree/bindings/input/touchscreen/sis,9200-ts.yaml new file mode 100644 index 000000000000..5c4806348fcb --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/sis,9200-ts.yaml @@ -0,0 +1,61 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/sis,9200-ts.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: SiS 9200 Family I2C Touchscreen Controller + +maintainers: + - Mika Penttilä + +allOf: + - $ref: touchscreen.yaml# + +properties: + compatible: + const: sis,9200-ts + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + attn-gpios: + maxItems: 1 + description: GPIO pin used as the attention line + + reset-gpios: + maxItems: 1 + description: GPIO pin used to reset the controller + + wakeup-source: true + +required: + - compatible + - reg + - interrupts + +unevaluatedProperties: false + +examples: + - | + #include + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@5c { + compatible = "sis,9200-ts"; + reg = <0x5c>; + pinctrl-names = "default"; + pinctrl-0 = <&pinctrl_sis>; + interrupt-parent = <&gpio3>; + interrupts = <19 IRQ_TYPE_EDGE_FALLING>; + attn-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>; + reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; + }; + }; diff --git a/Documentation/devicetree/bindings/input/touchscreen/sis_i2c.txt b/Documentation/devicetree/bindings/input/touchscreen/sis_i2c.txt deleted file mode 100644 index 8f5322e01024..000000000000 --- a/Documentation/devicetree/bindings/input/touchscreen/sis_i2c.txt +++ /dev/null @@ -1,31 +0,0 @@ -* SiS I2C Multiple Touch Controller - -Required properties: -- compatible: must be "sis,9200-ts" -- reg: i2c slave address -- interrupts: touch controller interrupt (see interrupt - binding [0]) - -Optional properties: -- pinctrl-names: should be "default" (see pinctrl binding [1]). -- pinctrl-0: a phandle pointing to the pin settings for the - device (see pinctrl binding [1]). -- attn-gpios: the gpio pin used as attention line -- reset-gpios: the gpio pin used to reset the controller -- wakeup-source: touchscreen can be used as a wakeup source - -[0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt -[1]: Documentation/devicetree/bindings/pinctrl/pinctrl-bindings.txt - -Example: - - sis9255@5c { - compatible = "sis,9200-ts"; - reg = <0x5c>; - pinctrl-names = "default"; - pinctrl-0 = <&pinctrl_sis>; - interrupt-parent = <&gpio3>; - interrupts = <19 IRQ_TYPE_EDGE_FALLING>; - irq-gpios = <&gpio3 19 GPIO_ACTIVE_LOW>; - reset-gpios = <&gpio2 30 GPIO_ACTIVE_LOW>; - }; diff --git a/MAINTAINERS b/MAINTAINERS index 806bd2d80d15..b8c4e1080af9 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -24865,7 +24865,7 @@ SIS I2C TOUCHSCREEN DRIVER M: Mika Penttilä L: linux-input@vger.kernel.org S: Maintained -F: Documentation/devicetree/bindings/input/touchscreen/sis_i2c.txt +F: Documentation/devicetree/bindings/input/touchscreen/sis,9200-ts.yaml F: drivers/input/touchscreen/sis_i2c.c SIS USB2VGA DRIVER From f2db017d795282fbdd5a30dc7d7712494852bf91 Mon Sep 17 00:00:00 2001 From: Linmao Li Date: Wed, 9 Sep 2026 18:07:39 +0800 Subject: [PATCH 04/94] Input: matrix-keymap - reject keycodes above KEY_MAX matrix_keypad_map_key() validates the row and column of each entry before using them to update the keymap. It does not validate the keycode before using it as a bit number in input_dev->keybit, which only has KEY_CNT bits. A malformed firmware or platform keymap can therefore write past the bitmap. Reject keycodes above KEY_MAX before updating the keymap or capability bitmap. Fixes: 77a53fd21870 ("Input: matrix-keypad - add function to build device keymap") Signed-off-by: Linmao Li Link: https://patch.msgid.link/20260909100739.3107556-1-lilinmao@kylinos.cn Signed-off-by: Dmitry Torokhov --- drivers/input/matrix-keymap.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/drivers/input/matrix-keymap.c b/drivers/input/matrix-keymap.c index 3bea3575a0a9..e4227e96aa4e 100644 --- a/drivers/input/matrix-keymap.c +++ b/drivers/input/matrix-keymap.c @@ -35,6 +35,13 @@ static bool matrix_keypad_map_key(struct input_dev *input_dev, return false; } + if (code > KEY_MAX) { + dev_err(input_dev->dev.parent, + "%s: invalid keycode %u in keymap entry 0x%x\n", + __func__, code, key); + return false; + } + keymap[MATRIX_SCAN_CODE(row, col, row_shift)] = code; __set_bit(code, input_dev->keybit); From e7ca2ca510cc5c2ec3c0c739b2b0f43561f40b77 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 30 Aug 2026 13:52:46 -0700 Subject: [PATCH 05/94] Input: gscps2 - clean up driver code style and structure Clean up code style issues and function ordering in the gscps2 driver: - Reorder functions to place gscps2_interrupt() before its callers, allowing removal of its forward declaration. - Change gscps2_enable() to accept a boolean parameter and remove the ENABLE and DISABLE macro definitions. - Convert printk() calls to dev_dbg() and dev_warn(). - Fix operator spacing and multi-variable assignment. - Add spinlock comment and use cpu_relax() in spin-wait loop. Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-1-c733d4cae7f9@gmail.com Acked-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Dmitry Torokhov --- drivers/input/serio/gscps2.c | 208 +++++++++++++++-------------------- 1 file changed, 91 insertions(+), 117 deletions(-) diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 43453ec533b2..b82c56ba8ff7 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -1,6 +1,4 @@ /* - * drivers/input/serio/gscps2.c - * * Copyright (c) 2004-2006 Helge Deller * Copyright (c) 2002 Laurent Canet * Copyright (c) 2002 Thibaut Varene @@ -37,16 +35,10 @@ MODULE_AUTHOR("Laurent Canet , Thibaut Varene addr) & GSC_STAT_RBNE) gscps2_readb_input(ps2port->addr); - ps2port->act = ps2port->append = 0; + ps2port->act = 0; + ps2port->append = 0; } -/* - * gscps2_writeb_output() - write a byte to the port - * - * returns 1 on success, 0 on error - */ - -static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data) -{ - char __iomem *addr = ps2port->addr; - - if (!wait_TBE(addr)) { - printk(KERN_DEBUG PFX "timeout - could not write byte %#x\n", data); - return 0; - } - - while (gscps2_readb_status(addr) & GSC_STAT_RBNE) - /* wait */; - - scoped_guard(spinlock_irqsave, &ps2port->lock) - writeb(data, addr+GSC_XMTDATA); - - /* this is ugly, but due to timing of the port it seems to be necessary. */ - mdelay(6); - - /* make sure any received data is returned as fast as possible */ - /* this is important e.g. when we set the LEDs on the keyboard */ - gscps2_interrupt(0, NULL); - - return 1; -} - - -/* - * gscps2_enable() - enables or disables the port - */ - -static void gscps2_enable(struct gscps2port *ps2port, int enable) -{ - u8 data; - - /* now enable/disable the port */ - scoped_guard(spinlock_irqsave, &ps2port->lock) { - gscps2_flush(ps2port); - data = gscps2_readb_control(ps2port->addr); - if (enable) - data |= GSC_CTRL_ENBL; - else - data &= ~GSC_CTRL_ENBL; - gscps2_writeb_control(data, ps2port->addr); - } - - wait_TBE(ps2port->addr); - gscps2_flush(ps2port); -} - -/* - * gscps2_reset() - resets the PS/2 port - */ - -static void gscps2_reset(struct gscps2port *ps2port) -{ - /* reset the interface */ - guard(spinlock_irqsave)(&ps2port->lock); - gscps2_flush(ps2port); - writeb(0xff, ps2port->addr + GSC_RESET); - gscps2_flush(ps2port); -} - -static LIST_HEAD(ps2port_list); - static void gscps2_read_data(struct gscps2port *ps2port) { u8 status; @@ -348,8 +266,8 @@ static bool gscps2_report_data(struct gscps2port *ps2port) data = ps2port->buffer[ps2port->act].data; ps2port->act = (ps2port->act + 1) & BUFFER_SIZE; - rxflags = ((status & GSC_STAT_TERR) ? SERIO_TIMEOUT : 0 ) | - ((status & GSC_STAT_PERR) ? SERIO_PARITY : 0 ); + rxflags = ((status & GSC_STAT_TERR) ? SERIO_TIMEOUT : 0) | + ((status & GSC_STAT_PERR) ? SERIO_PARITY : 0); serio_interrupt(ps2port->port, data, rxflags); } @@ -370,7 +288,6 @@ static bool gscps2_report_data(struct gscps2port *ps2port) * the data as fast as possible and handle the reporting to the upper layer * later. */ - static irqreturn_t gscps2_interrupt(int irq, void *dev) { struct gscps2port *ps2port; @@ -392,17 +309,79 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev) return IRQ_HANDLED; } +/* + * gscps2_writeb_output() - write a byte to the port + * + * returns 1 on success, 0 on error + */ +static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data) +{ + char __iomem *addr = ps2port->addr; + + if (!wait_TBE(addr)) { + dev_dbg(&ps2port->padev->dev, "timeout - could not write byte %#x\n", data); + return 0; + } + + while (gscps2_readb_status(addr) & GSC_STAT_RBNE) + cpu_relax(); + + scoped_guard(spinlock_irqsave, &ps2port->lock) + writeb(data, addr + GSC_XMTDATA); + + /* this is ugly, but due to timing of the port it seems to be necessary. */ + mdelay(6); + + /* make sure any received data is returned as fast as possible */ + /* this is important e.g. when we set the LEDs on the keyboard */ + gscps2_interrupt(0, NULL); + + return 1; +} + +/* + * gscps2_enable() - enables or disables the port + */ +static void gscps2_enable(struct gscps2port *ps2port, bool enable) +{ + u8 data; + + /* now enable/disable the port */ + scoped_guard(spinlock_irqsave, &ps2port->lock) { + gscps2_flush(ps2port); + data = gscps2_readb_control(ps2port->addr); + if (enable) + data |= GSC_CTRL_ENBL; + else + data &= ~GSC_CTRL_ENBL; + gscps2_writeb_control(data, ps2port->addr); + } + + wait_TBE(ps2port->addr); + gscps2_flush(ps2port); +} + +/* + * gscps2_reset() - resets the PS/2 port + */ +static void gscps2_reset(struct gscps2port *ps2port) +{ + /* reset the interface */ + guard(spinlock_irqsave)(&ps2port->lock); + gscps2_flush(ps2port); + writeb(0xff, ps2port->addr + GSC_RESET); + gscps2_flush(ps2port); +} /* * gscps2_write() - send a byte out through the aux interface. */ - static int gscps2_write(struct serio *port, unsigned char data) { struct gscps2port *ps2port = port->port_data; if (!gscps2_writeb_output(ps2port, data)) { - printk(KERN_DEBUG PFX "sending byte %#x failed.\n", data); + dev_dbg(&ps2port->padev->dev, "sending byte %#x failed.\n", data); return -1; } return 0; @@ -412,7 +391,6 @@ static int gscps2_write(struct serio *port, unsigned char data) * gscps2_open() is called when a port is opened by the higher layer. * It resets and enables the port. */ - static int gscps2_open(struct serio *port) { struct gscps2port *ps2port = port->port_data; @@ -420,7 +398,7 @@ static int gscps2_open(struct serio *port) gscps2_reset(ps2port); /* enable it */ - gscps2_enable(ps2port, ENABLE); + gscps2_enable(ps2port, true); gscps2_interrupt(0, NULL); @@ -430,11 +408,11 @@ static int gscps2_open(struct serio *port) /* * gscps2_close() disables the port */ - static void gscps2_close(struct serio *port) { struct gscps2port *ps2port = port->port_data; - gscps2_enable(ps2port, DISABLE); + + gscps2_enable(ps2port, false); } /** @@ -443,7 +421,6 @@ static void gscps2_close(struct serio *port) * * @return: success/error report */ - static int __init gscps2_probe(struct parisc_device *dev) { struct gscps2port *ps2port; @@ -494,8 +471,8 @@ static int __init gscps2_probe(struct parisc_device *dev) goto fail_miserably; if (ps2port->id != GSC_ID_KEYBOARD && ps2port->id != GSC_ID_MOUSE) { - printk(KERN_WARNING PFX "Unsupported PS/2 port at 0x%08lx (id=%d) ignored\n", - hpa, ps2port->id); + dev_warn(&dev->dev, "Unsupported PS/2 port at 0x%08lx (id=%d) ignored\n", + hpa, ps2port->id); ret = -ENODEV; goto fail; } @@ -552,7 +529,6 @@ static int __init gscps2_probe(struct parisc_device *dev) * * @return: success/error report */ - static void __exit gscps2_remove(struct parisc_device *dev) { struct gscps2port *ps2port = dev_get_drvdata(&dev->dev); @@ -572,7 +548,6 @@ static void __exit gscps2_remove(struct parisc_device *dev) kfree(ps2port); } - static const struct parisc_device_id gscps2_device_tbl[] __initconst = { { HPHW_FIO, HVERSION_REV_ANY_ID, HVERSION_ANY_ID, 0x00084 }, /* LASI PS/2 */ #ifdef DINO_TESTED @@ -610,6 +585,5 @@ static void __exit gscps2_exit(void) software_node_unregister(&gscps2_keyboard_node); } - module_init(gscps2_init); module_exit(gscps2_exit); From 66ea7cb72f9e45e268c2032a8d2b106775eebb99 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 30 Aug 2026 13:52:47 -0700 Subject: [PATCH 06/94] Input: gscps2 - use RCU for ps2port_list and manage it in open/close Managing ps2port_list in gscps2_probe() and gscps2_remove() had two issues: - in gscps2_remove(), serio_unregister_port() frees the serio port, but because the port remained in ps2port_list until later in remove, a shared interrupt firing on another CPU could traverse ps2port_list and dereference the freed serio port - ps2port_list additions and deletions in probe/remove raced locklessly against list traversals in gscps2_interrupt(). Convert ps2port_list traversal in gscps2_interrupt() to use RCU, and move list management to gscps2_open() and gscps2_close(). When serio_unregister_port() runs during device removal, serio_close() is invoked, cleanly taking the port out of ps2port_list before the serio structure is destroyed, while maintaining active hardware communication during child driver disconnect. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-2-c733d4cae7f9@gmail.com Acked-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Dmitry Torokhov --- drivers/input/serio/gscps2.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index b82c56ba8ff7..5b6e311f8a02 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -195,6 +196,7 @@ struct gscps2port { int id; }; +static DEFINE_SPINLOCK(ps2port_list_lock); static LIST_HEAD(ps2port_list); /* @@ -292,14 +294,16 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev) { struct gscps2port *ps2port; - list_for_each_entry(ps2port, &ps2port_list, node) { + guard(rcu)(); + + list_for_each_entry_rcu(ps2port, &ps2port_list, node) { guard(spinlock_irqsave)(&ps2port->lock); gscps2_read_data(ps2port); - } /* list_for_each_entry */ + } /* all data was read from the ports - now report the data to upper layer */ - list_for_each_entry(ps2port, &ps2port_list, node) { + list_for_each_entry_rcu(ps2port, &ps2port_list, node) { if (gscps2_report_data(ps2port)) { /* More data ready - break early to restart interrupt */ break; @@ -397,6 +401,9 @@ static int gscps2_open(struct serio *port) gscps2_reset(ps2port); + scoped_guard(spinlock_irqsave, &ps2port_list_lock) + list_add_tail_rcu(&ps2port->node, &ps2port_list); + /* enable it */ gscps2_enable(ps2port, true); @@ -413,6 +420,11 @@ static void gscps2_close(struct serio *port) struct gscps2port *ps2port = port->port_data; gscps2_enable(ps2port, false); + + scoped_guard(spinlock_irqsave, &ps2port_list_lock) + list_del_rcu(&ps2port->node); + + synchronize_rcu(); } /** @@ -446,6 +458,7 @@ static int __init gscps2_probe(struct parisc_device *dev) ps2port->port = serio; ps2port->padev = dev; + INIT_LIST_HEAD(&ps2port->node); ps2port->addr = ioremap(hpa, GSC_STATUS + 4); if (!ps2port->addr) { ret = -ENOMEM; @@ -501,8 +514,6 @@ static int __init gscps2_probe(struct parisc_device *dev) serio_register_port(ps2port->port); - list_add_tail(&ps2port->node, &ps2port_list); - return 0; fail: @@ -539,12 +550,10 @@ static void __exit gscps2_remove(struct parisc_device *dev) serio_unregister_port(ps2port->port); free_irq(dev->irq, ps2port); gscps2_flush(ps2port); - list_del(&ps2port->node); iounmap(ps2port->addr); #if 0 release_mem_region(dev->hpa, GSC_STATUS + 4); #endif - dev_set_drvdata(&dev->dev, NULL); kfree(ps2port); } From e73972da25a81844b6f86ceaf4b27e280bfc219c Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 30 Aug 2026 13:52:48 -0700 Subject: [PATCH 07/94] Input: gscps2 - protect buffer access in read and report helpers In gscps2_report_data(), the ring buffer consumer index ps2port->act was read and updated locklessly. When gscps2_interrupt() was called from process context (such as during port write or open) concurrently with a hardware interrupt running on another CPU, two execution contexts could execute gscps2_report_data() simultaneously for the same port, racing on ps2port->act and leading to duplicate, skipped, or out-of-order bytes. Protect buffer access by taking ps2port->lock inside gscps2_read_data() and gscps2_report_data(). In gscps2_report_data(), acquire ps2port->lock only when popping entries from the ring buffer and release it before calling serio_interrupt() to avoid recursive deadlocks if the input driver synchronously sends a command back via serio_write(). Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-3-c733d4cae7f9@gmail.com Acked-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Dmitry Torokhov --- drivers/input/serio/gscps2.c | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 5b6e311f8a02..fef6fffb6f86 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -238,6 +238,8 @@ static void gscps2_read_data(struct gscps2port *ps2port) { u8 status; + guard(spinlock_irqsave)(&ps2port->lock); + do { status = gscps2_readb_status(ps2port->addr); if (!(status & GSC_STAT_RBNE)) @@ -255,7 +257,7 @@ static bool gscps2_report_data(struct gscps2port *ps2port) unsigned int rxflags; u8 data, status; - while (ps2port->act != ps2port->append) { + while (true) { /* * Did new data arrived while we read existing data ? * If yes, exit now and let the new irq handler start @@ -264,17 +266,20 @@ static bool gscps2_report_data(struct gscps2port *ps2port) if (gscps2_readb_status(ps2port->addr) & GSC_STAT_CMPINTR) return true; - status = ps2port->buffer[ps2port->act].str; - data = ps2port->buffer[ps2port->act].data; + scoped_guard(spinlock_irqsave, &ps2port->lock) { + if (ps2port->act == ps2port->append) + return false; + + status = ps2port->buffer[ps2port->act].str; + data = ps2port->buffer[ps2port->act].data; + ps2port->act = (ps2port->act + 1) & BUFFER_SIZE; + } - ps2port->act = (ps2port->act + 1) & BUFFER_SIZE; rxflags = ((status & GSC_STAT_TERR) ? SERIO_TIMEOUT : 0) | ((status & GSC_STAT_PERR) ? SERIO_PARITY : 0); serio_interrupt(ps2port->port, data, rxflags); } - - return false; } /** @@ -296,11 +301,8 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev) guard(rcu)(); - list_for_each_entry_rcu(ps2port, &ps2port_list, node) { - guard(spinlock_irqsave)(&ps2port->lock); - + list_for_each_entry_rcu(ps2port, &ps2port_list, node) gscps2_read_data(ps2port); - } /* all data was read from the ports - now report the data to upper layer */ list_for_each_entry_rcu(ps2port, &ps2port_list, node) { From 81d577c0c5c602cffb0e0c16cdbde9ffbc8bb1eb Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 30 Aug 2026 13:52:49 -0700 Subject: [PATCH 08/94] Input: gscps2 - serialize hardware and buffer access in gscps2_flush() gscps2_flush() reads from hardware registers and resets the ring buffer indices ps2port->act and ps2port->append. In gscps2_enable(), the trailing gscps2_flush() was called without holding ps2port->lock, racing with concurrent hardware interrupts and buffer access. Assert that ps2port->lock is held in gscps2_flush() with lockdep_assert_held(), and ensure all callers acquire ps2port->lock so that multi-step hardware sequences remain fully serialized without unprotected windows. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-4-c733d4cae7f9@gmail.com Acked-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Dmitry Torokhov --- drivers/input/serio/gscps2.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index fef6fffb6f86..36c25db9ff7f 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -228,6 +228,8 @@ static int wait_TBE(char __iomem *addr) */ static void gscps2_flush(struct gscps2port *ps2port) { + lockdep_assert_held(&ps2port->lock); + while (gscps2_readb_status(ps2port->addr) & GSC_STAT_RBNE) gscps2_readb_input(ps2port->addr); ps2port->act = 0; @@ -364,7 +366,8 @@ static void gscps2_enable(struct gscps2port *ps2port, bool enable) } wait_TBE(ps2port->addr); - gscps2_flush(ps2port); + scoped_guard(spinlock_irqsave, &ps2port->lock) + gscps2_flush(ps2port); } /* @@ -551,7 +554,8 @@ static void __exit gscps2_remove(struct parisc_device *dev) serio_unregister_port(ps2port->port); free_irq(dev->irq, ps2port); - gscps2_flush(ps2port); + scoped_guard(spinlock_irqsave, &ps2port->lock) + gscps2_flush(ps2port); iounmap(ps2port->addr); #if 0 release_mem_region(dev->hpa, GSC_STATUS + 4); From 342e25835096f178377d5ae712debf199254670c Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 30 Aug 2026 13:52:50 -0700 Subject: [PATCH 09/94] Input: gscps2 - return IRQ_NONE when interrupt is not handled gscps2_interrupt() is registered with IRQF_SHARED. Unconditionally returning IRQ_HANDLED when no data was pending on any GSC PS/2 port masks unhandled interrupts on the shared interrupt line and prevents the kernel core spurious interrupt detector from identifying runaway interrupt storms. Have gscps2_read_data() return whether any bytes were read, accumulate the handled status in gscps2_interrupt(), and return IRQ_RETVAL(handled). Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-5-c733d4cae7f9@gmail.com Acked-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Dmitry Torokhov --- drivers/input/serio/gscps2.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 36c25db9ff7f..907fb1537595 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -236,8 +236,9 @@ static void gscps2_flush(struct gscps2port *ps2port) ps2port->append = 0; } -static void gscps2_read_data(struct gscps2port *ps2port) +static bool gscps2_read_data(struct gscps2port *ps2port) { + bool read_any = false; u8 status; guard(spinlock_irqsave)(&ps2port->lock); @@ -247,11 +248,14 @@ static void gscps2_read_data(struct gscps2port *ps2port) if (!(status & GSC_STAT_RBNE)) break; + read_any = true; ps2port->buffer[ps2port->append].str = status; ps2port->buffer[ps2port->append].data = gscps2_readb_input(ps2port->addr); ps2port->append = (ps2port->append + 1) & BUFFER_SIZE; } while (true); + + return read_any; } static bool gscps2_report_data(struct gscps2port *ps2port) @@ -300,11 +304,14 @@ static bool gscps2_report_data(struct gscps2port *ps2port) static irqreturn_t gscps2_interrupt(int irq, void *dev) { struct gscps2port *ps2port; + bool handled = false; guard(rcu)(); - list_for_each_entry_rcu(ps2port, &ps2port_list, node) - gscps2_read_data(ps2port); + list_for_each_entry_rcu(ps2port, &ps2port_list, node) { + if (gscps2_read_data(ps2port)) + handled = true; + } /* all data was read from the ports - now report the data to upper layer */ list_for_each_entry_rcu(ps2port, &ps2port_list, node) { @@ -314,7 +321,7 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev) } } - return IRQ_HANDLED; + return IRQ_RETVAL(handled); } /* From 21f6c39938a10abfc98961000b04b55fa0e70d89 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 30 Aug 2026 13:52:51 -0700 Subject: [PATCH 10/94] Input: gscps2 - serialize concurrent interrupt handlers gscps2_interrupt() may be invoked concurrently from a hardware interrupt on one CPU and from process context via gscps2_writeb_output() on another CPU. In gscps2_report_data(), ps2port->lock is released before calling serio_interrupt() to avoid recursive deadlocks. However, if two execution contexts run gscps2_report_data() concurrently for the same port, they could race to acquire serio->lock inside serio_interrupt(), potentially delivering multi-byte scancodes out of order. Serialize execution of gscps2_interrupt() using gscps2_interrupt_lock with ACQUIRE(spinlock_irqsave_try). Using spin_trylock prevents overlapping executions and guarantees in-order packet delivery without risking recursive deadlocks if an input driver synchronously sends a command back via serio_write(). If the lock cannot be acquired, return IRQ_NONE to preserve spurious interrupt detection on shared IRQ lines. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-6-c733d4cae7f9@gmail.com Acked-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Dmitry Torokhov --- drivers/input/serio/gscps2.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 907fb1537595..2afd53a163ff 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -288,6 +288,8 @@ static bool gscps2_report_data(struct gscps2port *ps2port) } } +static DEFINE_SPINLOCK(gscps2_interrupt_lock); + /** * gscps2_interrupt() - Interruption service routine * @irq: interrupt number which triggered (unused) @@ -305,21 +307,31 @@ static irqreturn_t gscps2_interrupt(int irq, void *dev) { struct gscps2port *ps2port; bool handled = false; + bool more_data; + + ACQUIRE(spinlock_irqsave_try, lock)(&gscps2_interrupt_lock); + if (ACQUIRE_ERR(spinlock_irqsave_try, &lock)) + return IRQ_NONE; guard(rcu)(); - list_for_each_entry_rcu(ps2port, &ps2port_list, node) { - if (gscps2_read_data(ps2port)) - handled = true; - } + do { + more_data = false; - /* all data was read from the ports - now report the data to upper layer */ - list_for_each_entry_rcu(ps2port, &ps2port_list, node) { - if (gscps2_report_data(ps2port)) { - /* More data ready - break early to restart interrupt */ - break; + list_for_each_entry_rcu(ps2port, &ps2port_list, node) { + if (gscps2_read_data(ps2port)) + handled = true; } - } + + /* all data was read from the ports - now report the data to upper layer */ + list_for_each_entry_rcu(ps2port, &ps2port_list, node) { + if (gscps2_report_data(ps2port)) { + /* More data ready - restart loop to read new data */ + more_data = true; + break; + } + } + } while (more_data); return IRQ_RETVAL(handled); } From daae2ab46e0cb612f50ca1d86cf50e5962461ae5 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 30 Aug 2026 13:52:52 -0700 Subject: [PATCH 11/94] Input: gscps2 - drop busy-wait and manual interrupt pump on transmit In gscps2_writeb_output(), after writing data to GSC_XMTDATA, the driver explicitly executed mdelay(6) and manually called gscps2_interrupt() as a polling mechanism to accelerate command responses (such as keyboard ACK or LED updates). On PA-RISC, the PS/2 controller asserts a level interrupt to the system ASIC whenever received data arrives in hardware, and the input/serio subsystem handles command responses asynchronously via completions. Busy-waiting for 6 ms on every transmitted byte introduces significant unnecessary latency during multi-byte command sequences and complicates interrupt handler locking. Remove mdelay(6) and the manual invocation of gscps2_interrupt() from gscps2_writeb_output(), relying on normal hardware interrupt delivery. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/20260830-gscps2-v1-7-c733d4cae7f9@gmail.com Acked-by: Helge Deller Tested-by: Helge Deller Signed-off-by: Dmitry Torokhov --- drivers/input/serio/gscps2.c | 7 ------- 1 file changed, 7 deletions(-) diff --git a/drivers/input/serio/gscps2.c b/drivers/input/serio/gscps2.c index 2afd53a163ff..985539f1d088 100644 --- a/drivers/input/serio/gscps2.c +++ b/drivers/input/serio/gscps2.c @@ -356,13 +356,6 @@ static inline int gscps2_writeb_output(struct gscps2port *ps2port, u8 data) scoped_guard(spinlock_irqsave, &ps2port->lock) writeb(data, addr + GSC_XMTDATA); - /* this is ugly, but due to timing of the port it seems to be necessary. */ - mdelay(6); - - /* make sure any received data is returned as fast as possible */ - /* this is important e.g. when we set the LEDs on the keyboard */ - gscps2_interrupt(0, NULL); - return 1; } From b331b6d23cb7f0a957d89a4a1a9bf3f041784d94 Mon Sep 17 00:00:00 2001 From: Krzysztof Kozlowski Date: Sun, 13 Sep 2026 14:33:11 +0200 Subject: [PATCH 12/94] dt-bindings: input: Use consistent indentation in the example Correct indentation in the examples to consistent 2- or 4-spaces indentation to fix dt-check-style warnings ("example 0 [indent-consistent] indent mismatch ..."). Preferred is 4-spaces, but re-indenting entire example just for that is too much churn. Signed-off-by: Krzysztof Kozlowski Reviewed-by: Mattijs Korpershoek Reviewed-by: Rob Herring (Arm) Link: https://patch.msgid.link/20260913123310.100170-2-krzysztof.kozlowski@oss.qualcomm.com Signed-off-by: Dmitry Torokhov --- .../bindings/input/adc-joystick.yaml | 20 +++++++++---------- .../devicetree/bindings/input/cypress-sf.yaml | 14 ++++++------- .../input/mediatek,mt6779-keypad.yaml | 10 +++++----- .../bindings/input/microchip,cap11xx.yaml | 14 ++++++------- .../input/touchscreen/eeti,exc3000.yaml | 16 +++++++-------- .../input/touchscreen/ti,tsc2007.yaml | 12 +++++------ 6 files changed, 43 insertions(+), 43 deletions(-) diff --git a/Documentation/devicetree/bindings/input/adc-joystick.yaml b/Documentation/devicetree/bindings/input/adc-joystick.yaml index 6c244d66f8ce..ac0ca5aa8212 100644 --- a/Documentation/devicetree/bindings/input/adc-joystick.yaml +++ b/Documentation/devicetree/bindings/input/adc-joystick.yaml @@ -111,17 +111,17 @@ examples: #size-cells = <0>; axis@0 { - reg = <0>; - linux,code = ; - abs-range = <3300 0>; - abs-fuzz = <4>; - abs-flat = <200>; + reg = <0>; + linux,code = ; + abs-range = <3300 0>; + abs-fuzz = <4>; + abs-flat = <200>; }; axis@1 { - reg = <1>; - linux,code = ; - abs-range = <0 3300>; - abs-fuzz = <4>; - abs-flat = <200>; + reg = <1>; + linux,code = ; + abs-range = <0 3300>; + abs-fuzz = <4>; + abs-flat = <200>; }; }; diff --git a/Documentation/devicetree/bindings/input/cypress-sf.yaml b/Documentation/devicetree/bindings/input/cypress-sf.yaml index c0b051466272..8492ffd84bfd 100644 --- a/Documentation/devicetree/bindings/input/cypress-sf.yaml +++ b/Documentation/devicetree/bindings/input/cypress-sf.yaml @@ -50,12 +50,12 @@ examples: #size-cells = <0>; touchkey@28 { - compatible = "cypress,sf3155"; - reg = <0x28>; - interrupt-parent = <&msmgpio>; - interrupts = <77 IRQ_TYPE_EDGE_FALLING>; - avdd-supply = <&vreg_l6a_1p8>; - vdd-supply = <&vdd_3v2_tp>; - linux,keycodes = ; + compatible = "cypress,sf3155"; + reg = <0x28>; + interrupt-parent = <&msmgpio>; + interrupts = <77 IRQ_TYPE_EDGE_FALLING>; + avdd-supply = <&vreg_l6a_1p8>; + vdd-supply = <&vdd_3v2_tp>; + linux,keycodes = ; }; }; diff --git a/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml b/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml index 914dd3283df3..83b83aaa6ad9 100644 --- a/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml +++ b/Documentation/devicetree/bindings/input/mediatek,mt6779-keypad.yaml @@ -78,10 +78,10 @@ examples: #size-cells = <2>; keyboard@10010000 { - compatible = "mediatek,mt6779-keypad"; - reg = <0 0x10010000 0 0x1000>; - interrupts = ; - clocks = <&clk26m>; - clock-names = "kpd"; + compatible = "mediatek,mt6779-keypad"; + reg = <0 0x10010000 0 0x1000>; + interrupts = ; + clocks = <&clk26m>; + clock-names = "kpd"; }; }; diff --git a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml index 983f4701b51e..fa95270ac2c2 100644 --- a/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml +++ b/Documentation/devicetree/bindings/input/microchip,cap11xx.yaml @@ -290,19 +290,19 @@ examples: #size-cells = <0>; led@0 { - label = "cap11xx:green:usr0"; - reg = <0>; + label = "cap11xx:green:usr0"; + reg = <0>; }; led@1 { - label = "cap11xx:green:usr1"; - reg = <1>; + label = "cap11xx:green:usr1"; + reg = <1>; }; led@2 { - label = "cap11xx:green:alive"; - reg = <2>; - linux,default-trigger = "heartbeat"; + label = "cap11xx:green:alive"; + reg = <2>; + linux,default-trigger = "heartbeat"; }; }; }; diff --git a/Documentation/devicetree/bindings/input/touchscreen/eeti,exc3000.yaml b/Documentation/devicetree/bindings/input/touchscreen/eeti,exc3000.yaml index 930c70104b3f..00bd4062ebd7 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/eeti,exc3000.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/eeti,exc3000.yaml @@ -82,13 +82,13 @@ examples: #address-cells = <1>; #size-cells = <0>; touchscreen@2a { - compatible = "eeti,exc3000"; - reg = <0x2a>; - interrupt-parent = <&gpio1>; - interrupts = <9 IRQ_TYPE_LEVEL_LOW>; - touchscreen-size-x = <4096>; - touchscreen-size-y = <4096>; - touchscreen-inverted-x; - touchscreen-swapped-x-y; + compatible = "eeti,exc3000"; + reg = <0x2a>; + interrupt-parent = <&gpio1>; + interrupts = <9 IRQ_TYPE_LEVEL_LOW>; + touchscreen-size-x = <4096>; + touchscreen-size-y = <4096>; + touchscreen-inverted-x; + touchscreen-swapped-x-y; }; }; diff --git a/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2007.yaml b/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2007.yaml index d9cb53e86512..5ef38d24d6a9 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2007.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/ti,tsc2007.yaml @@ -70,11 +70,11 @@ examples: #size-cells = <0>; touch@49 { - compatible = "ti,tsc2007"; - reg = <0x49>; - interrupt-parent = <&gpio4>; - interrupts = <0x0 0x8>; - gpios = <&gpio4 0 0>; - ti,x-plate-ohms = <180>; + compatible = "ti,tsc2007"; + reg = <0x49>; + interrupt-parent = <&gpio4>; + interrupts = <0x0 0x8>; + gpios = <&gpio4 0 0>; + ti,x-plate-ohms = <180>; }; }; From 16e10569b30cba05dde89608033e9a6ac2f08bb1 Mon Sep 17 00:00:00 2001 From: Peng Fan Date: Sat, 19 Sep 2026 21:07:36 +0800 Subject: [PATCH 13/94] Input: atkbd - use __assign_bit() where applicable Convert open-coded if/else with __set_bit/__clear_bit to the __assign_bit API. Signed-off-by: Peng Fan Link: https://patch.msgid.link/20260919130741.3041442-1-peng.fan@oss.nxp.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/atkbd.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/drivers/input/keyboard/atkbd.c b/drivers/input/keyboard/atkbd.c index 3509b58e6492..c34ae215d000 100644 --- a/drivers/input/keyboard/atkbd.c +++ b/drivers/input/keyboard/atkbd.c @@ -357,10 +357,7 @@ static void atkbd_calculate_xl_bit(struct atkbd *atkbd, u8 code) for (i = 0; i < ARRAY_SIZE(xl_table); i++) { if (!((code ^ xl_table[i]) & 0x7f)) { - if (code & 0x80) - __clear_bit(i, &atkbd->xl_bit); - else - __set_bit(i, &atkbd->xl_bit); + __assign_bit(i, &atkbd->xl_bit, !(code & 0x80)); break; } } From 740c1600d67f4c9e15defd6ba83091c972ca12ad Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 25 Sep 2026 12:01:12 -0700 Subject: [PATCH 14/94] Input: mt - update input_mt_report_slot_state() kerneldoc Commit c258e84b180d ("Input: do not assign new tracking ID when changing tool type") stopped assigning a new tracking ID when the tool type in a slot changes, but left the kerneldoc comment for input_mt_report_slot_state() stating the old behavior. Update the comment to match the implementation. Signed-off-by: Dmitry Torokhov --- drivers/input/input-mt.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/input/input-mt.c b/drivers/input/input-mt.c index c06e98fbd77c..4fe386fa86af 100644 --- a/drivers/input/input-mt.c +++ b/drivers/input/input-mt.c @@ -126,9 +126,8 @@ EXPORT_SYMBOL(input_mt_destroy_slots); * * Reports a contact via ABS_MT_TRACKING_ID, and optionally * ABS_MT_TOOL_TYPE. If active is true and the slot is currently - * inactive, or if the tool type is changed, a new tracking id is - * assigned to the slot. The tool type is only reported if the - * corresponding absbit field is set. + * inactive, a new tracking id is assigned to the slot. The tool + * type is only reported if the corresponding absbit field is set. * * Returns true if contact is active. */ From 5b051ea055b319fb9a4f1d09f6f181ca7017bdd8 Mon Sep 17 00:00:00 2001 From: "Rob Herring (Arm)" Date: Wed, 23 Sep 2026 14:16:03 -0500 Subject: [PATCH 15/94] dt-bindings: input: Add AD7147 CapTouch schema Add a schema for the Analog Devices AD7147 CapTouch controller used by the Microsoft Lumia 950 and Lumia 950 XL device trees. Document its I2C address, interrupt, and optional vcc supply. Assisted-by: LLM Signed-off-by: Rob Herring (Arm) Link: https://patch.msgid.link/20260923191604.2213710-1-robh@kernel.org Signed-off-by: Dmitry Torokhov --- .../bindings/input/adi,ad7147_captouch.yaml | 48 +++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 Documentation/devicetree/bindings/input/adi,ad7147_captouch.yaml diff --git a/Documentation/devicetree/bindings/input/adi,ad7147_captouch.yaml b/Documentation/devicetree/bindings/input/adi,ad7147_captouch.yaml new file mode 100644 index 000000000000..1120b85276a0 --- /dev/null +++ b/Documentation/devicetree/bindings/input/adi,ad7147_captouch.yaml @@ -0,0 +1,48 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/adi,ad7147_captouch.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Analog Devices AD7147 CapTouch Programmable Controller + +maintainers: + - Michael Hennerich + +properties: + compatible: + const: adi,ad7147_captouch + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + vcc-supply: true + +required: + - compatible + - reg + - interrupts + +additionalProperties: false + +examples: + - | + #include + + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touch@2c { + compatible = "adi,ad7147_captouch"; + reg = <0x2c>; + interrupt-parent = <&tlmm>; + interrupts = <96 IRQ_TYPE_EDGE_FALLING>; + vcc-supply = <&vreg_l18a_2p85>; + }; + }; + +... From 1a3ba2dc2b91d50201a9d4721f166e68f4903eb6 Mon Sep 17 00:00:00 2001 From: Diederik de Haas Date: Thu, 1 Oct 2026 19:53:18 +0200 Subject: [PATCH 16/94] Input: cyttsp5 - convert to DEFINE_SIMPLE_DEV_PM_OPS The use of SIMPLE_DEV_PM_OPS got deprecated in commit 1a3c7bb08826 ("PM: core: Add new *_PM_OPS macros, deprecate old ones") So convert the pm ops to use its replacement: DEFINE_SIMPLE_DEV_PM_OPS. This also allows us to drop the __maybe_unused attributes. Signed-off-by: Diederik de Haas Link: https://patch.msgid.link/20261001175415.159900-1-diederik@cknow-tech.com Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/cyttsp5.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/touchscreen/cyttsp5.c b/drivers/input/touchscreen/cyttsp5.c index 9266c07314be..7b0613156fc1 100644 --- a/drivers/input/touchscreen/cyttsp5.c +++ b/drivers/input/touchscreen/cyttsp5.c @@ -942,7 +942,7 @@ static const struct i2c_device_id cyttsp5_i2c_id[] = { }; MODULE_DEVICE_TABLE(i2c, cyttsp5_i2c_id); -static int __maybe_unused cyttsp5_suspend(struct device *dev) +static int cyttsp5_suspend(struct device *dev) { struct cyttsp5 *ts = dev_get_drvdata(dev); @@ -952,7 +952,7 @@ static int __maybe_unused cyttsp5_suspend(struct device *dev) return 0; } -static int __maybe_unused cyttsp5_resume(struct device *dev) +static int cyttsp5_resume(struct device *dev) { struct cyttsp5 *ts = dev_get_drvdata(dev); @@ -962,13 +962,13 @@ static int __maybe_unused cyttsp5_resume(struct device *dev) return 0; } -static SIMPLE_DEV_PM_OPS(cyttsp5_pm, cyttsp5_suspend, cyttsp5_resume); +static DEFINE_SIMPLE_DEV_PM_OPS(cyttsp5_pm, cyttsp5_suspend, cyttsp5_resume); static struct i2c_driver cyttsp5_i2c_driver = { .driver = { .name = CYTTSP5_NAME, .of_match_table = cyttsp5_of_match, - .pm = &cyttsp5_pm, + .pm = pm_sleep_ptr(&cyttsp5_pm), }, .probe = cyttsp5_i2c_probe, .id_table = cyttsp5_i2c_id, From 4d8221c0d7e72bea5ee1a6bf8ae423a1faca66fa Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 22:40:33 -0700 Subject: [PATCH 17/94] Input: matrix_keypad - propagate error code from matrix_keypad_build_keymap() When switching to managed resources in matrix_keypad_probe(), the error return path after matrix_keypad_build_keymap() was replaced with a hardcoded -ENOMEM instead of propagating the real error code. Return the original error so the actual failure reason is preserved. Fixes: 7d0f351da460 ("Input: matrix_keypad - switch to using managed resources") Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/ascss_vYXDPXIxmn@google.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/matrix_keypad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 8863b741d1a3..14a13abf3272 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -443,7 +443,7 @@ static int matrix_keypad_probe(struct platform_device *pdev) NULL, input_dev); if (err) { dev_err(&pdev->dev, "failed to build keymap\n"); - return -ENOMEM; + return err; } if (!device_property_read_bool(&pdev->dev, "linux,no-autorepeat")) From adf9f5237314ed04d2861fbf73729da4c28bb24f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 22:41:50 -0700 Subject: [PATCH 18/94] Input: gpio_keys - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in gpio_keys_probe() is redundant. Remove it. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/gpio_keys.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/gpio_keys.c b/drivers/input/keyboard/gpio_keys.c index e19617485679..defe4074a60e 100644 --- a/drivers/input/keyboard/gpio_keys.c +++ b/drivers/input/keyboard/gpio_keys.c @@ -885,7 +885,6 @@ static int gpio_keys_probe(struct platform_device *pdev) input->name = pdata->name ? : pdev->name; input->phys = "gpio-keys/input0"; - input->dev.parent = dev; input->open = gpio_keys_open; input->close = gpio_keys_close; From 3baa7660146a6f53e1bfe7179d8e3debaa532f7b Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 22:58:21 -0700 Subject: [PATCH 19/94] Input: applespi - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignments in applespi_register_touchpad_device() and applespi_probe() are redundant. Remove them. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/applespi.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/applespi.c index b5ff71cd5a70..da8fa3938a36 100644 --- a/drivers/input/keyboard/applespi.c +++ b/drivers/input/keyboard/applespi.c @@ -1259,7 +1259,6 @@ applespi_register_touchpad_device(struct applespi_data *applespi, touchpad_input_dev->name = "Apple SPI Touchpad"; touchpad_input_dev->phys = "applespi/input1"; - touchpad_input_dev->dev.parent = &applespi->spi->dev; touchpad_input_dev->id.bustype = BUS_SPI; touchpad_input_dev->id.vendor = SYNAPTICS_VENDOR_ID; touchpad_input_dev->id.product = @@ -1686,7 +1685,6 @@ static int applespi_probe(struct spi_device *spi) applespi->keyboard_input_dev->name = "Apple SPI Keyboard"; applespi->keyboard_input_dev->phys = "applespi/input0"; - applespi->keyboard_input_dev->dev.parent = &spi->dev; applespi->keyboard_input_dev->id.bustype = BUS_SPI; applespi->keyboard_input_dev->evbit[0] = From 940d4b53c1718dbd422d9ee981f02c4b21b8c4b5 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:00:41 -0700 Subject: [PATCH 20/94] Input: axp20x-pek - drop redundant idev->dev.parent assignment devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignment in axp20x_pek_probe_input_device() is redundant. Remove it. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/axp20x-pek.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/axp20x-pek.c b/drivers/input/misc/axp20x-pek.c index 24f9e9d893de..c34e002258ee 100644 --- a/drivers/input/misc/axp20x-pek.c +++ b/drivers/input/misc/axp20x-pek.c @@ -241,7 +241,6 @@ static int axp20x_pek_probe_input_device(struct axp20x_pek *axp20x_pek, idev->name = "axp20x-pek"; idev->phys = "m1kbd/input2"; - idev->dev.parent = &pdev->dev; input_set_capability(idev, EV_KEY, KEY_POWER); From b37d23791fe52eb457753eb5ecaa5361b2d64189 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:01:53 -0700 Subject: [PATCH 21/94] Input: cyapa - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in cyapa_create_input_dev() is redundant. Remove it. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/cyapa.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c index 47000c30e4d8..5d99abea89aa 100644 --- a/drivers/input/mouse/cyapa.c +++ b/drivers/input/mouse/cyapa.c @@ -449,7 +449,6 @@ static int cyapa_create_input_dev(struct cyapa *cyapa) input->id.bustype = BUS_I2C; input->id.version = 1; input->id.product = 0; /* Means any product in eventcomm. */ - input->dev.parent = &cyapa->client->dev; input->open = cyapa_open; input->close = cyapa_close; From a9cf50a1cdfa4db0f458e63c1a71bd9cde3d22fd Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:11:58 -0700 Subject: [PATCH 22/94] Input: 88pm860x-ts - drop redundant idev->dev.parent assignment devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignment in pm860x_touch_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/88pm860x-ts.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/88pm860x-ts.c b/drivers/input/touchscreen/88pm860x-ts.c index 0468ce2b216f..dd545a719019 100644 --- a/drivers/input/touchscreen/88pm860x-ts.c +++ b/drivers/input/touchscreen/88pm860x-ts.c @@ -246,7 +246,6 @@ static int pm860x_touch_probe(struct platform_device *pdev) touch->idev->name = "88pm860x-touch"; touch->idev->phys = "88pm860x/input0"; touch->idev->id.bustype = BUS_I2C; - touch->idev->dev.parent = &pdev->dev; touch->idev->open = pm860x_touch_open; touch->idev->close = pm860x_touch_close; touch->chip = chip; From fc50690069deafd527be8dc4ad6531543a2b8988 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:40 -0700 Subject: [PATCH 23/94] Input: adp5520-keys - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in adp5520_keys_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/adp5520-keys.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/adp5520-keys.c b/drivers/input/keyboard/adp5520-keys.c index 980d739e45b8..d778af2750ea 100644 --- a/drivers/input/keyboard/adp5520-keys.c +++ b/drivers/input/keyboard/adp5520-keys.c @@ -104,7 +104,6 @@ static int adp5520_keys_probe(struct platform_device *pdev) input->name = pdev->name; input->phys = "adp5520-keys/input0"; - input->dev.parent = &pdev->dev; input->id.bustype = BUS_I2C; input->id.vendor = 0x0001; From a502e4abdb9b437cc909f47ef5233011c68c292f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:41 -0700 Subject: [PATCH 24/94] Input: bcm-keypad - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in bcm_kp_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/bcm-keypad.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/bcm-keypad.c b/drivers/input/keyboard/bcm-keypad.c index 6b46f83a9edb..f76cc6e7b787 100644 --- a/drivers/input/keyboard/bcm-keypad.c +++ b/drivers/input/keyboard/bcm-keypad.c @@ -327,7 +327,6 @@ static int bcm_kp_probe(struct platform_device *pdev) input_dev->name = pdev->name; input_dev->phys = "keypad/input0"; - input_dev->dev.parent = &pdev->dev; input_dev->open = bcm_kp_open; input_dev->close = bcm_kp_close; From a8d548ccdbdd21e9d92b3fba14bd3a98301170c5 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:41 -0700 Subject: [PATCH 25/94] Input: clps711x-keypad - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in clps711x_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/clps711x-keypad.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/clps711x-keypad.c b/drivers/input/keyboard/clps711x-keypad.c index ddabd789861b..6a21ee17e164 100644 --- a/drivers/input/keyboard/clps711x-keypad.c +++ b/drivers/input/keyboard/clps711x-keypad.c @@ -130,7 +130,6 @@ static int clps711x_keypad_probe(struct platform_device *pdev) input_set_drvdata(input, priv); input->name = pdev->name; - input->dev.parent = dev; input->id.bustype = BUS_HOST; input->id.vendor = 0x0001; input->id.product = 0x0001; From 1056f24c0e2ba712b2ff9236560c3850b17b0e21 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:42 -0700 Subject: [PATCH 26/94] Input: cros-ec-keyb - drop redundant idev->dev.parent assignments devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignments in cros_ec_keyb_register_bs() and cros_ec_keyb_register_matrix() are redundant. Remove them. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/cros_ec_keyb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index 177e5d4a3382..e1df5f466c9d 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -602,7 +602,6 @@ static int cros_ec_keyb_register_bs(struct cros_ec_keyb *ckdev, idev->id.bustype = BUS_VIRTUAL; idev->id.version = 1; idev->id.product = 0; - idev->dev.parent = dev; input_set_drvdata(idev, ckdev); ckdev->bs_idev = idev; @@ -776,7 +775,6 @@ static int cros_ec_keyb_register_matrix(struct cros_ec_keyb *ckdev) idev->id.bustype = BUS_VIRTUAL; idev->id.version = 1; idev->id.product = 0; - idev->dev.parent = dev; idev->setkeycode = cros_ec_keyb_setkeycode; ckdev->ghost_filter = device_property_read_bool(dev, "google,needs-ghost-filter"); From a9328517a86ea1ec8e2d8d1e97c7f3835c0e9010 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:42 -0700 Subject: [PATCH 27/94] Input: imx-keypad - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in imx_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/imx_keypad.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/imx_keypad.c b/drivers/input/keyboard/imx_keypad.c index ccde60cd6bb3..6f6f99b28a2c 100644 --- a/drivers/input/keyboard/imx_keypad.c +++ b/drivers/input/keyboard/imx_keypad.c @@ -458,7 +458,6 @@ static int imx_keypad_probe(struct platform_device *pdev) /* Init the Input device */ input_dev->name = pdev->name; input_dev->id.bustype = BUS_HOST; - input_dev->dev.parent = &pdev->dev; input_dev->open = imx_keypad_open; input_dev->close = imx_keypad_close; From f46f6c39b2869f23d29905864232f7e02e1a9ee9 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:43 -0700 Subject: [PATCH 28/94] Input: jornada720-kbd - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in jornada720_kbd_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/jornada720_kbd.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/jornada720_kbd.c b/drivers/input/keyboard/jornada720_kbd.c index cd9af5221c3d..26b579f0280f 100644 --- a/drivers/input/keyboard/jornada720_kbd.c +++ b/drivers/input/keyboard/jornada720_kbd.c @@ -113,7 +113,6 @@ static int jornada720_kbd_probe(struct platform_device *pdev) input_dev->keycodesize = sizeof(unsigned short); input_dev->keycodemax = ARRAY_SIZE(jornada_std_keymap); input_dev->id.bustype = BUS_HOST; - input_dev->dev.parent = &pdev->dev; for (i = 0; i < ARRAY_SIZE(jornadakbd->keymap); i++) __set_bit(jornadakbd->keymap[i], input_dev->keybit); From 257ea41e656adf9d082bf8753072dd050bf3e817 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:44 -0700 Subject: [PATCH 29/94] Input: lpc32xx-keys - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in lpc32xx_kscan_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/lpc32xx-keys.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/lpc32xx-keys.c b/drivers/input/keyboard/lpc32xx-keys.c index 2392e7ec3b19..285d5c32fe70 100644 --- a/drivers/input/keyboard/lpc32xx-keys.c +++ b/drivers/input/keyboard/lpc32xx-keys.c @@ -198,7 +198,6 @@ static int lpc32xx_kscan_probe(struct platform_device *pdev) input->id.version = 0x0100; input->open = lpc32xx_kscan_open; input->close = lpc32xx_kscan_close; - input->dev.parent = &pdev->dev; input_set_capability(input, EV_MSC, MSC_SCAN); From 7809322ff6fba87106a26f7e4322191691d7e2ca Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:44 -0700 Subject: [PATCH 30/94] Input: max7359-keypad - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in max7359_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/max7359_keypad.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/max7359_keypad.c b/drivers/input/keyboard/max7359_keypad.c index f8fb44bc4915..94ebb875df1f 100644 --- a/drivers/input/keyboard/max7359_keypad.c +++ b/drivers/input/keyboard/max7359_keypad.c @@ -198,7 +198,6 @@ static int max7359_probe(struct i2c_client *client) input_dev->id.bustype = BUS_I2C; input_dev->open = max7359_open; input_dev->close = max7359_close; - input_dev->dev.parent = &client->dev; input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_REP); input_dev->keycodesize = sizeof(keypad->keycodes[0]); From 6660c1731edfb6328de1ec6700c3b562a3c0fcc3 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:45 -0700 Subject: [PATCH 31/94] Input: mpr121-touchkey - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in mpr_touchkey_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/mpr121_touchkey.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/mpr121_touchkey.c b/drivers/input/keyboard/mpr121_touchkey.c index a1a102855590..204426834371 100644 --- a/drivers/input/keyboard/mpr121_touchkey.c +++ b/drivers/input/keyboard/mpr121_touchkey.c @@ -235,7 +235,6 @@ static int mpr_touchkey_probe(struct i2c_client *client) input_dev->name = "Freescale MPR121 Touchkey"; input_dev->id.bustype = BUS_I2C; - input_dev->dev.parent = dev; if (device_property_read_bool(dev, "autorepeat")) __set_bit(EV_REP, input_dev->evbit); input_set_capability(input_dev, EV_MSC, MSC_SCAN); From e27af2a35bb089b2d105fcb4948fcc9e992ab954 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:45 -0700 Subject: [PATCH 32/94] Input: pxa27x-keypad - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in pxa27x_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/pxa27x_keypad.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/pxa27x_keypad.c b/drivers/input/keyboard/pxa27x_keypad.c index 4519eecb317b..059bce760401 100644 --- a/drivers/input/keyboard/pxa27x_keypad.c +++ b/drivers/input/keyboard/pxa27x_keypad.c @@ -645,7 +645,6 @@ static int pxa27x_keypad_probe(struct platform_device *pdev) input_dev->id.bustype = BUS_HOST; input_dev->open = pxa27x_keypad_open; input_dev->close = pxa27x_keypad_close; - input_dev->dev.parent = &pdev->dev; input_dev->keycode = keypad->keycodes; input_dev->keycodesize = sizeof(keypad->keycodes[0]); From 84e3b7fe5065166e20d153059172c1b7ee86d85b Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:46 -0700 Subject: [PATCH 33/94] Input: qt1050 - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in qt1050_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/qt1050.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/qt1050.c b/drivers/input/keyboard/qt1050.c index f9f480c91032..c6ab8e501f83 100644 --- a/drivers/input/keyboard/qt1050.c +++ b/drivers/input/keyboard/qt1050.c @@ -476,7 +476,6 @@ static int qt1050_probe(struct i2c_client *client) } input->name = "AT42QT1050 QTouch Sensor"; - input->dev.parent = &client->dev; input->id.bustype = BUS_I2C; /* Add the keycode */ From 9293becb199761b0429485808198fbc8b377cebe Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:46 -0700 Subject: [PATCH 34/94] Input: st-keyscan - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in keyscan_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/st-keyscan.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c index 8e9bac339dc4..ca177a708e55 100644 --- a/drivers/input/keyboard/st-keyscan.c +++ b/drivers/input/keyboard/st-keyscan.c @@ -145,7 +145,6 @@ static int keyscan_probe(struct platform_device *pdev) input_dev->name = pdev->name; input_dev->phys = "keyscan-keys/input0"; - input_dev->dev.parent = &pdev->dev; input_dev->open = keyscan_open; input_dev->close = keyscan_close; From 64159a032ae7016323bd07540e1a804cafca6853 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:47 -0700 Subject: [PATCH 35/94] Input: stmpe-keypad - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in stmpe_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/stmpe-keypad.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/stmpe-keypad.c b/drivers/input/keyboard/stmpe-keypad.c index 0acded4fb9c9..bc5d0217be5c 100644 --- a/drivers/input/keyboard/stmpe-keypad.c +++ b/drivers/input/keyboard/stmpe-keypad.c @@ -361,7 +361,6 @@ static int stmpe_keypad_probe(struct platform_device *pdev) input->name = "STMPE keypad"; input->id.bustype = BUS_I2C; - input->dev.parent = &pdev->dev; error = matrix_keypad_parse_properties(&pdev->dev, &rows, &cols); if (error) From 98505a38d551e65b288837837c2d562d06e640b9 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:47 -0700 Subject: [PATCH 36/94] Input: tc3589x-keypad - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in tc3589x_keypad_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tc3589x-keypad.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/tc3589x-keypad.c b/drivers/input/keyboard/tc3589x-keypad.c index 11988cffdfae..137f9fa554f0 100644 --- a/drivers/input/keyboard/tc3589x-keypad.c +++ b/drivers/input/keyboard/tc3589x-keypad.c @@ -405,7 +405,6 @@ static int tc3589x_keypad_probe(struct platform_device *pdev) input->id.bustype = BUS_I2C; input->name = pdev->name; - input->dev.parent = &pdev->dev; input->open = tc3589x_keypad_open; input->close = tc3589x_keypad_close; From 2fa867373b8fde4df7eb1dcdaf7e63c71add13f5 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:48 -0700 Subject: [PATCH 37/94] Input: tegra-kbc - drop redundant kbc->idev->dev.parent assignment devm_input_allocate_device() already initializes kbc->idev->dev.parent to the supplied parent device, so the explicit assignment in tegra_kbc_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/tegra-kbc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/keyboard/tegra-kbc.c b/drivers/input/keyboard/tegra-kbc.c index bc1c80a456f2..e6177f2bdf8d 100644 --- a/drivers/input/keyboard/tegra-kbc.c +++ b/drivers/input/keyboard/tegra-kbc.c @@ -641,7 +641,6 @@ static int tegra_kbc_probe(struct platform_device *pdev) kbc->idev->name = pdev->name; kbc->idev->id.bustype = BUS_HOST; - kbc->idev->dev.parent = &pdev->dev; kbc->idev->open = tegra_kbc_open; kbc->idev->close = tegra_kbc_close; From 83b9dabc2b5e43bd787658341201cc270f01ab32 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:49 -0700 Subject: [PATCH 38/94] Input: 88pm860x-onkey - drop redundant info->idev->dev.parent assignment devm_input_allocate_device() already initializes info->idev->dev.parent to the supplied parent device, so the explicit assignment in pm860x_onkey_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/88pm860x_onkey.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/88pm860x_onkey.c b/drivers/input/misc/88pm860x_onkey.c index 0f8b7ffb3aff..2d398119a620 100644 --- a/drivers/input/misc/88pm860x_onkey.c +++ b/drivers/input/misc/88pm860x_onkey.c @@ -85,7 +85,6 @@ static int pm860x_onkey_probe(struct platform_device *pdev) info->idev->name = "88pm860x_on"; info->idev->phys = "88pm860x_on/input0"; info->idev->id.bustype = BUS_I2C; - info->idev->dev.parent = &pdev->dev; info->idev->evbit[0] = BIT_MASK(EV_KEY); info->idev->keybit[BIT_WORD(KEY_POWER)] = BIT_MASK(KEY_POWER); From 18c3c24df40aae2e3aea64e09612cb2970772219 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:49 -0700 Subject: [PATCH 39/94] Input: ab8500-ponkey - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in ab8500_ponkey_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/ab8500-ponkey.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/ab8500-ponkey.c b/drivers/input/misc/ab8500-ponkey.c index a9b9013680d6..4ace4739eee2 100644 --- a/drivers/input/misc/ab8500-ponkey.c +++ b/drivers/input/misc/ab8500-ponkey.c @@ -77,7 +77,6 @@ static int ab8500_ponkey_probe(struct platform_device *pdev) ponkey->irq_dbr = irq_dbr; input->name = "AB8500 POn(PowerOn) Key"; - input->dev.parent = &pdev->dev; input_set_capability(input, EV_KEY, KEY_POWER); From 405682801ec3ac786902a0294fcbe64b7cb88e69 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:50 -0700 Subject: [PATCH 40/94] Input: ad714x - drop redundant input->dev.parent assignments devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignments in ad714x_probe() are redundant. Remove them. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/ad714x.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/input/misc/ad714x.c b/drivers/input/misc/ad714x.c index c9fa789337ba..2aee2a4a027d 100644 --- a/drivers/input/misc/ad714x.c +++ b/drivers/input/misc/ad714x.c @@ -1046,7 +1046,6 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, input->id.product = ad714x->product; input->id.version = ad714x->version; input->name = "ad714x_captouch_slider"; - input->dev.parent = dev; error = input_register_device(input); if (error) @@ -1076,7 +1075,6 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, input->id.product = ad714x->product; input->id.version = ad714x->version; input->name = "ad714x_captouch_wheel"; - input->dev.parent = dev; error = input_register_device(input); if (error) @@ -1109,7 +1107,6 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, input->id.product = ad714x->product; input->id.version = ad714x->version; input->name = "ad714x_captouch_pad"; - input->dev.parent = dev; error = input_register_device(input); if (error) @@ -1139,7 +1136,6 @@ struct ad714x_chip *ad714x_probe(struct device *dev, u16 bus_type, int irq, input->id.product = ad714x->product; input->id.version = ad714x->version; input->name = "ad714x_captouch_button"; - input->dev.parent = dev; error = input_register_device(input); if (error) From f8c6256d69370b138cf1b6913179c299dda229b9 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:50 -0700 Subject: [PATCH 41/94] Input: ariel-pwrbutton - drop redundant priv->input->dev.parent assignment devm_input_allocate_device() already initializes priv->input->dev.parent to the supplied parent device, so the explicit assignment in ariel_pwrbutton_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/ariel-pwrbutton.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/ariel-pwrbutton.c b/drivers/input/misc/ariel-pwrbutton.c index f0e06ee604d6..e22f8985e7eb 100644 --- a/drivers/input/misc/ariel-pwrbutton.c +++ b/drivers/input/misc/ariel-pwrbutton.c @@ -113,7 +113,6 @@ static int ariel_pwrbutton_probe(struct spi_device *spi) if (!priv->input) return -ENOMEM; priv->input->name = "Power Button"; - priv->input->dev.parent = &spi->dev; input_set_capability(priv->input, EV_KEY, KEY_POWER); error = input_register_device(priv->input); if (error) { From 3f950bb62c6a3396dc48656cff8862034382a1d1 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:51 -0700 Subject: [PATCH 42/94] Input: e3x0-button - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in e3x0_button_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/e3x0-button.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/e3x0-button.c b/drivers/input/misc/e3x0-button.c index 5bd527117470..5b399284723d 100644 --- a/drivers/input/misc/e3x0-button.c +++ b/drivers/input/misc/e3x0-button.c @@ -78,7 +78,6 @@ static int e3x0_button_probe(struct platform_device *pdev) input->name = "NI Ettus Research USRP E3x0 Button Driver"; input->phys = "e3x0_button/input0"; - input->dev.parent = &pdev->dev; input_set_capability(input, EV_KEY, KEY_POWER); From 0a61e7fb7dd0a7451d03a3c21df07aaf4f888884 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:51 -0700 Subject: [PATCH 43/94] Input: max77693-haptic - drop redundant haptic->input_dev->dev.parent assignment devm_input_allocate_device() already initializes haptic->input_dev->dev.parent to the supplied parent device, so the explicit assignment in max77693_haptic_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/max77693-haptic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/max77693-haptic.c b/drivers/input/misc/max77693-haptic.c index 5d45680d74a4..10325c1296da 100644 --- a/drivers/input/misc/max77693-haptic.c +++ b/drivers/input/misc/max77693-haptic.c @@ -356,7 +356,6 @@ static int max77693_haptic_probe(struct platform_device *pdev) haptic->input_dev->name = "max77693-haptic"; haptic->input_dev->id.version = 1; - haptic->input_dev->dev.parent = &pdev->dev; haptic->input_dev->open = max77693_haptic_open; haptic->input_dev->close = max77693_haptic_close; input_set_drvdata(haptic->input_dev, haptic); From e774ba5aef83f267c041f5838d3e175fe96573e9 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:52 -0700 Subject: [PATCH 44/94] Input: max8925-onkey - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in max8925_onkey_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/max8925_onkey.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/max8925_onkey.c b/drivers/input/misc/max8925_onkey.c index 62619e4fed20..d185b3ca353d 100644 --- a/drivers/input/misc/max8925_onkey.c +++ b/drivers/input/misc/max8925_onkey.c @@ -96,7 +96,6 @@ static int max8925_onkey_probe(struct platform_device *pdev) input->name = "max8925_on"; input->phys = "max8925_on/input0"; input->id.bustype = BUS_I2C; - input->dev.parent = &pdev->dev; input_set_capability(input, EV_KEY, KEY_POWER); error = devm_request_threaded_irq(&pdev->dev, irq[0], NULL, From c936861223121b0f23289fa4e9528f2b8259f57f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:52 -0700 Subject: [PATCH 45/94] Input: pwm-vibra - drop redundant vibrator->input->dev.parent assignment devm_input_allocate_device() already initializes vibrator->input->dev.parent to the supplied parent device, so the explicit assignment in pwm_vibrator_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/pwm-vibra.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/pwm-vibra.c b/drivers/input/misc/pwm-vibra.c index 3e5ed685ed8f..53ca3b1d7360 100644 --- a/drivers/input/misc/pwm-vibra.c +++ b/drivers/input/misc/pwm-vibra.c @@ -202,7 +202,6 @@ static int pwm_vibrator_probe(struct platform_device *pdev) vibrator->input->name = "pwm-vibrator"; vibrator->input->id.bustype = BUS_HOST; - vibrator->input->dev.parent = &pdev->dev; vibrator->input->close = pwm_vibrator_close; input_set_drvdata(vibrator->input, vibrator); From 5ec79014764b9a01f768c2372567939dde4739b1 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:53 -0700 Subject: [PATCH 46/94] Input: regulator-haptic - drop redundant haptic->input_dev->dev.parent assignment devm_input_allocate_device() already initializes haptic->input_dev->dev.parent to the supplied parent device, so the explicit assignment in regulator_haptic_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/regulator-haptic.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/regulator-haptic.c b/drivers/input/misc/regulator-haptic.c index 9711f5c7c78a..bd26c8e1b338 100644 --- a/drivers/input/misc/regulator-haptic.c +++ b/drivers/input/misc/regulator-haptic.c @@ -179,7 +179,6 @@ static int regulator_haptic_probe(struct platform_device *pdev) haptic->input_dev = input_dev; haptic->input_dev->name = "regulator-haptic"; - haptic->input_dev->dev.parent = &pdev->dev; haptic->input_dev->close = regulator_haptic_close; input_set_drvdata(haptic->input_dev, haptic); input_set_capability(haptic->input_dev, EV_FF, FF_RUMBLE); From 01278816a15016f57f489d894c8941142f6d64af Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:54 -0700 Subject: [PATCH 47/94] Input: retu-pwrbutton - drop redundant idev->dev.parent assignment devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignment in retu_pwrbutton_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/retu-pwrbutton.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/retu-pwrbutton.c b/drivers/input/misc/retu-pwrbutton.c index 64023ac08e2b..65603826b957 100644 --- a/drivers/input/misc/retu-pwrbutton.c +++ b/drivers/input/misc/retu-pwrbutton.c @@ -57,7 +57,6 @@ static int retu_pwrbutton_probe(struct platform_device *pdev) return -ENOMEM; idev->name = "retu-pwrbutton"; - idev->dev.parent = &pdev->dev; input_set_capability(idev, EV_KEY, KEY_POWER); input_set_drvdata(idev, rdev); From 0e9c121b32457cdaf9393785aa306eafb741250d Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:54 -0700 Subject: [PATCH 48/94] Input: tps65218-pwrbutton - drop redundant idev->dev.parent assignment devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignment in tps6521x_pb_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/tps65218-pwrbutton.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/tps65218-pwrbutton.c b/drivers/input/misc/tps65218-pwrbutton.c index fc450fce0932..5c4de3a285d5 100644 --- a/drivers/input/misc/tps65218-pwrbutton.c +++ b/drivers/input/misc/tps65218-pwrbutton.c @@ -105,7 +105,6 @@ static int tps6521x_pb_probe(struct platform_device *pdev) snprintf(pwr->phys, sizeof(pwr->phys), "%s/input0", pwr->data->name); idev->phys = pwr->phys; - idev->dev.parent = dev; idev->id.bustype = BUS_I2C; input_set_capability(idev, EV_KEY, KEY_POWER); From 4653515dcb566d9140ab83bce54899e3323e2d83 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:55 -0700 Subject: [PATCH 49/94] Input: twl4030-pwrbutton - drop redundant pwr->dev.parent assignment devm_input_allocate_device() already initializes pwr->dev.parent to the supplied parent device, so the explicit assignment in twl4030_pwrbutton_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/twl4030-pwrbutton.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/twl4030-pwrbutton.c b/drivers/input/misc/twl4030-pwrbutton.c index 3e94a5995766..949d57f32958 100644 --- a/drivers/input/misc/twl4030-pwrbutton.c +++ b/drivers/input/misc/twl4030-pwrbutton.c @@ -90,7 +90,6 @@ static int twl4030_pwrbutton_probe(struct platform_device *pdev) input_set_capability(pwr, EV_KEY, KEY_POWER); pwr->name = "twl4030_pwrbutton"; pwr->phys = "twl4030_pwrbutton/input0"; - pwr->dev.parent = &pdev->dev; err = devm_request_threaded_irq(&pdev->dev, irq, NULL, powerbutton_irq, IRQF_TRIGGER_FALLING | IRQF_TRIGGER_RISING | From 892fd791e7b7af74716fb724d74f70328db4b7b7 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:55 -0700 Subject: [PATCH 50/94] Input: wm831x-on - drop redundant wm831x_on->dev->dev.parent assignment devm_input_allocate_device() already initializes wm831x_on->dev->dev.parent to the supplied parent device, so the explicit assignment in wm831x_on_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/misc/wm831x-on.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/wm831x-on.c b/drivers/input/misc/wm831x-on.c index 18eb319bc6f7..a885873bcbd8 100644 --- a/drivers/input/misc/wm831x-on.c +++ b/drivers/input/misc/wm831x-on.c @@ -96,7 +96,6 @@ static int wm831x_on_probe(struct platform_device *pdev) wm831x_on->dev->keybit[BIT_WORD(KEY_POWER)] = BIT_MASK(KEY_POWER); wm831x_on->dev->name = "wm831x_on"; wm831x_on->dev->phys = "wm831x_on/input0"; - wm831x_on->dev->dev.parent = &pdev->dev; ret = request_threaded_irq(irq, NULL, wm831x_on_irq, IRQF_TRIGGER_RISING | IRQF_ONESHOT, From 2bd73a60f4c3ff3722e3bdfbed53e4ce9c4d4a55 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:56 -0700 Subject: [PATCH 51/94] Input: ad7877 - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in ad7877_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ad7877.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/ad7877.c b/drivers/input/touchscreen/ad7877.c index cc39057d0117..90311df47e4f 100644 --- a/drivers/input/touchscreen/ad7877.c +++ b/drivers/input/touchscreen/ad7877.c @@ -725,7 +725,6 @@ static int ad7877_probe(struct spi_device *spi) input_dev->name = "AD7877 Touchscreen"; input_dev->phys = ts->phys; - input_dev->dev.parent = &spi->dev; __set_bit(EV_KEY, input_dev->evbit); __set_bit(BTN_TOUCH, input_dev->keybit); From 9c7c99e6d477ef06d41550df15be7d40d52b5272 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:56 -0700 Subject: [PATCH 52/94] Input: ad7879 - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in ad7879_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ad7879.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/ad7879.c b/drivers/input/touchscreen/ad7879.c index 31d2a3029d5f..0789d8e19eab 100644 --- a/drivers/input/touchscreen/ad7879.c +++ b/drivers/input/touchscreen/ad7879.c @@ -545,7 +545,6 @@ int ad7879_probe(struct device *dev, struct regmap *regmap, input_dev->name = "AD7879 Touchscreen"; input_dev->phys = ts->phys; - input_dev->dev.parent = dev; input_dev->id.bustype = bustype; input_dev->open = ad7879_open; From 6deb2aebcc9b049fe81a0b5e77f93c862e73568f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:57 -0700 Subject: [PATCH 53/94] Input: ar1021-i2c - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in ar1021_i2c_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/ar1021_i2c.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/ar1021_i2c.c b/drivers/input/touchscreen/ar1021_i2c.c index aa43fc1549df..a56b114bcb36 100644 --- a/drivers/input/touchscreen/ar1021_i2c.c +++ b/drivers/input/touchscreen/ar1021_i2c.c @@ -111,7 +111,6 @@ static int ar1021_i2c_probe(struct i2c_client *client) input->name = "ar1021 I2C Touchscreen"; input->id.bustype = BUS_I2C; - input->dev.parent = &client->dev; input->open = ar1021_i2c_open; input->close = ar1021_i2c_close; From d081ad39c4cb7da73fdf2a8f3c78712a342f78e4 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:57 -0700 Subject: [PATCH 54/94] Input: bcm-iproc-tsc - drop redundant idev->dev.parent assignment devm_input_allocate_device() already initializes idev->dev.parent to the supplied parent device, so the explicit assignment in iproc_ts_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/bcm_iproc_tsc.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/bcm_iproc_tsc.c b/drivers/input/touchscreen/bcm_iproc_tsc.c index e49bde50d77a..42c27b2ef949 100644 --- a/drivers/input/touchscreen/bcm_iproc_tsc.c +++ b/drivers/input/touchscreen/bcm_iproc_tsc.c @@ -459,7 +459,6 @@ static int iproc_ts_probe(struct platform_device *pdev) /* Set input device info */ idev->name = IPROC_TS_NAME; - idev->dev.parent = &pdev->dev; idev->id.bustype = BUS_HOST; idev->id.vendor = SERIO_UNKNOWN; From 6fdc2d0a60cf305024d936261eb3e39e44d285f7 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:58 -0700 Subject: [PATCH 55/94] Input: chipone-icn8318 - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in icn8318_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/chipone_icn8318.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/chipone_icn8318.c b/drivers/input/touchscreen/chipone_icn8318.c index 1b10a757313c..03b62706e39f 100644 --- a/drivers/input/touchscreen/chipone_icn8318.c +++ b/drivers/input/touchscreen/chipone_icn8318.c @@ -202,7 +202,6 @@ static int icn8318_probe(struct i2c_client *client) input->id.bustype = BUS_I2C; input->open = icn8318_start; input->close = icn8318_stop; - input->dev.parent = dev; input_set_capability(input, EV_ABS, ABS_MT_POSITION_X); input_set_capability(input, EV_ABS, ABS_MT_POSITION_Y); From 137fc97684c218e826754eb98beca0c48693519f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:59 -0700 Subject: [PATCH 56/94] Input: colibri-vf50-ts - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in vf50_ts_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/colibri-vf50-ts.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/colibri-vf50-ts.c b/drivers/input/touchscreen/colibri-vf50-ts.c index 98d5b2ba63fb..912edf5cea43 100644 --- a/drivers/input/touchscreen/colibri-vf50-ts.c +++ b/drivers/input/touchscreen/colibri-vf50-ts.c @@ -303,7 +303,6 @@ static int vf50_ts_probe(struct platform_device *pdev) input->name = DRIVER_NAME; input->id.bustype = BUS_HOST; - input->dev.parent = dev; input->open = vf50_ts_open; input->close = vf50_ts_close; From 83e34e6051dc6c8f0fce1566d79412e83bcabb1f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:19:59 -0700 Subject: [PATCH 57/94] Input: cyttsp - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in cyttsp_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/cyttsp_core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/cyttsp_core.c b/drivers/input/touchscreen/cyttsp_core.c index 012dfcae01cc..b535e38f895f 100644 --- a/drivers/input/touchscreen/cyttsp_core.c +++ b/drivers/input/touchscreen/cyttsp_core.c @@ -658,7 +658,6 @@ struct cyttsp *cyttsp_probe(const struct cyttsp_bus_ops *bus_ops, input_dev->name = "Cypress TTSP TouchScreen"; input_dev->id.bustype = bus_ops->bustype; - input_dev->dev.parent = ts->dev; input_dev->open = cyttsp_open; input_dev->close = cyttsp_close; From 238c76c9a6500a421fd441b6ad05eb637d3a8714 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:20:00 -0700 Subject: [PATCH 58/94] Input: da9034-ts - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in da9034_touch_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/da9034-ts.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/da9034-ts.c b/drivers/input/touchscreen/da9034-ts.c index 2943f6a58388..2c46079e47d0 100644 --- a/drivers/input/touchscreen/da9034-ts.c +++ b/drivers/input/touchscreen/da9034-ts.c @@ -330,7 +330,6 @@ static int da9034_touch_probe(struct platform_device *pdev) input_dev->name = pdev->name; input_dev->open = da9034_touch_open; input_dev->close = da9034_touch_close; - input_dev->dev.parent = &pdev->dev; __set_bit(EV_ABS, input_dev->evbit); __set_bit(ABS_X, input_dev->absbit); From eb78f815f603c80f033845c5d0e30a4f11a92c17 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:20:00 -0700 Subject: [PATCH 59/94] Input: edt-ft5x06 - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in edt_ft5x06_ts_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/edt-ft5x06.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/edt-ft5x06.c b/drivers/input/touchscreen/edt-ft5x06.c index d3b1177185a3..00f616e913f9 100644 --- a/drivers/input/touchscreen/edt-ft5x06.c +++ b/drivers/input/touchscreen/edt-ft5x06.c @@ -1290,7 +1290,6 @@ static int edt_ft5x06_ts_probe(struct i2c_client *client) input->name = tsdata->name; input->id.bustype = BUS_I2C; - input->dev.parent = &client->dev; input_set_abs_params(input, ABS_MT_POSITION_X, 0, tsdata->num_x * 64 - 1, 0, 0); From 4404fbc8bfcb7983f86776fe03d40228867f97a1 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:20:01 -0700 Subject: [PATCH 60/94] Input: hycon-hy46xx - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in hycon_hy46xx_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/hycon-hy46xx.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/hycon-hy46xx.c b/drivers/input/touchscreen/hycon-hy46xx.c index 1513f20cbf51..8ca408d66caf 100644 --- a/drivers/input/touchscreen/hycon-hy46xx.c +++ b/drivers/input/touchscreen/hycon-hy46xx.c @@ -499,7 +499,6 @@ static int hycon_hy46xx_probe(struct i2c_client *client) input->name = "Hycon Capacitive Touch"; input->id.bustype = BUS_I2C; - input->dev.parent = &client->dev; input_set_abs_params(input, ABS_MT_POSITION_X, 0, -1, 0, 0); input_set_abs_params(input, ABS_MT_POSITION_Y, 0, -1, 0, 0); From f63a1cac6d3c96ff6dbf7ae7738e277cd7712e5c Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:20:01 -0700 Subject: [PATCH 61/94] Input: jornada720-ts - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in jornada720_ts_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/jornada720_ts.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/jornada720_ts.c b/drivers/input/touchscreen/jornada720_ts.c index 974521102178..ba4e3c6e5c91 100644 --- a/drivers/input/touchscreen/jornada720_ts.c +++ b/drivers/input/touchscreen/jornada720_ts.c @@ -123,7 +123,6 @@ static int jornada720_ts_probe(struct platform_device *pdev) input_dev->name = "HP Jornada 7xx Touchscreen"; input_dev->phys = "jornadats/input0"; input_dev->id.bustype = BUS_HOST; - input_dev->dev.parent = &pdev->dev; input_dev->evbit[0] = BIT_MASK(EV_KEY) | BIT_MASK(EV_ABS); input_dev->keybit[BIT_WORD(BTN_TOUCH)] = BIT_MASK(BTN_TOUCH); From b3ea7dbcfd2c214b21923b8929aebeff04a2cb4f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:20:02 -0700 Subject: [PATCH 62/94] Input: max11801-ts - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in max11801_ts_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/max11801_ts.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/max11801_ts.c b/drivers/input/touchscreen/max11801_ts.c index 3996e4a61ff7..2191b4f8a00b 100644 --- a/drivers/input/touchscreen/max11801_ts.c +++ b/drivers/input/touchscreen/max11801_ts.c @@ -186,7 +186,6 @@ static int max11801_ts_probe(struct i2c_client *client) input_dev->name = "max11801_ts"; input_dev->id.bustype = BUS_I2C; - input_dev->dev.parent = &client->dev; __set_bit(EV_ABS, input_dev->evbit); __set_bit(EV_KEY, input_dev->evbit); From a23fff38a99552cfbe79dba9efff4600cc828582 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:20:03 -0700 Subject: [PATCH 63/94] Input: mms114 - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in mms114_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/mms114.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c index 27911a9f4e9e..47f51365003b 100644 --- a/drivers/input/touchscreen/mms114.c +++ b/drivers/input/touchscreen/mms114.c @@ -626,7 +626,6 @@ static int mms114_probe(struct i2c_client *client) return -ENOMEM; input_dev->id.bustype = BUS_I2C; - input_dev->dev.parent = &client->dev; input_dev->open = mms114_input_open; input_dev->close = mms114_input_close; From f49a843965576a403c729879c05110d6740793d8 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:20:03 -0700 Subject: [PATCH 64/94] Input: sx8654 - drop redundant input->dev.parent assignment devm_input_allocate_device() already initializes input->dev.parent to the supplied parent device, so the explicit assignment in sx8654_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/sx8654.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/sx8654.c b/drivers/input/touchscreen/sx8654.c index 0d92aaeea3e0..7311b5cd573f 100644 --- a/drivers/input/touchscreen/sx8654.c +++ b/drivers/input/touchscreen/sx8654.c @@ -345,7 +345,6 @@ static int sx8654_probe(struct i2c_client *client) input->name = "SX8654 I2C Touchscreen"; input->id.bustype = BUS_I2C; - input->dev.parent = &client->dev; input->open = sx8654_open; input->close = sx8654_close; From 24edf39189e88218a65890ab858a1c39ef2f4a3a Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:20:04 -0700 Subject: [PATCH 65/94] Input: wm831x-ts - drop redundant input_dev->dev.parent assignment devm_input_allocate_device() already initializes input_dev->dev.parent to the supplied parent device, so the explicit assignment in wm831x_ts_probe() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/wm831x-ts.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/wm831x-ts.c b/drivers/input/touchscreen/wm831x-ts.c index 98f8ec408cad..17c58b6fa123 100644 --- a/drivers/input/touchscreen/wm831x-ts.c +++ b/drivers/input/touchscreen/wm831x-ts.c @@ -356,7 +356,6 @@ static int wm831x_ts_probe(struct platform_device *pdev) input_set_abs_params(input_dev, ABS_PRESSURE, 0, 4095, 5, 0); input_set_drvdata(input_dev, wm831x_ts); - input_dev->dev.parent = &pdev->dev; error = input_register_device(input_dev); if (error) From 8a1a516e8ee68a0c99bd46eec1cc052637bd4670 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 7 Oct 2026 23:20:04 -0700 Subject: [PATCH 66/94] Input: wm97xx - drop redundant wm->input_dev->dev.parent assignment devm_input_allocate_device() already initializes wm->input_dev->dev.parent to the supplied parent device, so the explicit assignment in wm97xx_register_touch() is redundant. Remove it. Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/wm97xx-core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/wm97xx-core.c b/drivers/input/touchscreen/wm97xx-core.c index c51822563f3f..f6b7c03f654f 100644 --- a/drivers/input/touchscreen/wm97xx-core.c +++ b/drivers/input/touchscreen/wm97xx-core.c @@ -567,7 +567,6 @@ static int wm97xx_register_touch(struct wm97xx *wm) abs_p[2], 0); input_set_drvdata(wm->input_dev, wm); - wm->input_dev->dev.parent = wm->dev; ret = input_register_device(wm->input_dev); if (ret) From 68a0deade76c01da05f434df9094c2d4cefce1ef Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Tue, 4 Aug 2026 20:46:31 -0700 Subject: [PATCH 67/94] Input: mms114 - fix touch slot corruption in suspend In mms114_suspend, the driver synthesizes touch release events for all slots and calls input_sync before disabling the hardware interrupt via mms114_stop. Because the threaded interrupt handler runs independently and does not share a lock with this early part of the suspend path, an incoming hardware interrupt can fire after input_sync completes but before disable_irq is invoked. If a touch event arrives during this window, the interrupt handler reports the touch slot as active again, overwriting the synthetic release event right before the system goes to sleep. Upon resume, lifting the finger does not generate a release interrupt, potentially leaving userspace with a stuck active touch slot. Fix this race by calling mms114_stop, which disables the IRQ and synchronizes with any executing interrupt handler, before synthesizing the touch release events. Also ensure that we only synthesize touch release events if the input device is enabled, keeping the entire suspend sequence protected by input_dev->mutex. Reported-by: sashiko-bot@kernel.org Assisted-by: Antigravity:gemini-3.6-flash Link: https://patch.msgid.link/anKxGkyRRu5A92Q_@google.com Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/mms114.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/input/touchscreen/mms114.c b/drivers/input/touchscreen/mms114.c index 47f51365003b..f6039a47f7e9 100644 --- a/drivers/input/touchscreen/mms114.c +++ b/drivers/input/touchscreen/mms114.c @@ -678,6 +678,13 @@ static int mms114_suspend(struct device *dev) struct input_dev *input_dev = data->input_dev; int id; + guard(mutex)(&input_dev->mutex); + + if (!input_device_enabled(input_dev)) + return 0; + + mms114_stop(data); + /* Release all touch */ for (id = 0; id < MMS114_MAX_TOUCH; id++) { input_mt_slot(input_dev, id); @@ -687,11 +694,6 @@ static int mms114_suspend(struct device *dev) input_mt_report_pointer_emulation(input_dev, true); input_sync(input_dev); - guard(mutex)(&input_dev->mutex); - - if (input_device_enabled(input_dev)) - mms114_stop(data); - return 0; } From cbb37908effbe2fb3e3ee0fe6ba1fd0f7f47b359 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sat, 29 Aug 2026 04:12:18 -0700 Subject: [PATCH 68/94] Input: st-keyscan - disable interrupt while clock is gated The driver gates off its peripheral clock when the input device is not open and during system suspend without wakeup. However, the interrupt is requested without IRQF_NO_AUTOEN and remains unmasked when the device is stopped. If a pending or spurious interrupt fires while the clock is disabled, keyscan_isr() will attempt to read the matrix state register with the clock gated off, triggering a bus fault (synchronous external abort) and panicking the system. Request the interrupt with IRQF_NO_AUTOEN, enable it in keyscan_start(), and disable it in keyscan_stop() prior to gating the clock. Drop the pointless clock enable/stop sequence in keyscan_probe(), leaving the clock gated and hardware untouched until the device is opened. Fixes: 062589b13991 ("Input: add st-keyscan driver") Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Link: https://patch.msgid.link/apK-PZ5c97mCxBSC@google.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/st-keyscan.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/drivers/input/keyboard/st-keyscan.c b/drivers/input/keyboard/st-keyscan.c index ca177a708e55..2fbdf373fe99 100644 --- a/drivers/input/keyboard/st-keyscan.c +++ b/drivers/input/keyboard/st-keyscan.c @@ -75,6 +75,8 @@ static int keyscan_start(struct st_keyscan *keypad) writel(KEYSCAN_CONFIG_ENABLE, keypad->base + KEYSCAN_CONFIG_OFF); + enable_irq(keypad->irq); + return 0; } @@ -82,6 +84,8 @@ static void keyscan_stop(struct st_keyscan *keypad) { writel(0, keypad->base + KEYSCAN_CONFIG_OFF); + disable_irq(keypad->irq); + clk_disable(keypad->clk); } @@ -176,20 +180,12 @@ static int keyscan_probe(struct platform_device *pdev) return dev_err_probe(&pdev->dev, PTR_ERR(keypad_data->clk), "cannot get clock\n"); - error = clk_enable(keypad_data->clk); - if (error) { - dev_err(&pdev->dev, "failed to enable clock\n"); - return error; - } - - keyscan_stop(keypad_data); - keypad_data->irq = platform_get_irq(pdev, 0); if (keypad_data->irq < 0) return keypad_data->irq; - error = devm_request_irq(&pdev->dev, keypad_data->irq, keyscan_isr, 0, - pdev->name, keypad_data); + error = devm_request_irq(&pdev->dev, keypad_data->irq, keyscan_isr, + IRQF_NO_AUTOEN, pdev->name, keypad_data); if (error) return error; From cf92023f517dcfa1fa4365a09f2ec941ce2b997e Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:25 -0700 Subject: [PATCH 69/94] Input: maple_keyb - fix key press detection The key press detection logic was using ptr instead of !ptr (where ptr is the result of memchr searching for the new key in the old keys). If ptr is not NULL, it means the key was already pressed in the previous report, so it is not a new press. If ptr is NULL, it means the key was not pressed before, so it is a new press. Using ptr instead of !ptr caused new presses to be ignored in the first poll cycle (only reported in the second cycle if still held, because then it was in 'old'), and caused redundant press events to be sent on every subsequent poll while the key was held. Fix this by using !ptr for press detection, matching the release detection logic. Fixes: b11d2127c489 ("Input: add support for SEGA Dreamcast keyboard") Assisted-by: Antigravity:gemini-3.5-flash Tested-by: Florian Fuchs Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-2-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/maple_keyb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index 3d5538dd4f23..623d7951405b 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -107,7 +107,7 @@ static void dc_scan_kbd(struct dc_kbd *kbd) } ptr = memchr(kbd->old + 2, kbd->new[i], 6); code = kbd->new[i]; - if (code > 3 && ptr) { + if (code > 3 && !ptr) { keycode = kbd->keycode[code]; if (keycode) { input_event(dev, EV_MSC, MSC_SCAN, code); From dbb660ccc9f1506f87f92b51b013043b113b074a Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:26 -0700 Subject: [PATCH 70/94] Input: maplecontrol - only enable present axes The driver was unconditionally enabling all possible analog axes and hats on the input device, even if the controller reported it did not have them in its function data. Move the input_set_abs_params() calls inside the capability check loop so that only actually present axes are enabled on the input device. Also, correct the D-pad (hat) axis limits. They were initialized with inverted limits (min=1, max=-1). Correct them to min=-1, max=1, which matches the values (-1, 0, 1) reported by the driver. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-3-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/maplecontrol.c | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index 6293b6e8148b..a498fc322c4d 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -118,26 +118,19 @@ static int probe_maple_controller(struct device *dev) idev->close = dc_pad_close; for (i = 0; i < 32; i++) { - if (data & (1 << i)) { + if (data & BIT(i)) { if (btn_bit[i] >= 0) __set_bit(btn_bit[i], idev->keybit); - else if (abs_bit[i] >= 0) - __set_bit(abs_bit[i], idev->absbit); + else if (abs_bit[i] >= ABS_X && abs_bit[i] <= ABS_BRAKE) + input_set_abs_params(idev, abs_bit[i], 0, 255, 0, 0); + else if (abs_bit[i] >= ABS_HAT0X && abs_bit[i] <= ABS_HAT3Y) + input_set_abs_params(idev, abs_bit[i], -1, 1, 0, 0); } } if (idev->keybit[BIT_WORD(BTN_JOYSTICK)]) idev->evbit[0] |= BIT_MASK(EV_KEY); - if (idev->absbit[0]) - idev->evbit[0] |= BIT_MASK(EV_ABS); - - for (i = ABS_X; i <= ABS_BRAKE; i++) - input_set_abs_params(idev, i, 0, 255, 0, 0); - - for (i = ABS_HAT0X; i <= ABS_HAT3Y; i++) - input_set_abs_params(idev, i, 1, -1, 0, 0); - idev->dev.platform_data = pad; idev->dev.parent = &mdev->dev; idev->name = mdev->product_name; From 2f201770cd4a3e3178c53c977aab172085f3d2d4 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Wed, 14 Oct 2026 10:11:01 -0700 Subject: [PATCH 71/94] Input: maplecontrol - emit EV_SYN report after reporting events The driver decodes controller packets and reports button presses and axis positions in dc_pad_callback(), but never calls input_sync() to signal completion of the input report frame. Consequently, events remain pending without waking up userspace readers. Emit an EV_SYN/SYN_REPORT event after reporting buttons and axis states. Fixes: 01461d7e65a6 ("Input: add support for Maple controller as a joystick") Reported-by: sashiko-bot@kernel.org Closes: https://lore.kernel.org/r/20260704061045.036701F000E9@smtp.kernel.org Assisted-by: LLM Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/maplecontrol.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index a498fc322c4d..1eb7d279965d 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -58,6 +58,8 @@ static void dc_pad_callback(struct mapleq *mq) input_report_abs(dev, ABS_Y, res[13]); input_report_abs(dev, ABS_RX, res[14]); input_report_abs(dev, ABS_RY, res[15]); + + input_sync(dev); } static int dc_pad_open(struct input_dev *dev) From 779db8dab7b972f029f0f08fa4f7d60c8a8d2348 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:28 -0700 Subject: [PATCH 72/94] Input: maplecontrol - stop polling and clear callback on close In dc_pad_close(), pass NULL instead of dc_pad_callback to maple_getcond_callback() to both stop polling and clear the callback pointer when the input device is closed. This makes the manual clearing of mdev->callback in remove_maple_controller() redundant, as input_unregister_device() automatically closes the device if it was open. Remove the redundant assignment. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-5-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/maplecontrol.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index 1eb7d279965d..19ae238e6c00 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -76,8 +76,7 @@ static void dc_pad_close(struct input_dev *dev) { struct dc_pad *pad = dev_get_platdata(&dev->dev); - maple_getcond_callback(pad->mdev, dc_pad_callback, 0, - MAPLE_FUNC_CONTROLLER); + maple_getcond_callback(pad->mdev, NULL, 0, MAPLE_FUNC_CONTROLLER); } /* allow the controller to be used */ @@ -158,7 +157,6 @@ static int remove_maple_controller(struct device *dev) struct maple_device *mdev = to_maple_dev(dev); struct dc_pad *pad = maple_get_drvdata(mdev); - mdev->callback = NULL; input_unregister_device(pad->dev); maple_set_drvdata(mdev, NULL); kfree(pad); From fe676cb1e4678a7cb9901652d00155a8b1dc065a Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:27 -0700 Subject: [PATCH 73/94] Input: maplemouse - stop polling and clear callback on close In dc_mouse_close(), pass NULL instead of dc_mouse_callback to maple_getcond_callback() to both stop polling and clear the callback pointer when the input device is closed. This makes the manual clearing of mdev->callback in remove_maple_mouse() redundant, as input_unregister_device() automatically closes the device if it was open. Remove the redundant assignment. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-4-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/maplemouse.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c index 0c8f7d1b02aa..97d520e7d66d 100644 --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c @@ -60,8 +60,7 @@ static void dc_mouse_close(struct input_dev *dev) { struct dc_mouse *mse = input_get_drvdata(dev); - maple_getcond_callback(mse->mdev, dc_mouse_callback, 0, - MAPLE_FUNC_MOUSE); + maple_getcond_callback(mse->mdev, NULL, 0, MAPLE_FUNC_MOUSE); } /* allow the mouse to be used */ @@ -122,7 +121,6 @@ static int remove_maple_mouse(struct device *dev) struct maple_device *mdev = to_maple_dev(dev); struct dc_mouse *mse = maple_get_drvdata(mdev); - mdev->callback = NULL; input_unregister_device(mse->dev); maple_set_drvdata(mdev, NULL); kfree(mse); From 988e3ddd595644a2ee0953d64d9a8c6d65f54b00 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:30 -0700 Subject: [PATCH 74/94] Input: maple_keyb - implement open and close methods Instead of polling the keyboard constantly from probe, implement open and close methods for the input device to only start polling when the device is actually opened by userspace, and stop polling when it is closed. This matches the behavior of maplemouse and maplecontrol drivers. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-7-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/maple_keyb.c | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index 3d5538dd4f23..7039fdf42915 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -140,6 +140,24 @@ static void dc_kbd_callback(struct mapleq *mq) } } +static int dc_kbd_open(struct input_dev *dev) +{ + struct maple_device *mdev = input_get_drvdata(dev); + + /* Maple polling is locked to VBLANK - which may be just 50/s */ + maple_getcond_callback(mdev, dc_kbd_callback, HZ / 50, + MAPLE_FUNC_KEYBOARD); + + return 0; +} + +static void dc_kbd_close(struct input_dev *dev) +{ + struct maple_device *mdev = input_get_drvdata(dev); + + maple_getcond_callback(mdev, NULL, 0, MAPLE_FUNC_KEYBOARD); +} + static int probe_maple_kbd(struct device *dev) { struct maple_device *mdev; @@ -167,6 +185,7 @@ static int probe_maple_kbd(struct device *dev) memcpy(kbd->keycode, dc_kbd_keycode, sizeof(kbd->keycode)); maple_set_drvdata(mdev, kbd); + input_set_drvdata(idev, mdev); idev->name = mdev->product_name; idev->evbit[0] = BIT(EV_KEY) | BIT(EV_REP); @@ -175,6 +194,8 @@ static int probe_maple_kbd(struct device *dev) idev->keycodemax = ARRAY_SIZE(kbd->keycode); idev->id.bustype = BUS_HOST; idev->dev.parent = &mdev->dev; + idev->open = dc_kbd_open; + idev->close = dc_kbd_close; for (i = 0; i < NR_SCANCODES; i++) __set_bit(dc_kbd_keycode[i], idev->keybit); @@ -186,10 +207,6 @@ static int probe_maple_kbd(struct device *dev) if (error) goto fail_register; - /* Maple polling is locked to VBLANK - which may be just 50/s */ - maple_getcond_callback(mdev, dc_kbd_callback, HZ/50, - MAPLE_FUNC_KEYBOARD); - mdev->driver = mdrv; return error; From c7e04ad2a204a3e6f38a2589e8675565ee530511 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:31 -0700 Subject: [PATCH 75/94] Input: maplemouse - remove redundant drvdata resetting The driver core automatically resets driver data to NULL on probe failures and device removal, so we can remove it from the driver. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-8-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/maplemouse.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c index 97d520e7d66d..37f60bbd0ba4 100644 --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c @@ -109,7 +109,6 @@ static int probe_maple_mouse(struct device *dev) fail_register: input_free_device(input_dev); - maple_set_drvdata(mdev, NULL); fail_nomem: kfree(mse); fail: @@ -122,7 +121,6 @@ static int remove_maple_mouse(struct device *dev) struct dc_mouse *mse = maple_get_drvdata(mdev); input_unregister_device(mse->dev); - maple_set_drvdata(mdev, NULL); kfree(mse); return 0; From e3e377eac49e122570e33407bcd89c957cc7eb38 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:32 -0700 Subject: [PATCH 76/94] Input: maple_keyb - remove redundant drvdata resetting The driver core automatically resets driver data to NULL on probe failures and device removal, so we can remove it from the driver. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-9-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/maple_keyb.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index 7039fdf42915..7bd3f6871292 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -212,7 +212,6 @@ static int probe_maple_kbd(struct device *dev) return error; fail_register: - maple_set_drvdata(mdev, NULL); input_free_device(idev); fail_idev_alloc: kfree(kbd); @@ -230,7 +229,6 @@ static int remove_maple_kbd(struct device *dev) input_unregister_device(kbd->dev); kfree(kbd); - maple_set_drvdata(mdev, NULL); return 0; } From d4db324ecdc6b5372c4dc34bd0b8a5ac8d5cb38c Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:33 -0700 Subject: [PATCH 77/94] Input: maplecontrol - remove redundant drvdata resetting The driver core automatically resets driver data to NULL on probe failures and device removal, so we can remove it from the driver. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-10-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/maplecontrol.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index 19ae238e6c00..cc17a952833a 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -148,7 +148,6 @@ static int probe_maple_controller(struct device *dev) fail: input_free_device(idev); kfree(pad); - maple_set_drvdata(mdev, NULL); return error; } @@ -158,7 +157,6 @@ static int remove_maple_controller(struct device *dev) struct dc_pad *pad = maple_get_drvdata(mdev); input_unregister_device(pad->dev); - maple_set_drvdata(mdev, NULL); kfree(pad); return 0; From f18dd62d837daa464af426ea9e488fb60cf88af7 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:34 -0700 Subject: [PATCH 78/94] Input: maplemouse - remove unused mdev->driver assignment The driver field in struct maple_device is no longer used since commit 1795cf48b322 ("sh/maple: clean maple bus code") which removed the reading of this field. Remove the unused assignment to mdev->driver and the now unused mdrv variable in probe_maple_mouse. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-11-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/maplemouse.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/input/mouse/maplemouse.c b/drivers/input/mouse/maplemouse.c index 37f60bbd0ba4..f67e3eb5841b 100644 --- a/drivers/input/mouse/maplemouse.c +++ b/drivers/input/mouse/maplemouse.c @@ -67,7 +67,6 @@ static void dc_mouse_close(struct input_dev *dev) static int probe_maple_mouse(struct device *dev) { struct maple_device *mdev = to_maple_dev(dev); - struct maple_driver *mdrv = to_maple_driver(dev->driver); int error; struct input_dev *input_dev; struct dc_mouse *mse; @@ -102,9 +101,6 @@ static int probe_maple_mouse(struct device *dev) error = input_register_device(input_dev); if (error) goto fail_register; - - mdev->driver = mdrv; - return error; fail_register: From 37a1c20052235e505a0fd27ce687d366e98d3b08 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:35 -0700 Subject: [PATCH 79/94] Input: maplecontrol - remove unused mdev->driver assignment The driver field in struct maple_device is no longer used since commit 1795cf48b322 ("sh/maple: clean maple bus code") which removed the reading of this field. Remove the unused assignment to mdev->driver and the now unused mdrv variable in probe_maple_controller. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-12-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/maplecontrol.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/drivers/input/joystick/maplecontrol.c b/drivers/input/joystick/maplecontrol.c index cc17a952833a..eb28ff8d7222 100644 --- a/drivers/input/joystick/maplecontrol.c +++ b/drivers/input/joystick/maplecontrol.c @@ -97,7 +97,6 @@ static int probe_maple_controller(struct device *dev) }; struct maple_device *mdev = to_maple_dev(dev); - struct maple_driver *mdrv = to_maple_driver(dev->driver); int i, error; struct dc_pad *pad; struct input_dev *idev; @@ -140,9 +139,6 @@ static int probe_maple_controller(struct device *dev) error = input_register_device(idev); if (error) goto fail; - - mdev->driver = mdrv; - return 0; fail: From ac2d32a19f9e457e2baa5166bec3da825abc5083 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 3 Jul 2026 22:57:36 -0700 Subject: [PATCH 80/94] Input: maple_keyb - remove unused mdev->driver assignment The driver field in struct maple_device is no longer used since commit 1795cf48b322 ("sh/maple: clean maple bus code") which removed the reading of this field. Remove the unused assignment to mdev->driver and the now unused mdrv variable in probe_maple_kbd. Assisted-by: Antigravity:gemini-3.5-flash Link: https://patch.msgid.link/20260703-b4-maple-cleanup-v1-13-41e424964da5@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/maple_keyb.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/drivers/input/keyboard/maple_keyb.c b/drivers/input/keyboard/maple_keyb.c index 7bd3f6871292..219bc0cc490e 100644 --- a/drivers/input/keyboard/maple_keyb.c +++ b/drivers/input/keyboard/maple_keyb.c @@ -161,13 +161,11 @@ static void dc_kbd_close(struct input_dev *dev) static int probe_maple_kbd(struct device *dev) { struct maple_device *mdev; - struct maple_driver *mdrv; int i, error; struct dc_kbd *kbd; struct input_dev *idev; mdev = to_maple_dev(dev); - mdrv = to_maple_driver(dev->driver); kbd = kzalloc_obj(*kbd); if (!kbd) { @@ -206,9 +204,6 @@ static int probe_maple_kbd(struct device *dev) error = input_register_device(idev); if (error) goto fail_register; - - mdev->driver = mdrv; - return error; fail_register: From 6d1f1ec9174c27b0dc9d5b4ea0cc05c9033ac7ef Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 8 Oct 2026 02:47:31 -0700 Subject: [PATCH 81/94] Input: da7280 - fix input device parent assignment Assigning the I2C bus controller (client->dev.parent) instead of the I2C client (&client->dev) as the parent device after devm_input_allocate_device() causes input_register_device() to attach the devm unregistration action to the parent controller device rather than the client device. This leaves the input device registered on driver unbind, leading to use-after-free. devm_input_allocate_device() already sets input_dev->dev.parent to &client->dev. Drop the redundant and erroneous assignment. Fixes: cd3f609823a5 ("Input: new da7280 haptic driver") Assisted-by: LLM Link: https://patch.msgid.link/20261008094736.918137-1-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/misc/da7280.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/da7280.c b/drivers/input/misc/da7280.c index 77fcf868dca2..e607836efb50 100644 --- a/drivers/input/misc/da7280.c +++ b/drivers/input/misc/da7280.c @@ -1218,7 +1218,6 @@ static int da7280_probe(struct i2c_client *client) } input_dev->name = "da7280-haptic"; - input_dev->dev.parent = client->dev.parent; input_dev->open = da7280_haptic_open; input_dev->close = da7280_haptic_close; input_set_drvdata(input_dev, haptics); From 7e55dbd5404194ef1ab961ec56e7a7f182c03bd2 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 8 Oct 2026 02:47:32 -0700 Subject: [PATCH 82/94] Input: drv2665 - fix input device parent assignment Assigning the I2C bus controller (client->dev.parent) instead of the I2C client (&client->dev) as the parent device after devm_input_allocate_device() causes input_register_device() to attach the devm unregistration action to the parent controller device rather than the client device. This leaves the input device registered on driver unbind, leading to use-after-free. devm_input_allocate_device() already sets input_dev->dev.parent to &client->dev. Drop the redundant and erroneous assignment. Fixes: 4d10da13467e ("Input: add TI drv2665 haptics driver") Assisted-by: LLM Link: https://patch.msgid.link/20261008094736.918137-2-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/misc/drv2665.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/drv2665.c b/drivers/input/misc/drv2665.c index 4f8c1f69aa63..134d65fdcf2d 100644 --- a/drivers/input/misc/drv2665.c +++ b/drivers/input/misc/drv2665.c @@ -180,7 +180,6 @@ static int drv2665_probe(struct i2c_client *client) } haptics->input_dev->name = "drv2665:haptics"; - haptics->input_dev->dev.parent = client->dev.parent; haptics->input_dev->close = drv2665_close; input_set_drvdata(haptics->input_dev, haptics); input_set_capability(haptics->input_dev, EV_FF, FF_RUMBLE); From fc535ce753aa941af0f658277aa3e026e6db361a Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 8 Oct 2026 02:47:33 -0700 Subject: [PATCH 83/94] Input: drv2667 - fix input device parent assignment Assigning the I2C bus controller (client->dev.parent) instead of the I2C client (&client->dev) as the parent device after devm_input_allocate_device() causes input_register_device() to attach the devm unregistration action to the parent controller device rather than the client device. This leaves the input device registered on driver unbind, leading to use-after-free. devm_input_allocate_device() already sets input_dev->dev.parent to &client->dev. Drop the redundant and erroneous assignment. Fixes: 1c24622572d6 ("Input: add support for the DRV2667 haptic driver") Assisted-by: LLM Link: https://patch.msgid.link/20261008094736.918137-3-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/misc/drv2667.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/misc/drv2667.c b/drivers/input/misc/drv2667.c index 97309984fa7c..bbda7b4cbdcb 100644 --- a/drivers/input/misc/drv2667.c +++ b/drivers/input/misc/drv2667.c @@ -357,7 +357,6 @@ static int drv2667_probe(struct i2c_client *client) } haptics->input_dev->name = "drv2667:haptics"; - haptics->input_dev->dev.parent = client->dev.parent; haptics->input_dev->close = drv2667_close; input_set_drvdata(haptics->input_dev, haptics); input_set_capability(haptics->input_dev, EV_FF, FF_RUMBLE); From 2b4bcdd40ca00695ed21980f3bc7860823d1423e Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 8 Oct 2026 02:47:34 -0700 Subject: [PATCH 84/94] Input: tps6507x-ts - fix input device parent assignment Assigning the MFD parent device (tsc->dev) instead of the platform device (&pdev->dev) as the parent device after devm_input_allocate_device(&pdev->dev) splits devres management across two devices. As a result, input_register_device() attaches the devm unregistration action to the MFD parent device rather than the platform device, leaving the input device registered when the platform driver unbinds. devm_input_allocate_device(&pdev->dev) already sets input_dev->dev.parent to &pdev->dev. Drop the redundant and erroneous assignment. Fixes: 2e2a0db8c88d ("Input: tps6507x-ts - update to devm_* API") Assisted-by: LLM Link: https://patch.msgid.link/20261008094736.918137-4-dmitry.torokhov@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/tps6507x-ts.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/input/touchscreen/tps6507x-ts.c b/drivers/input/touchscreen/tps6507x-ts.c index f48871767763..e84dc3ea1fcb 100644 --- a/drivers/input/touchscreen/tps6507x-ts.c +++ b/drivers/input/touchscreen/tps6507x-ts.c @@ -251,7 +251,6 @@ static int tps6507x_ts_probe(struct platform_device *pdev) input_dev->name = "TPS6507x Touchscreen"; input_dev->phys = tsc->phys; - input_dev->dev.parent = tsc->dev; input_dev->id.bustype = BUS_I2C; if (init_data) { input_dev->id.vendor = init_data->vendor; From 7f0b4c25fdab38f1c2dd11f8ec17db3f48891192 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Fri, 9 Oct 2026 20:54:28 -0700 Subject: [PATCH 85/94] Input: reject parent overrides on managed input devices When an input device is allocated with devm_input_allocate_device(), the owner struct device is set as dev->dev.parent and holds the devm_input_device_release resource. Later, input_register_device() attaches the devm_input_device_unregister resource to dev->dev.parent. Clearing or overriding dev->dev.parent before registration splits devres ownership across different devices, which breaks managed lifetime assumptions. Verify via devres_find() that dev->dev.parent is non-NULL and still holds the matching devm_input_device_release entry before registering a managed input device, rejecting registration with -EINVAL otherwise. Also add KUnit test coverage in input_test.c verifying that reparented and NULL-parent managed input devices are rejected while preserving the owner parent succeeds. Assisted-by: LLM Link: https://patch.msgid.link/asmCc1VxVPLIMgY6@google.com Signed-off-by: Dmitry Torokhov --- drivers/input/input.c | 8 ++++++++ drivers/input/tests/input_test.c | 34 ++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/drivers/input/input.c b/drivers/input/input.c index 78c10eea7328..1cca6d48f597 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -2396,6 +2396,14 @@ int input_register_device(struct input_dev *dev) } if (dev->devres_managed) { + if (!dev->dev.parent || + !devres_find(dev->dev.parent, devm_input_device_release, + devm_input_device_match, dev)) { + dev_err(&dev->dev, + "Parent of managed input device was overridden, refusing to register\n"); + return -EINVAL; + } + devres = devres_alloc(devm_input_device_unregister, sizeof(*devres), GFP_KERNEL); if (!devres) diff --git a/drivers/input/tests/input_test.c b/drivers/input/tests/input_test.c index e105ce71a920..b8c8f04c041b 100644 --- a/drivers/input/tests/input_test.c +++ b/drivers/input/tests/input_test.c @@ -8,6 +8,7 @@ #include #include +#include #include #define POLL_INTERVAL 100 @@ -161,11 +162,44 @@ static void input_test_grab(struct kunit *test) input_put_device(input_dev); } +static void input_test_managed_parent_override(struct kunit *test) +{ + struct device *owner, *other_dev; + struct input_dev *input_dev; + + owner = kunit_device_register(test, "input-test-owner"); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, owner); + + other_dev = kunit_device_register(test, "input-test-other"); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, other_dev); + + /* Overriding dev.parent to another device must be rejected */ + input_dev = devm_input_allocate_device(owner); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, input_dev); + input_dev->name = "Managed input device (reparented)"; + input_dev->dev.parent = other_dev; + KUNIT_EXPECT_EQ(test, input_register_device(input_dev), -EINVAL); + + /* Clearing dev.parent to NULL must be rejected */ + input_dev = devm_input_allocate_device(owner); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, input_dev); + input_dev->name = "Managed input device (null parent)"; + input_dev->dev.parent = NULL; + KUNIT_EXPECT_EQ(test, input_register_device(input_dev), -EINVAL); + + /* Preserving original owner as dev.parent succeeds */ + input_dev = devm_input_allocate_device(owner); + KUNIT_ASSERT_NOT_ERR_OR_NULL(test, input_dev); + input_dev->name = "Managed input device (valid parent)"; + KUNIT_EXPECT_EQ(test, input_register_device(input_dev), 0); +} + static struct kunit_case input_tests[] = { KUNIT_CASE(input_test_polling), KUNIT_CASE(input_test_timestamp), KUNIT_CASE(input_test_match_device_id), KUNIT_CASE(input_test_grab), + KUNIT_CASE(input_test_managed_parent_override), { /* sentinel */ } }; From 2e3600723a99f131d704ca0f1acf36dcf7af9dac Mon Sep 17 00:00:00 2001 From: Pawel Zalewski Date: Tue, 13 Oct 2026 16:15:22 +0100 Subject: [PATCH 86/94] Input: keyboard - use named initializers for acpi_device_id Use a designated initializer for the acpi_device_id fields which makes the code more readable and consistent with how lists are initialized in the rest of the kernel code base. Also drop explicitly setting fields to 0 where it is redundant. Unify the list terminator to have a single space between the brackets and no trailing comma. Signed-off-by: Pawel Zalewski Link: https://patch.msgid.link/20261013-acpi-input-v1-1-53ad09ba82b7@thegoodpenguin.co.uk Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/applespi.c | 2 +- drivers/input/keyboard/cros_ec_keyb.c | 2 +- drivers/input/keyboard/goldfish_events.c | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/input/keyboard/applespi.c b/drivers/input/keyboard/applespi.c index da8fa3938a36..7d5ed45845bc 100644 --- a/drivers/input/keyboard/applespi.c +++ b/drivers/input/keyboard/applespi.c @@ -1902,7 +1902,7 @@ static int applespi_resume(struct device *dev) } static const struct acpi_device_id applespi_acpi_match[] = { - { "APP000D", 0 }, + { .id = "APP000D" }, { } }; MODULE_DEVICE_TABLE(acpi, applespi_acpi_match); diff --git a/drivers/input/keyboard/cros_ec_keyb.c b/drivers/input/keyboard/cros_ec_keyb.c index e1df5f466c9d..0a817680171c 100644 --- a/drivers/input/keyboard/cros_ec_keyb.c +++ b/drivers/input/keyboard/cros_ec_keyb.c @@ -909,7 +909,7 @@ static void cros_ec_keyb_remove(struct platform_device *pdev) #ifdef CONFIG_ACPI static const struct acpi_device_id cros_ec_keyb_acpi_match[] = { - { "GOOG0007", true }, + { .id = "GOOG0007", .driver_data = true }, { } }; MODULE_DEVICE_TABLE(acpi, cros_ec_keyb_acpi_match); diff --git a/drivers/input/keyboard/goldfish_events.c b/drivers/input/keyboard/goldfish_events.c index 57d435fc5c73..d0e387f22faf 100644 --- a/drivers/input/keyboard/goldfish_events.c +++ b/drivers/input/keyboard/goldfish_events.c @@ -179,8 +179,8 @@ MODULE_DEVICE_TABLE(of, goldfish_events_of_match); #ifdef CONFIG_ACPI static const struct acpi_device_id goldfish_events_acpi_match[] = { - { "GFSH0002", 0 }, - { }, + { .id = "GFSH0002" }, + { } }; MODULE_DEVICE_TABLE(acpi, goldfish_events_acpi_match); #endif From e7f8b63997e3dbbeb2f3f845a84ea6cc924f6c1e Mon Sep 17 00:00:00 2001 From: Pawel Zalewski Date: Tue, 13 Oct 2026 16:15:23 +0100 Subject: [PATCH 87/94] Input: misc - use named initializers for acpi_device_id Use a designated initializer for the acpi_device_id fields which makes the code more readable and consistent with how lists are initialized in the rest of the kernel code base. Also drop explicitly setting fields to 0 where it is redundant. Unify the list terminator to have a single space between the brackets and no trailing comma. Signed-off-by: Pawel Zalewski Link: https://patch.msgid.link/20261013-acpi-input-v1-2-53ad09ba82b7@thegoodpenguin.co.uk Signed-off-by: Dmitry Torokhov --- drivers/input/misc/atlas_btns.c | 4 ++-- drivers/input/misc/drv260x.c | 2 +- drivers/input/misc/soc_button_array.c | 12 ++++++------ 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/input/misc/atlas_btns.c b/drivers/input/misc/atlas_btns.c index 5805a1a3bb05..e77e53ee9d41 100644 --- a/drivers/input/misc/atlas_btns.c +++ b/drivers/input/misc/atlas_btns.c @@ -128,8 +128,8 @@ static void atlas_acpi_button_remove(struct platform_device *pdev) } static const struct acpi_device_id atlas_device_ids[] = { - { "ASIM0000" }, - { "" } + { .id = "ASIM0000" }, + { } }; MODULE_DEVICE_TABLE(acpi, atlas_device_ids); diff --git a/drivers/input/misc/drv260x.c b/drivers/input/misc/drv260x.c index 6c5c4c53753b..8a3d74d65d63 100644 --- a/drivers/input/misc/drv260x.c +++ b/drivers/input/misc/drv260x.c @@ -640,7 +640,7 @@ MODULE_DEVICE_TABLE(i2c, drv260x_id); #ifdef CONFIG_ACPI static const struct acpi_device_id drv260x_acpi_match[] = { - { "DRV2604" }, + { .id = "DRV2604" }, { } }; MODULE_DEVICE_TABLE(acpi, drv260x_acpi_match); diff --git a/drivers/input/misc/soc_button_array.c b/drivers/input/misc/soc_button_array.c index b8cad415c62c..2a4f7dd95e99 100644 --- a/drivers/input/misc/soc_button_array.c +++ b/drivers/input/misc/soc_button_array.c @@ -596,14 +596,14 @@ static const struct soc_device_data soc_device_MSHW0040 = { }; static const struct acpi_device_id soc_button_acpi_match[] = { - { "PNP0C40", (unsigned long)&soc_device_PNP0C40 }, - { "INT33D3", (unsigned long)&soc_device_INT33D3 }, - { "ID9001", (unsigned long)&soc_device_INT33D3 }, - { "ACPI0011", 0 }, + { .id = "PNP0C40", .driver_data = (unsigned long)&soc_device_PNP0C40 }, + { .id = "INT33D3", .driver_data = (unsigned long)&soc_device_INT33D3 }, + { .id = "ID9001", .driver_data = (unsigned long)&soc_device_INT33D3 }, + { .id = "ACPI0011" }, /* Microsoft Surface Devices (3th, 5th and 6th generation) */ - { "MSHW0028", (unsigned long)&soc_device_MSHW0028 }, - { "MSHW0040", (unsigned long)&soc_device_MSHW0040 }, + { .id = "MSHW0028", .driver_data = (unsigned long)&soc_device_MSHW0028 }, + { .id = "MSHW0040", .driver_data = (unsigned long)&soc_device_MSHW0040 }, { } }; From 4aaa4f16c9c8599632b1ee2fda1af50d659c4413 Mon Sep 17 00:00:00 2001 From: Pawel Zalewski Date: Tue, 13 Oct 2026 16:15:24 +0100 Subject: [PATCH 88/94] Input: mouse - cyapa: use named initializers for acpi_device_id Use a designated initializer for the acpi_device_id fields which makes the code more readable and consistent with how lists are initialized in the rest of the kernel code base. Also drop explicitly setting fields to 0 where it is redundant. Signed-off-by: Pawel Zalewski Link: https://patch.msgid.link/20261013-acpi-input-v1-3-53ad09ba82b7@thegoodpenguin.co.uk Signed-off-by: Dmitry Torokhov --- drivers/input/mouse/cyapa.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c index 5d99abea89aa..a8e9b9ab9f84 100644 --- a/drivers/input/mouse/cyapa.c +++ b/drivers/input/mouse/cyapa.c @@ -1462,9 +1462,9 @@ MODULE_DEVICE_TABLE(i2c, cyapa_id_table); #ifdef CONFIG_ACPI static const struct acpi_device_id cyapa_acpi_id[] = { - { "CYAP0000", 0 }, /* Gen3 trackpad with 0x67 I2C address. */ - { "CYAP0001", 0 }, /* Gen5 trackpad with 0x24 I2C address. */ - { "CYAP0002", 0 }, /* Gen6 trackpad with 0x24 I2C address. */ + { .id = "CYAP0000" }, /* Gen3 trackpad with 0x67 I2C address. */ + { .id = "CYAP0001" }, /* Gen5 trackpad with 0x24 I2C address. */ + { .id = "CYAP0002" }, /* Gen6 trackpad with 0x24 I2C address. */ { } }; MODULE_DEVICE_TABLE(acpi, cyapa_acpi_id); From 29ee387509a184c3bfff9e26831aacc7b2edc02a Mon Sep 17 00:00:00 2001 From: Pawel Zalewski Date: Tue, 13 Oct 2026 16:15:25 +0100 Subject: [PATCH 89/94] Input: touchscreen - use named initializers for acpi_device_id Use a designated initializer for the acpi_device_id fields which makes the code more readable and consistent with how lists are initialized in the rest of the kernel code base. Also drop explicitly setting fields to 0 where it is redundant. Unify the list terminator to have a single space between the brackets and no trailing comma. Signed-off-by: Pawel Zalewski Link: https://patch.msgid.link/20261013-acpi-input-v1-4-53ad09ba82b7@thegoodpenguin.co.uk Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/atmel_mxt_ts.c | 4 ++-- drivers/input/touchscreen/chipone_icn8505.c | 2 +- drivers/input/touchscreen/elants_i2c.c | 8 ++++---- drivers/input/touchscreen/exc3000.c | 2 +- drivers/input/touchscreen/goodix.c | 8 ++++---- drivers/input/touchscreen/hideep.c | 2 +- drivers/input/touchscreen/ilitek_ts_i2c.c | 4 ++-- drivers/input/touchscreen/melfas_mip4.c | 4 ++-- drivers/input/touchscreen/raydium_i2c_ts.c | 4 ++-- drivers/input/touchscreen/silead.c | 18 +++++++++--------- drivers/input/touchscreen/surface3_spi.c | 2 +- drivers/input/touchscreen/wdt87xx_i2c.c | 2 +- 12 files changed, 30 insertions(+), 30 deletions(-) diff --git a/drivers/input/touchscreen/atmel_mxt_ts.c b/drivers/input/touchscreen/atmel_mxt_ts.c index 2c0e5a67135b..522e1ea405a6 100644 --- a/drivers/input/touchscreen/atmel_mxt_ts.c +++ b/drivers/input/touchscreen/atmel_mxt_ts.c @@ -3409,8 +3409,8 @@ MODULE_DEVICE_TABLE(of, mxt_of_match); #ifdef CONFIG_ACPI static const struct acpi_device_id mxt_acpi_id[] = { - { "ATML0000", 0 }, /* Touchpad */ - { "ATML0001", 0 }, /* Touchscreen */ + { .id = "ATML0000" }, /* Touchpad */ + { .id = "ATML0001" }, /* Touchscreen */ { } }; MODULE_DEVICE_TABLE(acpi, mxt_acpi_id); diff --git a/drivers/input/touchscreen/chipone_icn8505.c b/drivers/input/touchscreen/chipone_icn8505.c index cde0e4789503..7d0a488166bb 100644 --- a/drivers/input/touchscreen/chipone_icn8505.c +++ b/drivers/input/touchscreen/chipone_icn8505.c @@ -486,7 +486,7 @@ static int icn8505_resume(struct device *dev) static DEFINE_SIMPLE_DEV_PM_OPS(icn8505_pm_ops, icn8505_suspend, icn8505_resume); static const struct acpi_device_id icn8505_acpi_match[] = { - { "CHPN0001" }, + { .id = "CHPN0001" }, { } }; MODULE_DEVICE_TABLE(acpi, icn8505_acpi_match); diff --git a/drivers/input/touchscreen/elants_i2c.c b/drivers/input/touchscreen/elants_i2c.c index 17175adcaebb..7a651899feb1 100644 --- a/drivers/input/touchscreen/elants_i2c.c +++ b/drivers/input/touchscreen/elants_i2c.c @@ -1360,9 +1360,9 @@ static void elants_i2c_power_off(void *_data) #ifdef CONFIG_ACPI static const struct acpi_device_id i2c_hid_ids[] = { - {"ACPI0C50", 0 }, - {"PNP0C50", 0 }, - { }, + { .id = "ACPI0C50" }, + { .id = "PNP0C50" }, + { } }; static const guid_t i2c_hid_guid = @@ -1624,7 +1624,7 @@ MODULE_DEVICE_TABLE(i2c, elants_i2c_id); #ifdef CONFIG_ACPI static const struct acpi_device_id elants_acpi_id[] = { - { "ELAN0001", EKTH3500 }, + { .id = "ELAN0001", .driver_data = EKTH3500 }, { } }; MODULE_DEVICE_TABLE(acpi, elants_acpi_id); diff --git a/drivers/input/touchscreen/exc3000.c b/drivers/input/touchscreen/exc3000.c index 037bb35238a3..d1f9b44d9d76 100644 --- a/drivers/input/touchscreen/exc3000.c +++ b/drivers/input/touchscreen/exc3000.c @@ -453,7 +453,7 @@ MODULE_DEVICE_TABLE(of, exc3000_of_match); #ifdef CONFIG_ACPI static const struct acpi_device_id exc3000_acpi_match[] = { - { "EGA00001", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] }, + { .id = "EGA00001", .driver_data = (kernel_ulong_t)&exc3000_info[EETI_EXC80H60] }, { } }; MODULE_DEVICE_TABLE(acpi, exc3000_acpi_match); diff --git a/drivers/input/touchscreen/goodix.c b/drivers/input/touchscreen/goodix.c index 03efc0c792c2..7609366f0b78 100644 --- a/drivers/input/touchscreen/goodix.c +++ b/drivers/input/touchscreen/goodix.c @@ -1531,10 +1531,10 @@ MODULE_DEVICE_TABLE(i2c, goodix_ts_id); #ifdef CONFIG_ACPI static const struct acpi_device_id goodix_acpi_match[] = { - { "GDIX1001", 0 }, - { "GDIX1002", 0 }, - { "GDIX1003", 0 }, - { "GDX9110", 0 }, + { .id = "GDIX1001" }, + { .id = "GDIX1002" }, + { .id = "GDIX1003" }, + { .id = "GDX9110" }, { } }; MODULE_DEVICE_TABLE(acpi, goodix_acpi_match); diff --git a/drivers/input/touchscreen/hideep.c b/drivers/input/touchscreen/hideep.c index 58e00c314ace..68ee61c71df6 100644 --- a/drivers/input/touchscreen/hideep.c +++ b/drivers/input/touchscreen/hideep.c @@ -1088,7 +1088,7 @@ MODULE_DEVICE_TABLE(i2c, hideep_i2c_id); #ifdef CONFIG_ACPI static const struct acpi_device_id hideep_acpi_id[] = { - { "HIDP0001", 0 }, + { .id = "HIDP0001" }, { } }; MODULE_DEVICE_TABLE(acpi, hideep_acpi_id); diff --git a/drivers/input/touchscreen/ilitek_ts_i2c.c b/drivers/input/touchscreen/ilitek_ts_i2c.c index 3de0fbf8da38..cdd02b7b6f67 100644 --- a/drivers/input/touchscreen/ilitek_ts_i2c.c +++ b/drivers/input/touchscreen/ilitek_ts_i2c.c @@ -646,8 +646,8 @@ MODULE_DEVICE_TABLE(i2c, ilitek_ts_i2c_id); #ifdef CONFIG_ACPI static const struct acpi_device_id ilitekts_acpi_id[] = { - { "ILTK0001", 0 }, - { }, + { .id = "ILTK0001" }, + { } }; MODULE_DEVICE_TABLE(acpi, ilitekts_acpi_id); #endif diff --git a/drivers/input/touchscreen/melfas_mip4.c b/drivers/input/touchscreen/melfas_mip4.c index fd6c0ac301a2..0c8a922e2f2e 100644 --- a/drivers/input/touchscreen/melfas_mip4.c +++ b/drivers/input/touchscreen/melfas_mip4.c @@ -1529,8 +1529,8 @@ MODULE_DEVICE_TABLE(of, mip4_of_match); #ifdef CONFIG_ACPI static const struct acpi_device_id mip4_acpi_match[] = { - { "MLFS0000", 0}, - { }, + { .id = "MLFS0000" }, + { } }; MODULE_DEVICE_TABLE(acpi, mip4_acpi_match); #endif diff --git a/drivers/input/touchscreen/raydium_i2c_ts.c b/drivers/input/touchscreen/raydium_i2c_ts.c index 0256055abcef..d046eba4b12d 100644 --- a/drivers/input/touchscreen/raydium_i2c_ts.c +++ b/drivers/input/touchscreen/raydium_i2c_ts.c @@ -1227,8 +1227,8 @@ MODULE_DEVICE_TABLE(i2c, raydium_i2c_id); #ifdef CONFIG_ACPI static const struct acpi_device_id raydium_acpi_id[] = { - { "RAYD0001", 0 }, - { /* sentinel */ } + { .id = "RAYD0001" }, + { } }; MODULE_DEVICE_TABLE(acpi, raydium_acpi_id); #endif diff --git a/drivers/input/touchscreen/silead.c b/drivers/input/touchscreen/silead.c index 44d7141103f4..6014c4e049a6 100644 --- a/drivers/input/touchscreen/silead.c +++ b/drivers/input/touchscreen/silead.c @@ -788,15 +788,15 @@ MODULE_DEVICE_TABLE(i2c, silead_ts_id); #ifdef CONFIG_ACPI static const struct acpi_device_id silead_ts_acpi_match[] = { - { "GSL1680", 0 }, - { "GSL1688", 0 }, - { "GSL3670", 0 }, - { "GSL3675", 0 }, - { "GSL3692", 0 }, - { "MSSL1680", 0 }, - { "MSSL0001", 0 }, - { "MSSL0002", 0 }, - { "MSSL0017", 0 }, + { .id = "GSL1680" }, + { .id = "GSL1688" }, + { .id = "GSL3670" }, + { .id = "GSL3675" }, + { .id = "GSL3692" }, + { .id = "MSSL1680" }, + { .id = "MSSL0001" }, + { .id = "MSSL0002" }, + { .id = "MSSL0017" }, { } }; MODULE_DEVICE_TABLE(acpi, silead_ts_acpi_match); diff --git a/drivers/input/touchscreen/surface3_spi.c b/drivers/input/touchscreen/surface3_spi.c index 6074b7730e86..9d74efc8d986 100644 --- a/drivers/input/touchscreen/surface3_spi.c +++ b/drivers/input/touchscreen/surface3_spi.c @@ -392,7 +392,7 @@ static DEFINE_SIMPLE_DEV_PM_OPS(surface3_spi_pm_ops, #ifdef CONFIG_ACPI static const struct acpi_device_id surface3_spi_acpi_match[] = { - { "MSHW0037", 0 }, + { .id = "MSHW0037" }, { } }; MODULE_DEVICE_TABLE(acpi, surface3_spi_acpi_match); diff --git a/drivers/input/touchscreen/wdt87xx_i2c.c b/drivers/input/touchscreen/wdt87xx_i2c.c index 1af309252092..858c7efd0c29 100644 --- a/drivers/input/touchscreen/wdt87xx_i2c.c +++ b/drivers/input/touchscreen/wdt87xx_i2c.c @@ -1147,7 +1147,7 @@ MODULE_DEVICE_TABLE(i2c, wdt87xx_dev_id); #ifdef CONFIG_ACPI static const struct acpi_device_id wdt87xx_acpi_id[] = { - { "WDHT0001", 0 }, + { .id = "WDHT0001" }, { } }; MODULE_DEVICE_TABLE(acpi, wdt87xx_acpi_id); From 2e6f2e5799f328ca0879dad14d7f3709c7f7496b Mon Sep 17 00:00:00 2001 From: Francesco Orlando Date: Sun, 11 Oct 2026 18:58:21 +0200 Subject: [PATCH 90/94] Input: xpad - add GameSir Nova Lite support Add vendor and product ID for GameSir Nova Lite (0x3537:0x1040) in XInput mode to enable force feedback rumble support. Signed-off-by: Francesco Orlando Link: https://patch.msgid.link/20261011165821.72698-1-francesco.orlando99@libero.it Cc: stable@vger.kernel.org Signed-off-by: Dmitry Torokhov --- drivers/input/joystick/xpad.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/input/joystick/xpad.c b/drivers/input/joystick/xpad.c index 810e52782ae8..d2eb48d98fea 100644 --- a/drivers/input/joystick/xpad.c +++ b/drivers/input/joystick/xpad.c @@ -408,6 +408,7 @@ static const struct xpad_device { { 0x3537, 0x1004, "GameSir T4 Kaleid", 0, XTYPE_XBOX360 }, { 0x3537, 0x100f, "GameSir Nova 2 Lite", 0, XTYPE_XBOX360 }, { 0x3537, 0x1010, "GameSir G7 SE", 0, XTYPE_XBOXONE }, + { 0x3537, 0x1040, "GameSir Nova Lite", 0, XTYPE_XBOX360 }, { 0x3651, 0x1000, "CRKD SG", 0, XTYPE_XBOX360 }, { 0x366c, 0x0005, "ByoWave Proteus Controller", MAP_SHARE_BUTTON, XTYPE_XBOXONE, FLAG_DELAY_INIT }, { 0x3767, 0x0101, "Fanatec Speedster 3 Forceshock Wheel", 0, XTYPE_XBOX }, From 6c9063f78856d2c8ab0d395b931c635e8e71ccc5 Mon Sep 17 00:00:00 2001 From: Frank Li Date: Mon, 12 Oct 2026 17:00:53 -0400 Subject: [PATCH 91/94] dt-bindings: input: dlg,da9062-onkey: Allow wakeup-source property Allow wakeup-source property to fix below CHECK_DTBS warnings: arch/arm/boot/dts/nxp/imx/imx6dl-emcon-avari.dtb: onkey (dlg,da9063-onkey): 'wakeup-source' does not match any of the regexes: 'pinctrl-[0-9]+' Acked-by: Rob Herring (Arm) Signed-off-by: Frank Li Link: https://patch.msgid.link/20261012210054.2848389-1-Frank.Li@oss.nxp.com Signed-off-by: Dmitry Torokhov --- Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml b/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml index 1480d95421e1..29ff8fc0d02e 100644 --- a/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml +++ b/Documentation/devicetree/bindings/input/dlg,da9062-onkey.yaml @@ -32,6 +32,8 @@ properties: the OnKey driver will remove support for the KEY_POWER key press when triggered using a long press of the OnKey. + wakeup-source: true + required: - compatible From c1d13bfdb9c75c2885d10332174a887349eb0b51 Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Sun, 11 Oct 2026 23:12:40 -0700 Subject: [PATCH 92/94] Input: always accept EV_SYN in input_event() Commit 0cd587735205 ("Input: preallocate memory to hold event values") moved allocation of dev->vals into input_allocate_device(), which caused input core to accumulate events reported while seeding initial device state before input_register_device(). However, because EV_SYN is only set in dev->evbit during input_register_device() (and some drivers also overwrite dev->evbit directly before registration), any EV_SYN/SYN_REPORT events sent before registration were dropped by is_event_supported(), leaving those seeded events stuck in dev->vals until the next SYN_REPORT after registration. Always accept EV_SYN in input_event() and input_inject_event() without checking dev->evbit so input_sync() flushes dev->vals as intended. Reported-by: Karlos Abel , Fixes: 0cd587735205 ("Input: preallocate memory to hold event values") Cc: stable@vger.kernel.org Assisted-by: LLM Acked-by: Jiri Kosina Link: https://patch.msgid.link/asx50uz6iafsyAd5@google.com Signed-off-by: Dmitry Torokhov --- drivers/input/input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/input/input.c b/drivers/input/input.c index 1cca6d48f597..3e6af517c596 100644 --- a/drivers/input/input.c +++ b/drivers/input/input.c @@ -391,7 +391,7 @@ void input_handle_event(struct input_dev *dev, void input_event(struct input_dev *dev, unsigned int type, unsigned int code, int value) { - if (is_event_supported(type, dev->evbit, EV_MAX)) { + if (type == EV_SYN || is_event_supported(type, dev->evbit, EV_MAX)) { guard(spinlock_irqsave)(&dev->event_lock); input_handle_event(dev, type, code, value); } @@ -415,7 +415,7 @@ void input_inject_event(struct input_handle *handle, struct input_dev *dev = handle->dev; struct input_handle *grab; - if (is_event_supported(type, dev->evbit, EV_MAX)) { + if (type == EV_SYN || is_event_supported(type, dev->evbit, EV_MAX)) { guard(spinlock_irqsave)(&dev->event_lock); guard(rcu)(); From a1ba4d41db3b028a7885d26bcff4eeb28e6b025f Mon Sep 17 00:00:00 2001 From: Dmitry Torokhov Date: Thu, 8 Oct 2026 02:33:14 -0700 Subject: [PATCH 93/94] Input: s6sy761 - drop duplicate axis initialization in s6sy761_probe() ABS_MT_TOUCH_MAJOR and ABS_MT_TOUCH_MINOR are initialized twice with identical parameters in s6sy761_probe(). Remove the duplicate calls. Reported-by: sashiko-bot@kernel.org Assisted-by: LLM Reviewed-by: David Heidelberg Link: https://patch.msgid.link/asdjLHHNrrtjIKCb@google.com Signed-off-by: Dmitry Torokhov --- drivers/input/touchscreen/s6sy761.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/drivers/input/touchscreen/s6sy761.c b/drivers/input/touchscreen/s6sy761.c index 0f24a9b73063..1adf78abde9e 100644 --- a/drivers/input/touchscreen/s6sy761.c +++ b/drivers/input/touchscreen/s6sy761.c @@ -433,8 +433,6 @@ static int s6sy761_probe(struct i2c_client *client) input_set_abs_params(sdata->input, ABS_MT_POSITION_Y, 0, max_y, 0, 0); input_set_abs_params(sdata->input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); input_set_abs_params(sdata->input, ABS_MT_TOUCH_MINOR, 0, 255, 0, 0); - input_set_abs_params(sdata->input, ABS_MT_TOUCH_MAJOR, 0, 255, 0, 0); - input_set_abs_params(sdata->input, ABS_MT_TOUCH_MINOR, 0, 255, 0, 0); input_set_abs_params(sdata->input, ABS_MT_PRESSURE, 0, 255, 0, 0); touchscreen_parse_properties(sdata->input, true, &sdata->prop); From 1527451f87dfe368b8ddeeb501c24ac9bde6b589 Mon Sep 17 00:00:00 2001 From: Alexander Kochetkov Date: Fri, 2 Oct 2026 13:09:35 +0300 Subject: [PATCH 94/94] Revert "Input: matrix_keypad - force switch rows to input mode" This reverts commit 01c84b03d80aab9f04c4e3e1f9085f4202ff7c29. The commit makes every scan call gpiod_direction_input() on the row GPIOs. On pin controllers where GPIO input and interrupt are separate pinmux functions this switches the row pins out of interrupt mode, and enable_row_irqs() does not switch them back: it only unmasks the interrupts. Row interrupts then never arrive and the keypad stops working. Seen with a matrix keypad on an Allwinner A64 board (PINE A64-LTS); it works again with the commit reverted. The workaround is not needed on Ingenic either: the author of the reverted commit re-tested all available JZ47xx SoCs and they all report the live pin state in interrupt mode, see the thread in Link. Fixes: 01c84b03d80a ("Input: matrix_keypad - force switch rows to input mode") Link: https://lore.kernel.org/all/4130C026-2A83-408B-836A-ECA044491C47@gmail.com/ Cc: stable@vger.kernel.org Signed-off-by: Alexander Kochetkov Acked-by: Siarhei Volkau Acked-by: Paul Cercueil Link: https://patch.msgid.link/20261002100935.449473-1-al.kochet@gmail.com Signed-off-by: Dmitry Torokhov --- drivers/input/keyboard/matrix_keypad.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/drivers/input/keyboard/matrix_keypad.c b/drivers/input/keyboard/matrix_keypad.c index 14a13abf3272..d14d1d727487 100644 --- a/drivers/input/keyboard/matrix_keypad.c +++ b/drivers/input/keyboard/matrix_keypad.c @@ -134,9 +134,6 @@ static void matrix_keypad_scan(struct work_struct *work) memset(new_state, 0, sizeof(new_state)); - for (row = 0; row < keypad->num_row_gpios; row++) - gpiod_direction_input(keypad->row_gpios[row]); - /* assert each column and read the row status out */ for (col = 0; col < keypad->num_col_gpios; col++) {