Skip to content

Commit fc973f8

Browse files
committed
squash! power: supply: macsmc_power: Add CHLS charge thresholds
Prefer CHWA over CHLS since the SMC firmware from iBoot-10151.1.1 (macOS 14.0) is not compatible with our CHGLS usage. It was working with the SMC firmware from iBoot-10151.121.1 (macOS 14.5). Signed-off-by: Janne Grunau <j@jannau.net>
1 parent 77e8da6 commit fc973f8

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

drivers/power/supply/macsmc_power.c

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -805,10 +805,14 @@ static int macsmc_power_probe(struct platform_device *pdev)
805805
apple_smc_write_u8(power->smc, SMC_KEY(CH0K), 0);
806806
apple_smc_write_u8(power->smc, SMC_KEY(CH0B), 0);
807807

808-
if (apple_smc_read_u16(power->smc, SMC_KEY(CHLS), &vu16) >= 0) {
809-
power->has_chls = true;
810-
} else if (apple_smc_read_flag(power->smc, SMC_KEY(CHWA)) >= 0) {
808+
/*
809+
* Prefer CHWA as the SMC firmware from iBoot-10151.1.1 is not compatible with
810+
* this CHLS usage.
811+
*/
812+
if (apple_smc_read_flag(power->smc, SMC_KEY(CHWA)) >= 0) {
811813
power->has_chwa = true;
814+
} else if (apple_smc_read_u16(power->smc, SMC_KEY(CHLS), &vu16) >= 0) {
815+
power->has_chls = true;
812816
} else {
813817
/* Remove the last 2 properties that control the charge threshold */
814818
power->batt_desc.num_properties -= 2;

0 commit comments

Comments
 (0)