mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
kernel/fogo:fix The device automatically restarts during use
fogo: fix spi read write driver Change-Id: I5a74bee3eb109f898529f1459303c18544ca2ba1 Reviewed-on: https://gerrit.mot.com/2790440 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Jun Weng <wengjun1@motorola.com> Reviewed-by: Huosheng Liao <liaohs@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
908b9dec72
commit
47cbbdadeb
1 changed files with 13 additions and 2 deletions
|
|
@ -414,7 +414,12 @@ int32_t CTP_SPI_READ(struct spi_device *client, uint8_t *buf, uint16_t len)
|
|||
|
||||
while (retries < 5) {
|
||||
ret = spi_read_write(client, buf, len, NVTREAD);
|
||||
if (ret == 0) break;
|
||||
if (ret == 0)
|
||||
break;
|
||||
else if (ret == -ETIMEDOUT) {
|
||||
NVT_ERR("read error, ret = %d\n", ret);
|
||||
break;
|
||||
}
|
||||
retries++;
|
||||
}
|
||||
|
||||
|
|
@ -448,7 +453,13 @@ int32_t CTP_SPI_WRITE(struct spi_device *client, uint8_t *buf, uint16_t len)
|
|||
|
||||
while (retries < 5) {
|
||||
ret = spi_read_write(client, buf, len, NVTWRITE);
|
||||
if (ret == 0) break;
|
||||
if (ret == 0)
|
||||
break;
|
||||
else if (ret == -ETIMEDOUT) {
|
||||
NVT_ERR("write error, ret = %d\n", ret);
|
||||
break;
|
||||
}
|
||||
|
||||
retries++;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue