Commit Graph

14 Commits

Author SHA1 Message Date
Mark Brown 0c18b7638a Merge remote-tracking branches 'spi/topic/orion', 'spi/topic/pl022', 'spi/topic/qup', 'spi/topic/rockchip' and 'spi/topic/rspi' into spi-next 2014-08-04 17:21:12 +01:00
Andy Gross 4a8573abe9 spi: qup: Remove chip select function
This patch removes the chip select function.  Chip select should instead be
supported using GPIOs, defining the DT entry "cs-gpios", and letting the SPI
core assert/deassert the chip select as it sees fit.

The chip select control inside the controller is buggy.  It is supposed to
automatically assert the chip select based on the activity in the controller,
but it is buggy and doesn't work at all.  So instead we elect to use GPIOs.

Signed-off-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-22 11:48:09 +01:00
Andy Gross 70cea0a953 spi: qup: Add support for v1.1.1
This patch adds support for v1.1.1 of the SPI QUP controller.

Signed-off-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-21 11:13:19 +01:00
Andy Gross 045c243a51 spi: qup: Fix order of spi_register_master
This patch moves the devm_spi_register_master below the initialization of the
runtime_pm.  If done in the wrong order, the spi_register_master fails if any
probed slave devices issue SPI transactions.

Signed-off-by: Andy Gross <agross@codeaurora.org>
Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-06-21 11:11:54 +01:00
Mark Brown 8fb3b066a6 Merge remote-tracking branches 'spi/topic/dw', 'spi/topic/fsl', 'spi/topic/fsl-espi' and 'spi/topic/id-const' into spi-next 2014-06-02 17:08:38 +01:00
Andy Gross 8f391222c0 spi: qup: Correct selection of FIFO/Block mode
This patch fixes the calculation for determining whether to use FIFO or BLOCK
mode.

Signed-off-by: Andy Gross <agross@codeaurora.org>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-14 16:16:51 +01:00
Jingoo Han 113b1a0715 spi: qup: Make of_device_id array const
Make of_device_id array const, because all OF functions
handle it as const.

Signed-off-by: Jingoo Han <jg1.han@samsung.com>
Reviewed-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-07 20:53:04 +01:00
Axel Lin 3d89e141bb spi: qup: Fix return value checking for pm_runtime_get_sync()
pm_runtime_get_sync() returns 1 if !CONFIG_PM_RUNTIME.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-05-03 09:52:27 -07:00
Axel Lin 00cce74d08 spi: qup: Get rid of using struct spi_qup_device
Current code uses struct spi_qup_device to store spi->mode and spi->chip_select
settings. We can get these settings in spi_qup_transfer_one and spi_qup_set_cs
without using struct spi_qup_device. Refactor the code a bit to remove
spi_qup_setup(), spi_qup_cleanup(), and struct spi_qup_device.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Tested-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-26 08:54:54 +09:00
Axel Lin 83f091440d spi: qup: Remove module version
The module version is unlikely to be updated, use kernel version should be
enough.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-24 22:04:45 +09:00
Axel Lin f0ceb114ae spi: qup: Fix build error due to a typo
Fix below build error when CONFIG_PM_RUNTIME=y:

C [M]  drivers/spi/spi-qup.o
drivers/spi/spi-qup.c: In function 'spi_qup_pm_suspend_runtime':
drivers/spi/spi-qup.c:712:12: error: 'QUP_CLOCK_AUTO_GATE' undeclared (first use in this function)
drivers/spi/spi-qup.c:712:12: note: each undeclared identifier is reported only once for each function it appears in
drivers/spi/spi-qup.c: In function 'spi_qup_pm_resume_runtime':
drivers/spi/spi-qup.c:725:13: error: 'QUP_CLOCK_AUTO_GATE' undeclared (first use in this function)
make[2]: *** [drivers/spi/spi-qup.o] Error 1
make[1]: *** [drivers/spi] Error 2
make: *** [drivers] Error 2

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-23 14:39:06 +09:00
Axel Lin cb64ca5407 spi: qup: Convert ot let spi core handle checking transfer speed
Set master->max_speed_hz then spi core will handle checking transfer speed.
So we can remove the same checking in this driver.

Also remove checking spi->chip_select in spi_qup_setup(), the checking is done
by spi core.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-23 12:28:28 +09:00
Axel Lin 81b045fe72 spi: qup: Remove spi_master_put in spi_qup_remove
This driver uses devm_spi_register_master() so don't explicitly call
spi_master_put() in spi_qup_remove().

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Acked-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-23 12:28:18 +09:00
Ivan T. Ivanov 64ff247a97 spi: Add Qualcomm QUP SPI controller support
Qualcomm Universal Peripheral (QUP) core is an AHB slave that
provides a common data path (an output FIFO and an input FIFO)
for serial peripheral interface (SPI) mini-core. SPI in master
mode supports up to 50MHz, up to four chip selects, programmable
data path from 4 bits to 32 bits and numerous protocol variants.

Cc: Alok Chauhan <alokc@codeaurora.org>
Cc: Gilad Avidov <gavidov@codeaurora.org>
Cc: Kiran Gunda <kgunda@codeaurora.org>
Cc: Sagar Dharia <sdharia@codeaurora.org>
Cc: dsneddon@codeaurora.org
Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
2014-02-20 00:29:06 +09:00