5b37be0be4e927d297682085f7b00b99ec055b5b
[linux-2.6-microblaze.git] / Documentation / devicetree / bindings / input / fsl,mpr121-touchkey.yaml
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/input/fsl,mpr121-touchkey.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Freescale MPR121 capacitive touch sensor controller
8
9 maintainers:
10   - Dmitry Torokhov <dmitry.torokhov@gmail.com>
11
12 description: |
13   The MPR121 supports up to 12 completely independent electrodes/capacitance
14   sensing inputs in which 8 are multifunctional for LED driving and GPIO.
15   https://www.nxp.com/docs/en/data-sheet/MPR121.pdf
16
17 allOf:
18   - $ref: input.yaml#
19
20 anyOf:
21   - required: [ interrupts ]
22   - required: [ poll-interval ]
23
24 properties:
25   compatible:
26     const: fsl,mpr121-touchkey
27
28   reg:
29     maxItems: 1
30
31   interrupts:
32     maxItems: 1
33
34   vdd-supply:
35     maxItems: 1
36
37   linux,keycodes:
38     minItems: 1
39     maxItems: 12
40
41   wakeup-source:
42     description: Use any event on keypad as wakeup event.
43     type: boolean
44
45 required:
46   - compatible
47   - reg
48   - vdd-supply
49   - linux,keycodes
50
51 examples:
52   - |
53     // Example with interrupts
54     #include "dt-bindings/input/input.h"
55     i2c {
56         #address-cells = <1>;
57         #size-cells = <0>;
58
59         mpr121@5a {
60             compatible = "fsl,mpr121-touchkey";
61             reg = <0x5a>;
62             interrupt-parent = <&gpio1>;
63             interrupts = <28 2>;
64             autorepeat;
65             vdd-supply = <&ldo4_reg>;
66             linux,keycodes = <KEY_0>, <KEY_1>, <KEY_2>, <KEY_3>,
67                              <KEY_4>, <KEY_5>, <KEY_6>, <KEY_7>,
68                              <KEY_8>, <KEY_9>, <KEY_A>, <KEY_B>;
69         };
70     };
71
72   - |
73     // Example with polling
74     #include "dt-bindings/input/input.h"
75     i2c {
76         #address-cells = <1>;
77         #size-cells = <0>;
78
79         mpr121@5a {
80             compatible = "fsl,mpr121-touchkey";
81             reg = <0x5a>;
82             poll-interval = <20>;
83             autorepeat;
84             vdd-supply = <&ldo4_reg>;
85             linux,keycodes = <KEY_0>, <KEY_1>, <KEY_2>, <KEY_3>,
86                              <KEY_4>, <KEY_5>, <KEY_6>, <KEY_7>,
87                              <KEY_8>, <KEY_9>, <KEY_A>, <KEY_B>;
88         };
89     };