xref: /linux/Documentation/devicetree/bindings/iio/adc/qcom,spmi-adc5-gen3.yaml (revision cb4eb6771c0f8fd1c52a8f6fdec7762fb087380a)
1*1c1b853eSJishnu Prakash# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*1c1b853eSJishnu Prakash%YAML 1.2
3*1c1b853eSJishnu Prakash---
4*1c1b853eSJishnu Prakash$id: http://devicetree.org/schemas/iio/adc/qcom,spmi-adc5-gen3.yaml#
5*1c1b853eSJishnu Prakash$schema: http://devicetree.org/meta-schemas/core.yaml#
6*1c1b853eSJishnu Prakash
7*1c1b853eSJishnu Prakashtitle: Qualcomm's SPMI PMIC ADC5 Gen3
8*1c1b853eSJishnu Prakash
9*1c1b853eSJishnu Prakashmaintainers:
10*1c1b853eSJishnu Prakash  - Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
11*1c1b853eSJishnu Prakash
12*1c1b853eSJishnu Prakashdescription: |
13*1c1b853eSJishnu Prakash  SPMI PMIC5 Gen3 voltage ADC (ADC) provides interface to clients to read
14*1c1b853eSJishnu Prakash  voltage. It is a 16-bit sigma-delta ADC. It also performs the same thermal
15*1c1b853eSJishnu Prakash  monitoring function as the existing ADC_TM devices.
16*1c1b853eSJishnu Prakash
17*1c1b853eSJishnu Prakash  The interface is implemented on SDAM (Shared Direct Access Memory) peripherals
18*1c1b853eSJishnu Prakash  on the master PMIC rather than a dedicated ADC peripheral. The number of PMIC
19*1c1b853eSJishnu Prakash  SDAM peripherals allocated for ADC is not correlated with the PMIC used, it is
20*1c1b853eSJishnu Prakash  programmed in FW (PBS) and is fixed per SOC, based on the SOC requirements.
21*1c1b853eSJishnu Prakash  All boards using a particular (SOC + master PMIC) combination will have the
22*1c1b853eSJishnu Prakash  same number of ADC SDAMs supported on that PMIC.
23*1c1b853eSJishnu Prakash
24*1c1b853eSJishnu Prakashproperties:
25*1c1b853eSJishnu Prakash  compatible:
26*1c1b853eSJishnu Prakash    const: qcom,spmi-adc5-gen3
27*1c1b853eSJishnu Prakash
28*1c1b853eSJishnu Prakash  reg:
29*1c1b853eSJishnu Prakash    items:
30*1c1b853eSJishnu Prakash      - description: SDAM0 base address in the SPMI PMIC register map
31*1c1b853eSJishnu Prakash      - description: SDAM1 base address
32*1c1b853eSJishnu Prakash    minItems: 1
33*1c1b853eSJishnu Prakash
34*1c1b853eSJishnu Prakash  "#address-cells":
35*1c1b853eSJishnu Prakash    const: 1
36*1c1b853eSJishnu Prakash
37*1c1b853eSJishnu Prakash  "#size-cells":
38*1c1b853eSJishnu Prakash    const: 0
39*1c1b853eSJishnu Prakash
40*1c1b853eSJishnu Prakash  "#io-channel-cells":
41*1c1b853eSJishnu Prakash    const: 1
42*1c1b853eSJishnu Prakash
43*1c1b853eSJishnu Prakash  "#thermal-sensor-cells":
44*1c1b853eSJishnu Prakash    const: 1
45*1c1b853eSJishnu Prakash
46*1c1b853eSJishnu Prakash  interrupts:
47*1c1b853eSJishnu Prakash    items:
48*1c1b853eSJishnu Prakash      - description: SDAM0 end of conversion (EOC) interrupt
49*1c1b853eSJishnu Prakash      - description: SDAM1 EOC interrupt
50*1c1b853eSJishnu Prakash    minItems: 1
51*1c1b853eSJishnu Prakash
52*1c1b853eSJishnu PrakashpatternProperties:
53*1c1b853eSJishnu Prakash  "^channel@[0-9a-f]+$":
54*1c1b853eSJishnu Prakash    type: object
55*1c1b853eSJishnu Prakash    unevaluatedProperties: false
56*1c1b853eSJishnu Prakash    $ref: /schemas/iio/adc/qcom,spmi-vadc-common.yaml
57*1c1b853eSJishnu Prakash    description:
58*1c1b853eSJishnu Prakash      Represents the external channels which are connected to the ADC.
59*1c1b853eSJishnu Prakash
60*1c1b853eSJishnu Prakash    properties:
61*1c1b853eSJishnu Prakash      qcom,decimation:
62*1c1b853eSJishnu Prakash        enum: [ 85, 340, 1360 ]
63*1c1b853eSJishnu Prakash        default: 1360
64*1c1b853eSJishnu Prakash
65*1c1b853eSJishnu Prakash      qcom,hw-settle-time:
66*1c1b853eSJishnu Prakash        enum: [ 15, 100, 200, 300, 400, 500, 600, 700,
67*1c1b853eSJishnu Prakash                1000, 2000, 4000, 8000, 16000, 32000, 64000, 128000 ]
68*1c1b853eSJishnu Prakash        default: 15
69*1c1b853eSJishnu Prakash
70*1c1b853eSJishnu Prakash      qcom,avg-samples:
71*1c1b853eSJishnu Prakash        enum: [ 1, 2, 4, 8, 16 ]
72*1c1b853eSJishnu Prakash        default: 1
73*1c1b853eSJishnu Prakash
74*1c1b853eSJishnu Prakash      qcom,adc-tm:
75*1c1b853eSJishnu Prakash        description:
76*1c1b853eSJishnu Prakash          ADC_TM is a threshold monitoring feature in HW which can be enabled
77*1c1b853eSJishnu Prakash          on any ADC channel, to trigger an IRQ for threshold violation. In
78*1c1b853eSJishnu Prakash          earlier ADC generations, it was implemented in a separate device
79*1c1b853eSJishnu Prakash          (documented in Documentation/devicetree/bindings/thermal/qcom-spmi-adc-tm5.yaml.)
80*1c1b853eSJishnu Prakash          In Gen3, this feature can be enabled in the same ADC device for any
81*1c1b853eSJishnu Prakash          channel and threshold monitoring and IRQ triggering are handled in FW
82*1c1b853eSJishnu Prakash          (PBS) instead of another dedicated HW block.
83*1c1b853eSJishnu Prakash          This property indicates ADC_TM monitoring is done on this channel.
84*1c1b853eSJishnu Prakash        type: boolean
85*1c1b853eSJishnu Prakash
86*1c1b853eSJishnu Prakashrequired:
87*1c1b853eSJishnu Prakash  - compatible
88*1c1b853eSJishnu Prakash  - reg
89*1c1b853eSJishnu Prakash  - "#address-cells"
90*1c1b853eSJishnu Prakash  - "#size-cells"
91*1c1b853eSJishnu Prakash  - "#io-channel-cells"
92*1c1b853eSJishnu Prakash  - interrupts
93*1c1b853eSJishnu Prakash
94*1c1b853eSJishnu PrakashadditionalProperties: false
95*1c1b853eSJishnu Prakash
96*1c1b853eSJishnu Prakashexamples:
97*1c1b853eSJishnu Prakash  - |
98*1c1b853eSJishnu Prakash    #include <dt-bindings/interrupt-controller/irq.h>
99*1c1b853eSJishnu Prakash
100*1c1b853eSJishnu Prakash    pmic {
101*1c1b853eSJishnu Prakash      #address-cells = <1>;
102*1c1b853eSJishnu Prakash      #size-cells = <0>;
103*1c1b853eSJishnu Prakash
104*1c1b853eSJishnu Prakash      adc@9000 {
105*1c1b853eSJishnu Prakash        compatible = "qcom,spmi-adc5-gen3";
106*1c1b853eSJishnu Prakash        reg = <0x9000>, <0x9100>;
107*1c1b853eSJishnu Prakash        interrupts = <0x0 0x90 0x1 IRQ_TYPE_EDGE_RISING>,
108*1c1b853eSJishnu Prakash                      <0x0 0x91 0x1 IRQ_TYPE_EDGE_RISING>;
109*1c1b853eSJishnu Prakash        #address-cells = <1>;
110*1c1b853eSJishnu Prakash        #size-cells = <0>;
111*1c1b853eSJishnu Prakash        #io-channel-cells = <1>;
112*1c1b853eSJishnu Prakash        #thermal-sensor-cells = <1>;
113*1c1b853eSJishnu Prakash
114*1c1b853eSJishnu Prakash        /* PMK8550 Channel nodes */
115*1c1b853eSJishnu Prakash        channel@3 {
116*1c1b853eSJishnu Prakash          reg = <0x3>;
117*1c1b853eSJishnu Prakash          label = "pmk8550_die_temp";
118*1c1b853eSJishnu Prakash          qcom,pre-scaling = <1 1>;
119*1c1b853eSJishnu Prakash        };
120*1c1b853eSJishnu Prakash
121*1c1b853eSJishnu Prakash        channel@44 {
122*1c1b853eSJishnu Prakash          reg = <0x44>;
123*1c1b853eSJishnu Prakash          label = "pmk8550_xo_therm";
124*1c1b853eSJishnu Prakash          qcom,pre-scaling = <1 1>;
125*1c1b853eSJishnu Prakash          qcom,ratiometric;
126*1c1b853eSJishnu Prakash          qcom,hw-settle-time = <200>;
127*1c1b853eSJishnu Prakash          qcom,adc-tm;
128*1c1b853eSJishnu Prakash        };
129*1c1b853eSJishnu Prakash
130*1c1b853eSJishnu Prakash        /* PM8550 Channel nodes */
131*1c1b853eSJishnu Prakash        channel@103 {
132*1c1b853eSJishnu Prakash          reg = <0x103>;
133*1c1b853eSJishnu Prakash          label = "pm8550_die_temp";
134*1c1b853eSJishnu Prakash          qcom,pre-scaling = <1 1>;
135*1c1b853eSJishnu Prakash        };
136*1c1b853eSJishnu Prakash
137*1c1b853eSJishnu Prakash        /* PM8550B Channel nodes */
138*1c1b853eSJishnu Prakash        channel@78f {
139*1c1b853eSJishnu Prakash          reg = <0x78f>;
140*1c1b853eSJishnu Prakash          label = "pm8550b_vbat_sns_qbg";
141*1c1b853eSJishnu Prakash          qcom,pre-scaling = <1 3>;
142*1c1b853eSJishnu Prakash        };
143*1c1b853eSJishnu Prakash
144*1c1b853eSJishnu Prakash        /* PM8550VS_C Channel nodes */
145*1c1b853eSJishnu Prakash        channel@203 {
146*1c1b853eSJishnu Prakash          reg = <0x203>;
147*1c1b853eSJishnu Prakash          label = "pm8550vs_c_die_temp";
148*1c1b853eSJishnu Prakash          qcom,pre-scaling = <1 1>;
149*1c1b853eSJishnu Prakash        };
150*1c1b853eSJishnu Prakash      };
151*1c1b853eSJishnu Prakash    };
152