diff options
author | Wendly Li <wendlyli@google.com> | 2022-10-13 11:14:54 +0000 |
---|---|---|
committer | Wendly Li <wendlyli@google.com> | 2022-10-14 05:36:54 +0000 |
commit | 731f5bf21d19a3761d3d88a55b21ab837bc5ca03 (patch) | |
tree | 6d6e7ee728e251dd63c560f8729643bfe00aca1b | |
parent | bce2c2785dd25b80227cf2b0f819b95d7d9ab104 (diff) | |
download | goodix_touch-731f5bf21d19a3761d3d88a55b21ab837bc5ca03.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>
-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"); |