summaryrefslogtreecommitdiffstats
path: root/drivers/spi
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'kconfig' of ↵Linus Torvalds2015-02-191-3/+3
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild Pull kconfig updates from Michal Marek: "Yann E Morin was supposed to take over kconfig maintainership, but this hasn't happened. So I'm sending a few kconfig patches that I collected: - Fix for missing va_end in kconfig - merge_config.sh displays used if given too few arguments - s/boolean/bool/ in Kconfig files for consistency, with the plan to only support bool in the future" * 'kconfig' of git://git.kernel.org/pub/scm/linux/kernel/git/mmarek/kbuild: kconfig: use va_end to match corresponding va_start merge_config.sh: Display usage if given too few arguments kconfig: use bool instead of boolean for type definition attributes
| * kconfig: use bool instead of boolean for type definition attributesChristoph Jaeger2015-01-071-3/+3
| | | | | | | | | | | | | | | | | | | | Support for keyword 'boolean' will be dropped later on. No functional change. Reference: http://lkml.kernel.org/r/cover.1418003065.git.cj@linux.com Signed-off-by: Christoph Jaeger <cj@linux.com> Signed-off-by: Michal Marek <mmarek@suse.cz>
* | treewide: Remove unnecessary BCMA_CORETABLE_END macroJoe Perches2015-02-111-1/+1
| | | | | | | | | | | | | | | | | | Use the normal {} instead of a macro to terminate an array. Remove the macro too. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: David S. Miller <davem@davemloft.net>
* | Merge remote-tracking branch 'spi/topic/xilinx' into spi-nextMark Brown2015-02-081-135/+163
|\ \
| * | spi/xilinx: Fix access invalid memory on xilinx_spi_txRicardo Ribalda Delgado2015-02-021-1/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On 1 and 2 bytes per word, the transfer of the 3 last bytes will access memory outside tx_ptr. Although this has not trigger any error on real hardware, we should better fix this. Fixes: 24ba5e593f391507 (Remove rx_fn and tx_fn pointer) Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: Revert "spi/xilinx: Remove iowrite/ioread wrappers"Mark Brown2015-01-301-4/+24
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 99082eab63449f9dfa83d5157fa6d78bfc1b04d7 since it breaks the build due to differing implementations of iowrite() and ioread(). Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Check number of slaves rangeRicardo Ribalda2015-01-281-0/+7
| | | | | | | | | | | | | | | | | | | | | | | | The core only supports up to 32 slaves, and the chipselect function expects the same. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Use polling mode on small transfersRicardo Ribalda Delgado2015-01-281-18/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Small transfers generally can be accomplished faster in polling mode. This patch select the transfer which size is bellow the buffer size to be done on polling mode Suggested-by: Mark Brown <broonie@kernel.org> Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Remove remaining_words driver data variableRicardo Ribalda Delgado2015-01-281-16/+12
| | | | | | | | | | | | | | | | | | | | | The variable never leaves the scope of txrx_bufs. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Remove iowrite/ioread wrappersRicardo Ribalda Delgado2015-01-281-24/+4
| | | | | | | | | | | | | | | | | | | | | Save a stack level and cleanup code. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Convert bits_per_word in bytes_per_wordRicardo Ribalda Delgado2015-01-281-9/+9
| | | | | | | | | | | | | | | | | | | | | Simplify the code by using the unit used on most of the code logic. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Convert remainding_bytes in remaining wordsRicardo Ribalda Delgado2015-01-281-7/+6
| | | | | | | | | | | | | | | | | | | | | Simplify the code by using the unit used on most of the code logic. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Make spi_tx and spi_rx simmetricRicardo Ribalda Delgado2015-01-281-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | spi_rx handles the case where the buffer is null. Nevertheless spi_tx did not handle it, and was handled by the caller function. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Remove rx_fn and tx_fn pointerRicardo Ribalda Delgado2015-01-281-51/+18
| | | | | | | | | | | | | | | | | | | | | | | | Simplify the code by removing the tx and and rx function pointers and substitute them by a single function. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Support for spi mode CS_HIGHRicardo Ribalda Delgado2015-01-281-24/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The core controls the chip select lines individually. By default, all the lines are consider active_low. After spi_setup_transfer, it has its real value. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Do not inhibit transmission in polling modeRicardo Ribalda Delgado2015-01-281-10/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | When no irq is used, there is no need to inhibit the transmission for every transaction. This inhibition was implemented to avoid a race condition with the irq handler. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Support cores with no interruptRicardo Ribalda Delgado2015-01-281-14/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The core can run in polling mode. In fact, the performance of the core is similar (or even better), due to the fact most of the spi transactions are just a couple of bytes and there is one irq per transactions. When an mtd device is connected via spi, reading 8MB of data produces more than 80K interrupts (with irq disabling, context swith....) Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Use cached value of registerRicardo Ribalda Delgado2015-01-281-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | The control register has not changed since the previous access. Therefore we can use the cached value and safe one bus access. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Code cleanupRicardo Ribalda Delgado2015-01-281-5/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On the transmission loop, check for remaining bytes at the loop condition. This way we can handle transmissions of 0 bytes and clean the code. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Leave the IRQ always enabled.Ricardo Ribalda Delgado2015-01-281-14/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of enabling the IRQ and disabling it for every transaction. Specially the small transactions (1,2 words) benefit from removing 3 bus accesses. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Simplify spi_fill_tx_fifoRicardo Ribalda Delgado2015-01-281-13/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of checking the TX_FULL flag for every transaction, find out the size of the buffer at probe time and use it. To avoid situations where the core had some data on the buffer before initialization, the core is reseted before the buffer size is detected Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Simplify data read from the Rx FIFORicardo Ribalda Delgado2015-01-271-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The number of words in the read buffer will be exactly the same as the number of words written on write buffer, once the transaction has finished. Instead of cheking the rx_empty flags for every word simply save the number of words written by fill_tx_fifo. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Support for spi mode LOOPRicardo Ribalda Delgado2015-01-261-2/+4
| | | | | | | | | | | | | | | | | | | | | Hardware supports LOOP mode. Support it also in the driver. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi/xilinx: Support for spi mode LSB_FIRSTRicardo Ribalda Delgado2015-01-261-2/+5
| |/ | | | | | | | | | | | | Hardware supports LSB_FIRST mode. Support it also in the driver. Signed-off-by: Ricardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
| \
| \
| \
| \
*-----. \ Merge remote-tracking branches 'spi/topic/sirf', 'spi/topic/spidev', ↵Mark Brown2015-02-086-33/+615
|\ \ \ \ \ | | | | | | | | | | | | | | | | | | 'spi/topic/st-ssc' and 'spi/topic/ti-qspi' into spi-next
| | | | * | spi: ti-qspi: cleanup wait_for_completion return handlingNicholas Mc Guire2015-02-051-8/+6
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | return type of wait_for_completion_timeout is unsigned long not int, this patch uses the return value of wait_for_completion_timeout in the condition directly rather than assigning it to an incorrect type variable. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: st-ssc4: Remove duplicate code to test unsupported mode bitsAxel Lin2015-01-141-6/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | spi_setup() will test unsupported mode bits before calling spi->master->setup. Thus remove duplicate code to test unsupported mode bits in spi_st_setup(). Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: Add new driver for STMicroelectronics' SPI ControllerLee Jones2014-12-223-0/+518
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | This patch adds support for the SPI portion of ST's SSC device. Signed-off-by: Lee Jones <lee.jones@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: spidev: Convert buf pointers for 32-bit compat SPI_IOC_MESSAGE(n)Ian Abbott2015-02-021-24/+97
| | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The SPI_IOC_MESSAGE(n) ioctl commands' argument points to an array of n struct spi_ioc_transfer elements. The spidev's compat_ioctl handler just converts this pointer and passes it on to the unlocked_ioctl handler to process it. The tx_buf and rx_buf members of struct spi_ioc_transfer are of type __u64 and hold pointer values. A 32-bit userspace application running in a 64-bit kernel might not have widened the 32-bit pointers correctly for the kernel. The application might have sign-extended the pointer to when the kernel expects it to be zero-extended, or vice versa, leading to an -EFAULT being returned by spidev_message() if the widened pointer is invalid. Handle the SPI_IOC_MESSAGE(n) ioctl commands specially in the compat_ioctl handler, calling new function spidev_compat_ioctl_message() to handle them. This processes them in the same way as the unlocked_ioctl handler except that it uses compat_ptr() to convert the tx_buf and rx_buf members of each struct spi_ioc_transfer element. To save code, factor out part of the unlocked_ioctl handler into a new function spidev_get_ioc_message(). This checks the ioctl command code is a valid SPI_IOC_MESSAGE(n), determines n and copies the array of n struct spi_ioc_transfer elements from userspace into dynamically allocated memory, returning either a pointer to the memory, an ERR_PTR(-err) value, or NULL (for SPI_IOC_MESSAGE(0)). Signed-off-by: Ian Abbott <abbotti@mev.co.uk> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: sirf: drop redundant sirf,marco-spi compatible stringBarry Song2015-01-061-1/+0
| |/ | | | | | | | | | | | | | | | | | | "sirf,marco-spi" is redundant as all SPI controllers in CSR SiRFSoC are compatible with prima2-spi. at the same time, the whole marco project was dropped and its replacement atlas7 is also compatible with prima2 in SPI. Signed-off-by: Barry Song <Baohua.Song@csr.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
| \
| \
| \
| \
| \
| \
*-------. \ Merge remote-tracking branches 'spi/topic/orion', 'spi/topic/pxa2xx', ↵Mark Brown2015-02-088-211/+179
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | 'spi/topic/qup', 'spi/topic/rockchip' and 'spi/topic/samsung' into spi-next
| | | | | * | spi: pl08x: do not select S3C64XX_PL080Arnd Bergmann2015-01-281-1/+0
| | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The pl08x driver originally selected S3C64XX_PL080 to avoid having the legacy Samsung DMA interfaces. Those are now gone, so the select is no longer needed, but it now causes problems when CONFIG_DMA_ENGINE is disabled: arch/arm/plat-samsung/built-in.o: In function `s3c64xx_spi0_set_platdata': :(.init.text+0x518): undefined reference to `pl08x_filter_id' This simply removes the 'select' to avoid this problem. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | * | spi/rockchip: avoid uninitialized-use warningArnd Bergmann2015-01-281-2/+4
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We currently get a warning about potentially uninitialized variables in the rockchip spi driver, at least in certain toolchain versions: spi/spi-rockchip.c: In function 'rockchip_spi_prepare_dma': include/linux/dmaengine.h:796:2: warning: 'txdesc' may be used uninitialized in this function include/linux/dmaengine.h:796:2: warning: 'rxdesc' may be used uninitialized in this function The reason seems to be that gcc cannot know whether the value of the rs->rx and rs->tx variables change between the two points these are accessed. The code is actually correct, but to make this clearer to the compiler, this changes the conditionals to test for the local rxdesc/txdesc variables instead, which it knows won't change. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: qup: Add SPI_CPOL configuration supportIvan T. Ivanov2014-12-291-1/+10
| | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Device support SPI_CPOL, but driver have missed to add support for this configuration. Signed-off-by: Ivan T. Ivanov <iivanov@mm-sol.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: spi-pxa2xx: only include mach/dma.h for legacy DMARob Herring2015-02-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move the include of mach/dma.h to the legacy PXA DMA code where it is used. This enables building spi-pxa2xx on ARM64. Signed-off-by: Rob Herring <robh@kernel.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: pxa2xx: Fix unconditional call of lpss_ssp_setup in pxa2xx_spi_resumeJarkko Nikula2015-01-281-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 7566bcc76b15 ("spi: pxa2xx: Move is_lpss_ssp() tests to caller") did not check LPSS before calling lpss_ssp_setup() in pxa2xx_spi_resume(). Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: pxa2xx: Cleanup register access macrosJarkko Nikula2014-12-224-142/+117
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently SSP registers are accessed by having an own read and write macros for each register. For instance read_SSSR(iobase) and write_SSSR(iobase). In my opinion this hurts readability and requires new macros to be defined for each new added register. Let's define and use instead common pxa2xx_spi_read() and pxa2xx_spi_write() accessors. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: pxa2xx: Pass driver data instead of ioaddr to wait_ssp_rx_stall()Jarkko Nikula2014-12-221-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Pass pointer to struct driver_data instead of ioaddr to wait_ssp_rx_stall() for preparing to register access macro cleanup. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: pxa2xx: Move is_lpss_ssp() tests to callerJarkko Nikula2014-12-221-9/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Move is_lpss_ssp() tests from functions to caller. Although this aims to improve readability it also saves a few code bytes on x86. Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | spi: pxa2xx: Remove unused defineJarkko Nikula2014-12-221-2/+0
| | |/ | | | | | | | | | | | | Signed-off-by: Jarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: orion: Add multiple chip select support to spi-orionKen Wilson2015-01-161-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit adds support for multiple hardware chip selects to spi-orion. Different SoCs support different number of chip selects (up to 8 on some platforms). The driver allows up to this number, and it is up to the implementer to only use the chip selects that are available. Signed-off-by: Ken Wilson <ken.wilson@opengear.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| * | spi: orion: Change spi-orion to use transfer_one() semantics for SPI transfersKen Wilson2015-01-141-50/+23
| |/ | | | | | | | | | | | | | | | | This commit changes spi-orion to provide setup, set_cs, and transfer_one functions instead of transfer_one_message. This allows chip select support for both native and GPIO chip selects to be added. Signed-off-by: Ken Wilson <ken.wilson@opengear.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| |
| \
| \
| \
| \
| \
| \
| \
*-------. \ Merge remote-tracking branches 'spi/topic/img-spfi', 'spi/topic/imx', ↵Mark Brown2015-02-085-69/+129
|\ \ \ \ \ \ | | | | | | | | | | | | | | | | | | | | | 'spi/topic/inline', 'spi/topic/meson' and 'spi/topic/mxs' into spi-next
| | | | | * | spi: mxs: cleanup wait_for_completion return handlingNicholas Mc Guire2015-02-051-3/+2
| | | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | return type of wait_for_completion_timeout is unsigned long not int, this patch uses the return value of wait_for_completion_timeout in the condition directly rather than adding a additional appropriately typed variable. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | | * | spi: meson: Constify struct regmap_configKrzysztof Kozlowski2015-01-051-1/+1
| | | | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The regmap_config struct may be const because it is not modified by the driver and regmap_init() accepts pointer to const. Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com> Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: Only idle the message pump in the worker kthreadMark Brown2014-12-111-6/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In order to avoid the situation where the kthread is waiting for another context to make the hardware idle let the message pump know if it's being called from the worker thread context and if it isn't then defer to the worker thread instead of idling the hardware immediately. This will ensure that if this situation happens we block rather than busy waiting. Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: Pump transfers inside calling context for spi_sync()Mark Brown2014-12-111-8/+58
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we are using the standard SPI message pump (which all drivers should be transitioning over to) then special case the message enqueue and instead of starting the worker thread to push messages to the hardware do so in the context of the caller if the controller is idle. This avoids a context switch in the common case where the controller has a single user in a single thread, for short PIO transfers there may be no need to context switch away from the calling context to complete the transfer. The code is a bit more complex than is desirable in part due to the need to handle drivers not using the standard queue and in part due to handling the various combinations of bus locking and asynchronous submission in interrupt context. It is still suboptimal since it will still wake the message pump for each transfer in order to schedule idling of the hardware and if multiple contexts are using the controller simultaneously a caller may end up pumping a message for some random other thread rather than for itself, and if the thread ends up deferring due to another context idling the hardware then it will just busy wait. It can, however, have the benefit of aggregating power up and down of the hardware when a caller performs a series of transfers back to back without any need for the use of spi_async(). Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: Check to see if the device is processing a message before we idleMark Brown2014-12-111-6/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | cur_msg is updated under the queue lock and holds the message we are currently processing. Since currently we only ever do removals in the pump kthread it doesn't matter in what order we do things but we want to be able to push things out from the submitting thread so pull the check to see if we're currently handling a message before we check to see if the queue is idle. Signed-off-by: Mark Brown <broonie@kernel.org>
| | | * | spi: Move queue data structure initialisation to main master initMark Brown2014-12-111-3/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since most devices now do use the standard queue and in order to avoid initialisation ordering issues being introduced by further refactorings to improve performance move the initialisation of the queue and the lock for it to the main master allocation. Signed-off-by: Mark Brown <broonie@kernel.org>
| | * | | spi: spi-imx: cleanup wait_for_completion handlingNicholas Mc Guire2015-02-041-7/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | return type of wait_for_completion_timeout is unsigned long not int and always returns >=0 , this patch adds a suitable return variable and simplifies the return value checking as there is no < 0 case. Signed-off-by: Nicholas Mc Guire <hofrat@osadl.org> Signed-off-by: Mark Brown <broonie@kernel.org>
OpenPOWER on IntegriCloud