spi/omap2_mcspi: disable channel after TX_ONLY transfer in PIO mode

In the TX_ONLY transfer, the SPI controller also receives data
simultaneously and saves them in the rx register. After the TX_ONLY
transfer, the rx register will hold the random data received during
the last tx transaction.

If the direct following transfer is RX_ONLY, this random data has the
possibility to affect this transfer like this:
When the SPI controller is changed from TX_ONLY to RX_ONLY,
the random data makes the rx register full immediately and
triggers a dummy write automatically(in SPI RX_ONLY transfers,
we need a dummy write to trigger the first transaction).

So the first data received in the RX_ONLY transfer will be that
random data instead of something meaningful.

We can avoid this by inserting a Disable/Re-enable toggle of the
channel after the TX_ONLY transfer, since it purges the rx register.

Signed-off-by: Jason Wang <jason77.wang@gmail.com>
Tested-by: Grazvydas Ignotas <notasas@gmail.com>
Acked-by: Tony Lindgren <tony@atomide.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>

authored by Jason Wang and committed by Grant Likely e1993ed6 db181a8e

+6
+6
drivers/spi/omap2_mcspi.c
··· 626 } else if (mcspi_wait_for_reg_bit(chstat_reg, 627 OMAP2_MCSPI_CHSTAT_EOT) < 0) 628 dev_err(&spi->dev, "EOT timed out\n"); 629 } 630 out: 631 omap2_mcspi_set_enable(spi, 1);
··· 626 } else if (mcspi_wait_for_reg_bit(chstat_reg, 627 OMAP2_MCSPI_CHSTAT_EOT) < 0) 628 dev_err(&spi->dev, "EOT timed out\n"); 629 + 630 + /* disable chan to purge rx datas received in TX_ONLY transfer, 631 + * otherwise these rx datas will affect the direct following 632 + * RX_ONLY transfer. 633 + */ 634 + omap2_mcspi_set_enable(spi, 0); 635 } 636 out: 637 omap2_mcspi_set_enable(spi, 1);