diff options
author | Hyungwoo Yang <hyungwooyang@google.com> | 2023-02-27 07:10:40 +0000 |
---|---|---|
committer | Hyungwoo Yang <hyungwooyang@google.com> | 2023-03-08 05:34:21 +0000 |
commit | d7162912e6da57cd046545fecf4e26eb4e281290 (patch) | |
tree | dbb1e8783ae038e4c712407940436f24ac312862 | |
parent | 56a9d343f35dff81006fe10a92e35edae0b4e508 (diff) | |
download | novatek_touch-d7162912e6da57cd046545fecf4e26eb4e281290.tar.gz |
touch/novatek: stylus info handling on normal fairingandroid-13.0.0_r0.92android-13.0.0_r0.127android-13.0.0_r0.126android-13.0.0_r0.125android-13.0.0_r0.124android-13.0.0_r0.123android-13.0.0_r0.121android-13.0.0_r0.117android-13.0.0_r0.116android-13.0.0_r0.115android-13.0.0_r0.114android-13.0.0_r0.113android-13.0.0_r0.112android-13.0.0_r0.107android-13.0.0_r0.106android-13.0.0_r0.105android-13.0.0_r0.104android-13.0.0_r0.103android-13.0.0_r0.100android-gs-tangorpro-5.10-android13-qpr3android-gs-raviole-5.10-android13-qpr3android-gs-pantah-5.10-android13-qpr3android-gs-lynx-5.10-android13-qpr3android-gs-felix-5.10-android13-qpr3-candroid-gs-felix-5.10-android13-qpr3android-gs-bluejay-5.10-android13-qpr3
Sometimes, even with the only one stylus, we see normal pairing
happening instead of fast pairing. This removes the stylus
information maintained in the driver and the UI platform cannot
shows the stylus information until the driver collects the same
information again.
This patch, when there's normal pairing, compares new HASH ID with the
one from the previous stylus. The driver removes the stylus information
only when the HASH ID is changed.
Bug: 259261326
Change-Id: I1cda091a3455d8e7adcdecfeeded5de69bbece5d
Signed-off-by: Hyungwoo Yang <hyungwooyang@google.com>
-rw-r--r-- | nt36xxx/nt36xxx.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/nt36xxx/nt36xxx.c b/nt36xxx/nt36xxx.c index ea24edb..ab7d104 100644 --- a/nt36xxx/nt36xxx.c +++ b/nt36xxx/nt36xxx.c @@ -1591,8 +1591,14 @@ static void process_usi_responses(uint16_t info_buf_flags, const uint8_t *info_b } } - if (info_buf_flags & USI_NORMAL_PAIR_FLAG) - nvt_usi_clear_stylus_read_map(); + if (info_buf_flags & USI_NORMAL_PAIR_FLAG) { + uint8_t hash_id[2] = {0}; + + /* clear stylus info map if the HASH ID is not available or not matched */ + if (nvt_usi_get_hash_id(hash_id) || hash_id[0] != *(info_buf + USI_HASH_ID_OFFSET) || + hash_id[1] != *(info_buf + USI_HASH_ID_OFFSET + 1)) + nvt_usi_clear_stylus_read_map(); + } if (info_buf_flags & USI_BATTERY_FLAG) { nvt_usi_store_battery(info_buf + USI_BATTERY_OFFSET); |