* [PATCH v2 1/2] dt-bindings: touchscreen: trivial-touch: Drop 'interrupts' requirement for old Ilitek @ 2026-01-15 2:34 Marek Vasut 2026-01-15 2:34 ` [PATCH v2 2/2] Input: ili210x - add support for polling mode Marek Vasut 2026-01-15 15:25 ` [PATCH v2 1/2] dt-bindings: touchscreen: trivial-touch: Drop 'interrupts' requirement for old Ilitek Frank Li 0 siblings, 2 replies; 5+ messages in thread From: Marek Vasut @ 2026-01-15 2:34 UTC (permalink / raw) To: linux-input Cc: Marek Vasut, Conor Dooley, Dmitry Torokhov, Frank Li, Job Noorman, Krzysztof Kozlowski, Rob Herring, devicetree, linux-kernel, linux-renesas-soc The old Ilitek touch controllers V3 and V6 can operate without interrupt line, in polling mode. Drop the 'interrupts' property requirement for those four controllers. To avoid overloading the trivial-touch, fork the old Ilitek V3/V6 touch controller binding into separate document. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> --- Cc: Conor Dooley <conor+dt@kernel.org> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Frank Li <Frank.Li@nxp.com> Cc: Job Noorman <job@noorman.info> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> Cc: Rob Herring <robh@kernel.org> Cc: devicetree@vger.kernel.org Cc: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org --- V2: Fork the Ilitek V3/V6 bindings into separate document --- .../input/touchscreen/ilitek,ili210x.yaml | 51 +++++++++++++++++++ .../input/touchscreen/trivial-touch.yaml | 4 -- 2 files changed, 51 insertions(+), 4 deletions(-) create mode 100644 Documentation/devicetree/bindings/input/touchscreen/ilitek,ili210x.yaml diff --git a/Documentation/devicetree/bindings/input/touchscreen/ilitek,ili210x.yaml b/Documentation/devicetree/bindings/input/touchscreen/ilitek,ili210x.yaml new file mode 100644 index 0000000000000..1d02aaba64f97 --- /dev/null +++ b/Documentation/devicetree/bindings/input/touchscreen/ilitek,ili210x.yaml @@ -0,0 +1,51 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/input/touchscreen/ilitek,ili210x.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Ilitek ILI21xx/ILI251x V3/V6 touch screen controller with i2c interface + +maintainers: + - Frank Li <Frank.Li@nxp.com> + - Marek Vasut <marek.vasut+renesas@mailbox.org> + +properties: + compatible: + enum: + - ilitek,ili210x + - ilitek,ili2117 + - ilitek,ili2120 + - ilitek,ili251x + + reg: + maxItems: 1 + + interrupts: + maxItems: 1 + + reset-gpios: + maxItems: 1 + + wakeup-source: true + +allOf: + - $ref: touchscreen.yaml + +required: + - compatible + - reg + +unevaluatedProperties: false + +examples: + - | + i2c { + #address-cells = <1>; + #size-cells = <0>; + + touchscreen@41 { + compatible = "ilitek,ili2120"; + reg = <0x41>; + }; + }; diff --git a/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml b/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml index fa27c6754ca4e..6441d21223caf 100644 --- a/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml +++ b/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml @@ -23,9 +23,6 @@ properties: # Hynitron cstxxx series touchscreen controller - hynitron,cst340 # Ilitek I2C Touchscreen Controller - - ilitek,ili210x - - ilitek,ili2117 - - ilitek,ili2120 - ilitek,ili2130 - ilitek,ili2131 - ilitek,ili2132 @@ -33,7 +30,6 @@ properties: - ilitek,ili2322 - ilitek,ili2323 - ilitek,ili2326 - - ilitek,ili251x - ilitek,ili2520 - ilitek,ili2521 # MAXI MAX11801 Resistive touch screen controller with i2c interface -- 2.51.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v2 2/2] Input: ili210x - add support for polling mode 2026-01-15 2:34 [PATCH v2 1/2] dt-bindings: touchscreen: trivial-touch: Drop 'interrupts' requirement for old Ilitek Marek Vasut @ 2026-01-15 2:34 ` Marek Vasut 2026-01-15 15:29 ` Frank Li 2026-01-15 15:25 ` [PATCH v2 1/2] dt-bindings: touchscreen: trivial-touch: Drop 'interrupts' requirement for old Ilitek Frank Li 1 sibling, 1 reply; 5+ messages in thread From: Marek Vasut @ 2026-01-15 2:34 UTC (permalink / raw) To: linux-input Cc: Marek Vasut, Conor Dooley, Dmitry Torokhov, Frank Li, Job Noorman, Krzysztof Kozlowski, Rob Herring, devicetree, linux-kernel, linux-renesas-soc There are designs incorporating Ilitek ILI2xxx touch controller that do not connect interrupt pin, for example Waveshare 13.3" DSI display. To support such systems use polling mode for the input device when I2C client does not have interrupt assigned to it. Factor out ili210x_firmware_update_noirq() to allow conditional scoped guard around this code. The scoped guard has to be applied only in case the IRQ line is connected, and not applied otherwise. Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> --- Cc: Conor Dooley <conor+dt@kernel.org> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> Cc: Frank Li <Frank.Li@nxp.com> Cc: Job Noorman <job@noorman.info> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> Cc: Rob Herring <robh@kernel.org> Cc: devicetree@vger.kernel.org Cc: linux-input@vger.kernel.org Cc: linux-kernel@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org --- V2: Test client->irq > 0 for IRQ presence --- drivers/input/touchscreen/ili210x.c | 84 ++++++++++++++++++++--------- 1 file changed, 60 insertions(+), 24 deletions(-) diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c index fa38d70aded7b..0574f2e86580f 100644 --- a/drivers/input/touchscreen/ili210x.c +++ b/drivers/input/touchscreen/ili210x.c @@ -327,9 +327,8 @@ static bool ili210x_report_events(struct ili210x *priv, u8 *touchdata) return contact; } -static irqreturn_t ili210x_irq(int irq, void *irq_data) +static void ili210x_process_events(struct ili210x *priv) { - struct ili210x *priv = irq_data; struct i2c_client *client = priv->client; const struct ili2xxx_chip *chip = priv->chip; u8 touchdata[ILI210X_DATA_SIZE] = { 0 }; @@ -356,8 +355,22 @@ static irqreturn_t ili210x_irq(int irq, void *irq_data) usleep_range(time_delta, time_delta + 1000); } } while (!priv->stop && keep_polling); +} + +static irqreturn_t ili210x_irq(int irq, void *irq_data) +{ + struct ili210x *priv = irq_data; + + ili210x_process_events(priv); return IRQ_HANDLED; +}; + +static void ili210x_work_i2c_poll(struct input_dev *input) +{ + struct ili210x *priv = input_get_drvdata(input); + + ili210x_process_events(priv); } static int ili251x_firmware_update_resolution(struct device *dev) @@ -829,12 +842,32 @@ static int ili210x_do_firmware_update(struct ili210x *priv, return 0; } +static ssize_t ili210x_firmware_update_noirq(struct device *dev, + const u8 *fwbuf, u16 ac_end, u16 df_end) +{ + struct i2c_client *client = to_i2c_client(dev); + struct ili210x *priv = i2c_get_clientdata(client); + const char *fwname = ILI251X_FW_FILENAME; + int error; + + dev_dbg(dev, "Firmware update started, firmware=%s\n", fwname); + + ili210x_hardware_reset(priv->reset_gpio); + + error = ili210x_do_firmware_update(priv, fwbuf, ac_end, df_end); + + ili210x_hardware_reset(priv->reset_gpio); + + dev_dbg(dev, "Firmware update ended, error=%i\n", error); + + return error; +} + static ssize_t ili210x_firmware_update_store(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { struct i2c_client *client = to_i2c_client(dev); - struct ili210x *priv = i2c_get_clientdata(client); const char *fwname = ILI251X_FW_FILENAME; u16 ac_end, df_end; int error; @@ -860,16 +893,12 @@ static ssize_t ili210x_firmware_update_store(struct device *dev, * the touch controller to disable the IRQs during update, so we have * to do it this way here. */ - scoped_guard(disable_irq, &client->irq) { - dev_dbg(dev, "Firmware update started, firmware=%s\n", fwname); - - ili210x_hardware_reset(priv->reset_gpio); - - error = ili210x_do_firmware_update(priv, fwbuf, ac_end, df_end); - - ili210x_hardware_reset(priv->reset_gpio); - - dev_dbg(dev, "Firmware update ended, error=%i\n", error); + if (!client->irq) { + scoped_guard(disable_irq, &client->irq) { + error = ili210x_firmware_update_noirq(dev, fwbuf, ac_end, df_end); + } + } else { + error = ili210x_firmware_update_noirq(dev, fwbuf, ac_end, df_end); } return error ?: count; @@ -947,11 +976,6 @@ static int ili210x_i2c_probe(struct i2c_client *client) return -ENODEV; } - if (client->irq <= 0) { - dev_err(dev, "No IRQ!\n"); - return -EINVAL; - } - reset_gpio = devm_gpiod_get_optional(dev, "reset", GPIOD_OUT_HIGH); if (IS_ERR(reset_gpio)) return PTR_ERR(reset_gpio); @@ -1003,12 +1027,24 @@ static int ili210x_i2c_probe(struct i2c_client *client) return error; } - error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq, - IRQF_ONESHOT, client->name, priv); - if (error) { - dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n", - error); - return error; + input_set_drvdata(input, priv); + + if (client->irq > 0) { + error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq, + IRQF_ONESHOT, client->name, priv); + if (error) { + dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n", + error); + return error; + } + } else { + error = input_setup_polling(input, ili210x_work_i2c_poll); + if (error) { + dev_err(dev, "Could not set up polling mode, err: %d\n", + error); + return error; + } + input_set_poll_interval(input, ILI2XXX_POLL_PERIOD); } error = devm_add_action_or_reset(dev, ili210x_stop, priv); -- 2.51.0 ^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] Input: ili210x - add support for polling mode 2026-01-15 2:34 ` [PATCH v2 2/2] Input: ili210x - add support for polling mode Marek Vasut @ 2026-01-15 15:29 ` Frank Li 2026-01-15 16:19 ` Marek Vasut 0 siblings, 1 reply; 5+ messages in thread From: Frank Li @ 2026-01-15 15:29 UTC (permalink / raw) To: Marek Vasut Cc: linux-input, Conor Dooley, Dmitry Torokhov, Job Noorman, Krzysztof Kozlowski, Rob Herring, devicetree, linux-kernel, linux-renesas-soc On Thu, Jan 15, 2026 at 03:34:59AM +0100, Marek Vasut wrote: > There are designs incorporating Ilitek ILI2xxx touch controller that > do not connect interrupt pin, for example Waveshare 13.3" DSI display. > To support such systems use polling mode for the input device when I2C > client does not have interrupt assigned to it. > > Factor out ili210x_firmware_update_noirq() to allow conditional scoped > guard around this code. The scoped guard has to be applied only in case > the IRQ line is connected, and not applied otherwise. > > Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> > --- > Cc: Conor Dooley <conor+dt@kernel.org> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> > Cc: Frank Li <Frank.Li@nxp.com> > Cc: Job Noorman <job@noorman.info> > Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> > Cc: Rob Herring <robh@kernel.org> > Cc: devicetree@vger.kernel.org > Cc: linux-input@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-renesas-soc@vger.kernel.org > --- > V2: Test client->irq > 0 for IRQ presence > --- > drivers/input/touchscreen/ili210x.c | 84 ++++++++++++++++++++--------- > 1 file changed, 60 insertions(+), 24 deletions(-) > > diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c > index fa38d70aded7b..0574f2e86580f 100644 > --- a/drivers/input/touchscreen/ili210x.c > +++ b/drivers/input/touchscreen/ili210x.c > @@ -327,9 +327,8 @@ static bool ili210x_report_events(struct ili210x *priv, u8 *touchdata) > return contact; > } > ... > > - error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq, > - IRQF_ONESHOT, client->name, priv); > - if (error) { > - dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n", > - error); > - return error; > + input_set_drvdata(input, priv); > + > + if (client->irq > 0) { > + error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq, > + IRQF_ONESHOT, client->name, priv); > + if (error) { > + dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n", > + error); > + return error; return dev_err_probe() Frank > + } > + } else { > + error = input_setup_polling(input, ili210x_work_i2c_poll); > + if (error) { > + dev_err(dev, "Could not set up polling mode, err: %d\n", > + error); > + return error; > + } > + input_set_poll_interval(input, ILI2XXX_POLL_PERIOD); > } > > error = devm_add_action_or_reset(dev, ili210x_stop, priv); > -- > 2.51.0 > ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 2/2] Input: ili210x - add support for polling mode 2026-01-15 15:29 ` Frank Li @ 2026-01-15 16:19 ` Marek Vasut 0 siblings, 0 replies; 5+ messages in thread From: Marek Vasut @ 2026-01-15 16:19 UTC (permalink / raw) To: Frank Li Cc: linux-input, Conor Dooley, Dmitry Torokhov, Job Noorman, Krzysztof Kozlowski, Rob Herring, devicetree, linux-kernel, linux-renesas-soc On 1/15/26 4:29 PM, Frank Li wrote: > On Thu, Jan 15, 2026 at 03:34:59AM +0100, Marek Vasut wrote: >> There are designs incorporating Ilitek ILI2xxx touch controller that >> do not connect interrupt pin, for example Waveshare 13.3" DSI display. >> To support such systems use polling mode for the input device when I2C >> client does not have interrupt assigned to it. >> >> Factor out ili210x_firmware_update_noirq() to allow conditional scoped >> guard around this code. The scoped guard has to be applied only in case >> the IRQ line is connected, and not applied otherwise. >> >> Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> >> --- >> Cc: Conor Dooley <conor+dt@kernel.org> >> Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> >> Cc: Frank Li <Frank.Li@nxp.com> >> Cc: Job Noorman <job@noorman.info> >> Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> >> Cc: Rob Herring <robh@kernel.org> >> Cc: devicetree@vger.kernel.org >> Cc: linux-input@vger.kernel.org >> Cc: linux-kernel@vger.kernel.org >> Cc: linux-renesas-soc@vger.kernel.org >> --- >> V2: Test client->irq > 0 for IRQ presence >> --- >> drivers/input/touchscreen/ili210x.c | 84 ++++++++++++++++++++--------- >> 1 file changed, 60 insertions(+), 24 deletions(-) >> >> diff --git a/drivers/input/touchscreen/ili210x.c b/drivers/input/touchscreen/ili210x.c >> index fa38d70aded7b..0574f2e86580f 100644 >> --- a/drivers/input/touchscreen/ili210x.c >> +++ b/drivers/input/touchscreen/ili210x.c >> @@ -327,9 +327,8 @@ static bool ili210x_report_events(struct ili210x *priv, u8 *touchdata) >> return contact; >> } >> > > ... >> >> - error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq, >> - IRQF_ONESHOT, client->name, priv); >> - if (error) { >> - dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n", >> - error); >> - return error; >> + input_set_drvdata(input, priv); >> + >> + if (client->irq > 0) { >> + error = devm_request_threaded_irq(dev, client->irq, NULL, ili210x_irq, >> + IRQF_ONESHOT, client->name, priv); >> + if (error) { >> + dev_err(dev, "Unable to request touchscreen IRQ, err: %d\n", >> + error); >> + return error; > > return dev_err_probe() Fixed mostly in new patch part of V3 , thanks. ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: touchscreen: trivial-touch: Drop 'interrupts' requirement for old Ilitek 2026-01-15 2:34 [PATCH v2 1/2] dt-bindings: touchscreen: trivial-touch: Drop 'interrupts' requirement for old Ilitek Marek Vasut 2026-01-15 2:34 ` [PATCH v2 2/2] Input: ili210x - add support for polling mode Marek Vasut @ 2026-01-15 15:25 ` Frank Li 1 sibling, 0 replies; 5+ messages in thread From: Frank Li @ 2026-01-15 15:25 UTC (permalink / raw) To: Marek Vasut Cc: linux-input, Conor Dooley, Dmitry Torokhov, Job Noorman, Krzysztof Kozlowski, Rob Herring, devicetree, linux-kernel, linux-renesas-soc On Thu, Jan 15, 2026 at 03:34:58AM +0100, Marek Vasut wrote: > The old Ilitek touch controllers V3 and V6 can operate without > interrupt line, in polling mode. Drop the 'interrupts' property > requirement for those four controllers. To avoid overloading the > trivial-touch, fork the old Ilitek V3/V6 touch controller binding > into separate document. > > Signed-off-by: Marek Vasut <marek.vasut+renesas@mailbox.org> > --- Reviewed-by: Frank Li <Frank.Li@nxp.com> > Cc: Conor Dooley <conor+dt@kernel.org> > Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com> > Cc: Frank Li <Frank.Li@nxp.com> > Cc: Job Noorman <job@noorman.info> > Cc: Krzysztof Kozlowski <krzk+dt@kernel.org> > Cc: Rob Herring <robh@kernel.org> > Cc: devicetree@vger.kernel.org > Cc: linux-input@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Cc: linux-renesas-soc@vger.kernel.org > --- > V2: Fork the Ilitek V3/V6 bindings into separate document > --- > .../input/touchscreen/ilitek,ili210x.yaml | 51 +++++++++++++++++++ > .../input/touchscreen/trivial-touch.yaml | 4 -- > 2 files changed, 51 insertions(+), 4 deletions(-) > create mode 100644 Documentation/devicetree/bindings/input/touchscreen/ilitek,ili210x.yaml > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/ilitek,ili210x.yaml b/Documentation/devicetree/bindings/input/touchscreen/ilitek,ili210x.yaml > new file mode 100644 > index 0000000000000..1d02aaba64f97 > --- /dev/null > +++ b/Documentation/devicetree/bindings/input/touchscreen/ilitek,ili210x.yaml > @@ -0,0 +1,51 @@ > +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) > +%YAML 1.2 > +--- > +$id: http://devicetree.org/schemas/input/touchscreen/ilitek,ili210x.yaml# > +$schema: http://devicetree.org/meta-schemas/core.yaml# > + > +title: Ilitek ILI21xx/ILI251x V3/V6 touch screen controller with i2c interface > + > +maintainers: > + - Frank Li <Frank.Li@nxp.com> > + - Marek Vasut <marek.vasut+renesas@mailbox.org> > + > +properties: > + compatible: > + enum: > + - ilitek,ili210x > + - ilitek,ili2117 > + - ilitek,ili2120 > + - ilitek,ili251x > + > + reg: > + maxItems: 1 > + > + interrupts: > + maxItems: 1 > + > + reset-gpios: > + maxItems: 1 > + > + wakeup-source: true > + > +allOf: > + - $ref: touchscreen.yaml > + > +required: > + - compatible > + - reg > + > +unevaluatedProperties: false > + > +examples: > + - | > + i2c { > + #address-cells = <1>; > + #size-cells = <0>; > + > + touchscreen@41 { > + compatible = "ilitek,ili2120"; > + reg = <0x41>; > + }; > + }; > diff --git a/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml b/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml > index fa27c6754ca4e..6441d21223caf 100644 > --- a/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml > +++ b/Documentation/devicetree/bindings/input/touchscreen/trivial-touch.yaml > @@ -23,9 +23,6 @@ properties: > # Hynitron cstxxx series touchscreen controller > - hynitron,cst340 > # Ilitek I2C Touchscreen Controller > - - ilitek,ili210x > - - ilitek,ili2117 > - - ilitek,ili2120 > - ilitek,ili2130 > - ilitek,ili2131 > - ilitek,ili2132 > @@ -33,7 +30,6 @@ properties: > - ilitek,ili2322 > - ilitek,ili2323 > - ilitek,ili2326 > - - ilitek,ili251x > - ilitek,ili2520 > - ilitek,ili2521 > # MAXI MAX11801 Resistive touch screen controller with i2c interface > -- > 2.51.0 > ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-01-15 16:19 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2026-01-15 2:34 [PATCH v2 1/2] dt-bindings: touchscreen: trivial-touch: Drop 'interrupts' requirement for old Ilitek Marek Vasut 2026-01-15 2:34 ` [PATCH v2 2/2] Input: ili210x - add support for polling mode Marek Vasut 2026-01-15 15:29 ` Frank Li 2026-01-15 16:19 ` Marek Vasut 2026-01-15 15:25 ` [PATCH v2 1/2] dt-bindings: touchscreen: trivial-touch: Drop 'interrupts' requirement for old Ilitek Frank Li
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox