xref: /linux/Documentation/devicetree/bindings/input/mediatek,pmic-keys.yaml (revision bba2c3615bd6cfee7456d1130f2e6b01b3f4e9ba)
1# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2%YAML 1.2
3---
4$id: http://devicetree.org/schemas/input/mediatek,pmic-keys.yaml#
5$schema: http://devicetree.org/meta-schemas/core.yaml#
6
7title: MediaTek PMIC Keys
8
9maintainers:
10  - Chen Zhong <chen.zhong@mediatek.com>
11
12allOf:
13  - $ref: input.yaml#
14
15description: |
16  There are two key functions provided by MT6397, MT6323 and other MediaTek
17  PMICs: pwrkey and homekey.
18  The key functions are defined as the subnode of the function node provided
19  by the PMIC that is defined as a Multi-Function Device (MFD).
20
21  For MediaTek MT6323/MT6397 PMIC bindings see
22  Documentation/devicetree/bindings/mfd/mediatek,mt6397.yaml
23
24properties:
25  compatible:
26    oneOf:
27      - enum:
28          - mediatek,mt6323-keys
29          - mediatek,mt6328-keys
30          - mediatek,mt6331-keys
31          - mediatek,mt6357-keys
32          - mediatek,mt6358-keys
33          - mediatek,mt6359-keys
34          - mediatek,mt6397-keys
35      - items:
36          - enum:
37              - mediatek,mt6365-keys
38          - const: mediatek,mt6359-keys
39
40  power-off-time-sec: true
41
42  mediatek,long-press-mode:
43    description: |
44      Key long-press force shutdown setting
45      0 - disabled
46      1 - pwrkey
47      2 - pwrkey+homekey
48    $ref: /schemas/types.yaml#/definitions/uint32
49    default: 0
50    maximum: 2
51
52patternProperties:
53  "^((power|home)|(key-[a-z0-9-]+|[a-z0-9-]+-key))$":
54    $ref: input.yaml#
55
56    properties:
57      interrupts:
58        minItems: 1
59        items:
60          - description: Key press interrupt
61          - description: Key release interrupt
62
63      interrupt-names: true
64
65      linux,keycodes:
66        maxItems: 1
67
68      wakeup-source: true
69
70    required:
71      - linux,keycodes
72
73    if:
74      properties:
75        interrupt-names:
76          contains:
77            const: powerkey
78    then:
79      properties:
80        interrupt-names:
81          minItems: 1
82          items:
83            - const: powerkey
84            - const: powerkey_r
85    else:
86      properties:
87        interrupt-names:
88          minItems: 1
89          items:
90            - const: homekey
91            - const: homekey_r
92
93    unevaluatedProperties: false
94
95required:
96  - compatible
97
98unevaluatedProperties: false
99
100...
101