From c3fa2a27a7d6a4c94bbef2ec6cfb4ad963ff30d0 Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 29 Dec 2020 10:06:06 -0700 Subject: [PATCH] system76/common/peci.c: Do not use PECI when in C10 state and using ESPI --- src/board/system76/common/peci.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/board/system76/common/peci.c b/src/board/system76/common/peci.c index 010403f..7a35cd4 100644 --- a/src/board/system76/common/peci.c +++ b/src/board/system76/common/peci.c @@ -1,10 +1,12 @@ // SPDX-License-Identifier: GPL-3.0-only #include +#include #include #include #include #include +#include #include #include @@ -118,9 +120,15 @@ int peci_wr_pkg_config(uint8_t index, uint16_t param, uint32_t data) { // PECI information can be found here: https://www.intel.com/content/dam/www/public/us/en/documents/design-guides/core-i7-lga-2011-guide.pdf void peci_event(void) { uint8_t duty; - if (power_state == POWER_STATE_S0) { - // Use PECI if in S0 state +#if EC_ESPI + // Use PECI if CPU is not in C10 state + if (gpio_get(&CPU_C10_GATE_N)) +#else // EC_ESPI + // Use PECI if in S0 state + if (power_state == POWER_STATE_S0) +#endif // EC_ESPI + { // Wait for completion while (HOSTAR & 1) {} // Clear status