xref: /freebsd/sys/contrib/device-tree/Bindings/mfd/st,stmpe.yaml (revision aa1a8ff2d6dbc51ef058f46f3db5a8bb77967145)
1*aa1a8ff2SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*aa1a8ff2SEmmanuel Vadot%YAML 1.2
3*aa1a8ff2SEmmanuel Vadot---
4*aa1a8ff2SEmmanuel Vadot$id: http://devicetree.org/schemas/mfd/st,stmpe.yaml#
5*aa1a8ff2SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*aa1a8ff2SEmmanuel Vadot
7*aa1a8ff2SEmmanuel Vadottitle: STMicroelectonics Port Expander (STMPE)
8*aa1a8ff2SEmmanuel Vadot
9*aa1a8ff2SEmmanuel Vadotdescription: STMicroelectronics Port Expander (STMPE) is a series of slow
10*aa1a8ff2SEmmanuel Vadot  bus controllers for various expanded peripherals such as GPIO, keypad,
11*aa1a8ff2SEmmanuel Vadot  touchscreen, ADC, PWM or rotator. It can contain one or several different
12*aa1a8ff2SEmmanuel Vadot  peripherals connected to SPI or I2C.
13*aa1a8ff2SEmmanuel Vadot
14*aa1a8ff2SEmmanuel Vadotmaintainers:
15*aa1a8ff2SEmmanuel Vadot  - Linus Walleij <linus.walleij@linaro.org>
16*aa1a8ff2SEmmanuel Vadot
17*aa1a8ff2SEmmanuel VadotallOf:
18*aa1a8ff2SEmmanuel Vadot  - $ref: /schemas/spi/spi-peripheral-props.yaml#
19*aa1a8ff2SEmmanuel Vadot
20*aa1a8ff2SEmmanuel Vadotproperties:
21*aa1a8ff2SEmmanuel Vadot  compatible:
22*aa1a8ff2SEmmanuel Vadot    enum:
23*aa1a8ff2SEmmanuel Vadot      - st,stmpe601
24*aa1a8ff2SEmmanuel Vadot      - st,stmpe801
25*aa1a8ff2SEmmanuel Vadot      - st,stmpe811
26*aa1a8ff2SEmmanuel Vadot      - st,stmpe1600
27*aa1a8ff2SEmmanuel Vadot      - st,stmpe1601
28*aa1a8ff2SEmmanuel Vadot      - st,stmpe2401
29*aa1a8ff2SEmmanuel Vadot      - st,stmpe2403
30*aa1a8ff2SEmmanuel Vadot
31*aa1a8ff2SEmmanuel Vadot  reg:
32*aa1a8ff2SEmmanuel Vadot    maxItems: 1
33*aa1a8ff2SEmmanuel Vadot
34*aa1a8ff2SEmmanuel Vadot  interrupts:
35*aa1a8ff2SEmmanuel Vadot    maxItems: 1
36*aa1a8ff2SEmmanuel Vadot
37*aa1a8ff2SEmmanuel Vadot  vcc-supply: true
38*aa1a8ff2SEmmanuel Vadot
39*aa1a8ff2SEmmanuel Vadot  vio-supply: true
40*aa1a8ff2SEmmanuel Vadot
41*aa1a8ff2SEmmanuel Vadot  reset-gpios:
42*aa1a8ff2SEmmanuel Vadot    maxItems: 1
43*aa1a8ff2SEmmanuel Vadot
44*aa1a8ff2SEmmanuel Vadot  wakeup-source: true
45*aa1a8ff2SEmmanuel Vadot
46*aa1a8ff2SEmmanuel Vadot  st,autosleep-timeout:
47*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
48*aa1a8ff2SEmmanuel Vadot    enum: [ 4, 16, 32, 64, 128, 256, 512, 1024 ]
49*aa1a8ff2SEmmanuel Vadot    description: Time idle before going to automatic sleep to save power
50*aa1a8ff2SEmmanuel Vadot
51*aa1a8ff2SEmmanuel Vadot  st,sample-time:
52*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
53*aa1a8ff2SEmmanuel Vadot    enum: [ 0, 1, 2, 3, 4, 5, 6 ]
54*aa1a8ff2SEmmanuel Vadot    description: |
55*aa1a8ff2SEmmanuel Vadot      Sample time per iteration
56*aa1a8ff2SEmmanuel Vadot      0 = 36 clock ticks
57*aa1a8ff2SEmmanuel Vadot      1 = 44 clock ticks
58*aa1a8ff2SEmmanuel Vadot      2 = 56 clock ticks
59*aa1a8ff2SEmmanuel Vadot      3 = 64 clock ticks
60*aa1a8ff2SEmmanuel Vadot      4 = 80 clock ticks - recommended
61*aa1a8ff2SEmmanuel Vadot      5 = 96 clock ticks
62*aa1a8ff2SEmmanuel Vadot      6 = 124 clock ticks
63*aa1a8ff2SEmmanuel Vadot
64*aa1a8ff2SEmmanuel Vadot  st,mod-12b:
65*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
66*aa1a8ff2SEmmanuel Vadot    enum: [ 0, 1 ]
67*aa1a8ff2SEmmanuel Vadot    description: ADC bit mode 0 = 10bit ADC, 1 = 12bit ADC
68*aa1a8ff2SEmmanuel Vadot
69*aa1a8ff2SEmmanuel Vadot  st,ref-sel:
70*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
71*aa1a8ff2SEmmanuel Vadot    enum: [ 0, 1 ]
72*aa1a8ff2SEmmanuel Vadot    description: ADC reference source 0 = internal, 1 = external
73*aa1a8ff2SEmmanuel Vadot
74*aa1a8ff2SEmmanuel Vadot  st,adc-freq:
75*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
76*aa1a8ff2SEmmanuel Vadot    enum: [ 0, 1, 2, 3 ]
77*aa1a8ff2SEmmanuel Vadot    description: |
78*aa1a8ff2SEmmanuel Vadot      ADC clock speed
79*aa1a8ff2SEmmanuel Vadot      0 = 1.625 MHz
80*aa1a8ff2SEmmanuel Vadot      1 = 3.25 MHz
81*aa1a8ff2SEmmanuel Vadot      2, 3 = 6.5 MHz
82*aa1a8ff2SEmmanuel Vadot
83*aa1a8ff2SEmmanuel Vadot  adc:
84*aa1a8ff2SEmmanuel Vadot    type: object
85*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/iio/adc/st,stmpe-adc.yaml#
86*aa1a8ff2SEmmanuel Vadot
87*aa1a8ff2SEmmanuel Vadot  gpio:
88*aa1a8ff2SEmmanuel Vadot    type: object
89*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/gpio/st,stmpe-gpio.yaml#
90*aa1a8ff2SEmmanuel Vadot
91*aa1a8ff2SEmmanuel Vadot  keyboard-controller:
92*aa1a8ff2SEmmanuel Vadot    type: object
93*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/input/matrix-keymap.yaml#
94*aa1a8ff2SEmmanuel Vadot
95*aa1a8ff2SEmmanuel Vadot    unevaluatedProperties: false
96*aa1a8ff2SEmmanuel Vadot
97*aa1a8ff2SEmmanuel Vadot    properties:
98*aa1a8ff2SEmmanuel Vadot      compatible:
99*aa1a8ff2SEmmanuel Vadot        const: st,stmpe-keypad
100*aa1a8ff2SEmmanuel Vadot
101*aa1a8ff2SEmmanuel Vadot      debounce-interval:
102*aa1a8ff2SEmmanuel Vadot        description: Debouncing interval in milliseconds
103*aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
104*aa1a8ff2SEmmanuel Vadot
105*aa1a8ff2SEmmanuel Vadot      st,no-autorepeat:
106*aa1a8ff2SEmmanuel Vadot        description: If present, the keys will not autorepeat when pressed
107*aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/flag
108*aa1a8ff2SEmmanuel Vadot
109*aa1a8ff2SEmmanuel Vadot      st,scan-count:
110*aa1a8ff2SEmmanuel Vadot        description: Scanning cycles elapsed before key data is updated
111*aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
112*aa1a8ff2SEmmanuel Vadot
113*aa1a8ff2SEmmanuel Vadot    required:
114*aa1a8ff2SEmmanuel Vadot      - compatible
115*aa1a8ff2SEmmanuel Vadot      - linux,keymap
116*aa1a8ff2SEmmanuel Vadot
117*aa1a8ff2SEmmanuel Vadot  pwm:
118*aa1a8ff2SEmmanuel Vadot    type: object
119*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/pwm/pwm.yaml#
120*aa1a8ff2SEmmanuel Vadot
121*aa1a8ff2SEmmanuel Vadot    unevaluatedProperties: false
122*aa1a8ff2SEmmanuel Vadot
123*aa1a8ff2SEmmanuel Vadot    properties:
124*aa1a8ff2SEmmanuel Vadot      compatible:
125*aa1a8ff2SEmmanuel Vadot        const: st,stmpe-pwm
126*aa1a8ff2SEmmanuel Vadot
127*aa1a8ff2SEmmanuel Vadot      "#pwm-cells":
128*aa1a8ff2SEmmanuel Vadot        const: 2
129*aa1a8ff2SEmmanuel Vadot
130*aa1a8ff2SEmmanuel Vadot  touchscreen:
131*aa1a8ff2SEmmanuel Vadot    type: object
132*aa1a8ff2SEmmanuel Vadot    $ref: /schemas/input/touchscreen/touchscreen.yaml#
133*aa1a8ff2SEmmanuel Vadot
134*aa1a8ff2SEmmanuel Vadot    unevaluatedProperties: false
135*aa1a8ff2SEmmanuel Vadot
136*aa1a8ff2SEmmanuel Vadot    properties:
137*aa1a8ff2SEmmanuel Vadot      compatible:
138*aa1a8ff2SEmmanuel Vadot        const: st,stmpe-ts
139*aa1a8ff2SEmmanuel Vadot
140*aa1a8ff2SEmmanuel Vadot      st,ave-ctrl:
141*aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
142*aa1a8ff2SEmmanuel Vadot        enum: [ 0, 1, 2, 3 ]
143*aa1a8ff2SEmmanuel Vadot        description: |
144*aa1a8ff2SEmmanuel Vadot          Sample average control
145*aa1a8ff2SEmmanuel Vadot          0 = 1 sample
146*aa1a8ff2SEmmanuel Vadot          1 = 2 samples
147*aa1a8ff2SEmmanuel Vadot          2 = 4 samples
148*aa1a8ff2SEmmanuel Vadot          3 = 8 samples
149*aa1a8ff2SEmmanuel Vadot
150*aa1a8ff2SEmmanuel Vadot      st,touch-det-delay:
151*aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
152*aa1a8ff2SEmmanuel Vadot        enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
153*aa1a8ff2SEmmanuel Vadot        description: |
154*aa1a8ff2SEmmanuel Vadot          Touch detection delay
155*aa1a8ff2SEmmanuel Vadot          0 = 10 us
156*aa1a8ff2SEmmanuel Vadot          1 = 50 us
157*aa1a8ff2SEmmanuel Vadot          2 = 100 us
158*aa1a8ff2SEmmanuel Vadot          3 = 500 us - recommended
159*aa1a8ff2SEmmanuel Vadot          4 = 1 ms
160*aa1a8ff2SEmmanuel Vadot          5 = 5 ms
161*aa1a8ff2SEmmanuel Vadot          6 = 10 ms
162*aa1a8ff2SEmmanuel Vadot          7 = 50 ms
163*aa1a8ff2SEmmanuel Vadot
164*aa1a8ff2SEmmanuel Vadot      st,settling:
165*aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
166*aa1a8ff2SEmmanuel Vadot        enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
167*aa1a8ff2SEmmanuel Vadot        description: |
168*aa1a8ff2SEmmanuel Vadot          Panel driver settling time
169*aa1a8ff2SEmmanuel Vadot          0 = 10 us
170*aa1a8ff2SEmmanuel Vadot          1 = 100 us
171*aa1a8ff2SEmmanuel Vadot          2 = 500 us - recommended
172*aa1a8ff2SEmmanuel Vadot          3 = 1 ms
173*aa1a8ff2SEmmanuel Vadot          4 = 5 ms
174*aa1a8ff2SEmmanuel Vadot          5 = 10 ms
175*aa1a8ff2SEmmanuel Vadot          6 = 50 ms
176*aa1a8ff2SEmmanuel Vadot          7 = 100 ms
177*aa1a8ff2SEmmanuel Vadot
178*aa1a8ff2SEmmanuel Vadot      st,fraction-z:
179*aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
180*aa1a8ff2SEmmanuel Vadot        enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]
181*aa1a8ff2SEmmanuel Vadot        description: Length of the fractional part in z, recommended is 7
182*aa1a8ff2SEmmanuel Vadot          (fraction-z ([0..7]) = Count of the fractional part)
183*aa1a8ff2SEmmanuel Vadot
184*aa1a8ff2SEmmanuel Vadot      st,i-drive:
185*aa1a8ff2SEmmanuel Vadot        $ref: /schemas/types.yaml#/definitions/uint32
186*aa1a8ff2SEmmanuel Vadot        enum: [ 0, 1 ]
187*aa1a8ff2SEmmanuel Vadot        description: |
188*aa1a8ff2SEmmanuel Vadot          current limit value of the touchscreen drivers
189*aa1a8ff2SEmmanuel Vadot          0 = 20 mA (typical 35 mA max)
190*aa1a8ff2SEmmanuel Vadot          1 = 50 mA (typical 80 mA max)
191*aa1a8ff2SEmmanuel Vadot
192*aa1a8ff2SEmmanuel Vadot    required:
193*aa1a8ff2SEmmanuel Vadot      - compatible
194*aa1a8ff2SEmmanuel Vadot
195*aa1a8ff2SEmmanuel VadotadditionalProperties: false
196*aa1a8ff2SEmmanuel Vadot
197*aa1a8ff2SEmmanuel Vadotrequired:
198*aa1a8ff2SEmmanuel Vadot  - compatible
199*aa1a8ff2SEmmanuel Vadot  - reg
200*aa1a8ff2SEmmanuel Vadot  - interrupts
201*aa1a8ff2SEmmanuel Vadot
202*aa1a8ff2SEmmanuel Vadotexamples:
203*aa1a8ff2SEmmanuel Vadot  - |
204*aa1a8ff2SEmmanuel Vadot    #include <dt-bindings/gpio/gpio.h>
205*aa1a8ff2SEmmanuel Vadot    #include <dt-bindings/interrupt-controller/irq.h>
206*aa1a8ff2SEmmanuel Vadot    #include <dt-bindings/input/input.h>
207*aa1a8ff2SEmmanuel Vadot    i2c {
208*aa1a8ff2SEmmanuel Vadot      #address-cells = <1>;
209*aa1a8ff2SEmmanuel Vadot      #size-cells = <0>;
210*aa1a8ff2SEmmanuel Vadot
211*aa1a8ff2SEmmanuel Vadot      port-expander@43 {
212*aa1a8ff2SEmmanuel Vadot        compatible = "st,stmpe2401";
213*aa1a8ff2SEmmanuel Vadot        reg = <0x43>;
214*aa1a8ff2SEmmanuel Vadot        reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>;
215*aa1a8ff2SEmmanuel Vadot        interrupts = <26 IRQ_TYPE_EDGE_FALLING>;
216*aa1a8ff2SEmmanuel Vadot        interrupt-parent = <&gpio>;
217*aa1a8ff2SEmmanuel Vadot        vcc-supply = <&db8500_vsmps2_reg>;
218*aa1a8ff2SEmmanuel Vadot        vio-supply = <&db8500_vsmps2_reg>;
219*aa1a8ff2SEmmanuel Vadot        wakeup-source;
220*aa1a8ff2SEmmanuel Vadot        st,autosleep-timeout = <1024>;
221*aa1a8ff2SEmmanuel Vadot
222*aa1a8ff2SEmmanuel Vadot        gpio {
223*aa1a8ff2SEmmanuel Vadot          compatible = "st,stmpe-gpio";
224*aa1a8ff2SEmmanuel Vadot          gpio-controller;
225*aa1a8ff2SEmmanuel Vadot          #gpio-cells = <2>;
226*aa1a8ff2SEmmanuel Vadot          interrupt-controller;
227*aa1a8ff2SEmmanuel Vadot          #interrupt-cells = <2>;
228*aa1a8ff2SEmmanuel Vadot          st,norequest-mask = <0xf0f002>;
229*aa1a8ff2SEmmanuel Vadot        };
230*aa1a8ff2SEmmanuel Vadot
231*aa1a8ff2SEmmanuel Vadot        keyboard-controller {
232*aa1a8ff2SEmmanuel Vadot          compatible = "st,stmpe-keypad";
233*aa1a8ff2SEmmanuel Vadot          debounce-interval = <64>;
234*aa1a8ff2SEmmanuel Vadot          st,scan-count = <8>;
235*aa1a8ff2SEmmanuel Vadot          st,no-autorepeat;
236*aa1a8ff2SEmmanuel Vadot          keypad,num-rows = <8>;
237*aa1a8ff2SEmmanuel Vadot          keypad,num-columns = <8>;
238*aa1a8ff2SEmmanuel Vadot          linux,keymap = <
239*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x00, KEY_1)
240*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x01, KEY_2)
241*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x02, KEY_3)
242*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x03, KEY_4)
243*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x04, KEY_5)
244*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x05, KEY_6)
245*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x06, KEY_7)
246*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x07, KEY_8)
247*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x08, KEY_9)
248*aa1a8ff2SEmmanuel Vadot              MATRIX_KEY(0x00, 0x09, KEY_0)
249*aa1a8ff2SEmmanuel Vadot          >;
250*aa1a8ff2SEmmanuel Vadot        };
251*aa1a8ff2SEmmanuel Vadot
252*aa1a8ff2SEmmanuel Vadot        pwm {
253*aa1a8ff2SEmmanuel Vadot          compatible = "st,stmpe-pwm";
254*aa1a8ff2SEmmanuel Vadot          #pwm-cells = <2>;
255*aa1a8ff2SEmmanuel Vadot        };
256*aa1a8ff2SEmmanuel Vadot      };
257*aa1a8ff2SEmmanuel Vadot
258*aa1a8ff2SEmmanuel Vadot      port-expander@41 {
259*aa1a8ff2SEmmanuel Vadot        compatible = "st,stmpe811";
260*aa1a8ff2SEmmanuel Vadot        reg = <0x41>;
261*aa1a8ff2SEmmanuel Vadot        interrupts = <10 IRQ_TYPE_LEVEL_LOW>;
262*aa1a8ff2SEmmanuel Vadot        interrupt-parent = <&gpio>;
263*aa1a8ff2SEmmanuel Vadot        st,adc-freq = <1>;
264*aa1a8ff2SEmmanuel Vadot        st,mod-12b = <1>;
265*aa1a8ff2SEmmanuel Vadot        st,ref-sel = <0>;
266*aa1a8ff2SEmmanuel Vadot        st,sample-time = <4>;
267*aa1a8ff2SEmmanuel Vadot
268*aa1a8ff2SEmmanuel Vadot        adc {
269*aa1a8ff2SEmmanuel Vadot          compatible = "st,stmpe-adc";
270*aa1a8ff2SEmmanuel Vadot          st,norequest-mask = <0x0f>;
271*aa1a8ff2SEmmanuel Vadot          #io-channel-cells = <1>;
272*aa1a8ff2SEmmanuel Vadot        };
273*aa1a8ff2SEmmanuel Vadot
274*aa1a8ff2SEmmanuel Vadot        gpio {
275*aa1a8ff2SEmmanuel Vadot          compatible = "st,stmpe-gpio";
276*aa1a8ff2SEmmanuel Vadot          gpio-controller;
277*aa1a8ff2SEmmanuel Vadot          #gpio-cells = <2>;
278*aa1a8ff2SEmmanuel Vadot          interrupt-controller;
279*aa1a8ff2SEmmanuel Vadot          #interrupt-cells = <2>;
280*aa1a8ff2SEmmanuel Vadot        };
281*aa1a8ff2SEmmanuel Vadot
282*aa1a8ff2SEmmanuel Vadot        pwm {
283*aa1a8ff2SEmmanuel Vadot          compatible = "st,stmpe-pwm";
284*aa1a8ff2SEmmanuel Vadot          #pwm-cells = <2>;
285*aa1a8ff2SEmmanuel Vadot        };
286*aa1a8ff2SEmmanuel Vadot
287*aa1a8ff2SEmmanuel Vadot        touchscreen {
288*aa1a8ff2SEmmanuel Vadot          compatible = "st,stmpe-ts";
289*aa1a8ff2SEmmanuel Vadot          st,ave-ctrl = <3>;
290*aa1a8ff2SEmmanuel Vadot          st,touch-det-delay = <5>;
291*aa1a8ff2SEmmanuel Vadot          st,settling = <3>;
292*aa1a8ff2SEmmanuel Vadot          st,fraction-z = <7>;
293*aa1a8ff2SEmmanuel Vadot          st,i-drive = <1>;
294*aa1a8ff2SEmmanuel Vadot        };
295*aa1a8ff2SEmmanuel Vadot      };
296*aa1a8ff2SEmmanuel Vadot    };
297*aa1a8ff2SEmmanuel Vadot...
298