kbc: Add reset function
This function can be called after EC init to put the KBC into a known working state. Signed-off-by: Tim Crawford <tcrawford@system76.com>
This commit is contained in:
committed by
Jeremy Soller
parent
0d83819a21
commit
de546fa761
@@ -10,6 +10,7 @@
|
|||||||
extern uint8_t kbc_leds;
|
extern uint8_t kbc_leds;
|
||||||
|
|
||||||
void kbc_init(void);
|
void kbc_init(void);
|
||||||
|
void kbc_reset(void);
|
||||||
bool kbc_scancode(uint16_t key, bool pressed);
|
bool kbc_scancode(uint16_t key, bool pressed);
|
||||||
void kbc_event(struct Kbc *kbc);
|
void kbc_event(struct Kbc *kbc);
|
||||||
|
|
||||||
|
@@ -18,6 +18,11 @@ void kbc_init(void) {
|
|||||||
// Set IRQ mode to level-triggered
|
// Set IRQ mode to level-triggered
|
||||||
*(KBC.irq) = 0;
|
*(KBC.irq) = 0;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
kbc_reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
void kbc_reset(void) {
|
||||||
// Set "key lock" to disabled
|
// Set "key lock" to disabled
|
||||||
*(KBC.status) = BIT(4);
|
*(KBC.status) = BIT(4);
|
||||||
}
|
}
|
||||||
|
@@ -8,8 +8,6 @@
|
|||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
void kbc_init(void);
|
|
||||||
|
|
||||||
struct Kbc {
|
struct Kbc {
|
||||||
// Control register
|
// Control register
|
||||||
volatile uint8_t *control;
|
volatile uint8_t *control;
|
||||||
|
Reference in New Issue
Block a user