xref: /linux/Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma340.yaml (revision 164666fa66669d437bdcc8d5f1744a2aee73be41)
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/cypress,cy8ctma340.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Cypress CY8CTMA340 series touchscreen controller bindings
8
9description: The Cypress CY8CTMA340 series (also known as "CYTTSP" after
10  the marketing name Cypress TrueTouch Standard Product) touchscreens can
11  be connected to either I2C or SPI buses.
12
13maintainers:
14  - Javier Martinez Canillas <javier@dowhile0.org>
15  - Linus Walleij <linus.walleij@linaro.org>
16
17allOf:
18  - $ref: touchscreen.yaml#
19
20properties:
21  $nodename:
22    pattern: "^touchscreen(@.*)?$"
23
24  compatible:
25    oneOf:
26      - const: cypress,cy8ctma340
27      - const: cypress,cy8ctst341
28      - const: cypress,cyttsp-spi
29        description: Legacy compatible for SPI connected CY8CTMA340
30        deprecated: true
31      - const: cypress,cyttsp-i2c
32        description: Legacy compatible for I2C connected CY8CTMA340
33        deprecated: true
34
35  reg:
36    description: I2C address when used on the I2C bus, or the SPI chip
37      select index when used on the SPI bus
38
39  clock-frequency:
40    description: I2C client clock frequency, defined for host when using
41      the device on the I2C bus
42    minimum: 0
43    maximum: 400000
44
45  spi-max-frequency:
46    description: SPI clock frequency, defined for host, defined when using
47      the device on the SPI bus. The throughput is maximum 2 Mbps so the
48      typical value is 2000000, if higher rates are used the total throughput
49      needs to be restricted to 2 Mbps.
50    minimum: 0
51    maximum: 6000000
52
53  interrupts:
54    description: Interrupt to host
55    maxItems: 1
56
57  vcpin-supply:
58    description: Analog power supply regulator on VCPIN pin
59
60  vdd-supply:
61    description: Digital power supply regulator on VDD pin
62
63  reset-gpios:
64    description: Reset line for the touchscreen, should be tagged
65      as GPIO_ACTIVE_LOW
66
67  bootloader-key:
68    description: the 8-byte bootloader key that is required to switch
69      the chip from bootloader mode (default mode) to application mode
70    $ref: /schemas/types.yaml#/definitions/uint8-array
71    minItems: 8
72    maxItems: 8
73
74  touchscreen-size-x: true
75  touchscreen-size-y: true
76  touchscreen-fuzz-x: true
77  touchscreen-fuzz-y: true
78
79  active-distance:
80    description: the distance in pixels beyond which a touch must move
81      before movement is detected and reported by the device
82    $ref: /schemas/types.yaml#/definitions/uint32
83    minimum: 0
84    maximum: 15
85
86  active-interval-ms:
87    description: the minimum period in ms between consecutive
88      scanning/processing cycles when the chip is in active mode
89    minimum: 0
90    maximum: 255
91
92  lowpower-interval-ms:
93    description: the minimum period in ms between consecutive
94      scanning/processing cycles when the chip is in low-power mode
95    minimum: 0
96    maximum: 2550
97
98  touch-timeout-ms:
99    description: minimum time in ms spent in the active power state while no
100      touches are detected before entering low-power mode
101    minimum: 0
102    maximum: 2550
103
104  use-handshake:
105    description: enable register-based handshake (boolean). This should only
106      be used if the chip is configured to use 'blocking communication with
107      timeout' (in this case the device generates an interrupt at the end of
108      every scanning/processing cycle)
109    $ref: /schemas/types.yaml#/definitions/flag
110
111additionalProperties: false
112
113required:
114  - compatible
115  - reg
116  - interrupts
117  - bootloader-key
118  - touchscreen-size-x
119  - touchscreen-size-y
120
121examples:
122  - |
123    #include <dt-bindings/interrupt-controller/irq.h>
124    #include <dt-bindings/gpio/gpio.h>
125    spi {
126      #address-cells = <1>;
127      #size-cells = <0>;
128      num-cs = <1>;
129      cs-gpios = <&gpio 2 GPIO_ACTIVE_HIGH>;
130
131      touchscreen@0 {
132        compatible = "cypress,cy8ctma340";
133        reg = <0>;
134        interrupt-parent = <&gpio>;
135        interrupts = <20 IRQ_TYPE_EDGE_FALLING>;
136        reset-gpios = <&gpio 21 GPIO_ACTIVE_LOW>;
137        vdd-supply = <&ldo_aux1_reg>;
138        vcpin-supply = <&ldo_aux2_reg>;
139        bootloader-key = /bits/ 8 <0x00 0x01 0x02 0x03 0x04 0x05 0x06 0x07>;
140        touchscreen-size-x = <480>;
141        touchscreen-size-y = <800>;
142        active-interval-ms = <0>;
143        touch-timeout-ms = <255>;
144        lowpower-interval-ms = <10>;
145      };
146    };
147
148...
149