Loading drivers/power/smb358-charger.c +15 −11 Original line number Diff line number Diff line Loading @@ -1400,6 +1400,7 @@ static void smb358_chg_set_appropriate_vddmax( "Couldn't set float voltage rc = %d\n", rc); } #define HYSTERESIS_DECIDEGC 20 static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) { struct smb358_charger *chip = ctx; Loading @@ -1426,7 +1427,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_present = true; chip->adc_param.low_temp = chip->hot_bat_decidegc; chip->hot_bat_decidegc - HYSTERESIS_DECIDEGC; chip->adc_param.state_request = ADC_TM_COOL_THR_ENABLE; } else if (temp >= Loading @@ -1438,7 +1439,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_present = true; chip->adc_param.low_temp = chip->warm_bat_decidegc; chip->warm_bat_decidegc - HYSTERESIS_DECIDEGC; chip->adc_param.high_temp = chip->hot_bat_decidegc; } else if (temp >= Loading @@ -1450,7 +1451,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_present = true; chip->adc_param.low_temp = chip->cool_bat_decidegc; chip->cool_bat_decidegc - HYSTERESIS_DECIDEGC; chip->adc_param.high_temp = chip->warm_bat_decidegc; } else if (temp >= Loading @@ -1461,7 +1462,8 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_cool = true; bat_present = true; chip->adc_param.low_temp = chip->cold_bat_decidegc; chip->adc_param.low_temp = chip->cold_bat_decidegc - HYSTERESIS_DECIDEGC; if (chip->jeita_supported) chip->adc_param.high_temp = chip->cool_bat_decidegc; Loading @@ -1478,7 +1480,8 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_present = true; chip->adc_param.high_temp = chip->cold_bat_decidegc; chip->adc_param.low_temp = chip->bat_present_decidegc; chip->adc_param.low_temp = chip->bat_present_decidegc - HYSTERESIS_DECIDEGC; chip->adc_param.state_request = ADC_TM_HIGH_LOW_THR_ENABLE; } Loading @@ -1489,8 +1492,8 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_hot = false; bat_warm = false; bat_present = false; chip->adc_param.high_temp = chip->bat_present_decidegc; chip->adc_param.high_temp = chip->bat_present_decidegc + HYSTERESIS_DECIDEGC; chip->adc_param.state_request = ADC_TM_WARM_THR_ENABLE; } else if (temp <= chip->cold_bat_decidegc) { Loading @@ -1500,7 +1503,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_cool = false; bat_present = true; chip->adc_param.high_temp = chip->cold_bat_decidegc; chip->cold_bat_decidegc + HYSTERESIS_DECIDEGC; /* add low_temp to enable batt present check */ chip->adc_param.low_temp = chip->bat_present_decidegc; Loading @@ -1514,7 +1517,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_cool = true; bat_present = true; chip->adc_param.high_temp = chip->cool_bat_decidegc; chip->cool_bat_decidegc + HYSTERESIS_DECIDEGC; chip->adc_param.low_temp = chip->cold_bat_decidegc; chip->adc_param.state_request = Loading @@ -1527,7 +1530,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_cool = false; bat_present = true; chip->adc_param.high_temp = chip->warm_bat_decidegc; chip->warm_bat_decidegc + HYSTERESIS_DECIDEGC; chip->adc_param.low_temp = chip->cool_bat_decidegc; chip->adc_param.state_request = Loading @@ -1544,7 +1547,8 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) else chip->adc_param.low_temp = chip->cold_bat_decidegc; chip->adc_param.high_temp = chip->hot_bat_decidegc; chip->adc_param.high_temp = chip->hot_bat_decidegc + HYSTERESIS_DECIDEGC; chip->adc_param.state_request = ADC_TM_HIGH_LOW_THR_ENABLE; } Loading Loading
drivers/power/smb358-charger.c +15 −11 Original line number Diff line number Diff line Loading @@ -1400,6 +1400,7 @@ static void smb358_chg_set_appropriate_vddmax( "Couldn't set float voltage rc = %d\n", rc); } #define HYSTERESIS_DECIDEGC 20 static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) { struct smb358_charger *chip = ctx; Loading @@ -1426,7 +1427,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_present = true; chip->adc_param.low_temp = chip->hot_bat_decidegc; chip->hot_bat_decidegc - HYSTERESIS_DECIDEGC; chip->adc_param.state_request = ADC_TM_COOL_THR_ENABLE; } else if (temp >= Loading @@ -1438,7 +1439,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_present = true; chip->adc_param.low_temp = chip->warm_bat_decidegc; chip->warm_bat_decidegc - HYSTERESIS_DECIDEGC; chip->adc_param.high_temp = chip->hot_bat_decidegc; } else if (temp >= Loading @@ -1450,7 +1451,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_present = true; chip->adc_param.low_temp = chip->cool_bat_decidegc; chip->cool_bat_decidegc - HYSTERESIS_DECIDEGC; chip->adc_param.high_temp = chip->warm_bat_decidegc; } else if (temp >= Loading @@ -1461,7 +1462,8 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_cool = true; bat_present = true; chip->adc_param.low_temp = chip->cold_bat_decidegc; chip->adc_param.low_temp = chip->cold_bat_decidegc - HYSTERESIS_DECIDEGC; if (chip->jeita_supported) chip->adc_param.high_temp = chip->cool_bat_decidegc; Loading @@ -1478,7 +1480,8 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_present = true; chip->adc_param.high_temp = chip->cold_bat_decidegc; chip->adc_param.low_temp = chip->bat_present_decidegc; chip->adc_param.low_temp = chip->bat_present_decidegc - HYSTERESIS_DECIDEGC; chip->adc_param.state_request = ADC_TM_HIGH_LOW_THR_ENABLE; } Loading @@ -1489,8 +1492,8 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_hot = false; bat_warm = false; bat_present = false; chip->adc_param.high_temp = chip->bat_present_decidegc; chip->adc_param.high_temp = chip->bat_present_decidegc + HYSTERESIS_DECIDEGC; chip->adc_param.state_request = ADC_TM_WARM_THR_ENABLE; } else if (temp <= chip->cold_bat_decidegc) { Loading @@ -1500,7 +1503,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_cool = false; bat_present = true; chip->adc_param.high_temp = chip->cold_bat_decidegc; chip->cold_bat_decidegc + HYSTERESIS_DECIDEGC; /* add low_temp to enable batt present check */ chip->adc_param.low_temp = chip->bat_present_decidegc; Loading @@ -1514,7 +1517,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_cool = true; bat_present = true; chip->adc_param.high_temp = chip->cool_bat_decidegc; chip->cool_bat_decidegc + HYSTERESIS_DECIDEGC; chip->adc_param.low_temp = chip->cold_bat_decidegc; chip->adc_param.state_request = Loading @@ -1527,7 +1530,7 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) bat_cool = false; bat_present = true; chip->adc_param.high_temp = chip->warm_bat_decidegc; chip->warm_bat_decidegc + HYSTERESIS_DECIDEGC; chip->adc_param.low_temp = chip->cool_bat_decidegc; chip->adc_param.state_request = Loading @@ -1544,7 +1547,8 @@ static void smb_chg_adc_notification(enum qpnp_tm_state state, void *ctx) else chip->adc_param.low_temp = chip->cold_bat_decidegc; chip->adc_param.high_temp = chip->hot_bat_decidegc; chip->adc_param.high_temp = chip->hot_bat_decidegc + HYSTERESIS_DECIDEGC; chip->adc_param.state_request = ADC_TM_HIGH_LOW_THR_ENABLE; } Loading