diff options
author | Ravi Jain <raviajain@google.com> | 2022-12-07 15:50:47 +0800 |
---|---|---|
committer | Ravi Jain <raviajain@google.com> | 2022-12-07 15:50:47 +0800 |
commit | 51d002993d6867023d54bb4f00c167c6da2b9f7d (patch) | |
tree | f5327a757941e2bd15687fa70666c721e4f18c60 /goodix_brl_hw.c | |
parent | 54134850b07c335d110050dd5837af9f4bb5b1c6 (diff) | |
parent | 23f746a78e7081741677a30eec3a62df2e4fac76 (diff) | |
download | goodix_touch-51d002993d6867023d54bb4f00c167c6da2b9f7d.tar.gz |
Merge branch android13-gs-pixel-5.10-tm-qpr2 into android13-gs-pixel-5.15
Change-Id: I4df3c0d02549a14215966ec2ebd22e5bb8b9f51a
Signed-off-by: Ravi Jain <raviajain@google.com>
Diffstat (limited to 'goodix_brl_hw.c')
-rw-r--r-- | goodix_brl_hw.c | 26 |
1 files changed, 24 insertions, 2 deletions
diff --git a/goodix_brl_hw.c b/goodix_brl_hw.c index 5ff8e77..1e3bc1a 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) @@ -343,7 +344,7 @@ static int brl_irq_enable(struct goodix_ts_core *cd, bool enable) } if (!enable && atomic_cmpxchg(&cd->irq_enabled, 1, 0)) { - disable_irq(cd->irq); + disable_irq_nosync(cd->irq); ts_debug("Irq disabled"); return 0; } @@ -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); |