Skip to content

Commit

Permalink
Removed cold battery logic and replaced with
Browse files Browse the repository at this point in the history
normal temp logic
  • Loading branch information
H2102M committed Jun 19, 2024
1 parent 111b483 commit 597907e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"files.associations": {
"sec_battery.h": "c"
}
}
21 changes: 14 additions & 7 deletions drivers/battery/common/sec_battery_thermal.c
Original file line number Diff line number Diff line change
Expand Up @@ -885,14 +885,21 @@ void sec_bat_thermal_check(struct sec_battery_info *battery)
SEC_BAT_CURRENT_EVENT_SWELLING_MODE);
break;
case BAT_THERMAL_COLD:
// battery->usb_thm_status = USB_THM_NORMAL;
// battery->cold_cool3_thresh += THERMAL_HYSTERESIS_2;
// battery->cool3_cool2_thresh += THERMAL_HYSTERESIS_2;
// battery->cool2_cool1_thresh += THERMAL_HYSTERESIS_2;
// battery->cool1_normal_thresh += THERMAL_HYSTERESIS_2;
// sec_vote(battery->chgen_vote, VOTER_SWELLING, true, SEC_BAT_CHG_MODE_CHARGING_OFF);
// battery->health = POWER_SUPPLY_HEALTH_COLD;
// sec_bat_set_charging_status(battery, POWER_SUPPLY_STATUS_NOT_CHARGING);
battery->usb_thm_status = USB_THM_NORMAL;
battery->cold_cool3_thresh += THERMAL_HYSTERESIS_2;
battery->cool3_cool2_thresh += THERMAL_HYSTERESIS_2;
battery->cool2_cool1_thresh += THERMAL_HYSTERESIS_2;
battery->cool1_normal_thresh += THERMAL_HYSTERESIS_2;
sec_vote(battery->chgen_vote, VOTER_SWELLING, true, SEC_BAT_CHG_MODE_CHARGING_OFF);
battery->health = POWER_SUPPLY_HEALTH_COLD;
sec_bat_set_charging_status(battery, POWER_SUPPLY_STATUS_NOT_CHARGING);
sec_vote(battery->fcc_vote, VOTER_SWELLING, false, 0);
sec_vote(battery->fv_vote, VOTER_SWELLING, false, 0);
sec_vote(battery->topoff_vote, VOTER_SWELLING, false, 0);
sec_vote(battery->chgen_vote, VOTER_SWELLING, false, 0);
battery->health = POWER_SUPPLY_HEALTH_GOOD;
break;
#if defined(CONFIG_BATTERY_CISD)
battery->cisd.data[CISD_DATA_UNSAFETY_TEMPERATURE]++;
battery->cisd.data[CISD_DATA_UNSAFE_TEMPERATURE_PER_DAY]++;
Expand Down

0 comments on commit 597907e

Please sign in to comment.