From a668cd559c771d7fb0e383d838f462bc8d0eca11 Mon Sep 17 00:00:00 2001 From: root Date: Sun, 19 Jun 2011 08:41:04 +0800 Subject: [PATCH] RK29 phone:modify battery parameter --- drivers/power/wm831x_power.c | 137 +++++++++-------------------------- 1 file changed, 33 insertions(+), 104 deletions(-) diff --git a/drivers/power/wm831x_power.c b/drivers/power/wm831x_power.c index a702ab2117ab..d3cf3e566405 100755 --- a/drivers/power/wm831x_power.c +++ b/drivers/power/wm831x_power.c @@ -33,119 +33,48 @@ #define WM831X_CHG_SYSLO_MASK ~(0x7 << 4) #define WM831X_CHG_SYSOK_MASK ~(0x7 << 0) -#define batt_num 57 -#if 0 -static int batt_chg_step_table[batt_num]={ - 3650,3700,3710,3720,3730,3740,3745,3755,3760, //+200 - 3770,3790,3805,3820,3830,3840, //+190 - 3842,3850,3860,3870,3880,3885, //+180 - - 3900,3910,3920,3930,3940,3950,3960,3970,3980,3990, //+170 - 4000,4010,4020,4030,4040,4050,4070,4090,4095,4100,4105,4110,4115,4120,4125,4130, - 4135,4140,4145,4150,4155,4160,4165,4170,4175,4180 -}; +#define batt_num 52 -static int batt_step_table[batt_num]={ - 3450,3500,3510,3520,3530,3540,3545,3555,3560, - 3580,3600,3615,3630,3640,3650, - 3660,3670,3680,3690,3700,3710, - 3720,3730,3740,3750,3760,3770,3780,3790,3800,3810, - 3815,3830,3845,3860,3875,3890,3900,3910,3920,3930,3940,3950,3960,3970,3985,4000, - 4005,4010,4015,4020,4030,4040,4050,4060,4070,4180 -}; - -static int batt_chg_disp_table[batt_num]={ - 0,2,4,6,8,10,12,14,15, - 18,20,23,26,28,30, - 33,37,40,43,47,50, - 52,54,57,60,62,64,66,68,69,70, - 72,74,76,78,79,80,81,82,83,84,85,86,87,88,89,90, - 91,92,93,94,95,96,97,98,99,100 -}; -#endif -#if 0 -//2010-3-15 for bengoV2 battery static int batt_step_table[batt_num] = { - //3100,3200,3280,3340,3410,3460,3510,3540,3550,3560,3570, - //3580,3590,3600,3610,3620,3630,3640, - //3650,3660,3670,3680,3690,3700,3710,3720,3730,3740, - //3750,3760,3770,3780,3790,3800,3810,3820,3830,3840, - //3860,3880,3900,3920,3940,3960,3980,3990,4010, - //4020,4030,4040,4050,4060,4070,4080,4085,4090,4090 - 3450,3455,3460,3465,3470,3475,3480,3485,3490,3495,3500, - 3540,3545,3550,3555,3560,3565,3570, - 3610,3620,3630,3640,3650,3660,3670,3680,3690,3700, - 3740,3750,3760,3770,3780,3790,3800,3810,3820,3830, - 3870,3880,3890,3900,3910,3920,3930,3940,3950, - 4020,4030,4040,4050,4060,4070,4080,4085,4088,4090 + 3370,3405,3440,3475,3505,3530, + 3550,3567,3584,3600,3615, + 3630,3643,3655,3665,3673, + 3680,3687,3693,3699,3705, + 3710,3714,3718,3722,3726, + 3730,3734,3738,3742,3746, + 3750,3756,3764,3774,3786, + 3800,3808,3817,3827,3838, + 3950,3964,3982,4002,4026, + 4050,4074,4098,4123,4149,4178 }; static int batt_disp_table[batt_num] = { - 0,1,2,3,5,6,8,10,12,13,15, - 17,19,21,23,25,27,29, - 31,33,35,37,39,41,43,45,47,49, - 51,53,55,58,60,62,64,66,68,70, - 72,75,77,79,81,84,86,88,90, - 91,92,93,94,95,96,97,98,99,100 + 0,1,2,3,5,7, + 9,11,13,15,17, + 19,21,23,25,27, + 29,31,33,35,37, + 39,41,43,45,47, + 49,51,53,55,57, + 59,61,63,65,67, + 69,71,73,75,77, + 79,81,83,85,87, + 89,91,93,95,97,100 }; -static int batt_chg_step_table[batt_num]={ - //3500,3550,3590,3600,3610,3660,3690,3730,3740,3750,3760, - //3765,3770,3775,3780,3785,3790,3795, - //3805,3830,3840,3850,3860,3870,3880,3890,3900,3910, - //3920,3925,3930,3940,3945,3950,3955,3960,3965,3970, - //3980,4000,4020,4040,4060,4080,4100,4110,4130, - //4135,4140,4145,4150,4155,4160,4160,4160,4160,4160 - 3650,3655,3660,3665,3670,3675,3680,3685,3690,3695,3700, - //3740,3745,3750,3755,3760,3765,3770, - 3730,3735,3740,3745,3750,3755,3760, - //3810,3820,3830,3840,3850,3860,3870,3880,3890,3900, - 3790,3800,3810,3820,3830,3840,3850,3860,3870,3880, - //3940,3950,3960,3970,3980,3990,4000,4010,4020,4030, - 3910,3920,3930,3940,3950,3960,3970,3980,3990,4000, - 4030,4040,4050,4065,4080,4090,4100,4110,4120, - 4135,4140,4145,4150,4155,4160,4160,4160,4160,4160 -}; -#endif -//2011-4-22 for k300 battery -static int batt_step_table[batt_num] = { - 3450,3465,3480,3510,3535,3540,3550,3560,3570,3575,3585, - 3600,3610,3615,3620,3623,3625,3628, - 3630,3640,3650,3655,3660,3665,3670,3680,3685,3690, - 3700,3705,3710,3725,3730,3745,3755,3780,3790,3800, - 3810,3830,3850,3860,3880,3890,3920,3940,3950, - 3960,3970,3980,3990,4000,4010,4020,4030,4040,4070 +static int batt_chg_step_table[batt_num] = { + 3530,3565,3600,3635,3655,3680,//+160 + 3700,3717,3734,3745,3755,//+150 + 3770,3778,3786,3795,3803,//+140 + 3810,3814,3818,3822,3825,//+130 + 3830,3832,3834,3836,3837,//+120 + 3840,3842,3844,3846,3847,//+110 + 3850,3857,3864,3871,3876,//+100 + 3890,3897,3904,3911,3918,//+90 + 4030,4047,4064,4080,4096,//+80 + 4120,4132,4144,4156,4170,4180//+70 }; -static int batt_disp_table[batt_num] = { - 0,1,2,3,5,6,8,10,12,13,15, - 17,19,21,23,25,27,29, - 31,33,35,37,39,41,43,45,47,49, - 51,53,55,58,60,62,64,66,68,70, - 72,75,77,79,81,84,86,88,90, - 91,92,93,94,95,96,97,98,99,100 -}; -#if 0 -// the max battery fast charge current is 1000mA -static int batt_chg_step_table[batt_num]={ - 3650,3665,3680,3710,3735,3740,3750,3760,3770,3775,3785,//+200 - 3800,3810,3815,3820,3823,3825,3828,//+200 - 3830,3840,3850,3855,3860,3865,3870,3880,3885,3890,//+200 - 3900,3905,3910,3925,3930,3945,3955,3980,3990,4000,//+200 - 4010,4030,4050,4060,4080,4090,4100,4105,4110, - 4115,4120,4130,4140,4150,4160,4165,4170,4175,4180 -}; -#else -// now the max battery fast charge current is 350mA -static int batt_chg_step_table[batt_num]={ - 3600,3615,3630,3660,3685,3690,3700,3710,3720,3725,3735,//+150 - 3740,3750,3755,3760,3763,3765,3768,//+140 - 3780,3790,3800,3805,3810,3815,3820,3830,3835,3840,//+150 - 3845,3850,3855,3865,3870,3885,3895,3920,3930,3940,//+140 - 3960,3980,4000,4010,4030,4040,4070,4090,4100,//+150 - 4115,4120,4130,4140,4150,4160,4165,4170,4175,4180 -}; -#endif + #define TIMER_MS_COUNTS 1000 struct wm_batt_priv_data { -- 2.34.1