xref: /linux/Documentation/devicetree/bindings/iio/adc/qcom,spmi-vadc-common.yaml (revision cb4eb6771c0f8fd1c52a8f6fdec7762fb087380a)
1*9f3a352eSJishnu Prakash# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
2*9f3a352eSJishnu Prakash%YAML 1.2
3*9f3a352eSJishnu Prakash---
4*9f3a352eSJishnu Prakash$id: http://devicetree.org/schemas/iio/adc/qcom,spmi-vadc-common.yaml#
5*9f3a352eSJishnu Prakash$schema: http://devicetree.org/meta-schemas/core.yaml#
6*9f3a352eSJishnu Prakash
7*9f3a352eSJishnu Prakashtitle: Qualcomm Technologies, Inc. SPMI PMIC ADC channels
8*9f3a352eSJishnu Prakash
9*9f3a352eSJishnu Prakashmaintainers:
10*9f3a352eSJishnu Prakash  - Jishnu Prakash <jishnu.prakash@oss.qualcomm.com>
11*9f3a352eSJishnu Prakash
12*9f3a352eSJishnu Prakashdescription:
13*9f3a352eSJishnu Prakash  This defines the common properties used to define Qualcomm VADC channels.
14*9f3a352eSJishnu Prakash
15*9f3a352eSJishnu Prakashproperties:
16*9f3a352eSJishnu Prakash  reg:
17*9f3a352eSJishnu Prakash    description:
18*9f3a352eSJishnu Prakash      ADC channel number (PMIC-specific for versions after PMIC5 ADC).
19*9f3a352eSJishnu Prakash    maxItems: 1
20*9f3a352eSJishnu Prakash
21*9f3a352eSJishnu Prakash  label:
22*9f3a352eSJishnu Prakash    description:
23*9f3a352eSJishnu Prakash      ADC input of the platform as seen in the schematics.
24*9f3a352eSJishnu Prakash      For thermistor inputs connected to generic AMUX or GPIO inputs
25*9f3a352eSJishnu Prakash      these can vary across platform for the same pins. Hence select
26*9f3a352eSJishnu Prakash      the platform schematics name for this channel.
27*9f3a352eSJishnu Prakash
28*9f3a352eSJishnu Prakash  qcom,decimation:
29*9f3a352eSJishnu Prakash    $ref: /schemas/types.yaml#/definitions/uint32
30*9f3a352eSJishnu Prakash    description:
31*9f3a352eSJishnu Prakash      This parameter is used to decrease ADC sampling rate.
32*9f3a352eSJishnu Prakash      Quicker measurements can be made by reducing decimation ratio.
33*9f3a352eSJishnu Prakash
34*9f3a352eSJishnu Prakash  qcom,pre-scaling:
35*9f3a352eSJishnu Prakash    $ref: /schemas/types.yaml#/definitions/uint32-array
36*9f3a352eSJishnu Prakash    description:
37*9f3a352eSJishnu Prakash      Used for scaling the channel input signal before the signal is
38*9f3a352eSJishnu Prakash      fed to VADC. The configuration for this node is to know the
39*9f3a352eSJishnu Prakash      pre-determined ratio and use it for post scaling. It is a pair of
40*9f3a352eSJishnu Prakash      integers, denoting the numerator and denominator of the fraction by which
41*9f3a352eSJishnu Prakash      input signal is multiplied. For example, <1 3> indicates the signal is scaled
42*9f3a352eSJishnu Prakash      down to 1/3 of its value before ADC measurement.
43*9f3a352eSJishnu Prakash      If property is not found default value depending on chip will be used.
44*9f3a352eSJishnu Prakash    oneOf:
45*9f3a352eSJishnu Prakash      - items:
46*9f3a352eSJishnu Prakash          - const: 1
47*9f3a352eSJishnu Prakash          - enum: [ 1, 3, 4, 6, 20, 8, 10, 16 ]
48*9f3a352eSJishnu Prakash      - items:
49*9f3a352eSJishnu Prakash          - const: 10
50*9f3a352eSJishnu Prakash          - const: 81
51*9f3a352eSJishnu Prakash
52*9f3a352eSJishnu Prakash  qcom,ratiometric:
53*9f3a352eSJishnu Prakash    type: boolean
54*9f3a352eSJishnu Prakash    description: |
55*9f3a352eSJishnu Prakash      Channel calibration type.
56*9f3a352eSJishnu Prakash      - For compatible property "qcom,spmi-vadc", if this property is
57*9f3a352eSJishnu Prakash        specified VADC will use the VDD reference (1.8V) and GND for
58*9f3a352eSJishnu Prakash        channel calibration. If property is not found, channel will be
59*9f3a352eSJishnu Prakash        calibrated with 0.625V and 1.25V reference channels, also
60*9f3a352eSJishnu Prakash        known as absolute calibration.
61*9f3a352eSJishnu Prakash      - For other compatible properties, if this property is specified
62*9f3a352eSJishnu Prakash        VADC will use the VDD reference (1.875V) and GND for channel
63*9f3a352eSJishnu Prakash        calibration. If property is not found, channel will be calibrated
64*9f3a352eSJishnu Prakash        with 0V and 1.25V reference channels, also known as absolute calibration.
65*9f3a352eSJishnu Prakash
66*9f3a352eSJishnu Prakash  qcom,hw-settle-time:
67*9f3a352eSJishnu Prakash    $ref: /schemas/types.yaml#/definitions/uint32
68*9f3a352eSJishnu Prakash    description: |
69*9f3a352eSJishnu Prakash      Time between AMUX getting configured and the ADC starting
70*9f3a352eSJishnu Prakash      conversion. The 'hw_settle_time' is an index used from valid values
71*9f3a352eSJishnu Prakash      and programmed in hardware to achieve the hardware settling delay.
72*9f3a352eSJishnu Prakash
73*9f3a352eSJishnu Prakash  qcom,avg-samples:
74*9f3a352eSJishnu Prakash    $ref: /schemas/types.yaml#/definitions/uint32
75*9f3a352eSJishnu Prakash    description: |
76*9f3a352eSJishnu Prakash      Number of samples to be used for measurement.
77*9f3a352eSJishnu Prakash      Averaging provides the option to obtain a single measurement
78*9f3a352eSJishnu Prakash      from the ADC that is an average of multiple samples. The value
79*9f3a352eSJishnu Prakash      selected is 2^(value).
80*9f3a352eSJishnu Prakash
81*9f3a352eSJishnu Prakashrequired:
82*9f3a352eSJishnu Prakash  - reg
83*9f3a352eSJishnu Prakash
84*9f3a352eSJishnu PrakashadditionalProperties: true
85