diff options
author | Vic Yang <victoryang@chromium.org> | 2014-06-10 21:17:06 -0700 |
---|---|---|
committer | chrome-internal-fetch <chrome-internal-fetch@google.com> | 2014-06-11 22:09:28 +0000 |
commit | 40ca542a0df0731f7f0df9789c9344581f826d11 (patch) | |
tree | 9a302ef6384190d90355984cf9110db2b1711803 | |
parent | 2478058b7a327a2c1c573dc887ade1675ffa85cc (diff) | |
download | chrome-ec-40ca542a0df0731f7f0df9789c9344581f826d11.tar.gz |
Keyborg: fix incorrect column driving in fast scanning
In the fast scan code, the master chip is driving the right side of the
panel at incorrect time. Let's fix this.
BUG=None
TEST=Manual
BRANCH=None
Change-Id: I9500f8ec4947c46762505ff20d0e5c4169bf5a67
Signed-off-by: Vic Yang <victoryang@chromium.org>
Reviewed-on: https://chromium-review.googlesource.com/203370
Reviewed-by: Vincent Palatin <vpalatin@chromium.org>
-rw-r--r-- | board/keyborg/touch_scan.c | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/board/keyborg/touch_scan.c b/board/keyborg/touch_scan.c index bd66c8f0b1..53eec0ae16 100644 --- a/board/keyborg/touch_scan.c +++ b/board/keyborg/touch_scan.c @@ -152,14 +152,19 @@ static inline void set_scan_needed(int col) int fast_scan(uint32_t *data) { int col; + int chip_col; memset(data, 0, SCAN_BUF_SIZE * 4); STM32_PMSE_MRCR = 1 << 31; for (col = 0; col < COL_COUNT * 2; ++col) { - if (col < COL_COUNT) { - enable_col(col, 1); - STM32_PMSE_MCCR = mccr_list[col]; + if (master_slave_is_master()) + chip_col = (col >= COL_COUNT) ? col - COL_COUNT : -1; + else + chip_col = (col < COL_COUNT) ? col : -1; + if (chip_col >= 0) { + enable_col(chip_col, 1); + STM32_PMSE_MCCR = mccr_list[chip_col]; } if (master_slave_sync(5) != EC_SUCCESS) @@ -173,8 +178,8 @@ int fast_scan(uint32_t *data) if (master_slave_sync(5) != EC_SUCCESS) return EC_ERROR_UNKNOWN; - if (col < COL_COUNT) { - enable_col(col, 0); + if (chip_col >= 0) { + enable_col(chip_col, 0); STM32_PMSE_MCCR = 0; } } |