summaryrefslogtreecommitdiff
path: root/driver/touchpad_st.c
diff options
context:
space:
mode:
authorWei-Han Chen <stimim@google.com>2018-09-25 10:49:09 +0800
committerchrome-bot <chrome-bot@chromium.org>2018-09-26 10:32:06 -0700
commit81851d0e69e89ff158427e91ded5dd88ac1a2e9e (patch)
treea74b9b4fc10254257f8b0f61d1f3e225e4c14103 /driver/touchpad_st.c
parent63dd0de36d4ca7148a3c775ffb59c7eff610cf93 (diff)
downloadchrome-ec-81851d0e69e89ff158427e91ded5dd88ac1a2e9e.tar.gz
touchpad_st: read dummy byte while dumping memory
We forgot to add dummy byte while dumping memory. Also make sure all other spi_transaction calls take dummy byte into account. BRANCH=nocturne BUG=b:112877237 TEST=manual on whiskers Signed-off-by: Wei-Han Chen <stimim@chromium.org> Change-Id: I5366e16103a0b1ba502dd34ba4c3536482b99776 Reviewed-on: https://chromium-review.googlesource.com/1242575 Commit-Ready: Wei-Han Chen <stimim@chromium.org> Tested-by: Wei-Han Chen <stimim@chromium.org> Reviewed-by: Nicolas Boichat <drinkcat@chromium.org>
Diffstat (limited to 'driver/touchpad_st.c')
-rw-r--r--driver/touchpad_st.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/driver/touchpad_st.c b/driver/touchpad_st.c
index be6628815a..ddef727fe9 100644
--- a/driver/touchpad_st.c
+++ b/driver/touchpad_st.c
@@ -556,7 +556,7 @@ static void dump_error(void)
*/
static void dump_memory(void)
{
- uint32_t size = 0x10000, rx_len = 512;
+ uint32_t size = 0x10000, rx_len = 512 + ST_TP_DUMMY_BYTE;
uint32_t offset, i;
uint8_t cmd[] = {0xFB, 0x00, 0x10, 0x00, 0x00};
@@ -818,7 +818,7 @@ static int wait_for_flash_ready(uint8_t type)
while (retry--) {
ret = spi_transaction(SPI, tx_buf, sizeof(tx_buf),
- (uint8_t *)&rx_buf, 2);
+ (uint8_t *)&rx_buf, 1 + ST_TP_DUMMY_BYTE);
if (ret == EC_SUCCESS && !(rx_buf.bytes[0] & 0x80))
break;
msleep(50);