dt-bindings: iio: qcom,spmi-vadc: Add PMIC5 GEN3 ADC bindings

PMIC5 GEN3 ADC has support for clients to read voltage and
current on supported channels connected to the PMIC.
Clients include reading voltage phone power and on board system
thermistors for thermal management. ADCs on certain PMICs have
support to read battery current.

Change-Id: Ief7cbdf77d227ba2cb4ef7919aa66d9962d98e37
Signed-off-by: Jishnu Prakash <quic_jprakash@quicinc.com>
[quic_amelende@quicinc.com: Converted binding change from .txt to .yaml]
Signed-off-by: Anjelique Melendez <quic_amelende@quicinc.com>
This commit is contained in:
Jishnu Prakash
2021-03-22 13:28:47 +05:30
committed by Anjelique Melendez
parent f3901bee1b
commit d6d5b31791

View File

@@ -25,6 +25,7 @@ properties:
- enum: - enum:
- qcom,spmi-vadc - qcom,spmi-vadc
- qcom,spmi-adc5 - qcom,spmi-adc5
- qcom,spmi-adc5-gen3
- qcom,spmi-adc5-lite - qcom,spmi-adc5-lite
- qcom,spmi-adc-rev2 - qcom,spmi-adc-rev2
- qcom,spmi-adc7 - qcom,spmi-adc7
@@ -39,6 +40,14 @@ properties:
- For compatible property "qcom,spmi-adc7-sw-calib", two registers are required. - For compatible property "qcom,spmi-adc7-sw-calib", two registers are required.
First register is the VADC peripheral base address and the second is the First register is the VADC peripheral base address and the second is the
ADC common peripheral base addess. ADC common peripheral base addess.
- For compatible property "qcom,spmi-adc5-gen3", each reg corresponds
to the SDAM peripheral base address that is being used.
qcom,debug-base:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Debug ADC peripheral base address in the SPMI PMIC register map. Defined for
compatible "qcom,spmi-adc5-gen3".
'#address-cells': '#address-cells':
const: 1 const: 1
@@ -49,10 +58,25 @@ properties:
'#io-channel-cells': '#io-channel-cells':
const: 1 const: 1
'#thermal-sensor-cells':
const: 1
description: |
For compatible property "qcom,spmi-adc5-gen3", property is required for ADC_TM device.
interrupts: interrupts:
maxItems: 1 minItems: 1
description: maxItems: 2
description: |
End of conversion interrupt. End of conversion interrupt.
- For compatible property "qcom,spmi-adc5-gen3", interrupts are defined
for each SDAM being used.
interrupt-names:
minItems: 1
maxItems: 2
description: |
For compatible property "qcom,spmi-adc5-gen3", names should be defined
as "adc-sdam<N>" where <N> represents the SDAM index.
required: required:
- compatible - compatible
@@ -168,10 +192,31 @@ patternProperties:
$ref: /schemas/types.yaml#/definitions/uint32 $ref: /schemas/types.yaml#/definitions/uint32
description: | description: |
The index of the VADC scale function used to convert raw ADC code to The index of the VADC scale function used to convert raw ADC code to
physical scaled unites for the channel. Defined for compatibles physical scaled units for the channel. Defined for compatibles
"qcom,spmi-adc5" and "qcom,spmi-adc7". "qcom,spmi-adc5", "qcom,spmi-adc7" and "qcom,spmi-adc5-gen3".
See include/dt-bindings/iio/qcom,spmi-vadc.h for values. See include/dt-bindings/iio/qcom,spmi-vadc.h for values.
qcom,adc-tm-type:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Type of ADC_TM usage defined for a given channel. Defined for compatible
"qcom,spmi-adc5-gen3".
0 - not used for ADC_TM
1 - connected to thermistor; supports temperature threshold violation detection
and temperature reading
2 - connected to thermistor; supports temperature reading
3 - not connected to thermistor; supports non-thermal threshold violation detection
enum: [ 0, 1, 2, 3]
default: 0
qcom,rscale-type:
$ref: /schemas/types.yaml#/definitions/uint32
description: |
Type of reverse scaling function used for the ADC_TM channels. Defined for
compatible "qcom,spmi-adc5-gen3" and valid only for the case of
non-thermal ADC_TM client.
const: 0
required: required:
- reg - reg
@@ -186,6 +231,9 @@ allOf:
properties: properties:
reg: reg:
maxItems: 1 maxItems: 1
interrupts:
maxItems: 1
qcom,debug-base: false
patternProperties: patternProperties:
"^channel@[0-9a-f]+$": "^channel@[0-9a-f]+$":
properties: properties:
@@ -203,6 +251,8 @@ allOf:
default: 1 default: 1
qcom,no-cal: false qcom,no-cal: false
qcom,adc-tm-type: false
qcom,rscale-type: false
- if: - if:
properties: properties:
@@ -214,6 +264,9 @@ allOf:
properties: properties:
reg: reg:
maxItems: 1 maxItems: 1
interrupts:
maxItems: 1
qcom,debug-base: false
patternProperties: patternProperties:
"^channel@[0-9a-f]+$": "^channel@[0-9a-f]+$":
properties: properties:
@@ -231,6 +284,8 @@ allOf:
default: 1 default: 1
qcom,no-cal: false qcom,no-cal: false
qcom,adc-tm-type: false
qcom,rscale-type: false
- if: - if:
properties: properties:
@@ -242,6 +297,9 @@ allOf:
properties: properties:
reg: reg:
maxItems: 1 maxItems: 1
interrupts:
maxItems: 1
qcom,debug-base: false
patternProperties: patternProperties:
"^channel@[0-9a-f]+$": "^channel@[0-9a-f]+$":
properties: properties:
@@ -259,6 +317,45 @@ allOf:
default: 1 default: 1
qcom,no-cal: false qcom,no-cal: false
qcom,adc-tm-type: false
qcom,rscale-type: false
- if:
properties:
compatible:
contains:
const: qcom,spmi-adc5-gen3
then:
properties:
reg:
minItems: 2
interrupts:
minItems: 2
interrupt-names:
items:
- const: adc-sdam0
- const: adc-sdam1
required:
- interrupts
- interrupt-names
patternProperties:
"^channel@[0-9a-f]+$":
properties:
qcom,decimation:
enum: [ 85, 340, 1360 ]
default: 1360
qcom,hw-settle-time:
enum: [ 15, 100, 200, 300, 400, 500, 600, 700, 1000, 2000, 4000,
8000, 16000, 32000, 64000, 128000 ]
default: 15
qcom,avg-samples:
enum: [ 1, 2, 4, 8, 16 ]
default: 1
qcom,no-cal: false
- if: - if:
properties: properties:
@@ -270,6 +367,9 @@ allOf:
properties: properties:
reg: reg:
maxItems: 1 maxItems: 1
interrupts:
maxItems: 1
qcom,debug-base: false
patternProperties: patternProperties:
"^channel@[0-9a-f]+$": "^channel@[0-9a-f]+$":
properties: properties:
@@ -287,6 +387,8 @@ allOf:
default: 1 default: 1
qcom,no-cal: false qcom,no-cal: false
qcom,adc-tm-type: false
qcom,rscale-type: false
- if: - if:
properties: properties:
@@ -298,6 +400,9 @@ allOf:
properties: properties:
reg: reg:
maxItems: 1 maxItems: 1
interrupts:
maxItems: 1
qcom,debug-base: false
patternProperties: patternProperties:
"^channel@[0-9a-f]+$": "^channel@[0-9a-f]+$":
properties: properties:
@@ -315,6 +420,8 @@ allOf:
default: 1 default: 1
qcom,no-cal: false qcom,no-cal: false
qcom,adc-tm-type: false
qcom,rscale-type: false
- if: - if:
properties: properties:
@@ -326,6 +433,9 @@ allOf:
properties: properties:
reg: reg:
minItems: 2 minItems: 2
interrupts:
maxItems: 1
qcom,debug-base: false
patternProperties: patternProperties:
"^channel@[0-9a-f]+$": "^channel@[0-9a-f]+$":
properties: properties:
@@ -342,6 +452,9 @@ allOf:
enum: [ 1, 2, 4, 8, 16 ] enum: [ 1, 2, 4, 8, 16 ]
default: 1 default: 1
qcom,adc-tm-type: false
qcom,rscale-type: false
not: not:
required: required:
- qcom,no-cal - qcom,no-cal
@@ -422,3 +535,39 @@ examples:
}; };
}; };
}; };
- |
#include <dt-bindings/iio/qcom,spmi-adc5-gen3-pmk8550.h>
#include <dt-bindings/interrupt-controller/irq.h>
spmi {
#address-cells = <1>;
#size-cells = <0>;
vadc@9000 {
compatible = "qcom,spmi-adc5-gen3";
reg = <0x9000>, <0x9100>;
qcom,debug-base = <0x7600>;
#address-cells = <1>;
#size-cells = <0>;
#io-channel-cells = <1>;
#thermal-sensor-cells = <1>;
interrupt-names = "adc-sdam0", "adc-sdam1";
interrupts = <0x0 0x90 0x1 IRQ_TYPE_EDGE_RISING>,
<0x0 0x91 0x1 IRQ_TYPE_EDGE_RISING>;
channel@0 {
reg = <PMK8550_ADC5_GEN3_OFFSET_REF>;
label = "pmk8550_offset_ref";
qcom,pre-scaling = <1 1>;
};
channel@4 {
reg = <PMK8550_ADC5_GEN3_AMUX_THM1_XO_THERM_100K_PU>;
label = "pmk8550_xo_therm";
qcom,ratiometric;
qcom,hw-settle-time = <200>;
qcom,pre-scaling = <1 1>;
qcom,adc-tm-type = <1>;
};
};
};