diff options
author | Dasky <32983009+daskygit@users.noreply.github.com> | 2023-12-04 00:14:28 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-04 00:14:28 +0000 |
commit | 86f073a8eaaa58648ca9168cc9ca318e76041c49 (patch) | |
tree | 1939a25a6f3f1f4c8ed84082d291d184c530d694 /drivers/sensors | |
parent | ce81801480d21147900f968e76c90974c889d244 (diff) |
Add basic presence check for cirque trackpad. (#22546)
Diffstat (limited to 'drivers/sensors')
-rw-r--r-- | drivers/sensors/cirque_pinnacle.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/drivers/sensors/cirque_pinnacle.c b/drivers/sensors/cirque_pinnacle.c index 3131805c20..b5c1abdebc 100644 --- a/drivers/sensors/cirque_pinnacle.c +++ b/drivers/sensors/cirque_pinnacle.c @@ -216,6 +216,13 @@ void cirque_pinnacle_cursor_smoothing(bool enable) { RAP_Write(HOSTREG__FEEDCONFIG3, feedconfig3); } +// Check sensor is connected +bool cirque_pinnacle_connected(void) { + uint8_t zidle = 0; + RAP_ReadBytes(HOSTREG__ZIDLE, &zidle, 1); + return zidle == HOSTREG__ZIDLE_DEFVAL; +} + /* Pinnacle-based TM040040/TM035035/TM023023 Functions */ void cirque_pinnacle_init(void) { #if defined(POINTING_DEVICE_DRIVER_cirque_pinnacle_spi) @@ -274,6 +281,10 @@ void cirque_pinnacle_init(void) { } cirque_pinnacle_enable_feed(true); + +#ifndef CIRQUE_PINNACLE_SKIP_SENSOR_CHECK + touchpad_init = cirque_pinnacle_connected(); +#endif } pinnacle_data_t cirque_pinnacle_read_data(void) { |