diff --git a/src/board/system76/darp5/acpi.c b/src/board/system76/darp5/acpi.c index 4063b27..c48b5c4 100644 --- a/src/board/system76/darp5/acpi.c +++ b/src/board/system76/darp5/acpi.c @@ -59,9 +59,15 @@ uint8_t acpi_read(uint8_t addr) { ACPI_16(0x1A, battery_full_capacity); ACPI_16(0x22, battery_design_voltage); - // Bypass status test in ACPI - TODO case 0x26: - data |= 1 << 1; + // If AC adapter connected + if (!gpio_get(&ACIN_N)) { + // And battery is not fully charged + if (!(battery_status & 0x0020)) { + // Battery is charging + data |= 1 << 1; + } + } break; ACPI_16(0x2A, battery_current); diff --git a/src/board/system76/galp3-c/acpi.c b/src/board/system76/galp3-c/acpi.c index 2ffb5c9..5df0af5 100644 --- a/src/board/system76/galp3-c/acpi.c +++ b/src/board/system76/galp3-c/acpi.c @@ -74,9 +74,15 @@ uint8_t acpi_read(uint8_t addr) { ACPI_16(0x1A, battery_full_capacity); ACPI_16(0x22, battery_design_voltage); - // Bypass status test in ACPI - TODO case 0x26: - data |= 1 << 1; + // If AC adapter connected + if (!gpio_get(&ACIN_N)) { + // And battery is not fully charged + if (!(battery_status & 0x0020)) { + // Battery is charging + data |= 1 << 1; + } + } break; ACPI_16(0x2A, battery_current); diff --git a/src/board/system76/lemp9/acpi.c b/src/board/system76/lemp9/acpi.c index bd9e345..ec0b79c 100644 --- a/src/board/system76/lemp9/acpi.c +++ b/src/board/system76/lemp9/acpi.c @@ -74,9 +74,15 @@ uint8_t acpi_read(uint8_t addr) { ACPI_16(0x1A, battery_full_capacity); ACPI_16(0x22, battery_design_voltage); - // Bypass status test in ACPI - TODO case 0x26: - data |= 1 << 1; + // If AC adapter connected + if (!gpio_get(&ACIN_N)) { + // And battery is not fully charged + if (!(battery_status & 0x0020)) { + // Battery is charging + data |= 1 << 1; + } + } break; ACPI_16(0x2A, battery_current);