LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] spi: qup: Add SPI_CPOL configuration support
@ 2014-12-16 10:21 Ivan T. Ivanov
  2014-12-29 17:14 ` Mark Brown
  0 siblings, 1 reply; 2+ messages in thread
From: Ivan T. Ivanov @ 2014-12-16 10:21 UTC (permalink / raw)
  To: Mark Brown; +Cc: Ivan T. Ivanov, linux-spi, linux-kernel, linux-arm-msm

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

Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
---
 drivers/spi/spi-qup.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 390ed71..1c3329c 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)
 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) {
@@ -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)
-- 
1.9.1


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] spi: qup: Add SPI_CPOL configuration support
  2014-12-16 10:21 [PATCH] spi: qup: Add SPI_CPOL configuration support Ivan T. Ivanov
@ 2014-12-29 17:14 ` Mark Brown
  0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2014-12-29 17:14 UTC (permalink / raw)
  To: Ivan T. Ivanov; +Cc: linux-spi, linux-kernel, linux-arm-msm

[-- Attachment #1: Type: text/plain, Size: 173 bytes --]

On Tue, Dec 16, 2014 at 12:21:55PM +0200, Ivan T. Ivanov wrote:
> Device support SPI_CPOL, but driver have missed to add
> support for this configuration.

Applied, thanks.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 473 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2014-12-29 17:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-12-16 10:21 [PATCH] spi: qup: Add SPI_CPOL configuration support Ivan T. Ivanov
2014-12-29 17:14 ` Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).