diff options
author | Wendly Li <wendlyli@google.com> | 2022-10-13 11:14:54 +0000 |
---|---|---|
committer | Wendly Li <wendlyli@google.com> | 2022-11-02 10:27:41 +0000 |
commit | 110cb4c053f662579afe49986971649a4d266d1d (patch) | |
tree | 191ac91c8fb0be64ca3e2ede5bde4f72036fa5fc /goodix_brl_hw.c | |
parent | b16b7761f8365500c7c3f4f2f22241115376f6fc (diff) | |
download | goodix_touch-110cb4c053f662579afe49986971649a4d266d1d.tar.gz |
touch/goodix: Fix brl_set_scan_mode
Bug: 253539023
Test: echo 1 > /sys/devices/platform/goodix_ts.0/scan_mode
Change-Id: If5f6c967c2c84db1aa1c990d7bf11eb563a088aa
Signed-off-by: Wendly Li <wendlyli@google.com>
Diffstat (limited to 'goodix_brl_hw.c')
-rw-r--r-- | goodix_brl_hw.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/goodix_brl_hw.c b/goodix_brl_hw.c index 46018dc..5ff8e77 100644 --- a/goodix_brl_hw.c +++ b/goodix_brl_hw.c @@ -1519,10 +1519,19 @@ int brl_get_scan_mode(struct goodix_ts_core *cd, enum raw_scan_mode* mode) int brl_set_scan_mode(struct goodix_ts_core *cd, enum raw_scan_mode mode) { struct goodix_ts_cmd cmd; + static const uint8_t raw_scan_mode_cmd_codes[] ={ + [RAW_SCAN_MODE_AUTO] = 0x00, + [RAW_SCAN_MODE_NORMAL_ACTIVE] = 0x02, + [RAW_SCAN_MODE_NORMAL_IDLE] = 0x03, + [RAW_SCAN_MODE_LOW_POWER_ACTIVE] = 0x00, + [RAW_SCAN_MODE_LOW_POWER_IDLE] = 0x00, + [RAW_SCAN_MODE_SLEEP] = 0x00, + }; + cmd.cmd = GOODIX_CMD_SET_SCAN_MODE; cmd.len = 5; - cmd.data[0] = mode; + cmd.data[0] = raw_scan_mode_cmd_codes[mode]; if (cd->hw_ops->send_cmd(cd, &cmd)) ts_err("failed set scan mode cmd"); |