diff options
author | Ivan T. Ivanov <iivanov@mm-sol.com> | 2014-12-16 05:21:55 -0500 |
---|---|---|
committer | Mark Brown <broonie@kernel.org> | 2014-12-29 12:14:21 -0500 |
commit | 0667dd5f6c203480f2e8dcb3fc039ef723453a2f (patch) | |
tree | 7184c21dea2e5e74f21ae026fddbb9c208b601e0 | |
parent | 97bf6af1f928216fd6c5a66e8a57bfa95a659672 (diff) |
spi: qup: Add SPI_CPOL configuration support
Device support SPI_CPOL, but driver have missed to add
support for this configuration.
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Mark Brown <broonie@kernel.org>
-rw-r--r-- | drivers/spi/spi-qup.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c index e7fb5a0d2e8d..ff9cdbdb6672 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c | |||
@@ -337,7 +337,7 @@ static irqreturn_t spi_qup_qup_irq(int irq, void *dev_id) | |||
337 | static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer) | 337 | static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer) |
338 | { | 338 | { |
339 | struct spi_qup *controller = spi_master_get_devdata(spi->master); | 339 | struct spi_qup *controller = spi_master_get_devdata(spi->master); |
340 | u32 config, iomode, mode; | 340 | u32 config, iomode, mode, control; |
341 | int ret, n_words, w_size; | 341 | int ret, n_words, w_size; |
342 | 342 | ||
343 | if (spi->mode & SPI_LOOP && xfer->len > controller->in_fifo_sz) { | 343 | if (spi->mode & SPI_LOOP && xfer->len > controller->in_fifo_sz) { |
@@ -392,6 +392,15 @@ static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer) | |||
392 | 392 | ||
393 | writel_relaxed(iomode, controller->base + QUP_IO_M_MODES); | 393 | writel_relaxed(iomode, controller->base + QUP_IO_M_MODES); |
394 | 394 | ||
395 | control = readl_relaxed(controller->base + SPI_IO_CONTROL); | ||
396 | |||
397 | if (spi->mode & SPI_CPOL) | ||
398 | control |= SPI_IO_C_CLK_IDLE_HIGH; | ||
399 | else | ||
400 | control &= ~SPI_IO_C_CLK_IDLE_HIGH; | ||
401 | |||
402 | writel_relaxed(control, controller->base + SPI_IO_CONTROL); | ||
403 | |||
395 | config = readl_relaxed(controller->base + SPI_CONFIG); | 404 | config = readl_relaxed(controller->base + SPI_CONFIG); |
396 | 405 | ||
397 | if (spi->mode & SPI_LOOP) | 406 | if (spi->mode & SPI_LOOP) |