Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 1 | Kernel driver da9052 |
| 2 | ==================== |
| 3 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 4 | Supported chips: |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 5 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 6 | * Dialog Semiconductors DA9052-BC and DA9053-AA/Bx PMICs |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 7 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 8 | Prefix: 'da9052' |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 9 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 10 | Datasheet: Datasheet is not publicly available. |
| 11 | |
| 12 | Authors: David Dajun Chen <dchen@diasemi.com> |
| 13 | |
| 14 | Description |
| 15 | ----------- |
| 16 | |
| 17 | The DA9052/53 provides an Analogue to Digital Converter (ADC) with 10 bits |
| 18 | resolution and track and hold circuitry combined with an analogue input |
| 19 | multiplexer. The analogue input multiplexer will allow conversion of up to 10 |
| 20 | different inputs. The track and hold circuit ensures stable input voltages at |
| 21 | the input of the ADC during the conversion. |
| 22 | |
| 23 | The ADC is used to measure the following inputs: |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 24 | |
| 25 | ========= =================================================================== |
| 26 | Channel 0 VDDOUT - measurement of the system voltage |
| 27 | Channel 1 ICH - internal battery charger current measurement |
| 28 | Channel 2 TBAT - output from the battery NTC |
| 29 | Channel 3 VBAT - measurement of the battery voltage |
| 30 | Channel 4 ADC_IN4 - high impedance input (0 - 2.5V) |
| 31 | Channel 5 ADC_IN5 - high impedance input (0 - 2.5V) |
| 32 | Channel 6 ADC_IN6 - high impedance input (0 - 2.5V) |
| 33 | Channel 7 XY - TSI interface to measure the X and Y voltage of the touch |
| 34 | screen resistive potentiometers |
| 35 | Channel 8 Internal Tjunc. - sense (internal temp. sensor) |
| 36 | Channel 9 VBBAT - measurement of the backup battery voltage |
| 37 | ========= =================================================================== |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 38 | |
| 39 | By using sysfs attributes we can measure the system voltage VDDOUT, the battery |
| 40 | charging current ICH, battery temperature TBAT, battery junction temperature |
| 41 | TJUNC, battery voltage VBAT and the back up battery voltage VBBAT. |
| 42 | |
| 43 | Voltage Monitoring |
| 44 | ------------------ |
| 45 | |
| 46 | Voltages are sampled by a 10 bit ADC. |
| 47 | |
| 48 | The battery voltage is calculated as: |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 49 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 50 | Milli volt = ((ADC value * 1000) / 512) + 2500 |
| 51 | |
| 52 | The backup battery voltage is calculated as: |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 53 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 54 | Milli volt = (ADC value * 2500) / 512; |
| 55 | |
| 56 | The voltages on ADC channels 4, 5 and 6 are calculated as: |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 57 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 58 | Milli volt = (ADC value * 2500) / 1023 |
| 59 | |
| 60 | Temperature Monitoring |
| 61 | ---------------------- |
| 62 | |
| 63 | Temperatures are sampled by a 10 bit ADC. Junction and battery temperatures |
| 64 | are monitored by the ADC channels. |
| 65 | |
| 66 | The junction temperature is calculated: |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 67 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 68 | Degrees celsius = 1.708 * (TJUNC_RES - T_OFFSET) - 108.8 |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 69 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 70 | The junction temperature attribute is supported by the driver. |
| 71 | |
| 72 | The battery temperature is calculated: |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 73 | |
| 74 | Degree Celsius = 1 / (t1 + 1/298) - 273 |
| 75 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 76 | where t1 = (1/B)* ln(( ADCval * 2.5)/(R25*ITBAT*255)) |
Mauro Carvalho Chehab | 08fae07 | 2019-04-17 06:46:24 -0300 | [diff] [blame] | 77 | |
Ashish Jangam | e41f643 | 2012-03-17 15:34:41 +0530 | [diff] [blame] | 78 | Default values of R25, B, ITBAT are 10e3, 3380 and 50e-6 respectively. |