2020-01-07 13:11:02

by Benjamin GAIGNARD

[permalink] [raw]
Subject: [PATCH 0/2] Convert Goodix touchscreen to json-schema

This series convert Goodix touchscreen used on STM32 boards to json-schema.
Before converting goodix bindings itself it add a schema for common
touchscreen properties.

Benjamin Gaignard (2):
dt-bindings: touchscreen: Add touchscreen schema
dt-bindings: touchscreen: Convert Goodix touchscreen to json-schema

.../bindings/input/touchscreen/goodix.txt | 50 ----------------
.../bindings/input/touchscreen/goodix.yaml | 69 ++++++++++++++++++++++
.../bindings/input/touchscreen/touchscreen.yaml | 63 ++++++++++++++++++++
3 files changed, 132 insertions(+), 50 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/goodix.txt
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/goodix.yaml
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml

--
2.15.0


2020-01-07 13:22:56

by Benjamin GAIGNARD

[permalink] [raw]
Subject: [PATCH 1/2] dt-bindings: touchscreen: Add touchscreen schema

Add touchscreen schema for common properties

Signed-off-by: Benjamin Gaignard <[email protected]>
---
.../bindings/input/touchscreen/touchscreen.yaml | 63 ++++++++++++++++++++++
1 file changed, 63 insertions(+)
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml

diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
new file mode 100644
index 000000000000..f6e7c73ef14e
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
@@ -0,0 +1,63 @@
+# SPDX-License-Identifier: GPL-2.0
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/touchscreen.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Common touchscreen Bindings
+
+maintainers:
+ - Dmitry Torokhov <[email protected]>
+
+properties:
+ touchscreen-min-x:
+ description: minimum x coordinate reported (0 if not set)
+
+ touchscreen-min-y:
+ description: minimum y coordinate reported (0 if not set)
+
+ touchscreen-size-x:
+ description: horizontal resolution of touchscreen (maximum x coordinate reported + 1)
+
+ touchscreen-size-y:
+ description: vertical resolution of touchscreen (maximum y coordinate reported + 1)
+
+ touchscreen-max-pressure:
+ description: maximum reported pressure (arbitrary range dependent on the controller)
+
+ touchscreen-min-pressure:
+ description: minimum pressure on the touchscreen to be achieved in order for the
+ touchscreen driver to report a touch event.
+
+ touchscreen-fuzz-x:
+ description: horizontal noise value of the absolute input device (in pixels)
+
+ touchscreen-fuzz-y:
+ description: vertical noise value of the absolute input device (in pixels)
+
+ touchscreen-fuzz-pressure:
+ description: pressure noise value of the absolute input device (arbitrary range
+ dependent on the controller)
+
+ touchscreen-average-samples:
+ description: Number of data samples which are averaged for each read (valid values
+ dependent on the controller)
+
+ touchscreen-inverted-x:
+ description: X axis is inverted (boolean)
+ type: boolean
+
+ touchscreen-inverted-y:
+ description: Y axis is inverted (boolean)
+ type: boolean
+
+ touchscreen-swapped-x-y:
+ description: X and Y axis are swapped (boolean)
+ Swapping is done after inverting the axis
+ type: boolean
+
+ touchscreen-x-mm:
+ description: horizontal length in mm of the touchscreen
+
+ touchscreen-y-mm:
+ description: vertical length in mm of the touchscreen
--
2.15.0

2020-01-07 17:50:00

by Rob Herring

[permalink] [raw]
Subject: Re: [PATCH 1/2] dt-bindings: touchscreen: Add touchscreen schema

On Tue, Jan 7, 2020 at 7:09 AM Benjamin Gaignard
<[email protected]> wrote:
>
> Add touchscreen schema for common properties
>
> Signed-off-by: Benjamin Gaignard <[email protected]>
> ---
> .../bindings/input/touchscreen/touchscreen.yaml | 63 ++++++++++++++++++++++
> 1 file changed, 63 insertions(+)
> create mode 100644 Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml

Don't just add schema. Remove the old definitions. To avoid updating a
bunch of references to touchscreen.txt, I just put a 'see
touchscreen.yaml' in it.

> diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
> new file mode 100644
> index 000000000000..f6e7c73ef14e
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
> @@ -0,0 +1,63 @@
> +# SPDX-License-Identifier: GPL-2.0
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/input/touchscreen/touchscreen.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Common touchscreen Bindings
> +
> +maintainers:
> + - Dmitry Torokhov <[email protected]>
> +
> +properties:
> + touchscreen-min-x:
> + description: minimum x coordinate reported (0 if not set)

You need a type reference on a bunch of these. And "(0 if not set)"
sounds like a 'default' constraint.

> +
> + touchscreen-min-y:
> + description: minimum y coordinate reported (0 if not set)
> +
> + touchscreen-size-x:
> + description: horizontal resolution of touchscreen (maximum x coordinate reported + 1)
> +
> + touchscreen-size-y:
> + description: vertical resolution of touchscreen (maximum y coordinate reported + 1)

I don't think it makes sense if both of these aren't present, so you need:

dependencies:
touchscreen-size-x: [ touchscreen-size-y ]
touchscreen-size-y: [ touchscreen-size-x ]

> +
> + touchscreen-max-pressure:
> + description: maximum reported pressure (arbitrary range dependent on the controller)
> +
> + touchscreen-min-pressure:
> + description: minimum pressure on the touchscreen to be achieved in order for the
> + touchscreen driver to report a touch event.
> +
> + touchscreen-fuzz-x:
> + description: horizontal noise value of the absolute input device (in pixels)
> +
> + touchscreen-fuzz-y:
> + description: vertical noise value of the absolute input device (in pixels)
> +
> + touchscreen-fuzz-pressure:
> + description: pressure noise value of the absolute input device (arbitrary range
> + dependent on the controller)
> +
> + touchscreen-average-samples:
> + description: Number of data samples which are averaged for each read (valid values
> + dependent on the controller)
> +
> + touchscreen-inverted-x:
> + description: X axis is inverted (boolean)
> + type: boolean
> +
> + touchscreen-inverted-y:
> + description: Y axis is inverted (boolean)
> + type: boolean
> +
> + touchscreen-swapped-x-y:
> + description: X and Y axis are swapped (boolean)
> + Swapping is done after inverting the axis
> + type: boolean
> +
> + touchscreen-x-mm:
> + description: horizontal length in mm of the touchscreen
> +
> + touchscreen-y-mm:
> + description: vertical length in mm of the touchscreen

Same dependencies here.

Rob