| From f61b61466d8a5c9aceaeb18179e7f3ab254560f5 Mon Sep 17 00:00:00 2001 |
| From: Geert Uytterhoeven <geert+renesas@glider.be> |
| Date: Mon, 2 Jun 2014 15:38:04 +0200 |
| Subject: spi: rspi: Do not call rspi_receive_init() for TX-only |
| |
| Since commit 8449fd76deb9ac67a15a6fb8ead7bb4595d019d2 ("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> |
| (cherry picked from commit 32c64261c6f50a4e71ec7546f7e2f48eba91c985) |
| Signed-off-by: Simon Horman <horms+renesas@verge.net.au> |
| --- |
| drivers/spi/spi-rspi.c | 8 ++++---- |
| 1 file changed, 4 insertions(+), 4 deletions(-) |
| |
| diff --git a/drivers/spi/spi-rspi.c b/drivers/spi/spi-rspi.c |
| index d04a4acce231..57beda209599 100644 |
| --- a/drivers/spi/spi-rspi.c |
| +++ b/drivers/spi/spi-rspi.c |
| @@ -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) { |
| -- |
| 2.1.2 |
| |