298 lines · yaml
1# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)2%YAML 1.23---4$id: http://devicetree.org/schemas/mfd/st,stmpe.yaml#5$schema: http://devicetree.org/meta-schemas/core.yaml#6 7title: STMicroelectonics Port Expander (STMPE)8 9description: STMicroelectronics Port Expander (STMPE) is a series of slow10 bus controllers for various expanded peripherals such as GPIO, keypad,11 touchscreen, ADC, PWM or rotator. It can contain one or several different12 peripherals connected to SPI or I2C.13 14maintainers:15 - Linus Walleij <linus.walleij@linaro.org>16 17allOf:18 - $ref: /schemas/spi/spi-peripheral-props.yaml#19 20properties:21 compatible:22 enum:23 - st,stmpe60124 - st,stmpe80125 - st,stmpe81126 - st,stmpe160027 - st,stmpe160128 - st,stmpe240129 - st,stmpe240330 31 reg:32 maxItems: 133 34 interrupts:35 maxItems: 136 37 vcc-supply: true38 39 vio-supply: true40 41 reset-gpios:42 maxItems: 143 44 wakeup-source: true45 46 st,autosleep-timeout:47 $ref: /schemas/types.yaml#/definitions/uint3248 enum: [ 4, 16, 32, 64, 128, 256, 512, 1024 ]49 description: Time idle before going to automatic sleep to save power50 51 st,sample-time:52 $ref: /schemas/types.yaml#/definitions/uint3253 enum: [ 0, 1, 2, 3, 4, 5, 6 ]54 description: |55 Sample time per iteration56 0 = 36 clock ticks57 1 = 44 clock ticks58 2 = 56 clock ticks59 3 = 64 clock ticks60 4 = 80 clock ticks - recommended61 5 = 96 clock ticks62 6 = 124 clock ticks63 64 st,mod-12b:65 $ref: /schemas/types.yaml#/definitions/uint3266 enum: [ 0, 1 ]67 description: ADC bit mode 0 = 10bit ADC, 1 = 12bit ADC68 69 st,ref-sel:70 $ref: /schemas/types.yaml#/definitions/uint3271 enum: [ 0, 1 ]72 description: ADC reference source 0 = internal, 1 = external73 74 st,adc-freq:75 $ref: /schemas/types.yaml#/definitions/uint3276 enum: [ 0, 1, 2, 3 ]77 description: |78 ADC clock speed79 0 = 1.625 MHz80 1 = 3.25 MHz81 2, 3 = 6.5 MHz82 83 adc:84 type: object85 $ref: /schemas/iio/adc/st,stmpe-adc.yaml#86 87 gpio:88 type: object89 $ref: /schemas/gpio/st,stmpe-gpio.yaml#90 91 keyboard-controller:92 type: object93 $ref: /schemas/input/matrix-keymap.yaml#94 95 unevaluatedProperties: false96 97 properties:98 compatible:99 const: st,stmpe-keypad100 101 debounce-interval:102 description: Debouncing interval in milliseconds103 $ref: /schemas/types.yaml#/definitions/uint32104 105 st,no-autorepeat:106 description: If present, the keys will not autorepeat when pressed107 $ref: /schemas/types.yaml#/definitions/flag108 109 st,scan-count:110 description: Scanning cycles elapsed before key data is updated111 $ref: /schemas/types.yaml#/definitions/uint32112 113 required:114 - compatible115 - linux,keymap116 117 pwm:118 type: object119 $ref: /schemas/pwm/pwm.yaml#120 121 unevaluatedProperties: false122 123 properties:124 compatible:125 const: st,stmpe-pwm126 127 "#pwm-cells":128 const: 2129 130 touchscreen:131 type: object132 $ref: /schemas/input/touchscreen/touchscreen.yaml#133 134 unevaluatedProperties: false135 136 properties:137 compatible:138 const: st,stmpe-ts139 140 st,ave-ctrl:141 $ref: /schemas/types.yaml#/definitions/uint32142 enum: [ 0, 1, 2, 3 ]143 description: |144 Sample average control145 0 = 1 sample146 1 = 2 samples147 2 = 4 samples148 3 = 8 samples149 150 st,touch-det-delay:151 $ref: /schemas/types.yaml#/definitions/uint32152 enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]153 description: |154 Touch detection delay155 0 = 10 us156 1 = 50 us157 2 = 100 us158 3 = 500 us - recommended159 4 = 1 ms160 5 = 5 ms161 6 = 10 ms162 7 = 50 ms163 164 st,settling:165 $ref: /schemas/types.yaml#/definitions/uint32166 enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]167 description: |168 Panel driver settling time169 0 = 10 us170 1 = 100 us171 2 = 500 us - recommended172 3 = 1 ms173 4 = 5 ms174 5 = 10 ms175 6 = 50 ms176 7 = 100 ms177 178 st,fraction-z:179 $ref: /schemas/types.yaml#/definitions/uint32180 enum: [ 0, 1, 2, 3, 4, 5, 6, 7 ]181 description: Length of the fractional part in z, recommended is 7182 (fraction-z ([0..7]) = Count of the fractional part)183 184 st,i-drive:185 $ref: /schemas/types.yaml#/definitions/uint32186 enum: [ 0, 1 ]187 description: |188 current limit value of the touchscreen drivers189 0 = 20 mA (typical 35 mA max)190 1 = 50 mA (typical 80 mA max)191 192 required:193 - compatible194 195additionalProperties: false196 197required:198 - compatible199 - reg200 - interrupts201 202examples:203 - |204 #include <dt-bindings/gpio/gpio.h>205 #include <dt-bindings/interrupt-controller/irq.h>206 #include <dt-bindings/input/input.h>207 i2c {208 #address-cells = <1>;209 #size-cells = <0>;210 211 port-expander@43 {212 compatible = "st,stmpe2401";213 reg = <0x43>;214 reset-gpios = <&gpio 13 GPIO_ACTIVE_LOW>;215 interrupts = <26 IRQ_TYPE_EDGE_FALLING>;216 interrupt-parent = <&gpio>;217 vcc-supply = <&db8500_vsmps2_reg>;218 vio-supply = <&db8500_vsmps2_reg>;219 wakeup-source;220 st,autosleep-timeout = <1024>;221 222 gpio {223 compatible = "st,stmpe-gpio";224 gpio-controller;225 #gpio-cells = <2>;226 interrupt-controller;227 #interrupt-cells = <2>;228 st,norequest-mask = <0xf0f002>;229 };230 231 keyboard-controller {232 compatible = "st,stmpe-keypad";233 debounce-interval = <64>;234 st,scan-count = <8>;235 st,no-autorepeat;236 keypad,num-rows = <8>;237 keypad,num-columns = <8>;238 linux,keymap = <239 MATRIX_KEY(0x00, 0x00, KEY_1)240 MATRIX_KEY(0x00, 0x01, KEY_2)241 MATRIX_KEY(0x00, 0x02, KEY_3)242 MATRIX_KEY(0x00, 0x03, KEY_4)243 MATRIX_KEY(0x00, 0x04, KEY_5)244 MATRIX_KEY(0x00, 0x05, KEY_6)245 MATRIX_KEY(0x00, 0x06, KEY_7)246 MATRIX_KEY(0x00, 0x07, KEY_8)247 MATRIX_KEY(0x00, 0x08, KEY_9)248 MATRIX_KEY(0x00, 0x09, KEY_0)249 >;250 };251 252 pwm {253 compatible = "st,stmpe-pwm";254 #pwm-cells = <2>;255 };256 };257 258 port-expander@41 {259 compatible = "st,stmpe811";260 reg = <0x41>;261 interrupts = <10 IRQ_TYPE_LEVEL_LOW>;262 interrupt-parent = <&gpio>;263 st,adc-freq = <1>;264 st,mod-12b = <1>;265 st,ref-sel = <0>;266 st,sample-time = <4>;267 268 adc {269 compatible = "st,stmpe-adc";270 st,norequest-mask = <0x0f>;271 #io-channel-cells = <1>;272 };273 274 gpio {275 compatible = "st,stmpe-gpio";276 gpio-controller;277 #gpio-cells = <2>;278 interrupt-controller;279 #interrupt-cells = <2>;280 };281 282 pwm {283 compatible = "st,stmpe-pwm";284 #pwm-cells = <2>;285 };286 287 touchscreen {288 compatible = "st,stmpe-ts";289 st,ave-ctrl = <3>;290 st,touch-det-delay = <5>;291 st,settling = <3>;292 st,fraction-z = <7>;293 st,i-drive = <1>;294 };295 };296 };297...298