Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Input: cyttsp - convert bindings to YAML and extend

This converts the CYTTSP "Cypress TrueTouch Standard Product"
to YAML bindings and fixes and adds some things in the process:

- Rename the bindings file to cypress,cy8ctma340 after the main
product in the series.
- Add proper compatibles for the two known products:
CY8CTMA340 and CY8CTST341.
- Deprecate "cypress,cyttsp-spi" and "cypress,cyttsp-i2c"
because device compatibles should be named after the
hardware and not after which bus they are connected to.
The topology implicitly tells us which bus it is and what
interface to used.
- Add VCPIN and VDD supplies, these are present just like
on the CY8CTMA140.

Reviewed-by: Rob Herring <robh@kernel.org>
Reviewed-by: Javier Martinez Canillas <javier@dowhile0.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
Link: https://lore.kernel.org/r/20210526230352.1433537-1-linus.walleij@linaro.org
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Linus Walleij and committed by
Dmitry Torokhov
4b48d935 fb082cd5

+148 -93
+148
Documentation/devicetree/bindings/input/touchscreen/cypress,cy8ctma340.yaml
··· 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 + 7 + title: Cypress CY8CTMA340 series touchscreen controller bindings 8 + 9 + description: 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 + 13 + maintainers: 14 + - Javier Martinez Canillas <javier@dowhile0.org> 15 + - Linus Walleij <linus.walleij@linaro.org> 16 + 17 + allOf: 18 + - $ref: touchscreen.yaml# 19 + 20 + properties: 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 + 111 + additionalProperties: false 112 + 113 + required: 114 + - compatible 115 + - reg 116 + - interrupts 117 + - bootloader-key 118 + - touchscreen-size-x 119 + - touchscreen-size-y 120 + 121 + examples: 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 + ...
-93
Documentation/devicetree/bindings/input/touchscreen/cyttsp.txt
··· 1 - * Cypress cyttsp touchscreen controller 2 - 3 - Required properties: 4 - - compatible : must be "cypress,cyttsp-i2c" or "cypress,cyttsp-spi" 5 - - reg : Device I2C address or SPI chip select number 6 - - spi-max-frequency : Maximum SPI clocking speed of the device (for cyttsp-spi) 7 - - interrupts : (gpio) interrupt to which the chip is connected 8 - (see interrupt binding[0]). 9 - - bootloader-key : the 8-byte bootloader key that is required to switch 10 - the chip from bootloader mode (default mode) to 11 - application mode. 12 - This property has to be specified as an array of 8 13 - '/bits/ 8' values. 14 - 15 - Optional properties: 16 - - reset-gpios : the reset gpio the chip is connected to 17 - (see GPIO binding[1] for more details). 18 - - touchscreen-size-x : horizontal resolution of touchscreen (in pixels) 19 - - touchscreen-size-y : vertical resolution of touchscreen (in pixels) 20 - - touchscreen-fuzz-x : horizontal noise value of the absolute input device 21 - (in pixels) 22 - - touchscreen-fuzz-y : vertical noise value of the absolute input device 23 - (in pixels) 24 - - active-distance : the distance in pixels beyond which a touch must move 25 - before movement is detected and reported by the device. 26 - Valid values: 0-15. 27 - - active-interval-ms : the minimum period in ms between consecutive 28 - scanning/processing cycles when the chip is in active mode. 29 - Valid values: 0-255. 30 - - lowpower-interval-ms : the minimum period in ms between consecutive 31 - scanning/processing cycles when the chip is in low-power mode. 32 - Valid values: 0-2550 33 - - touch-timeout-ms : minimum time in ms spent in the active power state while no 34 - touches are detected before entering low-power mode. 35 - Valid values: 0-2550 36 - - use-handshake : enable register-based handshake (boolean). This should 37 - only be used if the chip is configured to use 'blocking 38 - communication with timeout' (in this case the device 39 - generates an interrupt at the end of every 40 - scanning/processing cycle). 41 - 42 - [0]: Documentation/devicetree/bindings/interrupt-controller/interrupts.txt 43 - [1]: Documentation/devicetree/bindings/gpio/gpio.txt 44 - 45 - Example: 46 - &i2c1 { 47 - /* ... */ 48 - cyttsp@a { 49 - compatible = "cypress,cyttsp-i2c"; 50 - reg = <0xa>; 51 - interrupt-parent = <&gpio0>; 52 - interrupts = <28 0>; 53 - reset-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>; 54 - 55 - touchscreen-size-x = <800>; 56 - touchscreen-size-y = <480>; 57 - touchscreen-fuzz-x = <4>; 58 - touchscreen-fuzz-y = <7>; 59 - 60 - bootloader-key = /bits/ 8 <0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08>; 61 - active-distance = <8>; 62 - active-interval-ms = <0>; 63 - lowpower-interval-ms = <200>; 64 - touch-timeout-ms = <100>; 65 - }; 66 - 67 - /* ... */ 68 - }; 69 - 70 - &mcspi1 { 71 - /* ... */ 72 - cyttsp@0 { 73 - compatible = "cypress,cyttsp-spi"; 74 - spi-max-frequency = <6000000>; 75 - reg = <0>; 76 - interrupt-parent = <&gpio0>; 77 - interrupts = <28 0>; 78 - reset-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>; 79 - 80 - touchscreen-size-x = <800>; 81 - touchscreen-size-y = <480>; 82 - touchscreen-fuzz-x = <4>; 83 - touchscreen-fuzz-y = <7>; 84 - 85 - bootloader-key = /bits/ 8 <0x01 0x02 0x03 0x04 0x05 0x06 0x07 0x08>; 86 - active-distance = <8>; 87 - active-interval-ms = <0>; 88 - lowpower-interval-ms = <200>; 89 - touch-timeout-ms = <100>; 90 - }; 91 - 92 - /* ... */ 93 - };