1*8cc087a1SEmmanuel Vadot# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
2*8cc087a1SEmmanuel Vadot%YAML 1.2
3*8cc087a1SEmmanuel Vadot---
4*8cc087a1SEmmanuel Vadot$id: http://devicetree.org/schemas/input/touchscreen/ti,am3359-tsc.yaml#
5*8cc087a1SEmmanuel Vadot$schema: http://devicetree.org/meta-schemas/core.yaml#
6*8cc087a1SEmmanuel Vadot
7*8cc087a1SEmmanuel Vadottitle: TI AM3359 Touchscreen controller
8*8cc087a1SEmmanuel Vadot
9*8cc087a1SEmmanuel Vadotmaintainers:
10*8cc087a1SEmmanuel Vadot  - Miquel Raynal <miquel.raynal@bootlin.com>
11*8cc087a1SEmmanuel Vadot
12*8cc087a1SEmmanuel Vadotproperties:
13*8cc087a1SEmmanuel Vadot  compatible:
14*8cc087a1SEmmanuel Vadot    const: ti,am3359-tsc
15*8cc087a1SEmmanuel Vadot
16*8cc087a1SEmmanuel Vadot  ti,wires:
17*8cc087a1SEmmanuel Vadot    description: Wires refer to application modes i.e. 4/5/8 wire touchscreen
18*8cc087a1SEmmanuel Vadot      support on the platform.
19*8cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
20*8cc087a1SEmmanuel Vadot    enum: [4, 5, 8]
21*8cc087a1SEmmanuel Vadot
22*8cc087a1SEmmanuel Vadot  ti,x-plate-resistance:
23*8cc087a1SEmmanuel Vadot    description: X plate resistance
24*8cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
25*8cc087a1SEmmanuel Vadot
26*8cc087a1SEmmanuel Vadot  ti,coordinate-readouts:
27*8cc087a1SEmmanuel Vadot    description: The sequencer supports a total of 16 programmable steps. Each
28*8cc087a1SEmmanuel Vadot      step is used to read a single coordinate. A single readout is enough but
29*8cc087a1SEmmanuel Vadot      multiple reads can increase the quality. A value of 5 means, 5 reads for
30*8cc087a1SEmmanuel Vadot      X, 5 for Y and 2 for Z (always). This utilises 12 of the 16 software steps
31*8cc087a1SEmmanuel Vadot      available. The remaining 4 can be used by the ADC.
32*8cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
33*8cc087a1SEmmanuel Vadot    minimum: 1
34*8cc087a1SEmmanuel Vadot    maximum: 6
35*8cc087a1SEmmanuel Vadot
36*8cc087a1SEmmanuel Vadot  ti,wire-config:
37*8cc087a1SEmmanuel Vadot    description: Different boards could have a different order for connecting
38*8cc087a1SEmmanuel Vadot      wires on touchscreen. We need to provide an 8-bit number where the
39*8cc087a1SEmmanuel Vadot      first four bits represent the analog lines and the next 4 bits represent
40*8cc087a1SEmmanuel Vadot      positive/negative terminal on that input line. Notations to represent the
41*8cc087a1SEmmanuel Vadot      input lines and terminals respectively are as follows, AIN0 = 0, AIN1 = 1
42*8cc087a1SEmmanuel Vadot      and so on until AIN7 = 7. XP = 0, XN = 1, YP = 2, YN = 3.
43*8cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32-array
44*8cc087a1SEmmanuel Vadot    minItems: 4
45*8cc087a1SEmmanuel Vadot    maxItems: 8
46*8cc087a1SEmmanuel Vadot
47*8cc087a1SEmmanuel Vadot  ti,charge-delay:
48*8cc087a1SEmmanuel Vadot    description: Length of touch screen charge delay step in terms of ADC clock
49*8cc087a1SEmmanuel Vadot      cycles. Charge delay value should be large in order to avoid false pen-up
50*8cc087a1SEmmanuel Vadot      events. This value effects the overall sampling speed, hence need to be
51*8cc087a1SEmmanuel Vadot      kept as low as possible, while avoiding false pen-up event. Start from a
52*8cc087a1SEmmanuel Vadot      lower value, say 0x400, and increase value until false pen-up events are
53*8cc087a1SEmmanuel Vadot      avoided. The pen-up detection happens immediately after the charge step,
54*8cc087a1SEmmanuel Vadot      so this does in fact function as a hardware knob for adjusting the amount
55*8cc087a1SEmmanuel Vadot      of "settling time".
56*8cc087a1SEmmanuel Vadot    $ref: /schemas/types.yaml#/definitions/uint32
57*8cc087a1SEmmanuel Vadot
58*8cc087a1SEmmanuel Vadotrequired:
59*8cc087a1SEmmanuel Vadot  - compatible
60*8cc087a1SEmmanuel Vadot  - ti,wires
61*8cc087a1SEmmanuel Vadot  - ti,x-plate-resistance
62*8cc087a1SEmmanuel Vadot  - ti,coordinate-readouts
63*8cc087a1SEmmanuel Vadot  - ti,wire-config
64*8cc087a1SEmmanuel Vadot
65*8cc087a1SEmmanuel VadotadditionalProperties: false
66*8cc087a1SEmmanuel Vadot
67*8cc087a1SEmmanuel Vadotexamples:
68*8cc087a1SEmmanuel Vadot  - |
69*8cc087a1SEmmanuel Vadot    tsc {
70*8cc087a1SEmmanuel Vadot        compatible = "ti,am3359-tsc";
71*8cc087a1SEmmanuel Vadot        ti,wires = <4>;
72*8cc087a1SEmmanuel Vadot        ti,x-plate-resistance = <200>;
73*8cc087a1SEmmanuel Vadot        ti,coordinate-readouts = <5>;
74*8cc087a1SEmmanuel Vadot        ti,wire-config = <0x00 0x11 0x22 0x33>;
75*8cc087a1SEmmanuel Vadot        ti,charge-delay = <0x400>;
76*8cc087a1SEmmanuel Vadot    };
77