spi: rspi: Do not call rspi_receive_init() for TX-only

Since commit 8449fd76de ("spi: rspi: Merge
rspi_send_pio() and rspi_receive_pio()"), rspi_receive_init() is called
for transmit-only transfers too, while this is not needed.
Only call rspi_receive_init() when receiving, to preserve behavior on
RSPI on SH.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: Mark Brown <broonie@linaro.org>
This commit is contained in:
Geert Uytterhoeven 2014-06-02 15:38:04 +02:00 committed by Mark Brown
parent 5f684c34fc
commit 32c64261c6
1 changed files with 4 additions and 4 deletions

View File

@ -726,13 +726,13 @@ static int rspi_transfer_out_in(struct rspi_data *rspi,
u8 *rx_buf = xfer->rx_buf;
u8 spcr, data;
rspi_receive_init(rspi);
spcr = rspi_read8(rspi, RSPI_SPCR);
if (rx_buf)
if (rx_buf) {
rspi_receive_init(rspi);
spcr &= ~SPCR_TXMD;
else
} else {
spcr |= SPCR_TXMD;
}
rspi_write8(rspi, spcr, RSPI_SPCR);
while (remain > 0) {