18c2ecf20Sopenharmony_ciQualcomm's SPMI PMIC current ADC
28c2ecf20Sopenharmony_ci
38c2ecf20Sopenharmony_ciQPNP PMIC current ADC (IADC) provides interface to clients to read current.
48c2ecf20Sopenharmony_ciA 16 bit ADC is used for current measurements. IADC can measure the current
58c2ecf20Sopenharmony_cithrough an external resistor (channel 1) or internal (built-in) resistor
68c2ecf20Sopenharmony_ci(channel 0). When using an external resistor it is to be described by
78c2ecf20Sopenharmony_ciqcom,external-resistor-micro-ohms property.
88c2ecf20Sopenharmony_ci
98c2ecf20Sopenharmony_ciIADC node:
108c2ecf20Sopenharmony_ci
118c2ecf20Sopenharmony_ci- compatible:
128c2ecf20Sopenharmony_ci    Usage: required
138c2ecf20Sopenharmony_ci    Value type: <string>
148c2ecf20Sopenharmony_ci    Definition: Should contain "qcom,spmi-iadc".
158c2ecf20Sopenharmony_ci
168c2ecf20Sopenharmony_ci- reg:
178c2ecf20Sopenharmony_ci    Usage: required
188c2ecf20Sopenharmony_ci    Value type: <prop-encoded-array>
198c2ecf20Sopenharmony_ci    Definition: IADC base address and length in the SPMI PMIC register map
208c2ecf20Sopenharmony_ci
218c2ecf20Sopenharmony_ci- interrupts:
228c2ecf20Sopenharmony_ci    Usage: optional
238c2ecf20Sopenharmony_ci    Value type: <prop-encoded-array>
248c2ecf20Sopenharmony_ci    Definition: End of ADC conversion.
258c2ecf20Sopenharmony_ci
268c2ecf20Sopenharmony_ci- qcom,external-resistor-micro-ohms:
278c2ecf20Sopenharmony_ci    Usage: optional
288c2ecf20Sopenharmony_ci    Value type: <u32>
298c2ecf20Sopenharmony_ci    Definition: Sense resister value in micro Ohm.
308c2ecf20Sopenharmony_ci                If not defined value of 10000 micro Ohms will be used.
318c2ecf20Sopenharmony_ci
328c2ecf20Sopenharmony_ciExample:
338c2ecf20Sopenharmony_ci	/* IADC node */
348c2ecf20Sopenharmony_ci	pmic_iadc: iadc@3600 {
358c2ecf20Sopenharmony_ci		compatible = "qcom,spmi-iadc";
368c2ecf20Sopenharmony_ci		reg = <0x3600 0x100>;
378c2ecf20Sopenharmony_ci		interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>;
388c2ecf20Sopenharmony_ci		qcom,external-resistor-micro-ohms = <10000>;
398c2ecf20Sopenharmony_ci		#io-channel-cells  = <1>;
408c2ecf20Sopenharmony_ci	};
418c2ecf20Sopenharmony_ci
428c2ecf20Sopenharmony_ci	/* IIO client node */
438c2ecf20Sopenharmony_ci	bat {
448c2ecf20Sopenharmony_ci		io-channels = <&pmic_iadc  0>;
458c2ecf20Sopenharmony_ci		io-channel-names = "iadc";
468c2ecf20Sopenharmony_ci	};
47