aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi
AgeCommit message (Collapse)AuthorFilesLines
2013-06-26Merge remote-tracking branch 'spi/topic/pl022' into spi-nextMark Brown1-0/+1
2013-06-26Merge remote-tracking branch 'spi/topic/pdata' into spi-nextMark Brown15-30/+28
2013-06-26Merge remote-tracking branch 'spi/topic/omap' into spi-nextMark Brown1-50/+187
2013-06-26Merge remote-tracking branch 'spi/topic/nuc900' into spi-nextMark Brown1-2/+0
2013-06-26Merge remote-tracking branch 'spi/topic/mxs' into spi-nextMark Brown1-6/+0
2013-06-26Merge remote-tracking branch 'spi/topic/mpc512x' into spi-nextMark Brown1-155/+186
2013-06-26Merge remote-tracking branch 'spi/topic/imx' into spi-nextMark Brown1-8/+0
2013-06-26Merge remote-tracking branch 'spi/topic/fsl' into spi-nextMark Brown1-1/+1
2013-06-26Merge remote-tracking branch 'spi/topic/ep93xx' into spi-nextMark Brown1-0/+1
2013-06-26Merge remote-tracking branch 'spi/topic/core' into spi-nextMark Brown15-34/+0
2013-06-26Merge remote-tracking branch 'spi/topic/coldfire-qspi' into spi-nextMark Brown1-5/+6
2013-06-26Merge remote-tracking branch 'spi/topic/bpw' into spi-nextMark Brown28-279/+47
2013-06-26Merge remote-tracking branch 'spi/topic/bcm2835' into spi-nextMark Brown1-4/+3
2013-06-26Merge remote-tracking branch 'spi/topic/atmel' into spi-nextMark Brown1-15/+27
2013-06-26Merge remote-tracking branch 'spi/fix/xilinx' into spi-linusMark Brown1-1/+1
2013-06-26Merge remote-tracking branch 'spi/fix/s3c64xx' into spi-linusMark Brown1-1/+1
2013-06-26spi/s3c64xx: Rely on the compiler eliminating the OF ID tableMark Brown1-2/+0
This should work with modern compilers, isn't that much of an issue if it goes wrong and it ensures that the DT-only hardware variants don't leave unreferenced parameters structures lying around. Signed-off-by: Mark Brown <[email protected]>
2013-06-25spi: s3c64xx: Added support for exynos5440 spiGirish K S1-0/+12
This patch adds support for the exynos5440 spi controller. The integration of the spi IP in exynos5440 is different from other SoC's. The I/O pins are no more configured via gpio, they have dedicated pins. Signed-off-by: Girish K S <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-25spi: s3c64xx: Added provision for dedicated cs pinGirish K S1-8/+26
The existing driver supports gpio based /cs signal. For controller's that have one device per controller, the slave device's /cs signal might be internally controlled by the chip select bit of slave select register. They are not externally asserted/deasserted using gpio pin. This patch adds support for controllers with dedicated /cs pin. if "cs-gpio" property doesnt exist in a spi dts node, the controller would treat the /cs pin as dedicated. Signed-off-by: Girish K S <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-24Merge remote-tracking branch 'spi/fix/s3c64xx' into spi-linusMark Brown1-1/+1
2013-06-24spi: omap2-mcspi: convert to dma_request_slave_channel_compat()Matt Porter1-20/+44
Convert dmaengine channel requests to use dma_request_slave_channel_compat(). This supports the DT case of platforms requiring channel selection from either the OMAP DMA or the EDMA engine. AM33xx only boots from DT and is the only user implementing EDMA so in the !DT case we can default to the OMAP DMA filter. Signed-off-by: Matt Porter <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Joel A Fernandes <[email protected]> Signed-off-by: Sourav Poddar <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-21spi/pxa2xx: fix memory corruption due to wrong size used in devm_kzalloc()Mika Westerberg1-1/+1
ACPI part of the driver accidentally used sizeof(*ssp) instead of the correct sizeof(*pdata). This leads to nasty memory corruptions like the one below: BUG: unable to handle kernel paging request at 0000000749fd30b8 IP: [<ffffffff813fe8a1>] __list_del_entry+0x31/0xd0 PGD 0 Oops: 0000 [#1] PREEMPT SMP Modules linked in: CPU: 0 PID: 30 Comm: kworker/0:1 Not tainted 3.10.0-rc6v3.10-rc6_sdhci_modprobe+ #443 task: ffff8801483a0940 ti: ffff88014839e000 task.ti: ffff88014839e000 RIP: 0010:[<ffffffff813fe8a1>] [<ffffffff813fe8a1>] __list_del_entry+0x31/0xd0 RSP: 0000:ffff88014839fde8 EFLAGS: 00010046 RAX: ffff880149fd30b0 RBX: ffff880149fd3040 RCX: dead000000200200 RDX: 0000000749fd30b0 RSI: ffff880149fd3058 RDI: ffff88014834d640 RBP: ffff88014839fde8 R08: ffff88014834d640 R09: 0000000000000001 R10: ffff8801483a0940 R11: 0000000000000001 R12: ffff880149fd3040 R13: ffffffff810e0b30 R14: ffff8801483a0940 R15: ffff88014834d640 FS: 0000000000000000(0000) GS:ffff880149e00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000168 CR3: 0000000001e0b000 CR4: 00000000001407f0 DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 Stack: ffff88014839fe48 ffffffff810e0baf ffffffff81120abd ffff88014839fe20 ffff8801483a0940 ffff8801483a0940 ffff8801483a0940 ffff8801486b1c90 ffff88014834d640 ffffffff810e0b30 0000000000000000 0000000000000000 Call Trace: [<ffffffff810e0baf>] worker_thread+0x7f/0x390 [<ffffffff81120abd>] ? trace_hardirqs_on+0xd/0x10 [<ffffffff810e0b30>] ? manage_workers.isra.22+0x2b0/0x2b0 [<ffffffff810e6c09>] kthread+0xd9/0xe0 [<ffffffff810f93df>] ? local_clock+0x3f/0x50 [<ffffffff810e6b30>] ? kthread_create_on_node+0x110/0x110 [<ffffffff818c5dec>] ret_from_fork+0x7c/0xb0 [<ffffffff810e6b30>] ? kthread_create_on_node+0x110/0x110 Fix this by using the right structure size in devm_kzalloc(). Reported-by: Jerome Blin <[email protected]> Signed-off-by: Mika Westerberg <[email protected]> Signed-off-by: Mark Brown <[email protected]> Cc: [email protected] # 3.9+
2013-06-20Merge tag 'imx-soc-3.11' of git://git.linaro.org/people/shawnguo/linux-2.6 ↵Arnd Bergmann3-41/+38
into next/soc From Shawn Guo: imx soc changes for 3.11: * New SoCs i.MX6 Sololite and Vybrid VF610 support * imx5 and imx6 clock fixes and additions * Update clock driver to use of_clk_init() function * Refactor restart routine mxc_restart() to get it work for DT boot as well * Clean up mxc specific ulpi access ops * imx defconfig updates * tag 'imx-soc-3.11' of git://git.linaro.org/people/shawnguo/linux-2.6: (29 commits) ARM: imx_v6_v7_defconfig: Enable Vybrid VF610 ARM: imx_v6_v7_defconfig: Enable imx-wm8962 by default ARM: clk-imx6qdl: Add clko1 configuration for imx6qdl-sabresd ARM: imx_v6_v7_defconfig: Enable PWM and backlight options ARM: imx: Remove mxc specific ulpi access ops ARM: imx: add initial support for VF610 ARM: imx: add VF610 clock support ARM: imx_v6_v7_defconfig: enable parallel display ARM: imx: clk: No need to initialize phandle struct ARM: imx: irq-common: Include header to avoid sparse warning ARM: imx: Enable mx6 solo-lite support ARM: imx6: use common of_clk_init() call to initialize clocks ARM: imx6q: call of_clk_init() to register fixed rate clocks ARM: imx: imx_v6_v7_defconfig: Select CONFIG_DRM_IMX_TVE ARM: i.MX6: clk: add different DualLite MLB clock config ARM i.MX5: Add S/PDIF clocks ARM i.MX53: Add SATA clock ARM: imx6q: clk: add the eim_slow clock ARM: imx: remove MLB PLL from pllv3 ARM: imx: disable pll8_mlb in mx6q_clks ... Conflicts: arch/arm/Kconfig.debug (simple add/add conflict) Includes an update to 3.10-rc6 Signed-off-by: Arnd Bergmann <[email protected]>
2013-06-20Merge tag 'u300-multiplatform' of ↵Arnd Bergmann1-0/+1
git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson into next/soc From Linus Walleij: Device Tree and Multiplatform support for U300: - Add devicetree support to timer, pinctrl (probe), I2C block, watchdog, DMA controller and clocks. - Piecewise add a device tree containing all peripherals. - Delete the ATAG boot path. - Delete redundant platform data and board files. - Convert to multiplatform. * tag 'u300-multiplatform' of git://git.kernel.org/pub/scm/linux/kernel/git/linusw/linux-stericsson: (40 commits) ARM: u300: switch to using syscon regmap for board ARM: u300: Update MMC configs for u300 defconfig spi: pl022: use DMA by default when probing from DT pinctrl: get rid of all platform data for coh901 ARM: u300: convert MMC/SD clock to device tree ARM: u300: move the gated system controller clocks to DT i2c: stu300: do not request a specific clock name clk: move the U300 fixed and fixed-factor to DT ARM: u300: remove register definition file ARM: u300: add syscon node ARM: u300 use module_spi_driver to register driver ARM: u300: delete remnant machine headers ARM: u300: convert to multiplatform ARM: u300: localize <mach/u300-regs.h> ARM: u300: delete <mach/irqs.h> ARM: u300: delete <mach/hardware.h> ARM: u300: push down syscon registers ARM: u300: remove deps from debug macro ARM: u300: move debugmacro to debug includes ARM: u300: delete all static board data ... Signed-off-by: Arnd Bergmann <[email protected]>
2013-06-20ARM: sirf: use CONFIG_SIRF rather than CONFIG_PRIMA2 where necessaryArnd Bergmann1-1/+1
I got a build error today that made me realize that it is not possible to build a kernel for a SiRF platform without enabling CONFIG_PRIMA2, since a lot of common code depends on CONFIG_PRIMA2. This fixes all occurences that appear like common SiRF code. Signed-off-by: Arnd Bergmann <[email protected]> Acked-by: Wolfram Sang <[email protected]> Acked-by: Mark Brown <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Barry Song <[email protected]> Acked-by: Mike Turquette <[email protected]>
2013-06-19spi/s3c64xx: Make wait_for_timeout() function name less genericMark Brown1-2/+3
Signed-off-by: Mark Brown <[email protected]>
2013-06-19spi: s3c64xx: added support for polling modeGirish K S1-49/+104
The 64xx spi driver supports partial polling mode. Only the last chunk of the transfer length is transferred or recieved in polling mode. Some SoC's that adopt this controller might not have have dma interface. This patch adds support for complete polling mode and gives flexibity for the user to select poll/dma mode. Signed-off-by: Girish K S <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-18spi/pxa2xx: use GFP_ATOMIC in sg table allocationMika Westerberg1-1/+1
pxa2xx_spi_map_dma_buffer() gets called in tasklet context so we can't sleep when we allocate a new sg table. Use GFP_ATOMIC here instead. Signed-off-by: Mika Westerberg <[email protected]> Signed-off-by: Mark Brown <[email protected]> Cc: [email protected]
2013-06-17spi: pl022: remove unused ret and pins_state variablesFabio Baltieri1-5/+0
Removes the warnings: drivers/spi/spi-pl022.c: In function 'pl022_suspend_resources': drivers/spi/spi-pl022.c:2322:24: warning: unused variable 'pins_state' [-Wunused-variable] drivers/spi/spi-pl022.c:2321:6: warning: unused variable 'ret' [-Wunused-variable] drivers/spi/spi-pl022.c: In function 'pl022_resume_resources': drivers/spi/spi-pl022.c:2334:6: warning: unused variable 'ret' [-Wunused-variable] introduced in: f1c9cf0 spi: pl022: use pinctrl PM helpers Signed-off-by: Fabio Baltieri <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-06-17spi: omap2-mcspi: Add FIFO buffer supportIllia Smyrnov1-17/+130
The MCSPI controller has a built-in FIFO buffer to unload the DMA or interrupt handler and improve data throughput. This patch adds FIFO buffer support for SPI transfers in DMA mode. For SPI transfers in DMA mode, the largest possible FIFO buffer size will be calculated and set up. The FIFO won't be used for the SPI transfers in DMA mode if: calculated FIFO buffer size is less then 2 bytes or the FIFO buffer size isn't multiple of the SPI word length. Signed-off-by: Illia Smyrnov <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-17spi: pl022: use DMA by default when probing from DTLinus Walleij1-0/+1
In the past we controlled the selection of DMA for a certain host by a boolean switch in the platform data. Currently there is no way to enable DMA on a PL022 probed from the device tree. Let's default to trying to obtain DMA channels in the DT case, and then we can always fail (and thus fall back to PIO mode). Signed-off-by: Linus Walleij <[email protected]>
2013-06-17spi: omap2-mcspi: Move bytes per word calculation to the functionIllia Smyrnov1-6/+13
Introduce mcspi_bytes_per_word function as replacement for the next code fragment: int c = (word_len <= 8) ? 1 : (word_len <= 16) ? 2 : /* word_len <= 32 */ 4; This code used 2 times in current driver code and will be used 2 times in the next FIFO buffer support patch. Replace it with inline function with clear name to improve code legibility. Signed-off-by: Illia Smyrnov <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-16spi: pl022: use pinctrl PM helpersLinus Walleij1-57/+8
This utilize the new pinctrl core PM helpers to transition the driver to "sleep" and "idle" states, cutting away some boilerplate code. Cc: Hebbar Gururaja <[email protected]> Cc: Dmitry Torokhov <[email protected]> Cc: Kevin Hilman <[email protected]> Cc: Greg Kroah-Hartman <[email protected]> Cc: Stephen Warren <[email protected]> Cc: Wolfram Sang <[email protected]> Acked-by: Mark Brown <[email protected]> Signed-off-by: Linus Walleij <[email protected]>
2013-06-10spi: s3c64xx: Fix pm_runtime_get_sync() return value checkSylwester Nawrocki1-1/+1
If the device is already in a runtime PM enabled state pm_runtime_get_sync() will return 1, so a test for negative value should be used to check for errors. Without this patch there are seen errors like: [ 8.540000] s3c64xx-spi 13930000.spi: Failed to enable device: 1 [ 8.545000] spi_master spi1: failed to prepare transfer hardware Likely because the driver uses synchronous API to runtime enable the device and asynchronous one to disable it. Signed-off-by: Sylwester Nawrocki <[email protected]> Signed-off-by: Kyungmin Park <[email protected]> Signed-off-by: Mark Brown <broonielinaro.org> Cc: [email protected]
2013-06-10MIPS: OCTEON: Rename Kconfig CAVIUM_OCTEON_REFERENCE_BOARD to CAVIUM_OCTEON_SOCDavid Daney1-1/+1
CAVIUM_OCTEON_SOC most place we used to use CPU_CAVIUM_OCTEON. This allows us to CPU_CAVIUM_OCTEON in places where we have no OCTEON SOC. Remove CAVIUM_OCTEON_SIMULATOR as it doesn't really do anything, we can get the same configuration with CAVIUM_OCTEON_SOC. Signed-off-by: David Daney <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Cc: [email protected] Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Wolfram Sang <[email protected]> Acked-by: Mauro Carvalho Chehab <[email protected]> Patchwork: https://patchwork.linux-mips.org/patch/5295/ Signed-off-by: Ralf Baechle <[email protected]>
2013-06-10spi: spi-xilinx: cleanup a check in xilinx_spi_txrx_bufs()[email protected]1-1/+1
'!' has higher precedence than comparisons so the original condition is equivalent to "if (xspi->remaining_bytes == 0)". This makes the static checkers complain. xspi->remaining_bytes is signed and from looking at the code briefly, I think it might be able to go negative. I suspect that going negative may cause a bug, but I don't have the hardware and can't test. Signed-off-by: Dan Carpenter <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-06spi: spi-nuc900: Remove redundant platform_set_drvdata()Sachin Kamat1-2/+0
Setting platform data to NULL is not necessary. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-04Merge remote-tracking branch 'spi/fix/xilinx' into spi-linusMark Brown1-39/+35
2013-06-04Merge remote-tracking branch 'spi/fix/topcliff' into spi-linusMark Brown1-1/+2
2013-06-04Merge remote-tracking branch 'spi/fix/hspi' into spi-linusMark Brown1-1/+1
2013-06-04spi: hspi: fixup long delay timeKuninori Morimoto1-1/+1
Current HSPI driver is using msleep(20) on hspi_status_check_timeout(), but it was too long delay for SPI device. Bock-W board SPI access was too slow without this patch. This patch uses udelay(10) for it. Tested-by: Yusuke Goda <[email protected]> Signed-off-by: Kuninori Morimoto <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-04spi: spi-fsl-lib: Make mpc8xxx_spi_work staticSachin Kamat1-1/+1
'mpc8xxx_spi_work' is used only in this file. Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-04spi: spi-topcliff-pch: Fix sparse warningsSachin Kamat1-4/+4
Fixes the following type of warnings: drivers/spi/spi-topcliff-pch.c:370:52: warning: Using plain integer as NULL pointer Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-04spi: spi-xilinx: Remove redundant platform_set_drvdata()Sachin Kamat1-1/+0
Setting platform data to NULL is not necessary. Also fixes the following sparse warning: drivers/spi/spi-xilinx.c:508:35: warning: Using plain integer as NULL pointer Signed-off-by: Sachin Kamat <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-04spi: spi-xilinx: Add run run-time endian detectionMichal Simek1-8/+21
Do not load endian value from platform data and rather autodetect it. Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-04spi: spi-xilinx: Remove ISR race conditionPeter Crosthwaite1-39/+35
The ISR currently consumes the rx buffer data and re-enables transmission from within interrupt context. This is bad because if the interrupt occurs again before the ISR exits, the new interrupt will be erroneously cleared by the still completing ISR. Simplified the ISR by just setting the completion variable and exiting with no action. Then just looped the transmit functionality in xilinx_spi_txrx_bufs(). Signed-off-by: Peter Crosthwaite <[email protected]> Signed-off-by: Michal Simek <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-04spi: mpc512x: use the SPI subsystem's message queueGerhard Sittig1-110/+73
the SPI subsystem recently grew support to queue messages before handing them to the SPI master, and erroneously emitted deprecation warnings when the SPI master's driver did not use the common logic (in fact the master might queue messages, but implement the queue in the master driver's source) [ 0.823015] mpc512x-psc-spi 80011400.psc: master is unqueued, this is deprecated [ 0.854913] mpc512x-psc-spi 80011500.psc: master is unqueued, this is deprecated this change makes the MPC512x PSC SPI driver use the SPI subsystem's support to queue SPI messages and removes the master driver's private code for the queue support Signed-off-by: Gerhard Sittig <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-04spi: mpc512x: improve throughput in the RX/TX funcGerhard Sittig1-34/+107
change the MPC512x SPI controller's transmission routine to increase throughput: allow the RX byte counter to "lag behind" the TX byte counter while iterating over the transfer's data, only wait for the remaining RX bytes at the very end of the transfer this approach eliminates delays in the milliseconds range, transfer times for e.g. 16MB of SPI flash data dropped from 31s to 9s, correct operation was tested by continuously transferring and comparing data from an SPI flash (more than 200GB in some 45 hours) background information on the motivation: one might assume that all the RX data should have been received when the TX data was sent, given the fact that we are the SPI master and provide all of the clock, but in practise there's a difference the ISR is triggered when the TX FIFO became empty, while transmission of the last item still occurs (from the TX hold and shift registers), sampling RX data on the opposite clock edge compared to the TX data adds another delay (half a bit period), and RX data needs to propagate from the reception buffer to the RX FIFO depending on the specific SoC implementation to cut it short: a difference between TX and RX byte counters during transmission is not just acceptable but should be considered the regular case, only the very end of the transfer needs to make sure that all of the RX data was received before deasserting the chip select and telling the caller that transmission has completed Signed-off-by: Gerhard Sittig <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-04spi: mpc512x: minor prep before feature changeGerhard Sittig1-24/+19
mechanical edits before changing functionality, to reduce diffs - rename variables to later tell remaining TX and RX apart - use size_t for the current TX and RX length (for better compatibility with the min() macro) - remove unused members from the master data (sysclk, eofbyte) - silence a checkpatch warning (braces around single statement) Signed-off-by: Gerhard Sittig <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2013-06-03PM / Runtime: Rework the "runtime idle" helper routineRafael J. Wysocki1-1/+1
The "runtime idle" helper routine, rpm_idle(), currently ignores return values from .runtime_idle() callbacks executed by it. However, it turns out that many subsystems use pm_generic_runtime_idle() which checks the return value of the driver's callback and executes pm_runtime_suspend() for the device unless that value is not 0. If that logic is moved to rpm_idle() instead, pm_generic_runtime_idle() can be dropped and its users will not need any .runtime_idle() callbacks any more. Moreover, the PCI, SCSI, and SATA subsystems' .runtime_idle() routines, pci_pm_runtime_idle(), scsi_runtime_idle(), and ata_port_runtime_idle(), respectively, as well as a few drivers' ones may be simplified if rpm_idle() calls rpm_suspend() after 0 has been returned by the .runtime_idle() callback executed by it. To reduce overall code bloat, make the changes described above. Tested-by: Mika Westerberg <[email protected]> Tested-by: Kevin Hilman <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]> Acked-by: Kevin Hilman <[email protected]> Reviewed-by: Ulf Hansson <[email protected]> Acked-by: Alan Stern <[email protected]>