GNU Linux-libre 6.1.90-gnu
[releases.git] / Documentation / devicetree / bindings / power / reset / qcom,pon.yaml
1 # SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2 %YAML 1.2
3 ---
4 $id: http://devicetree.org/schemas/power/reset/qcom,pon.yaml#
5 $schema: http://devicetree.org/meta-schemas/core.yaml#
6
7 title: Qualcomm PON Device
8
9 maintainers:
10   - Vinod Koul <vkoul@kernel.org>
11
12 description: |
13   The Power On device for Qualcomm PM8xxx is MFD supporting pwrkey
14   and resin along with the Android reboot-mode.
15
16   This DT node has pwrkey and resin as sub nodes.
17
18 properties:
19   compatible:
20     enum:
21       - qcom,pm8916-pon
22       - qcom,pms405-pon
23       - qcom,pm8998-pon
24       - qcom,pmk8350-pon
25
26   reg:
27     description: |
28       Specifies the SPMI base address for the PON (power-on) peripheral.  For
29       PMICs that have the PON peripheral (GEN3) split into PON_HLOS and PON_PBS
30       (e.g. PMK8350), this can hold addresses of both PON_HLOS and PON_PBS
31       peripherals.  In that case, the PON_PBS address needs to be specified to
32       facilitate software debouncing on some PMIC.
33     minItems: 1
34     maxItems: 2
35
36   reg-names:
37     minItems: 1
38     maxItems: 2
39
40   pwrkey:
41     type: object
42     $ref: /schemas/input/qcom,pm8941-pwrkey.yaml#
43
44   resin:
45     type: object
46     $ref: /schemas/input/qcom,pm8941-pwrkey.yaml#
47
48   watchdog:
49     type: object
50     $ref: /schemas/watchdog/qcom,pm8916-wdt.yaml
51
52 required:
53   - compatible
54   - reg
55
56 unevaluatedProperties: false
57
58 allOf:
59   - if:
60       properties:
61         compatible:
62           contains:
63             enum:
64               - qcom,pm8916-pon
65               - qcom,pms405-pon
66               - qcom,pm8998-pon
67     then:
68       allOf:
69         - $ref: reboot-mode.yaml#
70
71       properties:
72         reg:
73           maxItems: 1
74         reg-names:
75           items:
76             - const: pon
77   - if:
78       properties:
79         compatible:
80           contains:
81             const: qcom,pmk8350-pon
82     then:
83       properties:
84         reg:
85           minItems: 1
86           maxItems: 2
87         reg-names:
88           minItems: 1
89           items:
90             - const: hlos
91             - const: pbs
92
93 examples:
94   - |
95    #include <dt-bindings/interrupt-controller/irq.h>
96    #include <dt-bindings/input/linux-event-codes.h>
97    #include <dt-bindings/spmi/spmi.h>
98    spmi_bus: spmi@c440000 {
99      reg = <0x0c440000 0x1100>;
100      #address-cells = <2>;
101      #size-cells = <0>;
102      pmk8350: pmic@0 {
103        reg = <0x0 SPMI_USID>;
104        #address-cells = <1>;
105        #size-cells = <0>;
106        pmk8350_pon: pon_hlos@1300 {
107          reg = <0x1300>;
108          compatible = "qcom,pm8998-pon";
109
110          pwrkey {
111             compatible = "qcom,pm8941-pwrkey";
112             interrupts = < 0x0 0x8 0 IRQ_TYPE_EDGE_BOTH >;
113             debounce = <15625>;
114             bias-pull-up;
115             linux,code = <KEY_POWER>;
116          };
117
118          resin {
119             compatible = "qcom,pm8941-resin";
120             interrupts = <0x0 0x8 1 IRQ_TYPE_EDGE_BOTH>;
121             debounce = <15625>;
122             bias-pull-up;
123             linux,code = <KEY_VOLUMEDOWN>;
124          };
125        };
126      };
127    };
128 ...