diff options
-rw-r--r-- | drivers/spi/spi-topcliff-pch.c | 19 |
1 files changed, 11 insertions, 8 deletions
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c index c36d51657066..6cb2fdbe5dba 100644 --- a/drivers/spi/spi-topcliff-pch.c +++ b/drivers/spi/spi-topcliff-pch.c | |||
@@ -317,16 +317,19 @@ static void pch_spi_handler_sub(struct pch_spi_data *data, u32 reg_spsr_val, | |||
317 | 317 | ||
318 | /* if transfer complete interrupt */ | 318 | /* if transfer complete interrupt */ |
319 | if (reg_spsr_val & SPSR_FI_BIT) { | 319 | if (reg_spsr_val & SPSR_FI_BIT) { |
320 | if (tx_index < bpw_len) | 320 | if ((tx_index == bpw_len) && (rx_index == tx_index)) { |
321 | /* disable interrupts */ | ||
322 | pch_spi_setclr_reg(data->master, PCH_SPCR, 0, PCH_ALL); | ||
323 | |||
324 | /* transfer is completed; | ||
325 | inform pch_spi_process_messages */ | ||
326 | data->transfer_complete = true; | ||
327 | data->transfer_active = false; | ||
328 | wake_up(&data->wait); | ||
329 | } else { | ||
321 | dev_err(&data->master->dev, | 330 | dev_err(&data->master->dev, |
322 | "%s : Transfer is not completed", __func__); | 331 | "%s : Transfer is not completed", __func__); |
323 | /* disable interrupts */ | 332 | } |
324 | pch_spi_setclr_reg(data->master, PCH_SPCR, 0, PCH_ALL); | ||
325 | |||
326 | /* transfer is completed;inform pch_spi_process_messages */ | ||
327 | data->transfer_complete = true; | ||
328 | data->transfer_active = false; | ||
329 | wake_up(&data->wait); | ||
330 | } | 333 | } |
331 | } | 334 | } |
332 | 335 | ||