mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-10 22:40:54 -04:00
mmi_parallel_charger: optimize temp zone structure
-1, set temp_c as signed constant -2, add conditional judgment to prevent invalid temp zone Change-Id: I7ed0fe09034c5669f1538954ebf871e1ed7cf0e7 Signed-off-by: xuwt2 <xuwt2@lenovo.com> Reviewed-on: https://gerrit.mot.com/1408609 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jianqi Yang <yangj@motorola.com> Submit-Approved: Jira Key Reviewed-on: https://gerrit.mot.com/1893549 Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Reviewed-by: Wei Xu <xuwei9@lenovo.com>
This commit is contained in:
parent
6db973a7a7
commit
616e6682fb
2 changed files with 4 additions and 3 deletions
|
|
@ -113,7 +113,7 @@ bool mmi_find_temp_zone(struct mmi_charger_manager *chip, int temp_c)
|
|||
colder_t = zones[prev_zone - 1].temp_c;
|
||||
}
|
||||
|
||||
if (temp_c < MIN_TEMP_C)
|
||||
if (temp_c <= MIN_TEMP_C)
|
||||
chip->pres_temp_zone = ZONE_COLD;
|
||||
else if (temp_c >= max_temp)
|
||||
chip->pres_temp_zone = ZONE_HOT;
|
||||
|
|
@ -151,7 +151,8 @@ bool mmi_find_chrg_step(struct mmi_charger_manager *chip, int temp_zone, int vba
|
|||
}
|
||||
|
||||
if (chip->pres_temp_zone == ZONE_HOT ||
|
||||
chip->pres_temp_zone == ZONE_COLD) {
|
||||
chip->pres_temp_zone == ZONE_COLD ||
|
||||
chip->pres_temp_zone < ZONE_FIRST) {
|
||||
mmi_chrg_err(chip, "pres temp zone is HOT or COLD, "
|
||||
"can't find chrg step\n");
|
||||
return false;
|
||||
|
|
|
|||
|
|
@ -101,7 +101,7 @@ struct mmi_chrg_step_power {
|
|||
};
|
||||
|
||||
struct mmi_chrg_temp_zone {
|
||||
u32 temp_c; /*temperature*/
|
||||
int temp_c; /*temperature*/
|
||||
struct mmi_chrg_step_power *chrg_step_power;
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue