1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/input/microchip,cap11xx.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: Microchip CAP11xx based capacitive touch sensors
8
9description: |
10  The Microchip CAP1xxx Family of RightTouchTM multiple-channel capacitive
11  touch controllers and LED drivers. The device communication via I2C only.
12
13maintainers:
14  - Rob Herring <robh@kernel.org>
15
16properties:
17  compatible:
18    enum:
19      - microchip,cap1106
20      - microchip,cap1126
21      - microchip,cap1188
22      - microchip,cap1203
23      - microchip,cap1206
24      - microchip,cap1293
25      - microchip,cap1298
26
27  reg:
28    maxItems: 1
29
30  '#address-cells':
31    const: 1
32
33  '#size-cells':
34    const: 0
35
36  interrupts:
37    maxItems: 1
38    description: |
39      Property describing the interrupt line the
40      device's ALERT#/CM_IRQ# pin is connected to.
41      The device only has one interrupt source.
42
43  autorepeat:
44    description: |
45      Enables the Linux input system's autorepeat feature on the input device.
46
47  linux,keycodes:
48    minItems: 6
49    maxItems: 6
50    description: |
51      Specifies an array of numeric keycode values to
52      be used for the channels. If this property is
53      omitted, KEY_A, KEY_B, etc are used as defaults.
54      The array must have exactly six entries.
55
56  microchip,sensor-gain:
57    $ref: /schemas/types.yaml#/definitions/uint32
58    default: 1
59    enum: [1, 2, 4, 8]
60    description: |
61      Defines the gain of the sensor circuitry. This
62      effectively controls the sensitivity, as a
63      smaller delta capacitance is required to
64      generate the same delta count values.
65
66  microchip,irq-active-high:
67    type: boolean
68    description: |
69      By default the interrupt pin is active low
70      open drain. This property allows using the active
71      high push-pull output.
72
73patternProperties:
74  "^led@[0-7]$":
75    type: object
76    description: CAP11xx LEDs
77    $ref: /schemas/leds/common.yaml#
78
79    properties:
80      reg:
81        enum: [0, 1, 2, 3, 4, 5, 6, 7]
82
83      label: true
84
85      linux,default-trigger: true
86
87      default-state: true
88
89    required:
90      - reg
91
92    additionalProperties: false
93
94allOf:
95  - $ref: input.yaml
96  - if:
97      properties:
98        compatible:
99          contains:
100            enum:
101              - microchip,cap1106
102    then:
103      patternProperties:
104        "^led@[0-7]$": false
105
106required:
107  - compatible
108  - interrupts
109
110additionalProperties: false
111
112examples:
113  - |
114    i2c {
115      #address-cells = <1>;
116      #size-cells = <0>;
117
118      touch@28 {
119        compatible = "microchip,cap1188";
120        interrupt-parent = <&gpio1>;
121        interrupts = <0 0>;
122        reg = <0x28>;
123        autorepeat;
124        microchip,sensor-gain = <2>;
125
126        linux,keycodes = <103>,	/* KEY_UP */
127                         <106>,	/* KEY_RIGHT */
128                         <108>,	/* KEY_DOWN */
129                         <105>,	/* KEY_LEFT */
130                         <109>,	/* KEY_PAGEDOWN */
131                         <104>;	/* KEY_PAGEUP */
132
133        #address-cells = <1>;
134        #size-cells = <0>;
135
136        led@0 {
137                label = "cap11xx:green:usr0";
138                reg = <0>;
139        };
140
141        led@1 {
142                label = "cap11xx:green:usr1";
143                reg = <1>;
144        };
145
146        led@2 {
147                label = "cap11xx:green:alive";
148                reg = <2>;
149                linux,default-trigger = "heartbeat";
150        };
151      };
152    };
153