Skip to content

Commit 66fc847

Browse files
authored
Merge pull request #825 from FrameworkComputer/azalea.PL_v0920
azalea: Power Limit table v0920
2 parents 38a7c83 + aececb3 commit 66fc847

File tree

2 files changed

+8
-17
lines changed

2 files changed

+8
-17
lines changed

zephyr/program/lotus/azalea/src/charger.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,7 @@ void board_set_charge_limit(int port, int supplier, int charge_ma,
200200
* And needs to be at least 128mA bigger than the adapter current
201201
*/
202202
prochot_ma = (DIV_ROUND_UP(charge_ma, 128) * 128);
203-
charge_ma = charge_ma * 85 / 100;
203+
charge_ma = charge_ma * 90 / 100;
204204

205205
if ((prochot_ma - charge_ma) < 128) {
206206
charge_ma = prochot_ma - 128;

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

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -88,18 +88,10 @@ static void update_os_power_slider(int mode, int active_mpower)
8888
static void update_adapter_power_limit(int battery_percent, int active_mpower, bool with_dc)
8989
{
9090
if (with_dc && (battery_percent < 3) && active_mpower > 0) {
91-
power_limit[FUNCTION_POWER].mwatt[TYPE_SPL] = 12000;
92-
power_limit[FUNCTION_POWER].mwatt[TYPE_SPPT] = 12000;
93-
power_limit[FUNCTION_POWER].mwatt[TYPE_FPPT] = 15000;
94-
95-
if (active_mpower >= 55000) {
96-
power_limit[FUNCTION_POWER].mwatt[TYPE_P3T] =
97-
(active_mpower * 95 / 100) - 15000 + battery_mwatt_type;
98-
} else {
99-
power_limit[FUNCTION_POWER].mwatt[TYPE_P3T] =
100-
power_limit[FUNCTION_SLIDER].mwatt[TYPE_P3T];
101-
}
102-
91+
power_limit[FUNCTION_POWER].mwatt[TYPE_SPL] = 15000;
92+
power_limit[FUNCTION_POWER].mwatt[TYPE_SPPT] = 15000;
93+
power_limit[FUNCTION_POWER].mwatt[TYPE_FPPT] = 30000;
94+
power_limit[FUNCTION_POWER].mwatt[TYPE_P3T] = active_mpower * 95 / 100;
10395
/* CPB enable */
10496
*host_get_memmap(EC_CUSTOMIZED_MEMMAP_POWER_LIMIT_EVENT) &= ~CPB_DISABLE;
10597
CPRINTS("DRAIN BATTERY");
@@ -128,7 +120,7 @@ static void update_adapter_power_limit(int battery_percent, int active_mpower, b
128120
power_limit[FUNCTION_POWER].mwatt[TYPE_SPPT] = (active_mpower * 85 / 100) - 20000;
129121
power_limit[FUNCTION_POWER].mwatt[TYPE_FPPT] = (active_mpower * 85 / 100) - 15000;
130122
power_limit[FUNCTION_POWER].mwatt[TYPE_P3T] =
131-
(active_mpower * 95 / 100) - 15000 + battery_mwatt_type;
123+
MIN(176000, (active_mpower * 90 / 100) + 89000);
132124
/* CPB enable */
133125
*host_get_memmap(EC_CUSTOMIZED_MEMMAP_POWER_LIMIT_EVENT) &= ~CPB_DISABLE;
134126
} else if ((battery_percent >= 30) && (active_mpower >= 45000)) {
@@ -137,7 +129,7 @@ static void update_adapter_power_limit(int battery_percent, int active_mpower, b
137129
power_limit[FUNCTION_POWER].mwatt[TYPE_SPPT] = 35000;
138130
power_limit[FUNCTION_POWER].mwatt[TYPE_FPPT] = 53000;
139131
power_limit[FUNCTION_POWER].mwatt[TYPE_P3T] =
140-
(active_mpower * 95 / 100) - 15000 + battery_mwatt_type;
132+
MIN(176000, (active_mpower * 90 / 100) + 89000);
141133
/* CPB enable */
142134
*host_get_memmap(EC_CUSTOMIZED_MEMMAP_POWER_LIMIT_EVENT) &= ~CPB_DISABLE;
143135
} else {
@@ -146,8 +138,7 @@ static void update_adapter_power_limit(int battery_percent, int active_mpower, b
146138
power_limit[FUNCTION_POWER].mwatt[TYPE_SPPT] = 35000;
147139
power_limit[FUNCTION_POWER].mwatt[TYPE_FPPT] = battery_mwatt_type - 15000;
148140
/* DC mode p3t should follow os_power_slider */
149-
power_limit[FUNCTION_POWER].mwatt[TYPE_P3T] =
150-
power_limit[FUNCTION_SLIDER].mwatt[TYPE_P3T];
141+
power_limit[FUNCTION_POWER].mwatt[TYPE_P3T] = 89000;
151142
/* CPB enable */
152143
*host_get_memmap(EC_CUSTOMIZED_MEMMAP_POWER_LIMIT_EVENT) &= ~CPB_DISABLE;
153144
}

0 commit comments

Comments
 (0)