diff options
| author | Tomas Alvarez Vanoli <[email protected]> | 2026-03-24 18:02:12 +0100 |
|---|---|---|
| committer | Fabio Estevam <[email protected]> | 2026-04-02 09:07:48 -0300 |
| commit | 7917c2e356042505c7dea469c358f07b6e424fa2 (patch) | |
| tree | 1aea56b15166193ed45a7ef1d0a3fe4b9dce1c5a | |
| parent | c42db5019df01db7ba6e0b9ed659b6d57ef5c22a (diff) | |
spi: fsl_espi: fix din offset
In the case of SPI_XFER_BEGIN | SPI_XFER_END, the function creates a
buffer of double the size of the transaction, so that it can write the
data in into the second half. It sets the rx_offset to len, and in the
while loop we are setting an internal "din" to buffer + rx_offset.
However, at the end of each loop, the driver copies "buffer + 2 *
cmd_len" back to the data_in pointer.
This commit changes the source of the data to buffer + rx_offset.
Signed-off-by: Tomas Alvarez Vanoli <[email protected]>
| -rw-r--r-- | drivers/spi/fsl_espi.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/spi/fsl_espi.c b/drivers/spi/fsl_espi.c index 7ed35aa3e66..117e36376b7 100644 --- a/drivers/spi/fsl_espi.c +++ b/drivers/spi/fsl_espi.c @@ -275,7 +275,7 @@ int espi_xfer(struct fsl_spi_slave *fsl, uint cs, unsigned int bitlen, } } if (data_in) { - memcpy(data_in, buffer + 2 * cmd_len, tran_len); + memcpy(data_in, buffer + rx_offset, tran_len); if (*buffer == 0x0b) { data_in += tran_len; data_len -= tran_len; |
