From 0595ba2b16c6d65d7bfc0520b6c93f284c004ded Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 29 Dec 2020 10:04:02 -0700 Subject: [PATCH] system76/common: Adjust KBC interrupts when using ESPI --- src/board/system76/common/pnp.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/board/system76/common/pnp.c b/src/board/system76/common/pnp.c index d9a2ba5..8b63e4d 100644 --- a/src/board/system76/common/pnp.c +++ b/src/board/system76/common/pnp.c @@ -3,6 +3,7 @@ #include #include +#include volatile uint8_t __xdata __at(0x1200) IHIOA; volatile uint8_t __xdata __at(0x1201) IHD; @@ -33,10 +34,18 @@ void pnp_enable() { // Enable KBC keyboard pnp_write(0x07, 0x06); +#if EC_ESPI + // When using eSPI, IRQ must be inverted and edge-triggered + pnp_write(0x71, 0x02); +#endif // EC_ESPI pnp_write(0x30, 0x01); // Enable KBC mouse pnp_write(0x07, 0x05); +#if EC_ESPI + // When using eSPI, IRQ must be inverted and edge-triggered + pnp_write(0x71, 0x02); +#endif // EC_ESPI pnp_write(0x30, 0x01); // Enable SMFI