blob: 7e4b2fd05328dabcb27ad5673e69d483dba918d4 [file] [log] [blame]
tingtingf50326f2013-06-05 15:07:24 +08001/* Copyright (c) 2013, The Linux Foundation. All rights reserved.
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 Shi7ef86d92013-06-13 10:58:21 -070013#include <linux/batterydata-lib.h>
tingtingf50326f2013-06-05 15:07:24 +080014
15static struct single_row_lut fcc_temp = {
16 .x = {-20, 0, 25, 40, 60},
17 .y = {1343, 1353, 1408, 1345, 1342},
18 .cols = 5
19};
20
21static struct single_row_lut fcc_sf = {
22 .x = {0},
23 .y = {100},
24 .cols = 1
25};
26
27static struct sf_lut rbatt_sf = {
28 .rows = 29,
29 .cols = 5,
30 .row_entries = {-20, 0, 25, 40, 60},
31 .percent = {100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35,
32 30, 25, 20, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0},
33 .sf = {
34 {604, 192, 100, 79, 71},
35 {605, 192, 100, 79, 71},
36 {641, 205, 103, 81, 72},
37 {641, 221, 108, 84, 75},
38 {622, 238, 115, 87, 77},
39 {612, 254, 123, 92, 79},
40 {605, 252, 137, 96, 83},
41 {607, 219, 154, 104, 87},
42 {613, 202, 135, 109, 89},
43 {626, 200, 106, 90, 77},
44 {656, 201, 101, 82, 75},
45 {684, 204, 100, 84, 77},
46 {710, 211, 100, 85, 79},
47 {747, 224, 106, 89, 82},
48 {806, 241, 116, 90, 80},
49 {905, 260, 119, 87, 77},
50 {1046, 291, 113, 87, 77},
51 {1309, 329, 116, 90, 79},
52 {1476, 300, 126, 97, 83},
53 {1598, 311, 127, 98, 84},
54 {1771, 323, 130, 99, 85},
55 {1984, 342, 136, 101, 86},
56 {2438, 368, 140, 101, 86},
57 {3381, 388, 137, 100, 84},
58 {4913, 414, 141, 99, 86},
59 {6979, 468, 155, 104, 90},
60 {9968, 565, 192, 113, 98},
61 {16163, 833, 350, 140, 120},
62 {36511, 6483, 4872, 472, 1095}
63 }
64};
65
66static struct pc_temp_ocv_lut pc_temp_ocv = {
67 .rows = 29,
68 .cols = 5,
69 .temp = {-20, 0, 25, 40, 60},
70 .percent = {100, 95, 90, 85, 80, 75, 70, 65, 60, 55, 50, 45, 40, 35,
71 30, 25, 20, 15, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0},
72 .ocv = {
73 {4177, 4174, 4199, 4167, 4162},
74 {4107, 4112, 4141, 4109, 4106},
75 {4058, 4064, 4091, 4061, 4059},
76 {3996, 4015, 4044, 4017, 4015},
77 {3947, 3975, 4001, 3978, 3976},
78 {3909, 3939, 3962, 3943, 3940},
79 {3874, 3901, 3926, 3911, 3907},
80 {3845, 3858, 3892, 3882, 3878},
81 {3821, 3826, 3851, 3849, 3846},
82 {3801, 3804, 3815, 3810, 3808},
83 {3788, 3789, 3793, 3789, 3787},
84 {3778, 3780, 3778, 3776, 3773},
85 {3769, 3776, 3770, 3767, 3764},
86 {3757, 3772, 3766, 3762, 3757},
87 {3740, 3765, 3762, 3754, 3744},
88 {3714, 3747, 3750, 3739, 3724},
89 {3668, 3706, 3717, 3710, 3697},
90 {3602, 3644, 3662, 3662, 3654},
91 {3533, 3571, 3601, 3607, 3605},
92 {3518, 3557, 3583, 3592, 3590},
93 {3500, 3543, 3565, 3576, 3574},
94 {3478, 3528, 3546, 3559, 3557},
95 {3451, 3506, 3521, 3538, 3534},
96 {3417, 3473, 3481, 3505, 3496},
97 {3377, 3423, 3424, 3454, 3444},
98 {3327, 3361, 3351, 3391, 3380},
99 {3261, 3279, 3258, 3310, 3297},
100 {3165, 3165, 3138, 3198, 3182},
101 {3000, 3000, 3000, 3000, 3000}
102 }
103};
104
105struct bms_battery_data qrd_4v2_1300mah_data = {
106 .fcc = 1300,
107 .fcc_temp_lut = &fcc_temp,
108 .fcc_sf_lut = &fcc_sf,
109 .pc_temp_ocv_lut = &pc_temp_ocv,
110 .rbatt_sf_lut = &rbatt_sf,
111 .default_rbatt_mohm = 172
112};