diff options
author | Haikun Wang <Haikun.Wang@freescale.com> | 2015-01-21 16:47:42 (GMT) |
---|---|---|
committer | Zhengxiong Jin <Jason.Jin@freescale.com> | 2015-02-05 08:17:31 (GMT) |
commit | 97eb5207434a590554c3948f984f994f2859e64a (patch) | |
tree | 55174358d4dad1542027003b29a2a8e96df3a601 | |
parent | 2b1ea53af2c59f718f91ece8192f3b1b435a0f29 (diff) | |
download | linux-fsl-qoriq-97eb5207434a590554c3948f984f994f2859e64a.tar.xz |
spi:fsl-dspi:bug fix dspi incorrect CS de-assert
Spi chip select signal need to keep asserted between several
spi_transfer in the same spi_message.
But the driver will de-assert CS signal between serval spi_transfer
in the same spi_message under some condiations.This patch fix the bug.
Here is an example:
Assume you have two variables like the following,
struct spi_transfer a;
struct spi_transfer b;
if you send a spi_message only includes 'a' first,
and then you send a spi_message includes 'a' and 'b'
but without reseting 'a'.
Problem will occur in the second spi_message.
Signed-off-by: Haikun Wang <b53464@freescale.com>
Change-Id: I4203a79f3fa5ae83946e40a580009e1b6db8e642
Reviewed-on: http://git.am.freescale.net:8181/28867
Tested-by: Review Code-CDREVIEW <CDREVIEW@freescale.com>
Reviewed-by: Huan Wang <alison.wang@freescale.com>
Reviewed-by: Zhengxiong Jin <Jason.Jin@freescale.com>
-rw-r--r-- | drivers/spi/spi-fsl-dspi.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/spi/spi-fsl-dspi.c b/drivers/spi/spi-fsl-dspi.c index a6df59e..be9d7fc 100644 --- a/drivers/spi/spi-fsl-dspi.c +++ b/drivers/spi/spi-fsl-dspi.c @@ -337,10 +337,10 @@ static int dspi_transfer_one_message(struct spi_master *master, dspi->cur_msg = message; dspi->cur_chip = spi_get_ctldata(spi); dspi->cs = spi->chip_select; + dspi->cs_change = 0; if (dspi->cur_transfer->transfer_list.next == &dspi->cur_msg->transfers) - transfer->cs_change = 1; - dspi->cs_change = transfer->cs_change; + dspi->cs_change = 1; dspi->void_write_data = dspi->cur_chip->void_write_data; dspi->dataflags = 0; |