Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 0667dd5f authored by Ivan T. Ivanov's avatar Ivan T. Ivanov Committed by Mark Brown
Browse files

spi: qup: Add SPI_CPOL configuration support



Device support SPI_CPOL, but driver have missed to add
support for this configuration.

Signed-off-by: default avatarIvan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: default avatarMark Brown <broonie@kernel.org>
parent 97bf6af1
Loading
Loading
Loading
Loading
+10 −1
Original line number Original line Diff line number Diff line
@@ -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)
static int spi_qup_io_config(struct spi_device *spi, struct spi_transfer *xfer)
{
{
	struct spi_qup *controller = spi_master_get_devdata(spi->master);
	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;
	int ret, n_words, w_size;


	if (spi->mode & SPI_LOOP && xfer->len > controller->in_fifo_sz) {
	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)


	writel_relaxed(iomode, controller->base + QUP_IO_M_MODES);
	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);
	config = readl_relaxed(controller->base + SPI_CONFIG);


	if (spi->mode & SPI_LOOP)
	if (spi->mode & SPI_LOOP)