Skip to content

Commit 55f3b9c

Browse files
LeilaCY-Linquinchou77
authored andcommitted
fwk: lilac: Modify 75W battery PL setting
Modify 75W battery PL setting; the setting is the same as 65W's battery. BRANCH=fwk-lilac-refresh BUG=Modify 75W battery setting TEST=75W battery can recognize and cpupower setting same as 65W battery Signed-off-by: LeilaCY-Lin <LeilaCY_Lin@compal.com> (cherry picked from commit 0484faf57d99cababedfd3b4fce73094f82be69a)
1 parent 01cc0f9 commit 55f3b9c

1 file changed

Lines changed: 13 additions & 4 deletions

File tree

zephyr/program/framework/azalea/src/cpu_power.c

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@
1919
#define CPRINTS(format, args...) cprints(CC_USBCHARGE, format, ## args)
2020
#define CPRINTF(format, args...) cprintf(CC_USBCHARGE, format, ## args)
2121

22+
#define BATTERY_55mW 55000
23+
#define BATTERY_61mW 61000
24+
/*75W's PL setting same as 61W*/
25+
#define BATTERY_75mW BATTERY_61mW
26+
2227
static int battery_mwatt_type;
2328
static int battery_current_limit_mA;
2429
static int powerlimit_restore;
@@ -312,12 +317,16 @@ void update_soc_power_limit(bool force_update, bool force_no_adapter)
312317

313318
static void initial_soc_power_limit(void)
314319
{
315-
const char *str = "FRANGWAT01";
320+
const char *curr_model = battery_static[BATT_IDX_MAIN].model_ext;
316321
static int pre_battery_type;
317322

318-
battery_mwatt_type =
319-
(!strncmp(battery_static[BATT_IDX_MAIN].model_ext, str, 10) ?
320-
BATTERY_61mW : BATTERY_55mW);
323+
if (!strncmp(curr_model, "FRANEDA", 7)) {
324+
battery_mwatt_type = BATTERY_75mW;
325+
} else if (!strncmp(curr_model, "FRANGWAT01", 10)) {
326+
battery_mwatt_type = BATTERY_61mW;
327+
} else {
328+
battery_mwatt_type = BATTERY_55mW;
329+
}
321330

322331
if (pre_battery_type != battery_mwatt_type)
323332
pre_battery_type = battery_mwatt_type;

0 commit comments

Comments
 (0)