summaryrefslogtreecommitdiff
path: root/goodix_brl_hw.c
diff options
context:
space:
mode:
authorWendly Li <wendlyli@google.com>2022-11-30 14:35:41 +0000
committerWendly Li <wendlyli@google.com>2022-11-30 16:21:36 +0000
commitf513b970e0473db577afe9bba02e2cd8327eb270 (patch)
tree8d4af756bddc7f575efd4193ebbce08dad1cc8d8 /goodix_brl_hw.c
parentc9caff69d8254154342af935eca1501af123f53c (diff)
downloadgoodix_touch-f513b970e0473db577afe9bba02e2cd8327eb270.tar.gz
touch/goodix: Import v1.2.2 driver
Bug: 260835421 Test: Check one bin and two bin work properly Change-Id: I628ca6da4e33315da5489888d7c0d6617541bdb5 Signed-off-by: Wendly Li <wendlyli@google.com>
Diffstat (limited to 'goodix_brl_hw.c')
-rw-r--r--goodix_brl_hw.c24
1 files changed, 23 insertions, 1 deletions
diff --git a/goodix_brl_hw.c b/goodix_brl_hw.c
index 5ff8e77..c423674 100644
--- a/goodix_brl_hw.c
+++ b/goodix_brl_hw.c
@@ -46,7 +46,8 @@ enum brl_request_code {
BRL_REQUEST_CODE_REF_ERR = 0x02,
BRL_REQUEST_CODE_RESET = 0x03,
BRL_REQUEST_CODE_CLOCK = 0x04,
- BRL_REQUEST_CODE_UPDATE = 0x05
+ BRL_REQUEST_CODE_UPDATE = 0x05,
+ BRL_REQUEST_PEN_FREQ_HOP = 0x10,
};
static int brl_select_spi_mode(struct goodix_ts_core *cd)
@@ -1246,6 +1247,27 @@ static int brl_event_handler(
ts_event->request_code = REQUEST_TYPE_RESET;
else if (request->request_type == BRL_REQUEST_CODE_UPDATE)
ts_event->request_code = REQUEST_TYPE_UPDATE;
+ else if (request->request_type == BRL_REQUEST_PEN_FREQ_HOP)
+ if (request->data_len && !checksum_cmp(request->data,
+ request->data_len + 2,
+ CHECKSUM_MODE_U8_LE)) {
+ if (request->data_len + 2 <=
+ GOODIX_REQUEST_DATA_LEN) {
+ memcpy(ts_event->request_data,
+ request->data,
+ request->data_len + 2);
+ ts_event->request_code =
+ REQUEST_PEN_FREQ_HOP;
+ } else {
+ ts_err("request data len exceed limit %d",
+ request->data_len + 2);
+ }
+ } else {
+ ts_info("invalid request data %d",
+ request->data_len);
+ ts_info("request data:%*ph", request->data_len,
+ request->data);
+ }
else
ts_debug("unsupported request code 0x%x",
request->request_type);