From fcf4ad02f1eec3316678bf7dac95c21cffb921ce Mon Sep 17 00:00:00 2001 From: Arne182 Date: Sat, 26 Feb 2011 11:03:39 -0800 Subject: [PATCH 1/2] Inital Arne's EB Support added. --- drivers/power/ds2746_param.c | 7 +++++++ include/linux/ds2746_param_config.h | 4 ++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/power/ds2746_param.c b/drivers/power/ds2746_param.c index b881e113..07f78364 100644 --- a/drivers/power/ds2746_param.c +++ b/drivers/power/ds2746_param.c @@ -727,6 +727,13 @@ static BOOL __battery_param_udpate(struct battery_type *battery) /* calculate temperature*/ // battery->temp_01c = get_temp_c((float)temp_R_kohm / ((float)temp_adc_resl/battery->temp_adc - 1))*10; temp_01c = get_temp_01c(battery); + if(temp_01c == 700) + { + FL_25[battery->id_index] = 2350; + battery->charge_full_real_mAh = FL_25[battery->id_index]; + battery->charge_full_design_mAh = battery->charge_full_real_mAh; + temp_01c = 650 - battery->temp_adc*10; + } if (temp_01c >= TEMP_MIN*10) battery->temp_01c = temp_01c; else diff --git a/include/linux/ds2746_param_config.h b/include/linux/ds2746_param_config.h index 9779340f..ece34ee4 100644 --- a/include/linux/ds2746_param_config.h +++ b/include/linux/ds2746_param_config.h @@ -46,8 +46,8 @@ UINT32 ID_RANGE[] = 7150, 15500, /* Sony 1300mAh (Formosa) */ /* 7.1k~15k */ 27500, 49500, /* Sony 1300mAh (HTE) */ /* 28k~49.5k */ 15500, 27500, /* Sanyo 1300mAh (HTE) */ /* 16k~27k */ - 100, 7150, /* Samsung 1230mAh */ /* 1k~7k */ - 0, 100, /* HTC Extended 2300mAh */ /* 0k~1k */ + 100, 7150, /* Samsung 1230mAh */ /* 0.1k~7k */ + 0, 100, /* HTC Extended 2300mAh */ /* 0k~0.1k */ }; /*This table is calculated according to temp formula for temp mapping. From 3cc2d57e15326672237dfe22e2ba1e8f13fd66a7 Mon Sep 17 00:00:00 2001 From: Arne182 Date: Tue, 1 Mar 2011 22:35:03 -0800 Subject: [PATCH 2/2] Changed Voltage percentage curve and changed capacity to 2300mAh for EB --- drivers/power/ds2746_param.c | 8 ++++---- include/linux/ds2746_param_config.h | 6 +++--- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/drivers/power/ds2746_param.c b/drivers/power/ds2746_param.c index 07f78364..d8470bf1 100644 --- a/drivers/power/ds2746_param.c +++ b/drivers/power/ds2746_param.c @@ -719,17 +719,17 @@ static BOOL __battery_param_udpate(struct battery_type *battery) batt_id_stable_counter = 0; } } - + temp_01c = get_temp_01c(battery); if (batt_id_index == 5) { - battery->temp_adc = battery->temp_adc * 7; + //battery->temp_adc = battery->temp_adc * 7; + temp_01c = 650 - battery->temp_adc*10; } /* calculate temperature*/ // battery->temp_01c = get_temp_c((float)temp_R_kohm / ((float)temp_adc_resl/battery->temp_adc - 1))*10; - temp_01c = get_temp_01c(battery); if(temp_01c == 700) { - FL_25[battery->id_index] = 2350; + FL_25[battery->id_index] = 2300; battery->charge_full_real_mAh = FL_25[battery->id_index]; battery->charge_full_design_mAh = battery->charge_full_real_mAh; temp_01c = 650 - battery->temp_adc*10; diff --git a/include/linux/ds2746_param_config.h b/include/linux/ds2746_param_config.h index ece34ee4..728f0d4d 100644 --- a/include/linux/ds2746_param_config.h +++ b/include/linux/ds2746_param_config.h @@ -102,12 +102,12 @@ UINT32 *TEMP_MAP = TEMP_MAP_300K; UINT32 FL_25[] = { - 1280, /* Unknown battery */ + 2300, /* Unknown battery */ 1280, /* Sony 1300mAh (Formosa) */ 1280, /* Sony 1300mAh (HTE) */ 1250, /* Sanyo 1300mAh (HTE) */ 1230, /* Samsung 1230mAh */ - 2350, /* HTC Extended 2300mAh */ + 2300, /* HTC Extended 2300mAh */ }; UINT32 PD_M_COEF[] = @@ -159,7 +159,7 @@ UINT32 M_PARAMETER_Samsung_1230MAH_FORMOSA[] = UINT32 M_PARAMETER_HTC_2300MAH_FORMOSA[] = { /* capacity (in 0.01%) -> voltage (in mV)*/ - 10000, 4196, 7500, 4165, 4700, 3986, 1700, 3879, 900, 3833, 300, 3740, 0, 3420, + 10000, 4135, 7500, 3960, 4700, 3800, 1700, 3727, 900, 3674, 300, 3640, 0, 3420, };