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