blob: 2960a8b405d70182c4699c93dfbbe803359e75e8 [file] [log] [blame]
David Keitel8f2601b2012-02-14 22:31:07 -08001/* Copyright (c) 2011-2012, Code Aurora Forum. All rights reserved.
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -07002 *
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
13#include <linux/mfd/pm8xxx/pm8921-bms.h>
14
David Keitel8f2601b2012-02-14 22:31:07 -080015static struct single_row_lut palladium_1500_fcc_temp = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070016 .x = {-30, -20, -10, 0, 10, 25, 40, 60},
17 .y = {1103, 1179, 1284, 1330, 1420, 1511, 1541, 1571},
18 .cols = 8,
19};
20
David Keitel8f2601b2012-02-14 22:31:07 -080021static struct single_row_lut palladium_1500_fcc_sf = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070022 .x = {100, 200, 300, 400, 500},
23 .y = {97, 93, 93, 90, 87},
24 .cols = 5,
25};
26
Abhijeet Dharmapurikarf6fdcaa02012-02-27 00:10:10 -080027static struct sf_lut palladium_1500_pc_sf = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070028 .rows = 10,
29 .cols = 5,
Abhijeet Dharmapurikarf6fdcaa02012-02-27 00:10:10 -080030 /* row_entries are chargecycles */
31 .row_entries = {100, 200, 300, 400, 500},
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070032 .percent = {100, 90, 80, 70, 60, 50, 40, 30, 20, 10},
33 .sf = {
34 {97, 93, 93, 90, 87},
35 {97, 93, 93, 90, 87},
36 {98, 94, 92, 89, 86},
37 {98, 94, 92, 89, 86},
38 {99, 94, 92, 88, 86},
39 {99, 95, 92, 88, 87},
40 {99, 95, 92, 88, 87},
41 {99, 95, 92, 88, 87},
42 {99, 95, 92, 88, 87},
43 {99, 95, 92, 88, 87}
44 },
45};
46
Abhijeet Dharmapurikarf6fdcaa02012-02-27 00:10:10 -080047static struct sf_lut palladium_1500_rbatt_sf = {
48 .rows = 19,
49 .cols = 5,
50 /* row_entries are temperature */
51 .row_entries = {-20, 0, 20, 40, 65},
52 .percent = {100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50,
53 45, 40, 35, 30, 25, 20, 15, 10
54 },
55 .sf = {
56 {645, 301, 100, 80, 69},
57 {616, 290, 100, 79, 69},
58 {586, 279, 100, 78, 68},
59 {564, 270, 100, 78, 68},
60 {546, 262, 100, 78, 68},
61 {537, 256, 100, 79, 68},
62 {536, 253, 100, 79, 69},
63 {552, 258, 100, 81, 71},
64 {618, 284, 100, 80, 72},
65 {643, 290, 100, 77, 68},
66 {673, 294, 100, 77, 68},
67 {720, 296, 100, 77, 69},
68 {769, 294, 100, 76, 68},
69 {821, 288, 100, 74, 67},
70 {892, 284, 100, 74, 61},
71 {1003, 290, 100, 71, 58},
72 {1192, 307, 100, 70, 58},
73 {1579, 345, 100, 68, 57},
74 {1261, 324, 100, 68, 57},
75 }
76};
David Keitel8f2601b2012-02-14 22:31:07 -080077static struct pc_temp_ocv_lut palladium_1500_pc_temp_ocv = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -070078 .rows = 29,
79 .cols = 8,
80 .temp = {-30, -20, -10, 0, 10, 25, 40, 60},
81 .percent = {100, 95, 90, 85, 80, 75, 70, 65, 60, 55,
82 50, 45, 40, 35, 30, 25, 20, 15, 10, 9,
83 8, 7, 6, 5, 4, 3, 2, 1, 0
84 },
85 .ocv = {
86 {3673, 3814, 3945, 4025, 4106, 4176, 4218, 4260},
87 {3613, 3751, 3880, 3959, 4038, 4107, 4149, 4190},
88 {3573, 3710, 3837, 3916, 3994, 4062, 4103, 4144},
89 {3534, 3670, 3796, 3873, 3951, 4019, 4059, 4099},
90 {3491, 3625, 3749, 3826, 3902, 3969, 4009, 4049},
91 {3464, 3597, 3721, 3796, 3872, 3939, 3978, 4018},
92 {3436, 3568, 3691, 3766, 3841, 3907, 3946, 3985},
93 {3407, 3537, 3659, 3733, 3808, 3873, 3912, 3951},
94 {3377, 3507, 3627, 3701, 3775, 3840, 3878, 3917},
95 {3355, 3484, 3604, 3677, 3751, 3815, 3853, 3891},
96 {3339, 3467, 3586, 3659, 3732, 3796, 3834, 3872},
97 {3324, 3452, 3570, 3643, 3716, 3780, 3818, 3855},
98 {3312, 3440, 3558, 3630, 3703, 3766, 3804, 3842},
99 {3303, 3430, 3548, 3620, 3692, 3756, 3793, 3831},
100 {3297, 3424, 3541, 3614, 3686, 3749, 3787, 3824},
101 {3288, 3414, 3531, 3603, 3675, 3738, 3776, 3813},
102 {3272, 3398, 3514, 3586, 3658, 3720, 3757, 3795},
103 {3240, 3365, 3480, 3551, 3622, 3684, 3721, 3758},
104 {3224, 3348, 3463, 3533, 3604, 3666, 3702, 3739},
105 {3221, 3344, 3459, 3530, 3600, 3662, 3695, 3728},
106 {3216, 3340, 3454, 3525, 3595, 3657, 3686, 3715},
107 {3212, 3335, 3449, 3520, 3590, 3652, 3677, 3703},
108 {3203, 3326, 3440, 3510, 3580, 3642, 3664, 3686},
109 {3185, 3307, 3420, 3490, 3560, 3621, 3639, 3657},
110 {3176, 3298, 3411, 3481, 3550, 3611, 3626, 3640},
111 {3151, 3272, 3384, 3453, 3522, 3583, 3593, 3604},
112 {3106, 3225, 3335, 3446, 3472, 3531, 3538, 3545},
113 {3021, 3217, 3245, 3417, 3429, 3435, 3439, 3442},
114 {3000, 3000, 3000, 3000, 3000, 3000, 3000, 3000}
115 },
116};
117
David Keitel8f2601b2012-02-14 22:31:07 -0800118struct pm8921_bms_battery_data palladium_1500_data = {
Bryan Huntsman3f2bc4d2011-08-16 17:27:22 -0700119 .fcc = 1500,
David Keitel8f2601b2012-02-14 22:31:07 -0800120 .fcc_temp_lut = &palladium_1500_fcc_temp,
121 .fcc_sf_lut = &palladium_1500_fcc_sf,
122 .pc_temp_ocv_lut = &palladium_1500_pc_temp_ocv,
123 .pc_sf_lut = &palladium_1500_pc_sf,
Abhijeet Dharmapurikarf6fdcaa02012-02-27 00:10:10 -0800124 .rbatt_sf_lut = &palladium_1500_rbatt_sf,
125 .default_rbatt_mohm = 254,
David Keitel8f2601b2012-02-14 22:31:07 -0800126};