From 373dc3667687ec3f994caa62c26c718b5c1ccb38 Mon Sep 17 00:00:00 2001 From: Tim Crawford Date: Tue, 10 Jan 2023 12:08:37 -0700 Subject: [PATCH] kbc: Enable Transaction Done interrupt Step 2 for data transmission (both RX and TX) is to enable the Transaction Done interrupt. Ref: IT5570 V0.3.2, 7.9.3.1 Hardware Mode Selected Signed-off-by: Tim Crawford --- src/board/system76/common/kbc.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/board/system76/common/kbc.c b/src/board/system76/common/kbc.c index c80bf6e..73b76aa 100644 --- a/src/board/system76/common/kbc.c +++ b/src/board/system76/common/kbc.c @@ -396,6 +396,9 @@ static void kbc_on_input_data(struct Kbc *kbc, uint8_t data) { state = KBC_STATE_NORMAL; // Begin write *(PS2_TOUCHPAD.control) = 0x0D; + // Enable Transaction Done interrupt + *(PS2_TOUCHPAD.interrupt) |= BIT(2); + // Write the data *(PS2_TOUCHPAD.data) = data; // Pull data line low *(PS2_TOUCHPAD.control) = 0x0C; @@ -481,6 +484,8 @@ void kbc_event(struct Kbc *kbc) { if (kbc_second_wait == 0) { // Attempt to read from touchpad *(PS2_TOUCHPAD.control) = 0x07; + // Enable Transaction Done interrupt + *(PS2_TOUCHPAD.interrupt) |= BIT(2); if (state == KBC_STATE_NORMAL) { uint8_t sts = *(PS2_TOUCHPAD.status); *(PS2_TOUCHPAD.status) = sts;