diff mbox series

[v3,2/3] dt-bindings: touchscreen: Add HY46XX bindings

Message ID 20210402161627.2546145-3-giulio.benetti@benettiengineering.com
State Superseded
Headers show
Series Input: add Hycon HY46XX Touchscreen controller | expand

Commit Message

Giulio Benetti April 2, 2021, 4:16 p.m. UTC
This adds device tree bindings for the Hycon HY46XX touchscreen series.

Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
---
V1->V2:
As suggested by Rob Herring:
* fixed $id: address
* added "hycon," in front of every custom property
* changed all possible property to boolean type
* removed proximity-sensor-switch property since it's not handled in driver
V2->V3:
As suggested by Jonathan Neuschäfer:
* fixed some typo
* fixed description indentation
* improved boolean properties descriptions
* improved hycon,report-speed description
---
 .../input/touchscreen/hycon,hy46xx.yaml       | 120 ++++++++++++++++++
 MAINTAINERS                                   |   6 +
 2 files changed, 126 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

Comments

Rob Herring April 6, 2021, 1:24 p.m. UTC | #1
On Fri, 02 Apr 2021 18:16:26 +0200, Giulio Benetti wrote:
> This adds device tree bindings for the Hycon HY46XX touchscreen series.

> 

> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

> ---

> V1->V2:

> As suggested by Rob Herring:

> * fixed $id: address

> * added "hycon," in front of every custom property

> * changed all possible property to boolean type

> * removed proximity-sensor-switch property since it's not handled in driver

> V2->V3:

> As suggested by Jonathan Neuschäfer:

> * fixed some typo

> * fixed description indentation

> * improved boolean properties descriptions

> * improved hycon,report-speed description

> ---

>  .../input/touchscreen/hycon,hy46xx.yaml       | 120 ++++++++++++++++++

>  MAINTAINERS                                   |   6 +

>  2 files changed, 126 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

> 


My bot found errors running 'make dt_binding_check' on your patch:

yamllint warnings/errors:

dtschema/dtc warnings/errors:
Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.example.dt.yaml:0:0: /example-0/i2c/hycon-hy4633@1c: failed to match any schema with compatible: ['hycon,hy4633']

See https://patchwork.ozlabs.org/patch/1461797

This check can fail if there are any dependencies. The base for a patch
series is generally the most recent rc1.

If you already ran 'make dt_binding_check' and didn't see the above
error(s), then make sure 'yamllint' is installed and dt-schema is up to
date:

pip3 install dtschema --upgrade

Please check and re-submit.
J. Neuschäfer April 6, 2021, 1:37 p.m. UTC | #2
In the binding:
> +properties:

> +  compatible:

> +    enum:

> +      - hycon,hycon-hy4613

> +      - hycon,hycon-hy4614

> +      - hycon,hycon-hy4621

> +      - hycon,hycon-hy4623

> +      - hycon,hycon-hy4633

> +      - hycon,hycon-hy4635


In the example:
> +      hycon-hy4633@1c {

> +        compatible = "hycon,hy4633";

> +        reg = <0x1c>;

> +        interrupt-parent = <&gpio2>;

> +        interrupts = <5 IRQ_TYPE_EDGE_FALLING>;

> +        reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;

> +      };



Rob's devicetree lint bot detected the mismatch in compatible string
here.

I personally think 'hycon,hy4633' looks better than 'hycon,hycon-hy4633',
because it isn't so redundant.


Best regards,
Jonathan Neuschäfer
Giulio Benetti April 6, 2021, 2:07 p.m. UTC | #3
Hi Jonathan,

On 4/6/21 3:37 PM, Jonathan Neuschäfer wrote:
> In the binding:
>> +properties:
>> +  compatible:
>> +    enum:
>> +      - hycon,hycon-hy4613
>> +      - hycon,hycon-hy4614
>> +      - hycon,hycon-hy4621
>> +      - hycon,hycon-hy4623
>> +      - hycon,hycon-hy4633
>> +      - hycon,hycon-hy4635
> 
> In the example:
>> +      hycon-hy4633@1c {
>> +        compatible = "hycon,hy4633";
>> +        reg = <0x1c>;
>> +        interrupt-parent = <&gpio2>;
>> +        interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
>> +        reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
>> +      };
> 
> 
> Rob's devicetree lint bot detected the mismatch in compatible string
> here.
> 
> I personally think 'hycon,hy4633' looks better than 'hycon,hycon-hy4633',
> because it isn't so redundant.
> 

Thank you, I've realized it after submitting patches and waited for 
other comments. I've already fixed it the way you've pointed.

Kind regards
Giulio Benetti April 7, 2021, 5:57 p.m. UTC | #4
Hello Rob, All,

On 4/6/21 3:24 PM, Rob Herring wrote:
> On Fri, 02 Apr 2021 18:16:26 +0200, Giulio Benetti wrote:
>> This adds device tree bindings for the Hycon HY46XX touchscreen series.
>>
>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
>> ---
>> V1->V2:
>> As suggested by Rob Herring:
>> * fixed $id: address
>> * added "hycon," in front of every custom property
>> * changed all possible property to boolean type
>> * removed proximity-sensor-switch property since it's not handled in driver
>> V2->V3:
>> As suggested by Jonathan Neuschäfer:
>> * fixed some typo
>> * fixed description indentation
>> * improved boolean properties descriptions
>> * improved hycon,report-speed description
>> ---
>>   .../input/touchscreen/hycon,hy46xx.yaml       | 120 ++++++++++++++++++
>>   MAINTAINERS                                   |   6 +
>>   2 files changed, 126 insertions(+)
>>   create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml
>>
> 
> My bot found errors running 'make dt_binding_check' on your patch:
> 
> yamllint warnings/errors:
> 
> dtschema/dtc warnings/errors:
> Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.example.dt.yaml:0:0: /example-0/i2c/hycon-hy4633@1c: failed to match any schema with compatible: ['hycon,hy4633']
> 
> See https://patchwork.ozlabs.org/patch/1461797
> 
> This check can fail if there are any dependencies. The base for a patch
> series is generally the most recent rc1.
> 
> If you already ran 'make dt_binding_check' and didn't see the above
> error(s), then make sure 'yamllint' is installed and dt-schema is up to
> date:

I've just send corrected patches.

Anyway I'd like to understand how to make dt_binding_check works correctly.

I've installed yamllint and 'make dt_binding_check' works but it still 
doesn't show that error up on compatible string.

yamllint I have is version 1.20.0

> pip3 install dtschema --upgrade

I've already tried with that too and dtschema version is:
1.3.8

I've read that dtc must be compiled with YAML output enabled and it 
seems to be so, since when I issue 'make dt_binding_check' from my file:
hycon,hy46xx.yaml(with compatible string wrong "hycon,hy4633")

these files are generated:
hycon,hy46xx.example.dts
```

/dts-v1/;
/plugin/; // silence any missing phandle references


/{
     compatible = "foo";
     model = "foo";
     interrupt-parent = <&foo>;
     #address-cells = <1>;
     #size-cells = <1>;



     example-0 {
         #address-cells = <1>;
         #size-cells = <1>;

         #include <dt-bindings/gpio/gpio.h>
         #include <dt-bindings/interrupt-controller/arm-gic.h>
         i2c {
           #address-cells = <1>;
           #size-cells = <0>;
           hycon-hy4633@1c {
             compatible = "hycon,hy4633";
             reg = <0x1c>;
             interrupt-parent = <&gpio2>;
             interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
             reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
           };
         };

     };
};

```

AND

hycon,hy46xx.example.dt.yaml
```
---
- compatible: ["foo"]
   model: ["foo"]
   interrupt-parent: [[!phandle 0xffffffff]]
   '#address-cells': [[0x1]]
   '#size-cells': [[0x1]]
   example-0:
     '#address-cells': [[0x1]]
     '#size-cells': [[0x1]]
     i2c:
       '#address-cells': [[0x1]]
       '#size-cells': [[0x0]]
       hycon-hy4633@1c:
         compatible: ["hycon,hy4633"]
         reg: [[0x1c]]
         interrupt-parent: [[!phandle 0xffffffff]]
         interrupts: [[0x5, 0x2]]
         reset-gpios: [[!phandle 0xffffffff, 0x6, 0x1]]
   __fixups__:
     foo: ["/:interrupt-parent:0"]
     gpio2: ["/example-0/i2c/hycon-hy4633@1c:interrupt-parent:0", 
"/example-0/i2c/hycon-hy4633@1c:reset-gpios:0"]
...
```

So I can't reproduce the problem, can you point me some documentation 
that I didn't see before?

Thank in advance
Best regards
Rob Herring April 7, 2021, 6:56 p.m. UTC | #5
On Wed, Apr 7, 2021 at 12:57 PM Giulio Benetti
<giulio.benetti@benettiengineering.com> wrote:
>
> Hello Rob, All,
>
> On 4/6/21 3:24 PM, Rob Herring wrote:
> > On Fri, 02 Apr 2021 18:16:26 +0200, Giulio Benetti wrote:
> >> This adds device tree bindings for the Hycon HY46XX touchscreen series.
> >>
> >> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>
> >> ---
> >> V1->V2:
> >> As suggested by Rob Herring:
> >> * fixed $id: address
> >> * added "hycon," in front of every custom property
> >> * changed all possible property to boolean type
> >> * removed proximity-sensor-switch property since it's not handled in driver
> >> V2->V3:
> >> As suggested by Jonathan Neuschäfer:
> >> * fixed some typo
> >> * fixed description indentation
> >> * improved boolean properties descriptions
> >> * improved hycon,report-speed description
> >> ---
> >>   .../input/touchscreen/hycon,hy46xx.yaml       | 120 ++++++++++++++++++
> >>   MAINTAINERS                                   |   6 +
> >>   2 files changed, 126 insertions(+)
> >>   create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml
> >>
> >
> > My bot found errors running 'make dt_binding_check' on your patch:
> >
> > yamllint warnings/errors:
> >
> > dtschema/dtc warnings/errors:
> > Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.example.dt.yaml:0:0: /example-0/i2c/hycon-hy4633@1c: failed to match any schema with compatible: ['hycon,hy4633']
> >
> > See https://patchwork.ozlabs.org/patch/1461797
> >
> > This check can fail if there are any dependencies. The base for a patch
> > series is generally the most recent rc1.
> >
> > If you already ran 'make dt_binding_check' and didn't see the above
> > error(s), then make sure 'yamllint' is installed and dt-schema is up to
> > date:
>
> I've just send corrected patches.
>
> Anyway I'd like to understand how to make dt_binding_check works correctly.
>
> I've installed yamllint and 'make dt_binding_check' works but it still
> doesn't show that error up on compatible string.
>
> yamllint I have is version 1.20.0
>
> > pip3 install dtschema --upgrade
>
> I've already tried with that too and dtschema version is:
> 1.3.8

Huh? dtschema versions are YYYY.MM.

> I've read that dtc must be compiled with YAML output enabled and it
> seems to be so, since when I issue 'make dt_binding_check' from my file:
> hycon,hy46xx.yaml(with compatible string wrong "hycon,hy4633")

It's a new check queued for 5.13 in linux-next. See commit
c59773d204cc ("kbuild: Enable DT undocumented compatible checks").

I've updated the bot email with this, but after I sent this one.

Rob
Giulio Benetti April 7, 2021, 7:17 p.m. UTC | #6
On 4/7/21 8:56 PM, Rob Herring wrote:
> On Wed, Apr 7, 2021 at 12:57 PM Giulio Benetti

> <giulio.benetti@benettiengineering.com> wrote:

>>

>> Hello Rob, All,

>>

>> On 4/6/21 3:24 PM, Rob Herring wrote:

>>> On Fri, 02 Apr 2021 18:16:26 +0200, Giulio Benetti wrote:

>>>> This adds device tree bindings for the Hycon HY46XX touchscreen series.

>>>>

>>>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

>>>> ---

>>>> V1->V2:

>>>> As suggested by Rob Herring:

>>>> * fixed $id: address

>>>> * added "hycon," in front of every custom property

>>>> * changed all possible property to boolean type

>>>> * removed proximity-sensor-switch property since it's not handled in driver

>>>> V2->V3:

>>>> As suggested by Jonathan Neuschäfer:

>>>> * fixed some typo

>>>> * fixed description indentation

>>>> * improved boolean properties descriptions

>>>> * improved hycon,report-speed description

>>>> ---

>>>>    .../input/touchscreen/hycon,hy46xx.yaml       | 120 ++++++++++++++++++

>>>>    MAINTAINERS                                   |   6 +

>>>>    2 files changed, 126 insertions(+)

>>>>    create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

>>>>

>>>

>>> My bot found errors running 'make dt_binding_check' on your patch:

>>>

>>> yamllint warnings/errors:

>>>

>>> dtschema/dtc warnings/errors:

>>> Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.example.dt.yaml:0:0: /example-0/i2c/hycon-hy4633@1c: failed to match any schema with compatible: ['hycon,hy4633']

>>>

>>> See https://patchwork.ozlabs.org/patch/1461797

>>>

>>> This check can fail if there are any dependencies. The base for a patch

>>> series is generally the most recent rc1.

>>>

>>> If you already ran 'make dt_binding_check' and didn't see the above

>>> error(s), then make sure 'yamllint' is installed and dt-schema is up to

>>> date:

>>

>> I've just send corrected patches.

>>

>> Anyway I'd like to understand how to make dt_binding_check works correctly.

>>

>> I've installed yamllint and 'make dt_binding_check' works but it still

>> doesn't show that error up on compatible string.

>>

>> yamllint I have is version 1.20.0

>>

>>> pip3 install dtschema --upgrade

>>

>> I've already tried with that too and dtschema version is:

>> 1.3.8

> 

> Huh? dtschema versions are YYYY.MM.


Sorry, it is 2021.3

>> I've read that dtc must be compiled with YAML output enabled and it

>> seems to be so, since when I issue 'make dt_binding_check' from my file:

>> hycon,hy46xx.yaml(with compatible string wrong "hycon,hy4633")

> 

> It's a new check queued for 5.13 in linux-next. See commit

> c59773d204cc ("kbuild: Enable DT undocumented compatible checks").

> 

> I've updated the bot email with this, but after I sent this one.


Ah ok, thank you, I'll apply it in my Repos.

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
Rob Herring April 8, 2021, 8:21 p.m. UTC | #7
On Wed, Apr 07, 2021 at 07:49:08PM +0200, Giulio Benetti wrote:
> This adds device tree bindings for the Hycon HY46XX touchscreen series.

> 

> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

> ---

> V1->V2:

> As suggested by Rob Herring:

> * fixed $id: address

> * added "hycon," in front of every custom property

> * changed all possible property to boolean type

> * removed proximity-sensor-switch property since it's not handled in driver

> V2->V3:

> As suggested by Jonathan Neuschäfer:

> * fixed some typo

> * fixed description indentation

> * improved boolean properties descriptions

> * improved hycon,report-speed description

> V3->V4:

> * fixed binding compatible string in example as suggested by Jonathan Neuschäfer

> ---

>  .../input/touchscreen/hycon,hy46xx.yaml       | 120 ++++++++++++++++++

>  MAINTAINERS                                   |   6 +

>  2 files changed, 126 insertions(+)

>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

> 

> diff --git a/Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml b/Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

> new file mode 100644

> index 000000000000..8860613a12ad

> --- /dev/null

> +++ b/Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

> @@ -0,0 +1,120 @@

> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

> +%YAML 1.2

> +---

> +$id: http://devicetree.org/schemas/input/touchscreen/hycon,hy46xx.yaml#

> +$schema: http://devicetree.org/meta-schemas/core.yaml#

> +

> +title: Hycon HY46XX series touchscreen controller bindings

> +

> +description: |

> +  There are 6 variants of the chip for various touch panel sizes and cover lens material

> +   Glass: 0.3mm--4.0mm

> +    PET/PMMA: 0.2mm--2.0mm

> +    HY4613(B)-N048  < 6"

> +    HY4614(B)-N068  7" .. 10.1"

> +    HY4621-NS32  < 5"

> +    HY4623-NS48  5.1" .. 7"

> +   Glass: 0.3mm--8.0mm

> +    PET/PMMA: 0.2mm--4.0mm

> +    HY4633(B)-N048  < 6"

> +    HY4635(B)-N048  < 7" .. 10.1"

> +

> +maintainers:

> +  - Giulio Benetti <giulio.benetti@benettiengineering.com>

> +

> +allOf:

> +  - $ref: touchscreen.yaml#

> +

> +properties:

> +  compatible:

> +    enum:

> +      - hycon,hycon-hy4613

> +      - hycon,hycon-hy4614

> +      - hycon,hycon-hy4621

> +      - hycon,hycon-hy4623

> +      - hycon,hycon-hy4633

> +      - hycon,hycon-hy4635


As suggested earlier, drop the 2nd 'hycon'.

> +

> +  reg:

> +    maxItems: 1

> +

> +  interrupts:

> +    maxItems: 1

> +

> +  reset-gpios:

> +    maxItems: 1

> +

> +  vcc-supply: true

> +

> +  hycon,threshold:

> +    description: Allows setting the sensitivity in the range from 0 to 255.

> +    $ref: /schemas/types.yaml#/definitions/uint32

> +    minimum: 0

> +    maximum: 255

> +

> +  hycon,glove-enable:

> +    type: boolean

> +    description: Allows enabling glove setting.

> +

> +  hycon,report-speed:

> +    description: Allows setting the report speed in Hertz.


If in Hertz, use standard unit suffix.

> +    $ref: /schemas/types.yaml#/definitions/uint32


And then you can drop this.

> +    minimum: 0


0Hz doesn't seem to useful?

> +    maximum: 255

> +

> +  hycon,power-noise-enable:


hycon,noise-filter-enable

No one wants to enable power noise. :)

> +    type: boolean

> +    description: Allows enabling power noise filter.

> +

> +  hycon,filter-data:

> +    description: Allows setting the filtering data before reporting touch

> +                 in the range from 0 to 5.


This is averaging samples? Sounds like something common perhaps.

> +    $ref: /schemas/types.yaml#/definitions/uint32

> +    minimum: 0

> +    maximum: 5

> +

> +  hycon,gain:

> +    description: Allows setting the sensitivity distance in the range from 0 to 5.

> +    $ref: /schemas/types.yaml#/definitions/uint32

> +    minimum: 0

> +    maximum: 5

> +

> +  hycon,edge-offset:

> +    description: Allows setting the edge compensation in the range from 0 to 16.

> +    $ref: /schemas/types.yaml#/definitions/uint32

> +    minimum: 0

> +    maximum: 16

> +

> +  touchscreen-size-x: true

> +  touchscreen-size-y: true

> +  touchscreen-fuzz-x: true

> +  touchscreen-fuzz-y: true

> +  touchscreen-inverted-x: true

> +  touchscreen-inverted-y: true

> +  touchscreen-swapped-x-y: true

> +  interrupt-controller: true

> +

> +additionalProperties: false

> +

> +required:

> +  - compatible

> +  - reg

> +  - interrupts

> +

> +examples:

> +  - |

> +    #include <dt-bindings/gpio/gpio.h>

> +    #include <dt-bindings/interrupt-controller/arm-gic.h>

> +    i2c {

> +      #address-cells = <1>;

> +      #size-cells = <0>;

> +      hycon-hy4633@1c {


touchscreen@1c

> +        compatible = "hycon,hycon-hy4633";

> +        reg = <0x1c>;

> +        interrupt-parent = <&gpio2>;

> +        interrupts = <5 IRQ_TYPE_EDGE_FALLING>;

> +        reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;

> +      };

> +    };

> +

> +...

> diff --git a/MAINTAINERS b/MAINTAINERS

> index c80ad735b384..d022ff09e609 100644

> --- a/MAINTAINERS

> +++ b/MAINTAINERS

> @@ -8243,6 +8243,12 @@ S:	Maintained

>  F:	mm/hwpoison-inject.c

>  F:	mm/memory-failure.c

>  

> +HYCON HY46XX TOUCHSCREEN SUPPORT

> +M:	Giulio Benetti <giulio.benetti@benettiengineering.com>

> +L:	linux-input@vger.kernel.org

> +S:	Maintained

> +F:	Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

> +

>  HYGON PROCESSOR SUPPORT

>  M:	Pu Wen <puwen@hygon.cn>

>  L:	linux-kernel@vger.kernel.org

> -- 

> 2.25.1

>
Giulio Benetti April 11, 2021, 11:37 a.m. UTC | #8
On 4/8/21 10:21 PM, Rob Herring wrote:
> On Wed, Apr 07, 2021 at 07:49:08PM +0200, Giulio Benetti wrote:

>> This adds device tree bindings for the Hycon HY46XX touchscreen series.

>>

>> Signed-off-by: Giulio Benetti <giulio.benetti@benettiengineering.com>

>> ---

>> V1->V2:

>> As suggested by Rob Herring:

>> * fixed $id: address

>> * added "hycon," in front of every custom property

>> * changed all possible property to boolean type

>> * removed proximity-sensor-switch property since it's not handled in driver

>> V2->V3:

>> As suggested by Jonathan Neuschäfer:

>> * fixed some typo

>> * fixed description indentation

>> * improved boolean properties descriptions

>> * improved hycon,report-speed description

>> V3->V4:

>> * fixed binding compatible string in example as suggested by Jonathan Neuschäfer

>> ---

>>   .../input/touchscreen/hycon,hy46xx.yaml       | 120 ++++++++++++++++++

>>   MAINTAINERS                                   |   6 +

>>   2 files changed, 126 insertions(+)

>>   create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

>>

>> diff --git a/Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml b/Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

>> new file mode 100644

>> index 000000000000..8860613a12ad

>> --- /dev/null

>> +++ b/Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

>> @@ -0,0 +1,120 @@

>> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)

>> +%YAML 1.2

>> +---

>> +$id: http://devicetree.org/schemas/input/touchscreen/hycon,hy46xx.yaml#

>> +$schema: http://devicetree.org/meta-schemas/core.yaml#

>> +

>> +title: Hycon HY46XX series touchscreen controller bindings

>> +

>> +description: |

>> +  There are 6 variants of the chip for various touch panel sizes and cover lens material

>> +   Glass: 0.3mm--4.0mm

>> +    PET/PMMA: 0.2mm--2.0mm

>> +    HY4613(B)-N048  < 6"

>> +    HY4614(B)-N068  7" .. 10.1"

>> +    HY4621-NS32  < 5"

>> +    HY4623-NS48  5.1" .. 7"

>> +   Glass: 0.3mm--8.0mm

>> +    PET/PMMA: 0.2mm--4.0mm

>> +    HY4633(B)-N048  < 6"

>> +    HY4635(B)-N048  < 7" .. 10.1"

>> +

>> +maintainers:

>> +  - Giulio Benetti <giulio.benetti@benettiengineering.com>

>> +

>> +allOf:

>> +  - $ref: touchscreen.yaml#

>> +

>> +properties:

>> +  compatible:

>> +    enum:

>> +      - hycon,hycon-hy4613

>> +      - hycon,hycon-hy4614

>> +      - hycon,hycon-hy4621

>> +      - hycon,hycon-hy4623

>> +      - hycon,hycon-hy4633

>> +      - hycon,hycon-hy4635

> 

> As suggested earlier, drop the 2nd 'hycon'.


Ok

>> +

>> +  reg:

>> +    maxItems: 1

>> +

>> +  interrupts:

>> +    maxItems: 1

>> +

>> +  reset-gpios:

>> +    maxItems: 1

>> +

>> +  vcc-supply: true

>> +

>> +  hycon,threshold:

>> +    description: Allows setting the sensitivity in the range from 0 to 255.

>> +    $ref: /schemas/types.yaml#/definitions/uint32

>> +    minimum: 0

>> +    maximum: 255

>> +

>> +  hycon,glove-enable:

>> +    type: boolean

>> +    description: Allows enabling glove setting.

>> +

>> +  hycon,report-speed:

>> +    description: Allows setting the report speed in Hertz.

> 

> If in Hertz, use standard unit suffix.

> 

>> +    $ref: /schemas/types.yaml#/definitions/uint32

> 

> And then you can drop this.


Ok

>> +    minimum: 0

> 

> 0Hz doesn't seem to useful?


You're right, I've also checked and with 0Hz controller correctly does 
nothing. I've also tried seeting 1Hz and it actually works, but at 1Hz, 
so I keep 1Hz as minimum.

>> +    maximum: 255

>> +

>> +  hycon,power-noise-enable:

> 

> hycon,noise-filter-enable

> 

> No one wants to enable power noise. :)


:-) Yeah

> 

>> +    type: boolean

>> +    description: Allows enabling power noise filter.

>> +

>> +  hycon,filter-data:

>> +    description: Allows setting the filtering data before reporting touch

>> +                 in the range from 0 to 5.

> 

> This is averaging samples? Sounds like something common perhaps.


maybe you mean touchscreen-average-samples property, but this is not the 
case.In datasheet they state "Before report coordinate throw away the 
data number, setting range:0--5" and I've tried sweep-setting it 1-5 
and what I get with filter-data set to 5 is that touchscreen answers 
after like 0.5 seconds but keep reporting as fast as set report-speed, 
so to me it throws away the first samples because it considers them 
"bad" samples when one is first touching the panel. So I'm going to 
modify the description as:
description: Allows setting how many samples throw before reporting
               touch in the range from 0 to 5.

>> +    $ref: /schemas/types.yaml#/definitions/uint32

>> +    minimum: 0

>> +    maximum: 5

>> +

>> +  hycon,gain:

>> +    description: Allows setting the sensitivity distance in the range from 0 to 5.

>> +    $ref: /schemas/types.yaml#/definitions/uint32

>> +    minimum: 0

>> +    maximum: 5

>> +

>> +  hycon,edge-offset:

>> +    description: Allows setting the edge compensation in the range from 0 to 16.

>> +    $ref: /schemas/types.yaml#/definitions/uint32

>> +    minimum: 0

>> +    maximum: 16

>> +

>> +  touchscreen-size-x: true

>> +  touchscreen-size-y: true

>> +  touchscreen-fuzz-x: true

>> +  touchscreen-fuzz-y: true

>> +  touchscreen-inverted-x: true

>> +  touchscreen-inverted-y: true

>> +  touchscreen-swapped-x-y: true

>> +  interrupt-controller: true

>> +

>> +additionalProperties: false

>> +

>> +required:

>> +  - compatible

>> +  - reg

>> +  - interrupts

>> +

>> +examples:

>> +  - |

>> +    #include <dt-bindings/gpio/gpio.h>

>> +    #include <dt-bindings/interrupt-controller/arm-gic.h>

>> +    i2c {

>> +      #address-cells = <1>;

>> +      #size-cells = <0>;

>> +      hycon-hy4633@1c {

> 

> touchscreen@1c


Ok

>> +        compatible = "hycon,hycon-hy4633";

>> +        reg = <0x1c>;

>> +        interrupt-parent = <&gpio2>;

>> +        interrupts = <5 IRQ_TYPE_EDGE_FALLING>;

>> +        reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;

>> +      };

>> +    };

>> +

>> +...

>> diff --git a/MAINTAINERS b/MAINTAINERS

>> index c80ad735b384..d022ff09e609 100644

>> --- a/MAINTAINERS

>> +++ b/MAINTAINERS

>> @@ -8243,6 +8243,12 @@ S:	Maintained

>>   F:	mm/hwpoison-inject.c

>>   F:	mm/memory-failure.c

>>   

>> +HYCON HY46XX TOUCHSCREEN SUPPORT

>> +M:	Giulio Benetti <giulio.benetti@benettiengineering.com>

>> +L:	linux-input@vger.kernel.org

>> +S:	Maintained

>> +F:	Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml

>> +

>>   HYGON PROCESSOR SUPPORT

>>   M:	Pu Wen <puwen@hygon.cn>

>>   L:	linux-kernel@vger.kernel.org

>> -- 

>> 2.25.1

>>


Thank you

Best regards
-- 
Giulio Benetti
Benetti Engineering sas
Giulio Benetti April 11, 2021, 11:48 a.m. UTC | #9
This patchset adds Hycon vendor, HY46XX touchscreen controller driver
and its .yaml binding.

---
V1->V2:
* changed authorship and SoBs to @benettiengineering.com domain
* fixed vendor commit log according to Jonathan Neuschäfer's suggestion
* fixed hy46xx bindings according to Rob Herring's suggestions
* fixed hy46xx driver according to Dmitry Torokhov's suggestions
further details are listed in single patches
V2->V3:
* fixed hy46xx bindings according to Jonathan Neuschäfer's suggestion
* fixed hy46xx driver according to Jonathan Neuschäfer's suggestion
further details are listed in single patches
V3->V4:
* fixed binding compatible string as suggested by Jonathan Neuschäfer
V4->V5:
* fixed hy46xx bindings and driver according to Rob Herring's suggestions
further details are listed in single patches
---

Giulio Benetti (3):
  dt-bindings: Add Hycon Technology vendor prefix
  dt-bindings: touchscreen: Add HY46XX bindings
  Input: add driver for the Hycon HY46XX touchpanel series

 .../input/touchscreen/hycon,hy46xx.yaml       | 119 ++++
 .../devicetree/bindings/vendor-prefixes.yaml  |   2 +
 MAINTAINERS                                   |   7 +
 drivers/input/touchscreen/Kconfig             |  11 +
 drivers/input/touchscreen/Makefile            |   1 +
 drivers/input/touchscreen/hycon-hy46xx.c      | 591 ++++++++++++++++++
 6 files changed, 731 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml
 create mode 100644 drivers/input/touchscreen/hycon-hy46xx.c
diff mbox series

Patch

diff --git a/Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml b/Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml
new file mode 100644
index 000000000000..dddc6e3e654f
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml
@@ -0,0 +1,120 @@ 
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/hycon,hy46xx.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Hycon HY46XX series touchscreen controller bindings
+
+description: |
+  There are 6 variants of the chip for various touch panel sizes and cover lens material
+   Glass: 0.3mm--4.0mm
+    PET/PMMA: 0.2mm--2.0mm
+    HY4613(B)-N048  < 6"
+    HY4614(B)-N068  7" .. 10.1"
+    HY4621-NS32  < 5"
+    HY4623-NS48  5.1" .. 7"
+   Glass: 0.3mm--8.0mm
+    PET/PMMA: 0.2mm--4.0mm
+    HY4633(B)-N048  < 6"
+    HY4635(B)-N048  < 7" .. 10.1"
+
+maintainers:
+  - Giulio Benetti <giulio.benetti@benettiengineering.com>
+
+allOf:
+  - $ref: touchscreen.yaml#
+
+properties:
+  compatible:
+    enum:
+      - hycon,hycon-hy4613
+      - hycon,hycon-hy4614
+      - hycon,hycon-hy4621
+      - hycon,hycon-hy4623
+      - hycon,hycon-hy4633
+      - hycon,hycon-hy4635
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  reset-gpios:
+    maxItems: 1
+
+  vcc-supply: true
+
+  hycon,threshold:
+    description: Allows setting the sensitivity in the range from 0 to 255.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 255
+
+  hycon,glove-enable:
+    type: boolean
+    description: Allows enabling glove setting.
+
+  hycon,report-speed:
+    description: Allows setting the report speed in Hertz.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 255
+
+  hycon,power-noise-enable:
+    type: boolean
+    description: Allows enabling power noise filter.
+
+  hycon,filter-data:
+    description: Allows setting the filtering data before reporting touch
+                 in the range from 0 to 5.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 5
+
+  hycon,gain:
+    description: Allows setting the sensitivity distance in the range from 0 to 5.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 5
+
+  hycon,edge-offset:
+    description: Allows setting the edge compensation in the range from 0 to 16.
+    $ref: /schemas/types.yaml#/definitions/uint32
+    minimum: 0
+    maximum: 16
+
+  touchscreen-size-x: true
+  touchscreen-size-y: true
+  touchscreen-fuzz-x: true
+  touchscreen-fuzz-y: true
+  touchscreen-inverted-x: true
+  touchscreen-inverted-y: true
+  touchscreen-swapped-x-y: true
+  interrupt-controller: true
+
+additionalProperties: false
+
+required:
+  - compatible
+  - reg
+  - interrupts
+
+examples:
+  - |
+    #include <dt-bindings/gpio/gpio.h>
+    #include <dt-bindings/interrupt-controller/arm-gic.h>
+    i2c {
+      #address-cells = <1>;
+      #size-cells = <0>;
+      hycon-hy4633@1c {
+        compatible = "hycon,hy4633";
+        reg = <0x1c>;
+        interrupt-parent = <&gpio2>;
+        interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
+        reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
+      };
+    };
+
+...
diff --git a/MAINTAINERS b/MAINTAINERS
index 6e91994b8d3b..5e9cc7e610ce 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -8242,6 +8242,12 @@  S:	Maintained
 F:	mm/hwpoison-inject.c
 F:	mm/memory-failure.c
 
+HYCON HY46XX TOUCHSCREEN SUPPORT
+M:	Giulio Benetti <giulio.benetti@benettiengineering.com>
+L:	linux-input@vger.kernel.org
+S:	Maintained
+F:	Documentation/devicetree/bindings/input/touchscreen/hycon,hy46xx.yaml
+
 HYGON PROCESSOR SUPPORT
 M:	Pu Wen <puwen@hygon.cn>
 L:	linux-kernel@vger.kernel.org