1*b2d2a78aSEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) 2*b2d2a78aSEmmanuel Vadot%YAML 1.2 3*b2d2a78aSEmmanuel Vadot--- 4*b2d2a78aSEmmanuel Vadot$id: http://devicetree.org/schemas/input/touchscreen/adi,ad7879.yaml# 5*b2d2a78aSEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml# 6*b2d2a78aSEmmanuel Vadot 7*b2d2a78aSEmmanuel Vadottitle: Analog Devices AD7879(-1)/AD7889(-1) touchscreen interface (SPI/I2C) 8*b2d2a78aSEmmanuel Vadot 9*b2d2a78aSEmmanuel Vadotmaintainers: 10*b2d2a78aSEmmanuel Vadot - Frank Li <Frank.Li@nxp.com> 11*b2d2a78aSEmmanuel Vadot 12*b2d2a78aSEmmanuel Vadotproperties: 13*b2d2a78aSEmmanuel Vadot compatible: 14*b2d2a78aSEmmanuel Vadot description: | 15*b2d2a78aSEmmanuel Vadot for SPI slave, use "adi,ad7879" 16*b2d2a78aSEmmanuel Vadot for I2C slave, use "adi,ad7879-1" 17*b2d2a78aSEmmanuel Vadot enum: 18*b2d2a78aSEmmanuel Vadot - adi,ad7879 19*b2d2a78aSEmmanuel Vadot - adi,ad7879-1 20*b2d2a78aSEmmanuel Vadot 21*b2d2a78aSEmmanuel Vadot reg: 22*b2d2a78aSEmmanuel Vadot maxItems: 1 23*b2d2a78aSEmmanuel Vadot 24*b2d2a78aSEmmanuel Vadot interrupts: 25*b2d2a78aSEmmanuel Vadot maxItems: 1 26*b2d2a78aSEmmanuel Vadot 27*b2d2a78aSEmmanuel Vadot touchscreen-max-pressure: 28*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 29*b2d2a78aSEmmanuel Vadot description: maximum reported pressure 30*b2d2a78aSEmmanuel Vadot 31*b2d2a78aSEmmanuel Vadot adi,resistance-plate-x: 32*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint32 33*b2d2a78aSEmmanuel Vadot description: total resistance of X-plate (for pressure calculation) 34*b2d2a78aSEmmanuel Vadot 35*b2d2a78aSEmmanuel Vadot touchscreen-swapped-x-y: 36*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/flag 37*b2d2a78aSEmmanuel Vadot description: X and Y axis are swapped (boolean) 38*b2d2a78aSEmmanuel Vadot 39*b2d2a78aSEmmanuel Vadot adi,first-conversion-delay: 40*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint8 41*b2d2a78aSEmmanuel Vadot default: 0 42*b2d2a78aSEmmanuel Vadot minimum: 0 43*b2d2a78aSEmmanuel Vadot maximum: 15 44*b2d2a78aSEmmanuel Vadot description: | 45*b2d2a78aSEmmanuel Vadot 0-12: In 128us steps (starting with 128us) 46*b2d2a78aSEmmanuel Vadot 13 : 2.560ms 47*b2d2a78aSEmmanuel Vadot 14 : 3.584ms 48*b2d2a78aSEmmanuel Vadot 15 : 4.096ms 49*b2d2a78aSEmmanuel Vadot This property has to be a '/bits/ 8' value 50*b2d2a78aSEmmanuel Vadot 51*b2d2a78aSEmmanuel Vadot adi,acquisition-time: 52*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint8 53*b2d2a78aSEmmanuel Vadot default: 0 54*b2d2a78aSEmmanuel Vadot enum: [0, 1, 2, 3] 55*b2d2a78aSEmmanuel Vadot description: | 56*b2d2a78aSEmmanuel Vadot 0: 2us 57*b2d2a78aSEmmanuel Vadot 1: 4us 58*b2d2a78aSEmmanuel Vadot 2: 8us 59*b2d2a78aSEmmanuel Vadot 3: 16us 60*b2d2a78aSEmmanuel Vadot This property has to be a '/bits/ 8' value 61*b2d2a78aSEmmanuel Vadot 62*b2d2a78aSEmmanuel Vadot adi,median-filter-size: 63*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint8 64*b2d2a78aSEmmanuel Vadot default: 0 65*b2d2a78aSEmmanuel Vadot enum: [0, 1, 2, 3] 66*b2d2a78aSEmmanuel Vadot description: | 67*b2d2a78aSEmmanuel Vadot 0: disabled 68*b2d2a78aSEmmanuel Vadot 1: 4 measurements 69*b2d2a78aSEmmanuel Vadot 2: 8 measurements 70*b2d2a78aSEmmanuel Vadot 3: 16 measurements 71*b2d2a78aSEmmanuel Vadot This property has to be a '/bits/ 8' value 72*b2d2a78aSEmmanuel Vadot 73*b2d2a78aSEmmanuel Vadot adi,averaging: 74*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint8 75*b2d2a78aSEmmanuel Vadot default: 0 76*b2d2a78aSEmmanuel Vadot enum: [0, 1, 2, 3] 77*b2d2a78aSEmmanuel Vadot description: | 78*b2d2a78aSEmmanuel Vadot 0: 2 middle values (1 if median disabled) 79*b2d2a78aSEmmanuel Vadot 1: 4 middle values 80*b2d2a78aSEmmanuel Vadot 2: 8 middle values 81*b2d2a78aSEmmanuel Vadot 3: 16 values 82*b2d2a78aSEmmanuel Vadot This property has to be a '/bits/ 8' value 83*b2d2a78aSEmmanuel Vadot 84*b2d2a78aSEmmanuel Vadot adi,conversion-interval: 85*b2d2a78aSEmmanuel Vadot $ref: /schemas/types.yaml#/definitions/uint8 86*b2d2a78aSEmmanuel Vadot default: 0 87*b2d2a78aSEmmanuel Vadot description: | 88*b2d2a78aSEmmanuel Vadot 0 : convert one time only 89*b2d2a78aSEmmanuel Vadot 1-255: 515us + val * 35us (up to 9.440ms) 90*b2d2a78aSEmmanuel Vadot This property has to be a '/bits/ 8' value 91*b2d2a78aSEmmanuel Vadot 92*b2d2a78aSEmmanuel Vadot gpio-controller: true 93*b2d2a78aSEmmanuel Vadot 94*b2d2a78aSEmmanuel Vadot "#gpio-cells": 95*b2d2a78aSEmmanuel Vadot const: 1 96*b2d2a78aSEmmanuel Vadot 97*b2d2a78aSEmmanuel Vadotrequired: 98*b2d2a78aSEmmanuel Vadot - compatible 99*b2d2a78aSEmmanuel Vadot - reg 100*b2d2a78aSEmmanuel Vadot 101*b2d2a78aSEmmanuel VadotallOf: 102*b2d2a78aSEmmanuel Vadot - $ref: /schemas/spi/spi-peripheral-props.yaml 103*b2d2a78aSEmmanuel Vadot 104*b2d2a78aSEmmanuel VadotunevaluatedProperties: false 105*b2d2a78aSEmmanuel Vadot 106*b2d2a78aSEmmanuel Vadotexamples: 107*b2d2a78aSEmmanuel Vadot - | 108*b2d2a78aSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 109*b2d2a78aSEmmanuel Vadot i2c { 110*b2d2a78aSEmmanuel Vadot #address-cells = <1>; 111*b2d2a78aSEmmanuel Vadot #size-cells = <0>; 112*b2d2a78aSEmmanuel Vadot 113*b2d2a78aSEmmanuel Vadot touchscreen0@2c { 114*b2d2a78aSEmmanuel Vadot compatible = "adi,ad7879-1"; 115*b2d2a78aSEmmanuel Vadot reg = <0x2c>; 116*b2d2a78aSEmmanuel Vadot interrupt-parent = <&gpio1>; 117*b2d2a78aSEmmanuel Vadot interrupts = <13 IRQ_TYPE_EDGE_FALLING>; 118*b2d2a78aSEmmanuel Vadot touchscreen-max-pressure = <4096>; 119*b2d2a78aSEmmanuel Vadot adi,resistance-plate-x = <120>; 120*b2d2a78aSEmmanuel Vadot adi,first-conversion-delay = /bits/ 8 <3>; 121*b2d2a78aSEmmanuel Vadot adi,acquisition-time = /bits/ 8 <1>; 122*b2d2a78aSEmmanuel Vadot adi,median-filter-size = /bits/ 8 <2>; 123*b2d2a78aSEmmanuel Vadot adi,averaging = /bits/ 8 <1>; 124*b2d2a78aSEmmanuel Vadot adi,conversion-interval = /bits/ 8 <255>; 125*b2d2a78aSEmmanuel Vadot }; 126*b2d2a78aSEmmanuel Vadot }; 127*b2d2a78aSEmmanuel Vadot 128*b2d2a78aSEmmanuel Vadot - | 129*b2d2a78aSEmmanuel Vadot #include <dt-bindings/interrupt-controller/irq.h> 130*b2d2a78aSEmmanuel Vadot spi { 131*b2d2a78aSEmmanuel Vadot #address-cells = <1>; 132*b2d2a78aSEmmanuel Vadot #size-cells = <0>; 133*b2d2a78aSEmmanuel Vadot 134*b2d2a78aSEmmanuel Vadot touchscreen1@1 { 135*b2d2a78aSEmmanuel Vadot compatible = "adi,ad7879"; 136*b2d2a78aSEmmanuel Vadot reg = <1>; 137*b2d2a78aSEmmanuel Vadot spi-max-frequency = <5000000>; 138*b2d2a78aSEmmanuel Vadot gpio-controller; 139*b2d2a78aSEmmanuel Vadot #gpio-cells = <1>; 140*b2d2a78aSEmmanuel Vadot interrupt-parent = <&gpio1>; 141*b2d2a78aSEmmanuel Vadot interrupts = <13 IRQ_TYPE_EDGE_FALLING>; 142*b2d2a78aSEmmanuel Vadot touchscreen-max-pressure = <4096>; 143*b2d2a78aSEmmanuel Vadot adi,resistance-plate-x = <120>; 144*b2d2a78aSEmmanuel Vadot adi,first-conversion-delay = /bits/ 8 <3>; 145*b2d2a78aSEmmanuel Vadot adi,acquisition-time = /bits/ 8 <1>; 146*b2d2a78aSEmmanuel Vadot adi,median-filter-size = /bits/ 8 <2>; 147*b2d2a78aSEmmanuel Vadot adi,averaging = /bits/ 8 <1>; 148*b2d2a78aSEmmanuel Vadot adi,conversion-interval = /bits/ 8 <255>; 149*b2d2a78aSEmmanuel Vadot }; 150*b2d2a78aSEmmanuel Vadot }; 151