linux-input.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rob Herring <robh@kernel.org>
To: Benjamin Gaignard <benjamin.gaignard@st.com>
Cc: dmitry.torokhov@gmail.com, mark.rutland@arm.com,
	megous@megous.com, mylene.josserand@bootlin.com,
	linux-input@vger.kernel.org, devicetree@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] dt-bindings: touchscreen: Convert edt-ft5x06 to json-schema
Date: Wed, 5 Feb 2020 18:05:40 +0000	[thread overview]
Message-ID: <20200205180540.GA30370@bogus> (raw)
In-Reply-To: <20200128101455.4635-1-benjamin.gaignard@st.com>

On Tue, Jan 28, 2020 at 11:14:55AM +0100, Benjamin Gaignard wrote:
> Convert the EDT-FT5x06 to DT schema using json-schema.
> 
> Signed-off-by: Benjamin Gaignard <benjamin.gaignard@st.com>
> ---
>  .../bindings/input/touchscreen/edt-ft5x06.txt      |  75 -------------
>  .../bindings/input/touchscreen/edt-ft5x06.yaml     | 119 +++++++++++++++++++++
>  2 files changed, 119 insertions(+), 75 deletions(-)
>  delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
>  create mode 100644 Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
> 
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
> deleted file mode 100644
> index 0f6950073d6f..000000000000
> --- a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.txt
> +++ /dev/null
> @@ -1,75 +0,0 @@
> -FocalTech EDT-FT5x06 Polytouch driver
> -=====================================
> -
> -There are 5 variants of the chip for various touch panel sizes
> -FT5206GE1  2.8" .. 3.8"
> -FT5306DE4  4.3" .. 7"
> -FT5406EE8  7"   .. 8.9"
> -FT5506EEG  7"   .. 8.9"
> -FT5726NEI  5.7” .. 11.6"
> -
> -The software interface is identical for all those chips, so that
> -currently there is no need for the driver to distinguish between the
> -different chips. Nevertheless distinct compatible strings are used so
> -that a distinction can be added if necessary without changing the DT
> -bindings.
> -
> -
> -Required properties:
> - - compatible:  "edt,edt-ft5206"
> -           or:  "edt,edt-ft5306"
> -           or:  "edt,edt-ft5406"
> -           or:  "edt,edt-ft5506"
> -           or:  "evervision,ev-ft5726"
> -           or:  "focaltech,ft6236"
> -
> - - reg:         I2C slave address of the chip (0x38)
> - - interrupts:       interrupt specification for the touchdetect
> -                     interrupt
> -
> -Optional properties:
> - - reset-gpios: GPIO specification for the RESET input
> - - wake-gpios:  GPIO specification for the WAKE input
> - - vcc-supply:  Regulator that supplies the touchscreen
> -
> - - pinctrl-names: should be "default"
> - - pinctrl-0:   a phandle pointing to the pin settings for the
> -                control gpios
> -
> - - threshold:   allows setting the "click"-threshold in the range
> -                from 0 to 80.
> -
> - - gain:        allows setting the sensitivity in the range from 0 to
> -                31. Note that lower values indicate higher
> -                sensitivity.
> -
> - - offset:      allows setting the edge compensation in the range from
> -                0 to 31.
> -
> - - offset-x:    Same as offset, but applies only to the horizontal position.
> -                Range from 0 to 80, only supported by evervision,ev-ft5726
> -                devices.
> -
> - - offset-y:    Same as offset, but applies only to the vertical position.
> -                Range from 0 to 80, only supported by evervision,ev-ft5726
> -                devices.
> -
> - - touchscreen-size-x	   : See touchscreen.txt
> - - touchscreen-size-y	   : See touchscreen.txt
> - - touchscreen-fuzz-x      : See touchscreen.txt
> - - touchscreen-fuzz-y      : See touchscreen.txt
> - - touchscreen-inverted-x  : See touchscreen.txt
> - - touchscreen-inverted-y  : See touchscreen.txt
> - - touchscreen-swapped-x-y : See touchscreen.txt
> -
> -Example:
> -	polytouch: edt-ft5x06@38 {
> -		compatible = "edt,edt-ft5406", "edt,edt-ft5x06";
> -		reg = <0x38>;
> -		pinctrl-names = "default";
> -		pinctrl-0 = <&edt_ft5x06_pins>;
> -		interrupt-parent = <&gpio2>;
> -		interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
> -		reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
> -		wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>;
> -	};
> diff --git a/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
> new file mode 100644
> index 000000000000..178b7aea0f83
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/touchscreen/edt-ft5x06.yaml
> @@ -0,0 +1,119 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/touchscreen/edt-ft5x06.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: FocalTech EDT-FT5x06 Polytouch Bindings
> +
> +description: There are 5 variants of the chip for various touch panel sizes
> +             FT5206GE1  2.8" .. 3.8"
> +             FT5306DE4  4.3" .. 7"
> +             FT5406EE8  7"   .. 8.9"
> +             FT5506EEG  7"   .. 8.9"
> +             FT5726NEI  5.7” .. 11.6"

This needs a '|' to preserve formatting. (Running this into python and 
back out to yaml would clobber it.) 

> +
> +maintainers:
> +  - Dmitry Torokhov <dmitry.torokhov@gmail.com>
> +
> +allOf:
> +  - $ref: touchscreen.yaml#
> +  - if:
> +     properties:
> +       compatible:
> +         contains:
> +           enum:
> +             - evervision,ev-ft5726
> +
> +    then:
> +      properties:
> +        offset-x: true
> +        offset-y: true
> +
> +properties:
> +  compatible:
> +    enum:
> +      - edt,edt-ft5206
> +      - edt,edt-ft5306
> +      - edt,edt-ft5406
> +      - edt,edt-ft5506
> +      - evervision,ev-ft5726
> +      - focaltech,ft6236
> +
> +  reg:
> +    enum: [ 0x38 ]

const: 0x38

> +
> +  interrupts:
> +    maxItems: 1
> +
> +  reset-gpios:
> +    maxItems: 1
> +
> +  wake-gpios:
> +    maxItems: 1
> +
> +  vcc-supply:
> +    maxItems: 1
> +
> +  gain:
> +    description: Allows setting the sensitivity in the range from 0 to 31.
> +                 Note that lower values indicate higher sensitivity.
> +    $ref: /schemas/types.yaml#/definitions/uint32

Needs to be under an 'allOf' or minimum/maximum will be ignored.

And the others here...

> +    minimum: 0
> +    maximum: 31
> +
> +  offset:
> +    description: Allows setting the edge compensation in the range from 0 to 31.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 0
> +    maximum: 31
> +
> +  offset-x:
> +    description: Same as offset, but applies only to the horizontal position.
> +                 Range from 0 to 80, only supported by evervision,ev-ft5726 devices.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 0
> +    maximum: 80
> +
> +  offset-y:
> +    description: Same as offset, but applies only to the vertical position.
> +                 Range from 0 to 80, only supported by evervision,ev-ft5726 devices.
> +    $ref: /schemas/types.yaml#/definitions/uint32
> +    minimum: 0
> +    maximum: 80
> +
> +  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@00000000 {
> +      #address-cells = <1>;
> +      #size-cells = <0>;
> +      edt-ft5x06@38 {
> +        compatible = "edt,edt-ft5406";
> +        reg = <0x38>;
> +        interrupt-parent = <&gpio2>;
> +        interrupts = <5 IRQ_TYPE_EDGE_FALLING>;
> +        reset-gpios = <&gpio2 6 GPIO_ACTIVE_LOW>;
> +        wake-gpios = <&gpio4 9 GPIO_ACTIVE_HIGH>;
> +      };
> +    };
> +
> +...
> +
> -- 
> 2.15.0
> 

      reply	other threads:[~2020-02-05 18:05 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-28 10:14 [PATCH] dt-bindings: touchscreen: Convert edt-ft5x06 to json-schema Benjamin Gaignard
2020-02-05 18:05 ` Rob Herring [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200205180540.GA30370@bogus \
    --to=robh@kernel.org \
    --cc=benjamin.gaignard@st.com \
    --cc=devicetree@vger.kernel.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-input@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark.rutland@arm.com \
    --cc=megous@megous.com \
    --cc=mylene.josserand@bootlin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).