xref: /linux/Documentation/devicetree/bindings/input/touchscreen/adi,ad7879.yaml (revision a6021aa24f6417416d93318bbfa022ab229c33c8)
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/input/touchscreen/adi,ad7879.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Analog Devices AD7879(-1)/AD7889(-1) touchscreen interface (SPI/I2C)
8
9maintainers:
10  - Frank Li <Frank.Li@nxp.com>
11
12properties:
13  compatible:
14    description: |
15      for SPI slave, use "adi,ad7879"
16      for I2C slave, use "adi,ad7879-1"
17    enum:
18      - adi,ad7879
19      - adi,ad7879-1
20
21  reg:
22    maxItems: 1
23
24  interrupts:
25    maxItems: 1
26
27  touchscreen-max-pressure:
28    $ref: /schemas/types.yaml#/definitions/uint32
29    description: maximum reported pressure
30
31  adi,resistance-plate-x:
32    $ref: /schemas/types.yaml#/definitions/uint32
33    description: total resistance of X-plate (for pressure calculation)
34
35  touchscreen-swapped-x-y:
36    $ref: /schemas/types.yaml#/definitions/flag
37    description: X and Y axis are swapped (boolean)
38
39  adi,first-conversion-delay:
40    $ref: /schemas/types.yaml#/definitions/uint8
41    default: 0
42    minimum: 0
43    maximum: 15
44    description: |
45      0-12: In 128us steps (starting with 128us)
46      13  : 2.560ms
47      14  : 3.584ms
48      15  : 4.096ms
49      This property has to be a '/bits/ 8' value
50
51  adi,acquisition-time:
52    $ref: /schemas/types.yaml#/definitions/uint8
53    default: 0
54    enum: [0, 1, 2, 3]
55    description: |
56      0: 2us
57      1: 4us
58      2: 8us
59      3: 16us
60      This property has to be a '/bits/ 8' value
61
62  adi,median-filter-size:
63    $ref: /schemas/types.yaml#/definitions/uint8
64    default: 0
65    enum: [0, 1, 2, 3]
66    description: |
67      0: disabled
68      1: 4 measurements
69      2: 8 measurements
70      3: 16 measurements
71      This property has to be a '/bits/ 8' value
72
73  adi,averaging:
74    $ref: /schemas/types.yaml#/definitions/uint8
75    default: 0
76    enum: [0, 1, 2, 3]
77    description: |
78      0: 2 middle values (1 if median disabled)
79      1: 4 middle values
80      2: 8 middle values
81      3: 16 values
82      This property has to be a '/bits/ 8' value
83
84  adi,conversion-interval:
85    $ref: /schemas/types.yaml#/definitions/uint8
86    default: 0
87    description: |
88      0    : convert one time only
89      1-255: 515us + val * 35us (up to 9.440ms)
90      This property has to be a '/bits/ 8' value
91
92  gpio-controller: true
93
94  "#gpio-cells":
95    const: 1
96
97required:
98  - compatible
99  - reg
100
101allOf:
102  - $ref: /schemas/spi/spi-peripheral-props.yaml
103
104unevaluatedProperties: false
105
106examples:
107  - |
108    #include <dt-bindings/interrupt-controller/irq.h>
109    i2c {
110        #address-cells = <1>;
111        #size-cells = <0>;
112
113        touchscreen0@2c {
114            compatible = "adi,ad7879-1";
115            reg = <0x2c>;
116            interrupt-parent = <&gpio1>;
117            interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
118            touchscreen-max-pressure = <4096>;
119            adi,resistance-plate-x = <120>;
120            adi,first-conversion-delay = /bits/ 8 <3>;
121            adi,acquisition-time = /bits/ 8 <1>;
122            adi,median-filter-size = /bits/ 8 <2>;
123            adi,averaging = /bits/ 8 <1>;
124            adi,conversion-interval = /bits/ 8 <255>;
125        };
126    };
127
128  - |
129    #include <dt-bindings/interrupt-controller/irq.h>
130    spi {
131        #address-cells = <1>;
132        #size-cells = <0>;
133
134        touchscreen1@1 {
135            compatible = "adi,ad7879";
136            reg = <1>;
137            spi-max-frequency = <5000000>;
138            gpio-controller;
139            #gpio-cells = <1>;
140            interrupt-parent = <&gpio1>;
141            interrupts = <13 IRQ_TYPE_EDGE_FALLING>;
142            touchscreen-max-pressure = <4096>;
143            adi,resistance-plate-x = <120>;
144            adi,first-conversion-delay = /bits/ 8 <3>;
145            adi,acquisition-time = /bits/ 8 <1>;
146            adi,median-filter-size = /bits/ 8 <2>;
147            adi,averaging = /bits/ 8 <1>;
148            adi,conversion-interval = /bits/ 8 <255>;
149        };
150    };
151