Merge tag 'block-6.13-20242901' of git://git.kernel.dk/linux
[drm/drm-misc.git] / Documentation / devicetree / bindings / input / touchscreen / adi,ad7879.yaml
blobcaa5fa3cc3f1fb6d48d73f0fcc824faacfdbc503
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#
7 title: Analog Devices AD7879(-1)/AD7889(-1) touchscreen interface (SPI/I2C)
9 maintainers:
10   - Frank Li <Frank.Li@nxp.com>
12 properties:
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
21   reg:
22     maxItems: 1
24   interrupts:
25     maxItems: 1
27   touchscreen-max-pressure:
28     $ref: /schemas/types.yaml#/definitions/uint32
29     description: maximum reported pressure
31   adi,resistance-plate-x:
32     $ref: /schemas/types.yaml#/definitions/uint32
33     description: total resistance of X-plate (for pressure calculation)
35   touchscreen-swapped-x-y:
36     $ref: /schemas/types.yaml#/definitions/flag
37     description: X and Y axis are swapped (boolean)
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
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
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
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
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
92   gpio-controller: true
94   "#gpio-cells":
95     const: 1
97 required:
98   - compatible
99   - reg
101 allOf:
102   - $ref: /schemas/spi/spi-peripheral-props.yaml
104 unevaluatedProperties: false
106 examples:
107   - |
108     #include <dt-bindings/interrupt-controller/irq.h>
109     i2c {
110         #address-cells = <1>;
111         #size-cells = <0>;
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     };
128   - |
129     #include <dt-bindings/interrupt-controller/irq.h>
130     spi {
131         #address-cells = <1>;
132         #size-cells = <0>;
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     };