Skip to content

Commit 50902d3

Browse files
JohnWC-Yehamstan
authored andcommitted
fwk: tulip: charger option_0 ooa control
TI charger IC has different power consumption causing S5 cannot pass ErP regulation. In S5/S3/S0ix(AC & Battery in fully charged state) set the charger EN_OOA = 0 to reduce charger power consumption. BRANCH=fwk-tulip-29169 BUG=https://app.clickup.com/t/86ev17dkd TEST=use charger_dump command check 0x12 BIT(10). If AC + DC 100% in S3/S5, 0x12 Bit(10) will set to 0. Reduce power consumption by 169 mW in S5. Reduce power consumption by 184 mW for UMA and 170 mW for DIS in S0ix. Signed-off-by: johnwc_yeh <JohnWC_Yeh@compal.com>
1 parent 635a388 commit 50902d3

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

zephyr/program/framework/tulip/src/charger.c

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -395,3 +395,25 @@ __override int board_confirm_buck_transition_ready(enum level_buck_mode mode)
395395

396396
return rv;
397397
}
398+
399+
static void charger_chipset_suspend(void)
400+
{
401+
int batt_soc = charge_get_percent();
402+
bool batt_is_present = (battery_is_present() == BP_YES) ? true : false;
403+
404+
if (chipset_in_or_transitioning_to_state(CHIPSET_STATE_ANY_OFF |
405+
CHIPSET_STATE_ANY_SUSPEND) && extpower_is_present() &&
406+
batt_is_present && batt_soc == 100) {
407+
bq25710_set_ooa(CHARGER_SOLO, 0);
408+
} else {
409+
bq25710_set_ooa(CHARGER_SOLO, 1);
410+
}
411+
}
412+
DECLARE_HOOK(HOOK_CHIPSET_SUSPEND, charger_chipset_suspend, HOOK_PRIO_DEFAULT);
413+
DECLARE_HOOK(HOOK_BATTERY_SOC_CHANGE, charger_chipset_suspend, HOOK_PRIO_DEFAULT);
414+
415+
static void charger_chipset_resume(void)
416+
{
417+
bq25710_set_ooa(CHARGER_SOLO, 1);
418+
}
419+
DECLARE_HOOK(HOOK_CHIPSET_RESUME, charger_chipset_resume, HOOK_PRIO_DEFAULT);

0 commit comments

Comments
 (0)