- 07 11月, 2017 1 次提交
-
-
由 Trent Piepho 提交于
In commit 974488e4 ("spi: imx: Fix failure path leak on GPIO request error"), spi_bitbang_start() was moved later in the probe sequence. But this doesn't work, as spi_bitbang_start() has to be called before requesting GPIOs because the GPIO data in the spi master is populated when the master is registed, and that doesn't happen until spi_bitbang_start() is called. The default only works if one uses one CS. So add a failure path call to spi_bitbang_stop() to fix the leak. CC: Shawn Guo <shawnguo@kernel.org> CC: Sascha Hauer <kernel@pengutronix.de> CC: Fabio Estevam <fabio.estevam@nxp.com> CC: Mark Brown <broonie@kernel.org> CC: Oleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: NTrent Piepho <tpiepho@impinj.com> Reviewed-by: NOleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 31 10月, 2017 1 次提交
-
-
由 Trent Piepho 提交于
If the code that requests any chip select GPIOs fails, the cleanup of spi_bitbang_start() by calling spi_bitbang_stop() is not done. Fix this by moving spi_bitbang_start() to after the code that requets GPIOs. The GPIOs are dev managed and don't need explicit cleanup. Since spi_bitbang_start() is now the last operation, it doesn't need to be cleaned up in the failure path. CC: Shawn Guo <shawnguo@kernel.org> CC: Sascha Hauer <kernel@pengutronix.de> CC: Fabio Estevam <fabio.estevam@nxp.com> CC: Mark Brown <broonie@kernel.org> Reviewed-by: NOleksij Rempel <o.rempel@pengutronix.de> Signed-off-by: NTrent Piepho <tpiepho@impinj.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 19 9月, 2017 1 次提交
-
-
由 jiada wang 提交于
Previously i.MX SPI controller only works in Master mode. This patch adds support to i.MX51, i.MX53 and i.MX6 ECSPI controller to work also in Slave mode. Currently SPI Slave mode support patch has the following limitations: 1. The stale data in RXFIFO will be dropped when the Slave does any new transfer. 2. One transfer can be finished only after all transfer->len data been transferred to master device 3. Slave device only accepts transfer->len data. Any data longer than this from master device will be dropped. Any data shorter than this from master will cause SPI to stuck due to mentioned HW limitation 2. 4. Only PIO transfer is supported in Slave mode. 5. Dynamic burst size adjust isn't supported in Slave mode. Following HW limitation applies: 1. ECSPI has a HW issue when works in Slave mode, after 64 words written to TXFIFO, even TXFIFO becomes empty, ECSPI_TXDATA keeps shift out the last word data, so we have to disable ECSPI when in slave mode after the transfer completes 2. Due to Freescale errata ERR003775 "eCSPI: Burst completion by Chip Select (SS) signal in Slave mode is not functional" burst size must be set exactly to the size of the transfer. This limit SPI transaction with maximum 2^12 bits. This errata affects i.MX53 and i.MX6 ECSPI controllers. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 01 9月, 2017 1 次提交
-
-
由 Hauke Mehrtens 提交于
Do not check which flash type the SoC was booted from before using this driver. Assume that the device tree is correct and use this driver when it was added to device tree. This also removes a build dependency to the SoC code. All device trees I am aware of only have one correct flash device entry in it. The device tree is anyway bundled with the kernel in all systems using device tree I know of. The boot mode can be specified with some pin straps and will select the flash type the rom code will boot from. One SPI, NOR or NAND flash chip can be connect to the EBU and used to load the first stage boot loader from. Signed-off-by: NHauke Mehrtens <hauke@hauke-m.de> Cc: Mark Brown <broonie@kernel.org> Cc: linux-spi@vger.kernel.org Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 8月, 2017 1 次提交
-
-
由 Greg Ungerer 提交于
The commonly used mechanism of specifying the hardware or native chip-select on an SPI device in devicetree (that is "cs-gpios = <0>") does not result in the native chip-select being configured for use. So external SPI devices that require use of the native chip-select will not work. You can successfully specify native chip-selects if using a platform setup by specifying the cs-gpio as negative offset by 32. And that works correctly. You cannot use the same method in devicetree. The logic in the spi-imx.c driver during probe uses core spi function of_spi_register_master() in spi.c to parse the "cs-gpios" devicetree tag. For valid GPIO values that will be recorded for use, all other entries in the cs_gpios list will be set to -ENOENT. So entries like "<0>" will be set to -ENOENT in the cs_gpios list. When the SPI device registers are setup the code will use the GPIO listed in the cs_gpios list for the desired chip-select. If the cs_gpio is less then 0 then it is intended to be for a native chip-select, and its cs_gpio value is added to 32 to get the chipselect number to use. Problem is that with devicetree this can only ever be -ENOENT (which is -2), and that alone results in an invalid chip-select number. But also doesn't allow selection of the native chip-select at all. To fix, if the cs_gpio specified for this spi device is not a valid GPIO then use the "chip_select" (that is the native chip-select number) for hardware setup. Signed-off-by: NGreg Ungerer <gerg@linux-m68k.org> Reviewed-by: NVladimir Zapolskiy <vz@mleia.com> Tested-by: NVladimir Zapolskiy <vz@mleia.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 24 8月, 2017 1 次提交
-
-
由 Arvind Yadav 提交于
amba_id are not supposed to change at runtime. All functions working with const amba_id. So mark the non-const structs as const. Signed-off-by: NArvind Yadav <arvind.yadav.cs@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 8月, 2017 1 次提交
-
-
由 Arnd Bergmann 提交于
The newly added dynamic burst code produces a harmless warning on big-endian configurations: drivers/spi/spi-imx.c: In function 'spi_imx_buf_rx_swap_u32': drivers/spi/spi-imx.c:284:15: error: unused variable 'bytes_per_word' [-Werror=unused-variable] unsigned int bytes_per_word; ^~~~~~~~~~~~~~ drivers/spi/spi-imx.c: In function 'spi_imx_buf_tx_swap_u32': drivers/spi/spi-imx.c:319:15: error: unused variable 'bytes_per_word' [-Werror=unused-variable] unsigned int bytes_per_word; This adds another #ifdef around the variable declaration matching the one on the use. Fixes: 1673c81d ("spi: imx: dynamic burst length adjust for PIO mode") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 18 8月, 2017 2 次提交
-
-
由 Suniel Mahesh 提交于
spi framework should allocate bus number dynamically either via Linux IDR or spi alias for master drivers. This patch deletes code pertaining to manual allocation of spi bus number in spi omap2 master driver. Signed-off-by: NSuniel Mahesh <sunil.m@techveda.org> Signed-off-by: NKarthik Tummala <karthik@techveda.org> Tested-by: NKarthik Tummala <karthik@techveda.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Suniel Mahesh 提交于
Earlier commit: "spi: Pick spi bus number from Linux idr or spi alias" (SHA1:9b61e302) has introduced some checkpatch issues. As pointed by Lukas Wunner this patch does the following: - remove whitespaces - fix warnings, suspect code indent for conditional statements - fix errors, code indent should use tabs - remove spaces at the start of the line Signed-off-by: NSuniel Mahesh <sunil.m@techveda.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 17 8月, 2017 1 次提交
-
-
由 jiada wang 提交于
previously burst length (BURST_LENGTH) is always set to equal to bits_per_word, causes a 10us gap between each word in transfer, which significantly affects performance. This patch uses 32 bits transfer to simulate lower bits transfer, and adjusts burst length runtimely to use biggeest burst length as possible to reduce the gaps in transfer for PIO mode. Signed-off-by: NJiada Wang <jiada_wang@mentor.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 8月, 2017 4 次提交
-
-
由 Suniel Mahesh 提交于
Modify existing code, for automatically picking the spi bus number based on Linux idr scheme as mentioned in FIXME. This patch does the following: (a) Remove the now unnecessary code which was allocating bus numbers using ATOMIC_INIT and atomic_dec_return macros. (b) If we have an alias, pick the bus number from alias ID (c) Convert to linux idr interface Signed-off-by: NSuniel Mahesh <sunil.m@techveda.org> Signed-off-by: NKarthik Tummala <karthik@techveda.org> Tested-by: NKarthik Tummala <karthik@techveda.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Huibin Hong 提交于
CTRLR1 is number of data frames, when rx only. When data frame is 8 bit, CTRLR1 is len-1. When data frame is 16 bit, CTRLR1 is (len/2)-1. Signed-off-by: NHuibin Hong <huibin.hong@rock-chips.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lars-Peter Clausen 提交于
The patterns for accessing the TX/RX data registers is the same for the IRQ and non-IRQ paths. Consolidate the duplicated code into shared helper functions. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lars-Peter Clausen 提交于
The Altera SPI driver currently uses the spi-bitbang infrastructure for transfer queue management, but non of the bitbang functionality itself. This is because when the driver was written this was the only way to not have to do queue management in the driver itself. Nowadays transfer queue management is available from the SPI driver core itself and using the bitbang infrastructure just adds an additional level of indirection. Switch the driver over to using the core queue management directly. Signed-off-by: NLars-Peter Clausen <lars@metafoo.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 15 8月, 2017 1 次提交
-
-
由 Andy Yan 提交于
The spi on rv1108 is the same as other rockchip based socs, add compatible string for it. Signed-off-by: NAndy Yan <andy.yan@rock-chips.com> Acked-by: NRob Herring <robh@kernel.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 10 8月, 2017 10 次提交
-
-
由 Arnd Bergmann 提交于
On 64-bit systems, pointers are wider than 'int' variables, so we get a warning about a cast between them: drivers/spi/spi-qup.c:1060:23: error: cast from pointer to integer of different size [-Werror=pointer-to-int-cast] This changes the code to use the correct uintptr_t cast. Fixes: 4d023737 ("spi: qup: Fix QUP version identify method") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Arnd Bergmann 提交于
The added conditionals in this function apparently confused gcc to the point that it no longer sees the code is safe and instead shows a false-positive warning: drivers/spi/spi-qup.c: In function 'spi_qup_transfer_one': drivers/spi/spi-qup.c:507:28: error: 'tx_nents' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/spi/spi-qup.c:464:17: note: 'tx_nents' was declared here drivers/spi/spi-qup.c:505:28: error: 'rx_nents' may be used uninitialized in this function [-Werror=maybe-uninitialized] drivers/spi/spi-qup.c:464:7: note: 'rx_nents' was declared here This moves the initialization to a place that makes it obvious to the compiler. Fixes: 5884e17e ("spi: qup: allow multiple DMA transactions per spi xfer") Signed-off-by: NArnd Bergmann <arnd@arndb.de> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 H Hartley Sweeten 提交于
Update this driver to the default implementation of transfer_one_message(). Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 H Hartley Sweeten 提交于
The currently in-flight message can be found from the spi master. Use that instead and remove the private data pointer. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 H Hartley Sweeten 提交于
Change the parameters for some of the functions so that the spi_master pointer is passed around instead of the private data ep93xx_spi pointer. This allows removing the 'pdev' member of the private data and will help with some later cleanup. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 H Hartley Sweeten 提交于
These are each only called once. Just absorb them into the callers. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> [chris: use u32 instead of unsigned int] Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 H Hartley Sweeten 提交于
This driver currently enables the hardware at the start of every message and disabled it when the message is complete. Make it a bit smarter by adding the prepare_transfer_hardware() and unprepare_transfer_hardware() callbacks so that the core can enable/disable the hardware based on spi message queue. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> [chris: use u32 instead of unsigned int] Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 H Hartley Sweeten 提交于
All the EP93xx SSP registers are 32-bit. Since most of the upper bits are unused, this driver tries to be tricky and uses 8 or 16-bit I/O to access the registers. This really just adds a bit of confusion. Simplify the I/O by using 32-bit read/write's for all of the registers. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> [chris: use u32 instead of unsigned int] Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz> Reviewed-by: NAndy Shevchenko <andy.shevchenko@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 H Hartley Sweeten 提交于
The io wrappers just add obfuscation to the driver. Remove them. Signed-off-by: NH Hartley Sweeten <hsweeten@visionengravers.com> Signed-off-by: NChris Packham <chris.packham@alliedtelesis.co.nz> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Gustavo A. R. Silva 提交于
platform_get_irq() returns an error code, but the spi-sh driver ignores it and always returns -ENODEV. This is not correct and, prevents -EPROBE_DEFER from being propagated properly. Print and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 08 8月, 2017 15 次提交
-
-
由 Varadarajan Narayanan 提交于
Use of_device_get_match_data to identify QUP version instead of of_device_is_compatible. Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
This patch fixes an issue where a SPI transaction has completed, but the done condition is missed. This occurs because at the time of interrupt the MAX_INPUT_DONE_FLAG is not asserted. However, in the process of reading blocks of data from the FIFO, the last portion of data comes in. The opflags read at the beginning of the irq handler no longer matches the current opflag state. To get around this condition, the block read function should update the opflags so that done detection is correct after the return. Signed-off-by: NAndy Gross <agross@codeaurora.org> Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
Much like the block mode changes, we are breaking up DMA transactions into 64K chunks so we can reset the QUP engine. Signed-off-by: NMatthew McClintock <mmcclint@codeaurora.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
Take specific sgl and nent to be prepared. This is in preparation for splitting DMA into multiple transacations, this contains no code changes just refactoring. Signed-off-by: NMatthew McClintock <mmcclint@codeaurora.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
This let's you write more to the SPI bus than 64K-1 which is important if the block size of a SPI device is >= 64K or some other device wants to do something larger. This has the benefit of completely removing spi_message from the spi-qup transactions Signed-off-by: NMatthew McClintock <mmcclint@codeaurora.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
DMA transactions should only only need to call io_config only once, but block mode might call it several times to setup several transactions so it can handle reads/writes larger than the max size per transaction, so we move the call to the do_ functions. This is just refactoring, there should be no functional change Signed-off-by: NMatthew McClintock <mmcclint@codeaurora.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
This is in preparation for handling transactions larger than 64K-1 bytes in block mode, which is currently unsupported and quietly fails. We need to break these into two functions 1) prep is called once per spi_message and 2) io_config is called once per spi-qup bus transaction This is just refactoring, there should be no functional change Signed-off-by: NMatthew McClintock <mmcclint@codeaurora.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
This patch corrects the behavior of the BLOCK transactions. During block transactions, the controller must be read/written to in block size transactions. Signed-off-by: NAndy Gross <andy.gross@linaro.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
Wait to signal done until we get all of the interrupts we are expecting to get for a transaction. If we don't wait for the input done flag, we can be in between transactions when the done flag comes in and this can mess up the next transaction. While here cleaning up the code which sets controller->xfer = NULL and restores it in the ISR. This looks to be some debug code which is not required. Signed-off-by: NAndy Gross <andy.gross@linaro.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
Signed-off-by: NAndy Gross <andy.gross@linaro.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
Add i/o completion timeout for DMA and PIO modes. Signed-off-by: NAndy Gross <andy.gross@linaro.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
To operate in DMA mode, the buffer should be aligned and the size of the transfer should be a multiple of block size (for v1). And the no. of words being transferred should be programmed in the count registers appropriately. Signed-off-by: NAndy Gross <andy.gross@linaro.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Varadarajan Narayanan 提交于
Enable chip select support for QUP versions later than v1. The chip select support was broken in QUP version 1. Hence the chip select support was removed earlier in an earlier commit (4a8573ab "spi: qup: Remove chip select function"). Since the chip select support is functional in recent versions of QUP, re-enabling it for QUP versions later than v1. Signed-off-by: NSham Muthayyan <smuthayy@codeaurora.org> Signed-off-by: NVaradarajan Narayanan <varada@codeaurora.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Gustavo A. R. Silva 提交于
platform_get_irq() returns an error code, but the spi-bcm63xx-hsspi driver ignores it and always returns -ENXIO. This is not correct and, prevents -EPROBE_DEFER from being propagated properly. Notice that platform_get_irq() no longer returns 0 on error: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e330b9a6bb35dc7097a4f02cb1ae7b6f96df92af Print and propagate the return value of platform_get_irq on failure. This issue was detected with the help of Coccinelle. Signed-off-by: NGustavo A. R. Silva <gustavo@embeddedor.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-