David Keitel | 8f2601b | 2012-02-14 22:31:07 -0800 | [diff] [blame] | 1 | /* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved. |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 2 | * |
| 3 | * This program is free software; you can redistribute it and/or modify |
| 4 | * it under the terms of the GNU General Public License version 2 and |
| 5 | * only version 2 as published by the Free Software Foundation. |
| 6 | * |
| 7 | * This program is distributed in the hope that it will be useful, |
| 8 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 9 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 10 | * GNU General Public License for more details. |
| 11 | */ |
| 12 | |
Xiaozhe Shi | 5ee9519 | 2012-09-12 15:16:34 -0700 | [diff] [blame] | 13 | #include <linux/mfd/pm8xxx/batterydata-lib.h> |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 14 | |
Abhijeet Dharmapurikar | 21184fc | 2012-07-30 19:25:39 -0700 | [diff] [blame] | 15 | static struct single_row_lut fcc_temp = { |
| 16 | .x = {-20, 0, 25, 40, 65}, |
| 17 | .y = {1492, 1492, 1493, 1483, 1502}, |
| 18 | .cols = 5 |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 19 | }; |
| 20 | |
Abhijeet Dharmapurikar | 21184fc | 2012-07-30 19:25:39 -0700 | [diff] [blame] | 21 | static struct pc_temp_ocv_lut pc_temp_ocv = { |
| 22 | .rows = 29, |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 23 | .cols = 5, |
Abhijeet Dharmapurikar | 21184fc | 2012-07-30 19:25:39 -0700 | [diff] [blame] | 24 | .temp = {-20, 0, 25, 40, 65}, |
| 25 | .percent = {100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, |
| 26 | 35, 30, 25, 20, 15, 10, 9, 8, 7, 6, 5, |
| 27 | 4, 3, 2, 1, 0}, |
| 28 | .ocv = { |
| 29 | {4173, 4167, 4163, 4156, 4154}, |
| 30 | {4104, 4107, 4108, 4102, 4104}, |
| 31 | {4057, 4072, 4069, 4061, 4060}, |
| 32 | {3973, 4009, 4019, 4016, 4020}, |
| 33 | {3932, 3959, 3981, 3982, 3983}, |
| 34 | {3899, 3928, 3954, 3950, 3950}, |
| 35 | {3868, 3895, 3925, 3921, 3920}, |
| 36 | {3837, 3866, 3898, 3894, 3892}, |
| 37 | {3812, 3841, 3853, 3856, 3862}, |
| 38 | {3794, 3818, 3825, 3823, 3822}, |
| 39 | {3780, 3799, 3804, 3804, 3803}, |
| 40 | {3768, 3787, 3790, 3788, 3788}, |
| 41 | {3757, 3779, 3778, 3775, 3776}, |
| 42 | {3747, 3772, 3771, 3766, 3765}, |
| 43 | {3736, 3763, 3766, 3760, 3746}, |
| 44 | {3725, 3749, 3756, 3747, 3729}, |
| 45 | {3714, 3718, 3734, 3724, 3706}, |
| 46 | {3701, 3703, 3696, 3689, 3668}, |
| 47 | {3675, 3695, 3682, 3675, 3662}, |
| 48 | {3670, 3691, 3680, 3673, 3661}, |
| 49 | {3661, 3686, 3679, 3672, 3656}, |
| 50 | {3649, 3680, 3676, 3669, 3641}, |
| 51 | {3633, 3669, 3667, 3655, 3606}, |
| 52 | {3610, 3647, 3640, 3620, 3560}, |
| 53 | {3580, 3607, 3596, 3572, 3501}, |
| 54 | {3533, 3548, 3537, 3512, 3425}, |
| 55 | {3457, 3468, 3459, 3429, 3324}, |
| 56 | {3328, 3348, 3340, 3297, 3172}, |
| 57 | {3000, 3000, 3000, 3000, 3000} |
| 58 | } |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 59 | }; |
| 60 | |
Abhijeet Dharmapurikar | 21184fc | 2012-07-30 19:25:39 -0700 | [diff] [blame] | 61 | static struct sf_lut rbatt_sf = { |
| 62 | .rows = 29, |
Abhijeet Dharmapurikar | f6fdcaa0 | 2012-02-27 00:10:10 -0800 | [diff] [blame] | 63 | .cols = 5, |
| 64 | /* row_entries are temperature */ |
| 65 | .row_entries = {-20, 0, 20, 40, 65}, |
Abhijeet Dharmapurikar | 21184fc | 2012-07-30 19:25:39 -0700 | [diff] [blame] | 66 | .percent = {100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, |
| 67 | 35, 30, 25, 20, 15, 10, 9, 8, 7, 6, 5, |
| 68 | 4, 3, 2, 1, 0}, |
Abhijeet Dharmapurikar | f6fdcaa0 | 2012-02-27 00:10:10 -0800 | [diff] [blame] | 69 | .sf = { |
Abhijeet Dharmapurikar | 21184fc | 2012-07-30 19:25:39 -0700 | [diff] [blame] | 70 | {357, 187, 100, 91, 91}, |
| 71 | {400, 208, 105, 94, 94}, |
| 72 | {390, 204, 106, 95, 96}, |
| 73 | {391, 201, 108, 98, 98}, |
| 74 | {391, 202, 110, 98, 100}, |
| 75 | {390, 200, 110, 99, 102}, |
| 76 | {389, 200, 110, 99, 102}, |
| 77 | {393, 202, 101, 93, 100}, |
| 78 | {407, 205, 99, 89, 94}, |
| 79 | {428, 208, 100, 91, 96}, |
| 80 | {455, 212, 102, 92, 98}, |
| 81 | {495, 220, 104, 93, 101}, |
| 82 | {561, 232, 107, 95, 102}, |
| 83 | {634, 245, 112, 98, 98}, |
| 84 | {714, 258, 114, 98, 98}, |
| 85 | {791, 266, 114, 97, 100}, |
| 86 | {871, 289, 108, 95, 97}, |
| 87 | {973, 340, 124, 108, 105}, |
| 88 | {489, 241, 109, 96, 99}, |
| 89 | {511, 246, 110, 96, 99}, |
| 90 | {534, 252, 111, 95, 98}, |
| 91 | {579, 263, 112, 96, 96}, |
| 92 | {636, 276, 111, 95, 97}, |
| 93 | {730, 294, 109, 96, 99}, |
| 94 | {868, 328, 112, 98, 104}, |
| 95 | {1089, 374, 119, 101, 115}, |
| 96 | {1559, 457, 128, 105, 213}, |
| 97 | {12886, 1026, 637, 422, 3269}, |
| 98 | {170899, 127211, 98968, 88907, 77102}, |
Abhijeet Dharmapurikar | f6fdcaa0 | 2012-02-27 00:10:10 -0800 | [diff] [blame] | 99 | } |
| 100 | }; |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 101 | |
Xiaozhe Shi | 5ee9519 | 2012-09-12 15:16:34 -0700 | [diff] [blame] | 102 | struct bms_battery_data palladium_1500_data = { |
Bryan Huntsman | 3f2bc4d | 2011-08-16 17:27:22 -0700 | [diff] [blame] | 103 | .fcc = 1500, |
Abhijeet Dharmapurikar | 21184fc | 2012-07-30 19:25:39 -0700 | [diff] [blame] | 104 | .fcc_temp_lut = &fcc_temp, |
| 105 | .pc_temp_ocv_lut = &pc_temp_ocv, |
| 106 | .rbatt_sf_lut = &rbatt_sf, |
| 107 | .default_rbatt_mohm = 236, |
David Keitel | 8f2601b | 2012-02-14 22:31:07 -0800 | [diff] [blame] | 108 | }; |