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

dt-bindings: input: touchscreen: convert ad7879 to yaml format

Convert binding doc ad7879.txt to yaml format.
Additional change:
- Add ref to /schemas/spi/spi-peripheral-props.yaml
- Add #gpio-cell
- Remove spi-cpol and spi-cpha in example, the place hold 'spi' can't
correct detect spi-controler.yaml. So these two properties can't
be recongnized.

Fix warning:
arch/arm64/boot/dts/freescale/imx8dx-colibri-aster.dtb:
/bus@5a000000/i2c@5a800000/touchscreen@2c: failed to match any schema with compatible: ['adi,ad7879-1']

Signed-off-by: Frank Li <Frank.Li@nxp.com>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
Link: https://lore.kernel.org/r/20240810143840.3615450-1-Frank.Li@nxp.com
Signed-off-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>

authored by

Frank Li and committed by
Dmitry Torokhov
4e12e550 25162a4f

+150 -71
-71
Documentation/devicetree/bindings/input/touchscreen/ad7879.txt
··· 1 - * Analog Devices AD7879(-1)/AD7889(-1) touchscreen interface (SPI/I2C) 2 - 3 - Required properties: 4 - - compatible : for SPI slave, use "adi,ad7879" 5 - for I2C slave, use "adi,ad7879-1" 6 - - reg : SPI chipselect/I2C slave address 7 - See spi-bus.txt for more SPI slave properties 8 - - interrupts : touch controller interrupt 9 - - touchscreen-max-pressure : maximum reported pressure 10 - - adi,resistance-plate-x : total resistance of X-plate (for pressure 11 - calculation) 12 - Optional properties: 13 - - touchscreen-swapped-x-y : X and Y axis are swapped (boolean) 14 - - adi,first-conversion-delay : 0-12: In 128us steps (starting with 128us) 15 - 13 : 2.560ms 16 - 14 : 3.584ms 17 - 15 : 4.096ms 18 - This property has to be a '/bits/ 8' value 19 - - adi,acquisition-time : 0: 2us 20 - 1: 4us 21 - 2: 8us 22 - 3: 16us 23 - This property has to be a '/bits/ 8' value 24 - - adi,median-filter-size : 0: disabled 25 - 1: 4 measurements 26 - 2: 8 measurements 27 - 3: 16 measurements 28 - This property has to be a '/bits/ 8' value 29 - - adi,averaging : 0: 2 middle values (1 if median disabled) 30 - 1: 4 middle values 31 - 2: 8 middle values 32 - 3: 16 values 33 - This property has to be a '/bits/ 8' value 34 - - adi,conversion-interval: : 0 : convert one time only 35 - 1-255: 515us + val * 35us (up to 9.440ms) 36 - This property has to be a '/bits/ 8' value 37 - - gpio-controller : Switch AUX/VBAT/GPIO pin to GPIO mode 38 - 39 - Example: 40 - 41 - touchscreen0@2c { 42 - compatible = "adi,ad7879-1"; 43 - reg = <0x2c>; 44 - interrupt-parent = <&gpio1>; 45 - interrupts = <13 IRQ_TYPE_EDGE_FALLING>; 46 - touchscreen-max-pressure = <4096>; 47 - adi,resistance-plate-x = <120>; 48 - adi,first-conversion-delay = /bits/ 8 <3>; 49 - adi,acquisition-time = /bits/ 8 <1>; 50 - adi,median-filter-size = /bits/ 8 <2>; 51 - adi,averaging = /bits/ 8 <1>; 52 - adi,conversion-interval = /bits/ 8 <255>; 53 - }; 54 - 55 - touchscreen1@1 { 56 - compatible = "adi,ad7879"; 57 - spi-max-frequency = <5000000>; 58 - reg = <1>; 59 - spi-cpol; 60 - spi-cpha; 61 - gpio-controller; 62 - interrupt-parent = <&gpio1>; 63 - interrupts = <13 IRQ_TYPE_EDGE_FALLING>; 64 - touchscreen-max-pressure = <4096>; 65 - adi,resistance-plate-x = <120>; 66 - adi,first-conversion-delay = /bits/ 8 <3>; 67 - adi,acquisition-time = /bits/ 8 <1>; 68 - adi,median-filter-size = /bits/ 8 <2>; 69 - adi,averaging = /bits/ 8 <1>; 70 - adi,conversion-interval = /bits/ 8 <255>; 71 - };
+150
Documentation/devicetree/bindings/input/touchscreen/adi,ad7879.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/adi,ad7879.yaml# 5 + $schema: http://devicetree.org/meta-schemas/core.yaml# 6 + 7 + title: Analog Devices AD7879(-1)/AD7889(-1) touchscreen interface (SPI/I2C) 8 + 9 + maintainers: 10 + - Frank Li <Frank.Li@nxp.com> 11 + 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 20 + 21 + reg: 22 + maxItems: 1 23 + 24 + interrupts: 25 + maxItems: 1 26 + 27 + touchscreen-max-pressure: 28 + $ref: /schemas/types.yaml#/definitions/uint32 29 + description: maximum reported pressure 30 + 31 + adi,resistance-plate-x: 32 + $ref: /schemas/types.yaml#/definitions/uint32 33 + description: total resistance of X-plate (for pressure calculation) 34 + 35 + touchscreen-swapped-x-y: 36 + $ref: /schemas/types.yaml#/definitions/flag 37 + description: X and Y axis are swapped (boolean) 38 + 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 50 + 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 61 + 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 72 + 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 83 + 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 91 + 92 + gpio-controller: true 93 + 94 + "#gpio-cells": 95 + const: 1 96 + 97 + required: 98 + - compatible 99 + - reg 100 + 101 + allOf: 102 + - $ref: /schemas/spi/spi-peripheral-props.yaml 103 + 104 + unevaluatedProperties: false 105 + 106 + examples: 107 + - | 108 + #include <dt-bindings/interrupt-controller/irq.h> 109 + i2c { 110 + #address-cells = <1>; 111 + #size-cells = <0>; 112 + 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 + }; 127 + 128 + - | 129 + #include <dt-bindings/interrupt-controller/irq.h> 130 + spi { 131 + #address-cells = <1>; 132 + #size-cells = <0>; 133 + 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 + };