1*c66ec88fSEmmanuel VadotQualcomm's SPMI PMIC current ADC 2*c66ec88fSEmmanuel Vadot 3*c66ec88fSEmmanuel VadotQPNP PMIC current ADC (IADC) provides interface to clients to read current. 4*c66ec88fSEmmanuel VadotA 16 bit ADC is used for current measurements. IADC can measure the current 5*c66ec88fSEmmanuel Vadotthrough an external resistor (channel 1) or internal (built-in) resistor 6*c66ec88fSEmmanuel Vadot(channel 0). When using an external resistor it is to be described by 7*c66ec88fSEmmanuel Vadotqcom,external-resistor-micro-ohms property. 8*c66ec88fSEmmanuel Vadot 9*c66ec88fSEmmanuel VadotIADC node: 10*c66ec88fSEmmanuel Vadot 11*c66ec88fSEmmanuel Vadot- compatible: 12*c66ec88fSEmmanuel Vadot Usage: required 13*c66ec88fSEmmanuel Vadot Value type: <string> 14*c66ec88fSEmmanuel Vadot Definition: Should contain "qcom,spmi-iadc". 15*c66ec88fSEmmanuel Vadot 16*c66ec88fSEmmanuel Vadot- reg: 17*c66ec88fSEmmanuel Vadot Usage: required 18*c66ec88fSEmmanuel Vadot Value type: <prop-encoded-array> 19*c66ec88fSEmmanuel Vadot Definition: IADC base address and length in the SPMI PMIC register map 20*c66ec88fSEmmanuel Vadot 21*c66ec88fSEmmanuel Vadot- interrupts: 22*c66ec88fSEmmanuel Vadot Usage: optional 23*c66ec88fSEmmanuel Vadot Value type: <prop-encoded-array> 24*c66ec88fSEmmanuel Vadot Definition: End of ADC conversion. 25*c66ec88fSEmmanuel Vadot 26*c66ec88fSEmmanuel Vadot- qcom,external-resistor-micro-ohms: 27*c66ec88fSEmmanuel Vadot Usage: optional 28*c66ec88fSEmmanuel Vadot Value type: <u32> 29*c66ec88fSEmmanuel Vadot Definition: Sense resister value in micro Ohm. 30*c66ec88fSEmmanuel Vadot If not defined value of 10000 micro Ohms will be used. 31*c66ec88fSEmmanuel Vadot 32*c66ec88fSEmmanuel VadotExample: 33*c66ec88fSEmmanuel Vadot /* IADC node */ 34*c66ec88fSEmmanuel Vadot pmic_iadc: iadc@3600 { 35*c66ec88fSEmmanuel Vadot compatible = "qcom,spmi-iadc"; 36*c66ec88fSEmmanuel Vadot reg = <0x3600 0x100>; 37*c66ec88fSEmmanuel Vadot interrupts = <0x0 0x36 0x0 IRQ_TYPE_EDGE_RISING>; 38*c66ec88fSEmmanuel Vadot qcom,external-resistor-micro-ohms = <10000>; 39*c66ec88fSEmmanuel Vadot #io-channel-cells = <1>; 40*c66ec88fSEmmanuel Vadot }; 41*c66ec88fSEmmanuel Vadot 42*c66ec88fSEmmanuel Vadot /* IIO client node */ 43*c66ec88fSEmmanuel Vadot bat { 44*c66ec88fSEmmanuel Vadot io-channels = <&pmic_iadc 0>; 45*c66ec88fSEmmanuel Vadot io-channel-names = "iadc"; 46*c66ec88fSEmmanuel Vadot }; 47