79 lines · plain
1Kernel driver da90522====================3 4Supported chips:5 6 * Dialog Semiconductors DA9052-BC and DA9053-AA/Bx PMICs7 8 Prefix: 'da9052'9 10 Datasheet: Datasheet is not publicly available.11 12Authors: David Dajun Chen <dchen@diasemi.com>13 14Description15-----------16 17The DA9052/53 provides an Analogue to Digital Converter (ADC) with 10 bits18resolution and track and hold circuitry combined with an analogue input19multiplexer. The analogue input multiplexer will allow conversion of up to 1020different inputs. The track and hold circuit ensures stable input voltages at21the input of the ADC during the conversion.22 23The ADC is used to measure the following inputs:24 25========= ===================================================================26Channel 0 VDDOUT - measurement of the system voltage27Channel 1 ICH - internal battery charger current measurement28Channel 2 TBAT - output from the battery NTC29Channel 3 VBAT - measurement of the battery voltage30Channel 4 ADC_IN4 - high impedance input (0 - 2.5V)31Channel 5 ADC_IN5 - high impedance input (0 - 2.5V)32Channel 6 ADC_IN6 - high impedance input (0 - 2.5V)33Channel 7 XY - TSI interface to measure the X and Y voltage of the touch34 screen resistive potentiometers35Channel 8 Internal Tjunc. - sense (internal temp. sensor)36Channel 9 VBBAT - measurement of the backup battery voltage37========= ===================================================================38 39By using sysfs attributes we can measure the system voltage VDDOUT, the battery40charging current ICH, battery temperature TBAT, battery junction temperature41TJUNC, battery voltage VBAT and the back up battery voltage VBBAT.42 43Voltage Monitoring44------------------45 46Voltages are sampled by a 10 bit ADC.47 48The battery voltage is calculated as:49 50 Milli volt = ((ADC value * 1000) / 512) + 250051 52The backup battery voltage is calculated as:53 54 Milli volt = (ADC value * 2500) / 512;55 56The voltages on ADC channels 4, 5 and 6 are calculated as:57 58 Milli volt = (ADC value * 2500) / 102359 60Temperature Monitoring61----------------------62 63Temperatures are sampled by a 10 bit ADC. Junction and battery temperatures64are monitored by the ADC channels.65 66The junction temperature is calculated:67 68 Degrees celsius = 1.708 * (TJUNC_RES - T_OFFSET) - 108.869 70The junction temperature attribute is supported by the driver.71 72The battery temperature is calculated:73 74 Degree Celsius = 1 / (t1 + 1/298) - 27375 76where t1 = (1/B)* ln(( ADCval * 2.5)/(R25*ITBAT*255))77 78Default values of R25, B, ITBAT are 10e3, 3380 and 50e-6 respectively.79