- 24 2月, 2015 2 次提交
-
-
由 Andy Shevchenko 提交于
There is no need to have an additional variable to get a TX level. The patch refactors this piece of code. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Andy Shevchenko 提交于
There is no sense to keep a member assignment in the internal structure inside the condition which reprograms HW. It makes code readability better if kept outside of the condition. Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 12 2月, 2015 1 次提交
-
-
由 Joe Perches 提交于
Use the normal {} instead of a macro to terminate an array. Remove the macro too. Signed-off-by: NJoe Perches <joe@perches.com> Signed-off-by: NDavid S. Miller <davem@davemloft.net>
-
- 06 2月, 2015 2 次提交
-
-
由 Nicholas Mc Guire 提交于
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: NNicholas Mc Guire <hofrat@osadl.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nicholas Mc Guire 提交于
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: NNicholas Mc Guire <hofrat@osadl.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 05 2月, 2015 4 次提交
-
-
由 Nicholas Mc Guire 提交于
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: NNicholas Mc Guire <hofrat@osadl.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nicholas Mc Guire 提交于
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: NNicholas Mc Guire <der.herr@hofr.at> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nicholas Mc Guire 提交于
return type of wait_for_completion_timeout is unsigned long not int, this patch changes the type of m from int to unsigned long. Signed-off-by: NNicholas Mc Guire <der.herr@hofr.at> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Rob Herring 提交于
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: NRob Herring <robh@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 04 2月, 2015 1 次提交
-
-
由 Nicholas Mc Guire 提交于
return type of wait_for_completion_timeout is unsigned long not int, this patch adds an appropriate variable and fixes up the assignment. It removes the else branch as the only thing it was doing is assigning ret = 0; - but ret is never used thereafter so that is not needed. As the string in dev_err already states "timeout" there is little point in printing the 0. A typo in "trasfer" -> transfer is also fixed. Signed-off-by: NNicholas Mc Guire <hofrat@osadl.org> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 03 2月, 2015 4 次提交
-
-
由 Robin Gong 提交于
For TKT238285 hardware issue which may cause txfifo store data twice can only be caught on i.mx6dl, we use pio mode instead of DMA mode on i.mx6dl. Fixes: f62caccd (spi: spi-imx: add DMA support) Signed-off-by: NRobin Gong <b38343@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
由 Bhuvanchandra DV 提交于
Move the check for spi->bits_per_word before allocation, to avoid memory leak. Reported-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NBhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nobuhiro Iwamatsu 提交于
sh-msiof of frequency dividing does not perform the calculation, driver have to manage setting value in the table. It is not possible to set frequency dividing value close to the actual data in this way. This changes from frequency dividing of table management to setting by calculation. This driver is able to set a value close to the actual data. Signed-off-by: NNobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ian Abbott 提交于
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: NIan Abbott <abbotti@mev.co.uk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 02 2月, 2015 1 次提交
-
-
由 Ricardo Ribalda Delgado 提交于
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: 24ba5e59 (Remove rx_fn and tx_fn pointer) Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 1月, 2015 1 次提交
-
-
由 Mark Brown 提交于
This reverts commit 99082eab since it breaks the build due to differing implementations of iowrite() and ioread(). Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 29 1月, 2015 18 次提交
-
-
由 Ricardo Ribalda 提交于
The core only supports up to 32 slaves, and the chipselect function expects the same. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
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: NMark Brown <broonie@kernel.org> Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
The variable never leaves the scope of txrx_bufs. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Save a stack level and cleanup code. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Simplify the code by using the unit used on most of the code logic. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Simplify the code by using the unit used on most of the code logic. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
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: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Simplify the code by removing the tx and and rx function pointers and substitute them by a single function. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
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: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
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: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
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: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
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: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
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: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
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: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
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: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Chao Fu 提交于
DSPI module need cs change information in a spi transfer. According to cs change, DSPI will give last data the right flag. Bitbang provide cs change behind the last data in a transfer. So DSPI can not deal the last data in every transfer properly, so remove the bitbang in the driver. Signed-off-by: NBhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Arnd Bergmann 提交于
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: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Arnd Bergmann 提交于
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: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 28 1月, 2015 3 次提交
-
-
由 Jarkko Nikula 提交于
Commit 7566bcc7 ("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: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Bhuvanchandra DV 提交于
devm_* API was supposed to be used only in probe function call. Memory is allocated at 'probe' and free automatically at 'remove'. Usage of devm_* functions outside probe sometimes leads to memory leak. Avoid using devm_kzalloc in dspi_setup_transfer and use kzalloc instead. Also add the dspi_cleanup function to free the controller data upon cleanup. Acked-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NBhuvanchandra DV <bhuvanchandra.dv@toradex.com> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
-
由 Ricardo Ribalda Delgado 提交于
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: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 27 1月, 2015 3 次提交
-
-
由 Andy Shevchenko 提交于
The clock information is being kept in the custom register on Intel MID platforms. Each controller has its own dedicated custom register for that. Thus, to get a proper frequency we have to read value from the specific offset to the register block. This patch makes this happen. Fixes: d58cf5ff (spi: dw-pci: describe Intel MID controllers better) Signed-off-by: NAndy Shevchenko <andriy.shevchenko@linux.intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Hardware supports LOOP mode. Support it also in the driver. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ricardo Ribalda Delgado 提交于
Hardware supports LSB_FIRST mode. Support it also in the driver. Signed-off-by: NRicardo Ribalda Delgado <ricardo.ribalda@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-