diff --git a/src/board/system76/common/kbscan.c b/src/board/system76/common/kbscan.c index 59045a3..4bf8ff4 100644 --- a/src/board/system76/common/kbscan.c +++ b/src/board/system76/common/kbscan.c @@ -221,26 +221,32 @@ bool kbscan_press(uint16_t key, bool pressed, uint8_t * layer) { break; case (KT_SCI): if (pressed) { - uint8_t sci = (uint8_t)(key & 0xFF); - - if (!pmc_sci(&PMC_1, sci)) { - // In the case of ignored SCI, reset bit - return false; + // Send SCI if ACPI OS is loaded + if (acpi_ecos != EC_OS_NONE) { + uint8_t sci = (uint8_t)(key & 0xFF); + if (!pmc_sci(&PMC_1, sci)) { + // In the case of ignored SCI, reset bit + return false; + } } + // Handle hardware hotkeys hardware_hotkey(key); } break; case (KT_SCI_EXTRA): if (pressed) { - uint8_t sci = SCI_EXTRA; - sci_extra = (uint8_t)(key & 0xFF); - - if (!pmc_sci(&PMC_1, sci)) { - // In the case of ignored SCI, reset bit - return false; + // Send SCI if ACPI OS is loaded + if (acpi_ecos != EC_OS_NONE) { + uint8_t sci = SCI_EXTRA; + sci_extra = (uint8_t)(key & 0xFF); + if (!pmc_sci(&PMC_1, sci)) { + // In the case of ignored SCI, reset bit + return false; + } } + // Handle hardware hotkeys hardware_hotkey(key); } break; diff --git a/src/board/system76/common/lid.c b/src/board/system76/common/lid.c index 6c7d08d..d2c2383 100644 --- a/src/board/system76/common/lid.c +++ b/src/board/system76/common/lid.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-3.0-only #include +#include #include #include #include @@ -33,15 +34,17 @@ void lid_event(void) { DEBUG("closed\n"); } - // Send SCI + // Send SCI if ACPI OS is loaded send_sci = true; } lid_state = new; if (send_sci) { - // Send SCI 0x1B for lid event - if (pmc_sci(&PMC_1, 0x1B)) { - send_sci = false; + // Send SCI 0x1B for lid event if ACPI OS is loaded + if (acpi_ecos != EC_OS_NONE) { + if (pmc_sci(&PMC_1, 0x1B)) { + send_sci = false; + } } } } diff --git a/src/board/system76/common/power.c b/src/board/system76/common/power.c index 4105531..7a455c7 100644 --- a/src/board/system76/common/power.c +++ b/src/board/system76/common/power.c @@ -370,9 +370,11 @@ void power_event(void) { ac_send_sci = true; } if (ac_send_sci) { - // Send SCI 0x16 for AC detect event - if (pmc_sci(&PMC_1, 0x16)) { - ac_send_sci = false; + // Send SCI 0x16 for AC detect event if ACPI OS is loaded + if (acpi_ecos != EC_OS_NONE) { + if (pmc_sci(&PMC_1, 0x16)) { + ac_send_sci = false; + } } } ac_last = ac_new;