spi: rockchip: Increase transfer completion wait time

Increase the transfer completion wait time to 4 seconds.

Change-Id: I0bc56ac219f3b470b2184e3411ccdadfc9a7f5ac
Signed-off-by: Xuhui Lin <xuhui.lin@rock-chips.com>
This commit is contained in:
Xuhui Lin
2024-09-09 15:39:29 +08:00
committed by Tao Huang
parent c3f682ec2b
commit ad889adf73

View File

@@ -173,6 +173,7 @@
#define ROCKCHIP_SPI_REGISTER_SIZE 0x1000
#define ROCKCHIP_SPI_XFER_TIMEOUT_MS 4000
#define ROCKCHIP_AUTOSUSPEND_TIMEOUT 500
enum rockchip_spi_xfer_mode {
@@ -584,7 +585,7 @@ static int rockchip_spi_pio_transfer(struct rockchip_spi *rs,
ms = 8LL * 1000LL * xfer->len;
do_div(ms, speed_hz);
ms += ms + 200; /* some tolerance */
ms += ROCKCHIP_SPI_XFER_TIMEOUT_MS; /* some tolerance */
if (ms > UINT_MAX || ctlr->slave)
ms = UINT_MAX;
@@ -790,7 +791,7 @@ static int rockchip_spi_transfer_wait(struct spi_controller *ctlr,
ms = 8LL * 1000LL * xfer->len;
do_div(ms, speed_hz);
ms += ms + 200; /* some tolerance */
ms += ROCKCHIP_SPI_XFER_TIMEOUT_MS; /* some tolerance */
if (ms > UINT_MAX)
ms = UINT_MAX;