2021-05-19 19:26:55

by Oleksij Rempel

[permalink] [raw]
Subject: [PATCH v4 0/5] add z1 and z2 channels support for resistive-adc-touch driver

changes v4:
- resistive-adc-touch: remove unused variable

changes v3:
- yaml: fix validation for channel names
- yaml: add nodename validation

changes v2:
- add yaml conversion patch to this series
- reword commit message for the last patch
- fix possible overflow on the buffer dispatcher

Oleksij Rempel (5):
dt-bindings: touchscreen: validate nodename
dt-bindings: touchscreen: Convert resistive-adc-touch binding to json
schema
dt-bindings: touchscreen: add touchscreen-x/y-plate-ohms property
dt-bindings: touchscreen: resistive-adc-touch: add support for z1 and
z2 channels
Input: resistive-adc-touch: add support for z1 and z2 channels

.../input/touchscreen/resistive-adc-touch.txt | 33 ----
.../touchscreen/resistive-adc-touch.yaml | 86 +++++++++++
.../input/touchscreen/touchscreen.yaml | 9 ++
.../input/touchscreen/resistive-adc-touch.c | 142 ++++++++++++++++--
4 files changed, 223 insertions(+), 47 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml

--
2.29.2



2021-05-19 19:26:56

by Oleksij Rempel

[permalink] [raw]
Subject: [PATCH v4 3/5] dt-bindings: touchscreen: add touchscreen-x/y-plate-ohms property

Te calculate the pressure on a restrictive touchscreen we need need to
know resistance at least of X plate. Some calculations need to use both
X and Y values.
So, add generic properties which can be used by all drivers

Signed-off-by: Oleksij Rempel <[email protected]>
---
.../devicetree/bindings/input/touchscreen/touchscreen.yaml | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
index 057e1063759c..2d7b039ce47f 100644
--- a/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
+++ b/Documentation/devicetree/bindings/input/touchscreen/touchscreen.yaml
@@ -77,6 +77,12 @@ properties:
touchscreen-y-mm:
description: vertical length in mm of the touchscreen

+ touchscreen-x-plate-ohms:
+ description: Resistance of the X-plate in Ohms
+
+ touchscreen-y-plate-ohms:
+ description: Resistance of the Y-plate in Ohms
+
dependencies:
touchscreen-size-x: [ touchscreen-size-y ]
touchscreen-size-y: [ touchscreen-size-x ]
--
2.29.2


2021-05-19 19:26:56

by Oleksij Rempel

[permalink] [raw]
Subject: [PATCH v4 2/5] dt-bindings: touchscreen: Convert resistive-adc-touch binding to json schema

Convert the resistive-adc-touch binding to DT schema format using json-schema.

Signed-off-by: Oleksij Rempel <[email protected]>
---
.../input/touchscreen/resistive-adc-touch.txt | 33 ---------
.../touchscreen/resistive-adc-touch.yaml | 70 +++++++++++++++++++
2 files changed, 70 insertions(+), 33 deletions(-)
delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt
create mode 100644 Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml

diff --git a/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt b/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt
deleted file mode 100644
index af5223bb5bdd..000000000000
--- a/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt
+++ /dev/null
@@ -1,33 +0,0 @@
-Generic resistive touchscreen ADC
-
-Required properties:
-
- - compatible: must be "resistive-adc-touch"
-The device must be connected to an ADC device that provides channels for
-position measurement and optional pressure.
-Refer to
-https://github.com/devicetree-org/dt-schema/blob/master/schemas/iio/iio-consumer.yaml
-for details
-
- - iio-channels: must have at least two channels connected to an ADC device.
-These should correspond to the channels exposed by the ADC device and should
-have the right index as the ADC device registers them. These channels
-represent the relative position on the "x" and "y" axes.
- - iio-channel-names: must have all the channels' names. Mandatory channels
-are "x" and "y".
-
-Optional properties:
- - iio-channels: The third channel named "pressure" is optional and can be
-used if the ADC device also measures pressure besides position.
-If this channel is missing, pressure will be ignored and the touchscreen
-will only report position.
- - iio-channel-names: optional channel named "pressure".
-
-Example:
-
- resistive_touch: resistive_touch {
- compatible = "resistive-adc-touch";
- touchscreen-min-pressure = <50000>;
- io-channels = <&adc 24>, <&adc 25>, <&adc 26>;
- io-channel-names = "x", "y", "pressure";
- };
diff --git a/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml b/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml
new file mode 100644
index 000000000000..38b4cbee9429
--- /dev/null
+++ b/Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml
@@ -0,0 +1,70 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/input/touchscreen/resistive-adc-touch.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Generic resistive touchscreen ADC
+
+maintainers:
+ - Oleksij Rempel <[email protected]>
+
+description: |
+ Generic ADC based resistive touchscreen controller
+ The device must be connected to an ADC device that provides channels for
+ position measurement and optional pressure.
+
+allOf:
+ - $ref: touchscreen.yaml#
+
+properties:
+ compatible:
+ const: resistive-adc-touch
+
+ io-channels:
+ minItems: 2
+ items:
+ - description: x
+ - description: y
+ - description: pressure (optional)
+
+ io-channel-names:
+ oneOf:
+ - items:
+ - enum: [x, y]
+ - enum: [x, y]
+ - items:
+ - enum: [x, y, pressure]
+ - enum: [x, y, pressure]
+ - enum: [x, y, pressure]
+
+ 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
+ touchscreen-min-pressure: true
+
+additionalProperties: false
+
+required:
+ - compatible
+ - io-channels
+ - io-channel-names
+
+examples:
+ - |
+ touchscreen {
+ compatible = "resistive-adc-touch";
+ io-channels = <&adc 24>, <&adc 25>;
+ io-channel-names = "y", "x";
+ };
+ - |
+ touchscreen {
+ compatible = "resistive-adc-touch";
+ touchscreen-min-pressure = <50000>;
+ io-channels = <&adc 24>, <&adc 25>, <&adc 26>;
+ io-channel-names = "y", "pressure", "x";
+ };
--
2.29.2


2021-05-21 09:04:16

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v4 2/5] dt-bindings: touchscreen: Convert resistive-adc-touch binding to json schema

On Wed, 19 May 2021 11:42:18 +0200, Oleksij Rempel wrote:
> Convert the resistive-adc-touch binding to DT schema format using json-schema.
>
> Signed-off-by: Oleksij Rempel <[email protected]>
> ---
> .../input/touchscreen/resistive-adc-touch.txt | 33 ---------
> .../touchscreen/resistive-adc-touch.yaml | 70 +++++++++++++++++++
> 2 files changed, 70 insertions(+), 33 deletions(-)
> delete mode 100644 Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.txt
> create mode 100644 Documentation/devicetree/bindings/input/touchscreen/resistive-adc-touch.yaml
>

Reviewed-by: Rob Herring <[email protected]>

2021-05-21 09:04:26

by Rob Herring (Arm)

[permalink] [raw]
Subject: Re: [PATCH v4 3/5] dt-bindings: touchscreen: add touchscreen-x/y-plate-ohms property

On Wed, 19 May 2021 11:42:19 +0200, Oleksij Rempel wrote:
> Te calculate the pressure on a restrictive touchscreen we need need to
> know resistance at least of X plate. Some calculations need to use both
> X and Y values.
> So, add generic properties which can be used by all drivers
>
> Signed-off-by: Oleksij Rempel <[email protected]>
> ---
> .../devicetree/bindings/input/touchscreen/touchscreen.yaml | 6 ++++++
> 1 file changed, 6 insertions(+)
>

Reviewed-by: Rob Herring <[email protected]>