- 15 2月, 2017 1 次提交
-
-
由 Hauke Mehrtens 提交于
This driver supports the Lantiq SSC SPI controller in master mode. This controller is found on Intel (former Lantiq) SoCs like the Danube, Falcon, xRX200, xRX300. The hardware uses two hardware FIFOs one for received and one for transferred bytes. When the driver writes data into the transmit FIFO the complete word is taken from the FIFO into a shift register. The data from this shift register is then written to the wire. This driver uses the interrupts signaling the status of the FIFOs and not the shift register. It is also possible to use the interrupts for the shift register, but they will send a signal after every word. When using the interrupts for the shift register we get a signal when the last word is written into the shift register and not when it is written to the wire. After all FIFOs are empty the driver busy waits till the hardware is not busy any more and returns the transfer status. Signed-off-by: NDaniel Schwierzeck <daniel.schwierzeck@gmail.com> Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 09 12月, 2016 2 次提交
-
-
由 Uwe Kleine-König 提交于
The calculation of SPR and SPPR doesn't round correctly at several places which might result in baud rates that are too big. For example with tclk_hz = 250000001 and target rate 25000000 it determined a divider of 10 which is wrong. Instead of fixing all the corner cases replace the calculation by an algorithm without a loop which should even be quicker to execute apart from being correct. Fixes: df59fa7f ("spi: orion: support armada extended baud rates") Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Romain Perier 提交于
Marvell Armada 3700 SoC comprises an SPI Controller. This Controller supports up to 4 SPI slave devices, with dedicated chip selects,supports SPI mode 0/1/2 and 3, CPIO or Fifo mode with DMA transfers and different SPI transfer mode (Single, Dual or Quad). This commit adds basic driver support for FIFO mode. In this mode, dedicated registers are used to store the instruction, the address, the read mode and the data. Write and Read FIFO are used to store the outcoming or incoming data. The data FIFOs are accessible via DMA or by the CPU. Only the CPU is supported for now. Signed-off-by: NRomain Perier <romain.perier@free-electrons.com> Tested-by: NGregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 05 12月, 2016 2 次提交
-
-
由 Gao Pan 提交于
In case that error occurs during waiting for txfifo empty, it is not necessary to read rx fifo. It's better to return directly. Signed-off-by: NGao Pan <pandy.gao@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Gao Pan 提交于
At the beginning of lpspi driver, it is claimed that the dirver is under the terms of the GNU General Public License, either version 2 of the License. While at the end I only declared GPL V2. This patch make the license consistent. Signed-off-by: NGao Pan <pandy.gao@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 02 12月, 2016 1 次提交
-
-
由 Heiner Kallweit 提交于
fsl_espi_read_reg16 / fsl_espi_write_reg16 are supposed to read / write big endian values. Therefore ioread16be / iowrite16be have to be used. Fixes: 05823432 ("eliminate need for linearization when writing to hardware") Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 01 12月, 2016 7 次提交
-
-
由 Heiner Kallweit 提交于
After introducing direct transfers between hardware and transfer buffers remove all code which is unused now. This includes getting rid of the 64k linearization buffer. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Eliminate need for linearization when reading from the hardware and write to the transfer buffers directly. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Eliminate need for linearization when writing to the hardware and read from the transfer buffers directly. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Determine need for byte swap only once and store it in new member swab in struct fsl_espi. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Gao Pan 提交于
The lpspi tx/rx fifo size is a read only parameter resides lpspi Parameter Register. It's better to read lpspi tx/rx fifo size in probe(). Signed-off-by: NGao Pan <pandy.gao@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Gao Pan 提交于
It's a potential problem to use wait_for_completion() because the completion condition may never come. Thus, it's better to repalce wait_for_completion() with wait_for_completion_timeout(). Signed-off-by: NGao Pan <pandy.gao@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Uwe Kleine-König 提交于
MVEBU chips (Armada XP, Armada 370 and others) are supported by this driver. Mention this in the help text to make more obvious what is already specified in the dependencies of this symbol. Signed-off-by: NUwe Kleine-König <u.kleine-koenig@pengutronix.de> Acked-by: NGregory CLEMENT <gregory.clement@free-electrons.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 25 11月, 2016 8 次提交
-
-
由 Nicolas Ferre 提交于
For DMA transfers, we now use the core DMA framework which provides channel fields in the spi_master structure. Remove the private channels from atmel_spi stucture which were located in a sub-structure. This last one (atmel_spi_dma) which is now empty is also removed. Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nicolas Ferre 提交于
The atmel_spi_dma structure was cluttered with unused fields relative to older DMA channel selection API. Remove them. Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Cyrille Pitchen 提交于
Use the SPI core DMA mapping framework instead of our own in case of DMA support. PDC support is not converted to this framework. The driver is now able to transfer a complete sg list through DMA. This eventually fix an issue with vmalloc'ed DMA memory that is provided for example by UBI/UBIFS layers. Signed-off-by: NCyrille Pitchen <cyrille.pitchen@atmel.com> [nicolas.ferre@atmel.com: restrict the use to non-PDC DMA] Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nicolas Ferre 提交于
We need both RX and TX data for each transfer in any case (PIO, PDC, DMA). So convert the driver to the core dummy buffer handling with the SPI_MASTER_MUST_RX/SPI_MASTER_MUST_TX infrastructure. This move changes the maximum PDC/DMA buffer handling to 65535 bytes instead of a single page and sets master->max_dma_len to this value. All dummy buffer management is removed from the driver. Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Nicolas Ferre 提交于
The info banner is here to tell that everything went well, so place it at the very end of the probe function. Signed-off-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Gao Pan 提交于
It's more rational that just do the schedule when necessary other than do it every time. Thus, it's better to replace schedule() with cond_resched() in fsl_lpspi_txfifo_empty(), which contributes to saving cpu time. Signed-off-by: NGao Pan <pandy.gao@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Gao Pan 提交于
There is a static checker warning in fsl_lpspi_set_cmd(). I intended to write "temp |= (fsl_lpspi->config.mode & 0x3) << 30", but used "temp |= (fsl_lpspi->config.mode & 0x11) << 30" by mistake. This patch fixes this potential shift truncation. Signed-off-by: NGao Pan <pandy.gao@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Gao Pan 提交于
The old driver enable clk in fsl_lpspi_prepare_message() and disable clk in fsl_lpspi_unprepare_message(). Rather than doing this per message it's a bit better to do it in prepare_transfer_hardware(), that way if there's a sequence of messages queued one after another we don't turn the clock on and off all the time. Signed-off-by: NGao Pan <pandy.gao@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 24 11月, 2016 4 次提交
-
-
由 Javier Martinez Canillas 提交于
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/spi/spi-ath79.ko | grep alias alias: platform:ath79-spi After this patch: $ modinfo drivers/spi/spi-ath79.ko | grep alias alias: platform:ath79-spi alias: of:N*T*Cqca,ar7100-spiC* alias: of:N*T*Cqca,ar7100-spi Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Javier Martinez Canillas 提交于
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/spi/spi-xlp.ko | grep alias alias: acpi*:BRCM900D:* After this patch: $ modinfo drivers/spi/spi-xlp.ko | grep alias alias: acpi*:BRCM900D:* alias: of:N*T*Cnetlogic,xlp832-spiC* alias: of:N*T*Cnetlogic,xlp832-spi Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Javier Martinez Canillas 提交于
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/spi/spi-jcore.ko | grep alias alias: platform:jcore_spi After this patch: $ modinfo drivers/spi/spi-jcore.ko | grep alias alias: platform:jcore_spi alias: of:N*T*Cjcore,spi2C* alias: of:N*T*Cjcore,spi2 Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Javier Martinez Canillas 提交于
If the driver is built as a module, autoload won't work because the module alias information is not filled. So user-space can't match the registered device with the corresponding module. Export the module alias information using the MODULE_DEVICE_TABLE() macro. Before this patch: $ modinfo drivers/spi/spi-axi-spi-engine.ko | grep alias $ After this patch: $ modinfo drivers/spi/spi-axi-spi-engine.ko | grep alias alias: of:N*T*Cadi,axi-spi-engine-1.00.aC* alias: of:N*T*Cadi,axi-spi-engine-1.00.a Signed-off-by: NJavier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 11月, 2016 5 次提交
-
-
由 Gao Pan 提交于
This patch adds lpspi driver to support new i.MX products which use lpspi instead of ecspi. The lpspi can continue operating in stop mode when an appropriate clock is available. It is also designed for low CPU overhead with DMA offloading of FIFO register accesses. Signed-off-by: NGao Pan <pandy.gao@nxp.com> Reviewed-by: NFugang Duan <B38611@freescale.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Sanchayan Maity 提交于
Current DMA implementation was not handling the continuous selection format viz. SPI chip select would be deasserted even between sequential serial transfers. Use existing dspi_data_to_pushr function to restructure the transmit code path and set or reset the CONT bit on same lines as code path in EOQ mode does. This correctly implements continuous selection format while also correcting and cleaning up the transmit code path. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Sanchayan Maity 提交于
Currently dmaengine_prep_slave_single was being called with length set to the complete DMA buffer size. This resulted in unwanted bytes being transferred to the SPI register leading to clock and MOSI lines having unwanted data even after chip select got deasserted and the required bytes having been transferred. While at it also clean up the use of curr_xfer_len which is central to the DMA setup, from bytes to DMA transfers for every use. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Reviewed-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Sanchayan Maity 提交于
Buffers allocated with a call to dma_alloc_coherent should be freed with dma_free_coherent instead of the currently used devm_kfree. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Juan Gutierrez 提交于
A null dereference or Oops exception might occurs when reading at once the whole content of an spi-nor of big enough size that requires an scatterlist table that does not fit into one single page. The spi_map_buf function is ignoring the chained sg case by dereferenceing the scatterlist elements in an array fashion. This wrongly assumes that the allocation of the scatterlist elements are contiguous. This is true as long as the scatterlist table fits within a PAGE_SIZE. However, for allocation where the scatter table is bigger than that, the pages allocated by sg_alloc might not be contigous. The sg table can be properly walked by sg_next instead of using an array. Signed-off-by: NJuan Gutierrez <juan.gutierrez@nxp.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 22 11月, 2016 2 次提交
-
-
由 Christophe JAILLET 提交于
Since commit 0d357739 ("spi: spi-topcliff-pch: Remove deprecated create_singlethread_workqueue"), 'retval' is no more used in this function. So some now dead code can be removed. Also axe a debug message which looks useless now. Signed-off-by: NChristophe JAILLET <christophe.jaillet@wanadoo.fr> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Geert Uytterhoeven 提交于
MSIOF in R-Car M3-W (r8a7796) is handled fine by the existing driver. Signed-off-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 18 11月, 2016 1 次提交
-
-
由 Sanchayan Maity 提交于
Current DMA implementation had a bug where the DMA transfer would exit the loop in dspi_transfer_one_message after the completion of a single transfer. This results in a multi message transfer submitted with SPI_IOC_MESSAGE to terminate incorrectly without an error. Signed-off-by: NSanchayan Maity <maitysanchayan@gmail.com> Reviewed-by: NStefan Agner <stefan@agner.ch> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 11月, 2016 4 次提交
-
-
由 Heiner Kallweit 提交于
ESPI has a max and min supported SPI frequency, determined by the clock divider range. Set master->min_speed_hz/max_speed_hz to inform the SPI core about these limits. Then the SPI core handles cases where a transfer requests a frequency outside the supported range. So far the driver simply set the lowest supported frequency if the requested frequency was below the supported range. This is not necessarily an appropriate action as the device might not support frequencies greater than the requested one. With this patch the SPI core will reject transfers requesting a too low frequency. The check in fsl_espi_setup can be removed because the SPI core sets spi->max_speed_hz to master->max_speed_hz if it's not set already. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
Simplify of_fsl_espi_suspend a little. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Ben Whitten 提交于
A call to clk_get_rate appears to be called in the context of an interrupt, cache the bus clock for the frequency calculations in transmission. This fixes a 'BUG: scheduling while atomic' and 'WARNING: CPU: 0 PID: 777 at kernel/sched/core.c:2960 atmel_spi_unlock' Signed-off-by: NBen Whitten <ben.whitten@lairdtech.com> Signed-off-by: NSteve deRosier <steve.derosier@lairdtech.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Acked-by: NAlexandre Belloni <alexandre.belloni@free-electrons.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Prahlad V 提交于
completion variable should be reinitialized before reusing. Signed-off-by: NPrahlad V <prahlad.eee@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 15 11月, 2016 1 次提交
-
-
由 Dan Carpenter 提交于
These lines were indented one extra tab. Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Acked-by: NNicolas Ferre <nicolas.ferre@atmel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 14 11月, 2016 2 次提交
-
-
由 Jarkko Nikula 提交于
IS_DMA_ALIGNED() became unused by the commit 6356437e ("spi: spi-pxa2xx: remove legacy PXA DMA bits"). Signed-off-by: NJarkko Nikula <jarkko.nikula@linux.intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Heiner Kallweit 提交于
After having removed all code dependencies we can make fsl-espi completely independent of fsl-lib now. Signed-off-by: NHeiner Kallweit <hkallweit1@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-