Commit 2431a815 authored by Scott Jiang's avatar Scott Jiang Committed by Grant Likely

spi/spi-bfin5xx: Fix flush of last bit after each spi transfer

This patch ensures that the last bit of a transfer gets correctly
flushed out of the register.
Signed-off-by: default avatarScott Jiang <scott.jiang.linux@gmail.com>
Signed-off-by: default avatarGrant Likely <grant.likely@secretlab.ca>
parent 128465ca
...@@ -587,6 +587,7 @@ static void bfin_spi_pump_transfers(unsigned long data) ...@@ -587,6 +587,7 @@ static void bfin_spi_pump_transfers(unsigned long data)
if (message->state == DONE_STATE) { if (message->state == DONE_STATE) {
dev_dbg(&drv_data->pdev->dev, "transfer: all done!\n"); dev_dbg(&drv_data->pdev->dev, "transfer: all done!\n");
message->status = 0; message->status = 0;
bfin_spi_flush(drv_data);
bfin_spi_giveback(drv_data); bfin_spi_giveback(drv_data);
return; return;
} }
...@@ -870,8 +871,10 @@ static void bfin_spi_pump_transfers(unsigned long data) ...@@ -870,8 +871,10 @@ static void bfin_spi_pump_transfers(unsigned long data)
message->actual_length += drv_data->len_in_bytes; message->actual_length += drv_data->len_in_bytes;
/* Move to next transfer of this msg */ /* Move to next transfer of this msg */
message->state = bfin_spi_next_transfer(drv_data); message->state = bfin_spi_next_transfer(drv_data);
if (drv_data->cs_change) if (drv_data->cs_change && message->state != DONE_STATE) {
bfin_spi_flush(drv_data);
bfin_spi_cs_deactive(drv_data, chip); bfin_spi_cs_deactive(drv_data, chip);
}
} }
/* Schedule next transfer tasklet */ /* Schedule next transfer tasklet */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment