[PATCH v2 4/6] dt-bindings: touchscreen: fsl,imx6ul-tsc: support glitch thresold

Dario Binacchi posted 6 patches 2 weeks, 3 days ago
There is a newer version of this series
[PATCH v2 4/6] dt-bindings: touchscreen: fsl,imx6ul-tsc: support glitch thresold
Posted by Dario Binacchi 2 weeks, 3 days ago
Support the touchscreen-glitch-threshold-ns property. Unlike the
generic description in touchscreen.yaml, this controller maps the
provided value to one of four discrete thresholds internally.

Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
---

(no changes since v1)

 .../input/touchscreen/fsl,imx6ul-tsc.yaml         | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
index 678756ad0f92..310af56a0be6 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
+++ b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
@@ -62,6 +62,21 @@ properties:
     description: Number of data samples which are averaged for each read.
     enum: [ 1, 4, 8, 16, 32 ]
 
+  touchscreen-glitch-threshold-ns:
+    description: |
+      Unlike the generic property defined in touchscreen.yaml, this
+      controller does not allow arbitrary values. Internally the value is
+      converted to IPG clock cycles and mapped to one of four discrete
+      thresholds exposed by the TSC_DEBUG_MODE2 register:
+
+        0: 8191 IPG cycles
+        1: 4095 IPG cycles
+        2: 2047 IPG cycles
+        3: 1023 IPG cycles
+
+      Any value provided in device tree is converted to cycles and rounded
+      up to the next supported threshold, or to 8191 if above 4095.
+
 required:
   - compatible
   - reg
-- 
2.43.0
Re: [PATCH v2 4/6] dt-bindings: touchscreen: fsl,imx6ul-tsc: support glitch thresold
Posted by Frank Li 2 weeks, 3 days ago
On Sun, Sep 14, 2025 at 07:16:01PM +0200, Dario Binacchi wrote:
> Support the touchscreen-glitch-threshold-ns property. Unlike the
> generic description in touchscreen.yaml, this controller maps the
> provided value to one of four discrete thresholds internally.
>
> Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> ---
>
> (no changes since v1)
>
>  .../input/touchscreen/fsl,imx6ul-tsc.yaml         | 15 +++++++++++++++
>  1 file changed, 15 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> index 678756ad0f92..310af56a0be6 100644
> --- a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> +++ b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> @@ -62,6 +62,21 @@ properties:
>      description: Number of data samples which are averaged for each read.
>      enum: [ 1, 4, 8, 16, 32 ]
>
> +  touchscreen-glitch-threshold-ns:
> +    description: |
> +      Unlike the generic property defined in touchscreen.yaml, this
> +      controller does not allow arbitrary values. Internally the value is
> +      converted to IPG clock cycles and mapped to one of four discrete
> +      thresholds exposed by the TSC_DEBUG_MODE2 register:
> +
> +        0: 8191 IPG cycles
> +        1: 4095 IPG cycles
> +        2: 2047 IPG cycles
> +        3: 1023 IPG cycles

you should use ns
   enum:
      - 1023
      - 2047
      - 4095
      - 8191

you can limit only 4 values, but unit have to ns. your driver map it to
register value.

Frank

> +
> +      Any value provided in device tree is converted to cycles and rounded
> +      up to the next supported threshold, or to 8191 if above 4095.
> +
>  required:
>    - compatible
>    - reg
> --
> 2.43.0
>
Re: [PATCH v2 4/6] dt-bindings: touchscreen: fsl,imx6ul-tsc: support glitch thresold
Posted by Conor Dooley 2 weeks, 2 days ago
On Mon, Sep 15, 2025 at 10:30:26AM -0400, Frank Li wrote:
> On Sun, Sep 14, 2025 at 07:16:01PM +0200, Dario Binacchi wrote:
> > Support the touchscreen-glitch-threshold-ns property. Unlike the
> > generic description in touchscreen.yaml, this controller maps the
> > provided value to one of four discrete thresholds internally.
> >
> > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > ---
> >
> > (no changes since v1)
> >
> >  .../input/touchscreen/fsl,imx6ul-tsc.yaml         | 15 +++++++++++++++
> >  1 file changed, 15 insertions(+)
> >
> > diff --git a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> > index 678756ad0f92..310af56a0be6 100644
> > --- a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> > +++ b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> > @@ -62,6 +62,21 @@ properties:
> >      description: Number of data samples which are averaged for each read.
> >      enum: [ 1, 4, 8, 16, 32 ]
> >
> > +  touchscreen-glitch-threshold-ns:
> > +    description: |
> > +      Unlike the generic property defined in touchscreen.yaml, this
> > +      controller does not allow arbitrary values. Internally the value is
> > +      converted to IPG clock cycles and mapped to one of four discrete
> > +      thresholds exposed by the TSC_DEBUG_MODE2 register:
> > +
> > +        0: 8191 IPG cycles
> > +        1: 4095 IPG cycles
> > +        2: 2047 IPG cycles
> > +        3: 1023 IPG cycles
> 
> you should use ns
>    enum:
>       - 1023
>       - 2047
>       - 4095
>       - 8191
> 
> you can limit only 4 values, but unit have to ns. your driver map it to
> register value.

Looking at the driver change, I think Dario is already doing that. The
text here is just talking about how the controller doesn't support
anything other than these 4 glitch threshold and mapping must be done in
some way.

> > +
> > +      Any value provided in device tree is converted to cycles and rounded
> > +      up to the next supported threshold, or to 8191 if above 4095.

This seems to be the implementation details of one particular driver,
and does not belong in a binding.

> > +
> >  required:
> >    - compatible
> >    - reg
> > --
> > 2.43.0
> >
Re: [PATCH v2 4/6] dt-bindings: touchscreen: fsl,imx6ul-tsc: support glitch thresold
Posted by Frank Li 2 weeks, 2 days ago
On Mon, Sep 15, 2025 at 06:42:13PM +0100, Conor Dooley wrote:
> On Mon, Sep 15, 2025 at 10:30:26AM -0400, Frank Li wrote:
> > On Sun, Sep 14, 2025 at 07:16:01PM +0200, Dario Binacchi wrote:
> > > Support the touchscreen-glitch-threshold-ns property. Unlike the
> > > generic description in touchscreen.yaml, this controller maps the
> > > provided value to one of four discrete thresholds internally.
> > >
> > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > > ---
> > >
> > > (no changes since v1)
> > >
> > >  .../input/touchscreen/fsl,imx6ul-tsc.yaml         | 15 +++++++++++++++
> > >  1 file changed, 15 insertions(+)
> > >
> > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> > > index 678756ad0f92..310af56a0be6 100644
> > > --- a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> > > +++ b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> > > @@ -62,6 +62,21 @@ properties:
> > >      description: Number of data samples which are averaged for each read.
> > >      enum: [ 1, 4, 8, 16, 32 ]
> > >
> > > +  touchscreen-glitch-threshold-ns:
> > > +    description: |
> > > +      Unlike the generic property defined in touchscreen.yaml, this
> > > +      controller does not allow arbitrary values. Internally the value is
> > > +      converted to IPG clock cycles and mapped to one of four discrete
> > > +      thresholds exposed by the TSC_DEBUG_MODE2 register:
> > > +
> > > +        0: 8191 IPG cycles
> > > +        1: 4095 IPG cycles
> > > +        2: 2047 IPG cycles
> > > +        3: 1023 IPG cycles
> >
> > you should use ns
> >    enum:
> >       - 1023
> >       - 2047
> >       - 4095
> >       - 8191
> >
> > you can limit only 4 values, but unit have to ns. your driver map it to
> > register value.
>
> Looking at the driver change, I think Dario is already doing that. The
> text here is just talking about how the controller doesn't support
> anything other than these 4 glitch threshold and mapping must be done in
> some way.

Thanks, but descripton is confused.
"Unlike the generic property defined in touchscreen.yaml", which let me
think value is 0..3, instead of ns.

Suggest Remove

"Unlike the generic property defined in touchscreen.yaml, this
controller does not allow arbitrary values"

Frank
>
> > > +
> > > +      Any value provided in device tree is converted to cycles and rounded
> > > +      up to the next supported threshold, or to 8191 if above 4095.
>
> This seems to be the implementation details of one particular driver,
> and does not belong in a binding.
>
> > > +
> > >  required:
> > >    - compatible
> > >    - reg
> > > --
> > > 2.43.0
> > >
Re: [PATCH v2 4/6] dt-bindings: touchscreen: fsl,imx6ul-tsc: support glitch thresold
Posted by Conor Dooley 2 weeks, 1 day ago
On Tue, Sep 16, 2025 at 12:03:01PM -0400, Frank Li wrote:
> On Mon, Sep 15, 2025 at 06:42:13PM +0100, Conor Dooley wrote:
> > On Mon, Sep 15, 2025 at 10:30:26AM -0400, Frank Li wrote:
> > > On Sun, Sep 14, 2025 at 07:16:01PM +0200, Dario Binacchi wrote:
> > > > Support the touchscreen-glitch-threshold-ns property. Unlike the
> > > > generic description in touchscreen.yaml, this controller maps the
> > > > provided value to one of four discrete thresholds internally.
> > > >
> > > > Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
> > > > ---
> > > >
> > > > (no changes since v1)
> > > >
> > > >  .../input/touchscreen/fsl,imx6ul-tsc.yaml         | 15 +++++++++++++++
> > > >  1 file changed, 15 insertions(+)
> > > >
> > > > diff --git a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> > > > index 678756ad0f92..310af56a0be6 100644
> > > > --- a/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> > > > +++ b/Documentation/devicetree/bindings/input/touchscreen/fsl,imx6ul-tsc.yaml
> > > > @@ -62,6 +62,21 @@ properties:
> > > >      description: Number of data samples which are averaged for each read.
> > > >      enum: [ 1, 4, 8, 16, 32 ]
> > > >
> > > > +  touchscreen-glitch-threshold-ns:
> > > > +    description: |
> > > > +      Unlike the generic property defined in touchscreen.yaml, this
> > > > +      controller does not allow arbitrary values. Internally the value is
> > > > +      converted to IPG clock cycles and mapped to one of four discrete
> > > > +      thresholds exposed by the TSC_DEBUG_MODE2 register:
> > > > +
> > > > +        0: 8191 IPG cycles
> > > > +        1: 4095 IPG cycles
> > > > +        2: 2047 IPG cycles
> > > > +        3: 1023 IPG cycles
> > >
> > > you should use ns
> > >    enum:
> > >       - 1023
> > >       - 2047
> > >       - 4095
> > >       - 8191
> > >
> > > you can limit only 4 values, but unit have to ns. your driver map it to
> > > register value.
> >
> > Looking at the driver change, I think Dario is already doing that. The
> > text here is just talking about how the controller doesn't support
> > anything other than these 4 glitch threshold and mapping must be done in
> > some way.
> 
> Thanks, but descripton is confused.
> "Unlike the generic property defined in touchscreen.yaml", which let me
> think value is 0..3, instead of ns.
> 
> Suggest Remove
> 
> "Unlike the generic property defined in touchscreen.yaml, this
> controller does not allow arbitrary values"

Yeah, I agree this should be removed. It's unlikely that /any/
touchscreen will support completely arbitrary values, so stating it is
redundant.