System76 common board directory (#53)
* Move configuration for battery into board.mk * lemp9: remove tcpm code * Move touchpad to its own module * Add kbled_reset to all platforms, move items to run on CPU reset to a function * Add defines for battery and charger address * Add I2C_0 export to it5570e * Move common system76 board functions into src/board/system76/common
This commit is contained in:
20
src/board/system76/common/touchpad.c
Normal file
20
src/board/system76/common/touchpad.c
Normal file
@ -0,0 +1,20 @@
|
||||
#include <board/kbc.h>
|
||||
#include <board/touchpad.h>
|
||||
#include <common/debug.h>
|
||||
#include <ec/ps2.h>
|
||||
|
||||
void touchpad_event(void) {
|
||||
if (kbc_second) {
|
||||
*(PS2_TOUCHPAD.control) = 0x07;
|
||||
} else {
|
||||
ps2_reset(&PS2_TOUCHPAD);
|
||||
}
|
||||
|
||||
uint8_t status = *(PS2_TOUCHPAD.status);
|
||||
*(PS2_TOUCHPAD.status) = status;
|
||||
if (status & (1 << 3)) {
|
||||
uint8_t data = *(PS2_TOUCHPAD.data);
|
||||
TRACE("touchpad: %02X\n", data);
|
||||
kbc_mouse(&KBC, data, 1000);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user