Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1667564
| From | Varadarajan Narayanan <varada@codeaurora.org> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [PATCH 01/15] spi: qup: Enable chip select support |
| Date | 2017-06-16 11:10 +0200 |
| Message-ID | <tSVqs-6tS-59@gated-at.bofh.it> (permalink) |
| References | <tSVgJ-6bj-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Enable chip select support for QUP versions later than v1.
The chip select support was broken in QUP version 1. Hence
the chip select support was removed earlier in commit
4a8573abe965115bc5b064401fd669b74e985258. Since the chip
select support is functional in recent versions of QUP,
re-enabling it for QUP versions later than v1.
Signed-off-by: Sham Muthayyan <smuthayy@codeaurora.org>
Signed-off-by: Varadarajan Narayanan <varada@codeaurora.org>
---
drivers/spi/spi-qup.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c
index 1bfa889..c0d4def 100644
--- a/drivers/spi/spi-qup.c
+++ b/drivers/spi/spi-qup.c
@@ -750,6 +750,24 @@ static int spi_qup_init_dma(struct spi_master *master, resource_size_t base)
return ret;
}
+static void spi_qup_set_cs(struct spi_device *spi, bool val)
+{
+ struct spi_qup *controller;
+ u32 spi_ioc;
+ u32 spi_ioc_orig;
+
+ controller = spi_master_get_devdata(spi->master);
+ spi_ioc = readl_relaxed(controller->base + SPI_IO_CONTROL);
+ spi_ioc_orig = spi_ioc;
+ if (!val)
+ spi_ioc |= SPI_IO_C_FORCE_CS;
+ else
+ spi_ioc &= ~SPI_IO_C_FORCE_CS;
+
+ if (spi_ioc != spi_ioc_orig)
+ writel_relaxed(spi_ioc, controller->base + SPI_IO_CONTROL);
+}
+
static int spi_qup_probe(struct platform_device *pdev)
{
struct spi_master *master;
@@ -846,6 +864,9 @@ static int spi_qup_probe(struct platform_device *pdev)
if (of_device_is_compatible(dev->of_node, "qcom,spi-qup-v1.1.1"))
controller->qup_v1 = 1;
+ if (!controller->qup_v1)
+ master->set_cs = spi_qup_set_cs;
+
spin_lock_init(&controller->lock);
init_completion(&controller->done);
--
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a member of Code Aurora Forum, hosted by The Linux Foundation
Back to linux.kernel | Previous | Next — Previous in thread | Find similar | Unroll thread
[PATCH 00/15] spi: qup: Fixes and add support for >64k transfers Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:00 +0200 [PATCH 03/15] spi: qup: Add completion timeout for dma mode Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:00 +0200 [PATCH 02/15] spi: qup: Setup DMA mode correctly Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 13/15] spi: qup: allow multiple DMA transactions per spi xfer Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 06/15] spi: qup: Fix error handling in spi_qup_prep_sg Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 14/15] spi: qup: Ensure done detection Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 09/15] spi: qup: refactor spi_qup_io_config into two functions Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 12/15] spi: qup: refactor spi_qup_prep_sg Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 10/15] spi: qup: call io_config in mode specific function Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 07/15] spi: qup: Fix transaction done signaling Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 04/15] spi: qup: Add completion timeout for fifo/block mode Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 05/15] spi: qup: Place the QUP in run mode before DMA transactions Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 08/15] spi: qup: Do block sized read/write in block mode Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 15/15] spi: qup: support for qup v1 dma Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 11/15] spi: qup: allow block mode to generate multiple transactions Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200 [PATCH 01/15] spi: qup: Enable chip select support Varadarajan Narayanan <varada@codeaurora.org> - 2017-06-16 11:10 +0200
csiph-web