spi: orion: use new `word_delay` field for SPI transfers

The `word_delay` field had it's type changed to `struct spi_delay`.
This allows users to specify nano-second or clock-cycle delays (if needed).

Converting to use `word_delay` is straightforward: it just uses the new
`spi_delay_exec()` routine, that handles the `unit` part.

Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Link: https://lore.kernel.org/r/20190926105147.7839-6-alexandru.ardelean@analog.com
Signed-off-by: Mark Brown <broonie@kernel.org>
This commit is contained in:
Alexandru Ardelean 2019-09-26 13:51:33 +03:00 коммит произвёл Mark Brown
Родитель 84593a131c
Коммит 21e2606205
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 24D68B725D5487D0
1 изменённых файлов: 2 добавлений и 4 удалений

Просмотреть файл

@ -467,8 +467,7 @@ orion_spi_write_read(struct spi_device *spi, struct spi_transfer *xfer)
if (orion_spi_write_read_8bit(spi, &tx, &rx) < 0) if (orion_spi_write_read_8bit(spi, &tx, &rx) < 0)
goto out; goto out;
count--; count--;
if (xfer->word_delay_usecs) spi_delay_exec(&xfer->word_delay, xfer);
udelay(xfer->word_delay_usecs);
} while (count); } while (count);
} else if (word_len == 16) { } else if (word_len == 16) {
const u16 *tx = xfer->tx_buf; const u16 *tx = xfer->tx_buf;
@ -478,8 +477,7 @@ orion_spi_write_read(struct spi_device *spi, struct spi_transfer *xfer)
if (orion_spi_write_read_16bit(spi, &tx, &rx) < 0) if (orion_spi_write_read_16bit(spi, &tx, &rx) < 0)
goto out; goto out;
count -= 2; count -= 2;
if (xfer->word_delay_usecs) spi_delay_exec(&xfer->word_delay, xfer);
udelay(xfer->word_delay_usecs);
} while (count); } while (count);
} }