system76/common: Adjust KBC interrupts when using ESPI

This commit is contained in:
Jeremy Soller 2020-12-29 10:04:02 -07:00 committed by Jeremy Soller
parent 6da7a48e16
commit 0595ba2b16

View File

@ -3,6 +3,7 @@
#include <stdint.h>
#include <common/debug.h>
#include <ec/espi.h>
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