Skip to content

Commit

Permalink
spi: qup: Add SPI_CPOL configuration support
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Ivan T. Ivanov authored and Mark Brown committed Dec 29, 2014
1 parent 97bf6af commit 0667dd5
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion drivers/spi/spi-qup.c
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ static irqreturn_t spi_qup_qup_irq(int irq, void *dev_id)
static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer)
{
struct spi_qup *controller = spi_master_get_devdata(spi->master);
u32 config, iomode, mode;
u32 config, iomode, mode, control;
int ret, n_words, w_size;

if (spi->mode & SPI_LOOP && xfer->len > controller->in_fifo_sz) {
Expand Down Expand Up @@ -392,6 +392,15 @@ static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer)

writel_relaxed(iomode, controller->base + QUP_IO_M_MODES);

control = readl_relaxed(controller->base + SPI_IO_CONTROL);

if (spi->mode & SPI_CPOL)
control |= SPI_IO_C_CLK_IDLE_HIGH;
else
control &= ~SPI_IO_C_CLK_IDLE_HIGH;

writel_relaxed(control, controller->base + SPI_IO_CONTROL);

config = readl_relaxed(controller->base + SPI_CONFIG);

if (spi->mode & SPI_LOOP)
Expand Down

0 comments on commit 0667dd5

Please sign in to comment.