Skip to content

Commit

Permalink
kbc: Add reset function
Browse files Browse the repository at this point in the history
This function can be called after EC init to put the KBC into a known
working state.

Signed-off-by: Tim Crawford <[email protected]>
  • Loading branch information
crawfxrd authored and jackpot51 committed Jul 22, 2023
1 parent 0d83819 commit de546fa
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/board/system76/common/include/board/kbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
extern uint8_t kbc_leds;

void kbc_init(void);
void kbc_reset(void);
bool kbc_scancode(uint16_t key, bool pressed);
void kbc_event(struct Kbc *kbc);

Expand Down
5 changes: 5 additions & 0 deletions src/board/system76/common/kbc.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ void kbc_init(void) {
// Set IRQ mode to level-triggered
*(KBC.irq) = 0;
#endif

kbc_reset();
}

void kbc_reset(void) {
// Set "key lock" to disabled
*(KBC.status) = BIT(4);
}
Expand Down
2 changes: 0 additions & 2 deletions src/ec/ite/include/ec/kbc.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@
#include <stdbool.h>
#include <stdint.h>

void kbc_init(void);

struct Kbc {
// Control register
volatile uint8_t *control;
Expand Down

0 comments on commit de546fa

Please sign in to comment.