From cc86aabcf9f88ce01c149d6fc60527d721f536c9 Mon Sep 17 00:00:00 2001 From: "David.Huang" Date: Mon, 16 Jan 2017 14:38:36 +0800 Subject: [PATCH] Basking: Add Basking battery parameters for charger profile override. BRANCH=reef BUG=chrome-os-partner:60899 TEST=Observed correct charging profile is selected with Basking two battery. Change-Id: I2b030bf2c52e4717bec269d79dbab4c0f0126852 Signed-off-by: David Huang Reviewed-on: https://chromium-review.googlesource.com/428612 Reviewed-by: Vijay P Hiremath Reviewed-by: Aaron Durbin --- board/reef/battery.c | 94 +++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 92 insertions(+), 2 deletions(-) diff --git a/board/reef/battery.c b/board/reef/battery.c index 9996272194..6e5f616243 100644 --- a/board/reef/battery.c +++ b/board/reef/battery.c @@ -177,6 +177,96 @@ const struct battery_info batt_info_sonycorp = { .discharging_max_c = 75, }; +static const struct fast_charge_profile fast_charge_smp_c22n1626_info[] = { + /* < 1C */ + [TEMP_RANGE_0] = { + .temp_c = TEMPC_TENTHS_OF_DEG(0), + .current_mA = { + [VOLTAGE_RANGE_LOW] = 0, + [VOLTAGE_RANGE_HIGH] = 0, + }, + }, + + /* >=1C && <=10C */ + [TEMP_RANGE_1] = { + .temp_c = TEMPC_TENTHS_OF_DEG(10), + .current_mA = { + [VOLTAGE_RANGE_LOW] = 1752, + [VOLTAGE_RANGE_HIGH] = 1752, + }, + }, + + /* 10C > && <=45C */ + [TEMP_RANGE_2] = { + .temp_c = TEMPC_TENTHS_OF_DEG(45), + .current_mA = { + [VOLTAGE_RANGE_LOW] = 5200, + [VOLTAGE_RANGE_HIGH] = 5200, + }, + }, + + /* 45C > && <=60C */ + [TEMP_RANGE_3] = { + .temp_c = TEMPC_TENTHS_OF_DEG(60), + .current_mA = { + [VOLTAGE_RANGE_LOW] = 2920, + [VOLTAGE_RANGE_HIGH] = 0, + }, + }, + + /* > 60C */ + [TEMP_RANGE_4] = { + .temp_c = TEMPC_TENTHS_OF_DEG(CHARGER_PROF_TEMP_C_LAST_RANGE), + .current_mA = { + [VOLTAGE_RANGE_LOW] = 0, + [VOLTAGE_RANGE_HIGH] = 0, + }, + }, +}; + +static const struct fast_charge_params fast_chg_params_smp_c22n1626 = { + .total_temp_ranges = ARRAY_SIZE(fast_charge_smp_c22n1626_info), + .default_temp_range_profile = TEMP_RANGE_2, + .vtg_low_limit_mV = 8200, + .chg_profile_info = &fast_charge_smp_c22n1626_info[0], +}; + +static const struct fast_charge_profile fast_charge_cpt_c22n1626_info[] = { + /* < 0C */ + [TEMP_RANGE_0] = { + .temp_c = TEMPC_TENTHS_OF_DEG(-1), + .current_mA = { + [VOLTAGE_RANGE_LOW] = 0, + [VOLTAGE_RANGE_HIGH] = 0, + }, + }, + + /* >=0C && <=60C */ + [TEMP_RANGE_1] = { + .temp_c = TEMPC_TENTHS_OF_DEG(60), + .current_mA = { + [VOLTAGE_RANGE_LOW] = 5200, + [VOLTAGE_RANGE_HIGH] = 5200, + }, + }, + + /* >60C */ + [TEMP_RANGE_2] = { + .temp_c = TEMPC_TENTHS_OF_DEG(CHARGER_PROF_TEMP_C_LAST_RANGE), + .current_mA = { + [VOLTAGE_RANGE_LOW] = 0, + [VOLTAGE_RANGE_HIGH] = 0, + }, + }, +}; + +static const struct fast_charge_params fast_chg_params_cpt_c22n1626 = { + .total_temp_ranges = ARRAY_SIZE(fast_charge_cpt_c22n1626_info), + .default_temp_range_profile = TEMP_RANGE_1, + .vtg_low_limit_mV = 8000, + .chg_profile_info = &fast_charge_cpt_c22n1626_info[0], +}; + const struct battery_info batt_info_c22n1626 = { .voltage_max = 8800, /* mV */ .voltage_normal = 7700, @@ -270,7 +360,7 @@ static const struct board_batt_params info[] = { [BATTERY_SMP_C22N1626] = { .manuf_name = "AS1FNZD3KD", .ship_mode_inf = &ship_mode_info_c22n1626, - .fast_chg_params = &fast_chg_params_smp_cos4870, + .fast_chg_params = &fast_chg_params_smp_c22n1626, .batt_info = &batt_info_c22n1626, }, @@ -278,7 +368,7 @@ static const struct board_batt_params info[] = { [BATTERY_CPT_C22N1626] = { .manuf_name = "AS1FOAD3KD", .ship_mode_inf = &ship_mode_info_c22n1626, - .fast_chg_params = &fast_chg_params_smp_cos4870, + .fast_chg_params = &fast_chg_params_cpt_c22n1626, .batt_info = &batt_info_c22n1626, }, };