- 03 12月, 2018 1 次提交
-
-
由 Randy Dunlap 提交于
Fix build errors when CONFIG_PINCTRL is not enabled. The header file <linux/pinctrl/consumer.h> handles both CONFIG_PINCTRL enabled and disabled cases. CC [M] drivers/spi/spi-at91-usart.o ../drivers/spi/spi-at91-usart.c: In function 'at91_usart_spi_runtime_suspend': ../drivers/spi/spi-at91-usart.c:409:2: error: implicit declaration of function 'pinctrl_pm_select_sleep_state' [-Werror=implicit-function-declaration] pinctrl_pm_select_sleep_state(dev); ../drivers/spi/spi-at91-usart.c: In function 'at91_usart_spi_runtime_resume': ../drivers/spi/spi-at91-usart.c:419:2: error: implicit declaration of function 'pinctrl_pm_select_default_state' [-Werror=implicit-function-declaration] pinctrl_pm_select_default_state(dev); Signed-off-by: NRandy Dunlap <rdunlap@infradead.org> Cc: Radu Pirea <radu.pirea@microchip.com> Cc: Mark Brown <broonie@kernel.org> Cc: linux-spi@vger.kernel.org Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 30 11月, 2018 3 次提交
-
-
由 Mark Brown 提交于
Make everything look intentional by having a C++ comment for the whole block, not just the SPDX line. Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mark Brown 提交于
Merge branch 'for-4.20' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi into spi-4.21
-
由 Lukas Wunner 提交于
Commit e82b0b38 ("spi: bcm2835: Fix race on DMA termination") broke the build with COMPILE_TEST=y on arches whose cmpxchg() requires 32-bit operands (xtensa, older arm ISAs). Fix by changing the dma_pending flag's type from bool to unsigned int. Fixes: e82b0b38 ("spi: bcm2835: Fix race on DMA termination") Signed-off-by: NLukas Wunner <lukas@wunner.de> Signed-off-by: NMark Brown <broonie@kernel.org> Cc: Frank Pavlic <f.pavlic@kunbus.de> Cc: Martin Sperl <kernel@martin.sperl.org> Cc: Noralf Trønnes <noralf@tronnes.org>
-
- 28 11月, 2018 7 次提交
-
-
由 Lukas Wunner 提交于
When in DMA mode, the BCM2835 SPI controller requires that the FIFO is accessed in 4 byte chunks. This rule is not fulfilled if a transfer consists of multiple sglist entries, one per page, and the first entry starts in the middle of a page with an offset not a multiple of 4. The driver currently falls back to programmed I/O for such transfers, incurring a significant performance penalty. Overcome this hardware limitation by transferring the first few bytes of a transfer without DMA such that the remainder of the first sglist entry becomes a multiple of 4. Specifics are provided in kerneldoc comments. An alternative approach would have been to split transfers in the ->prepare_message hook, but this may necessitate two transfers per page, defeating the goal of clustering multiple pages together in a single transfer for efficiency. E.g. if the first TX sglist entry's length is 23 and the first RX's is 40, the first transfer would send and receive 23 bytes, the second 40 - 23 = 17 bytes, the third 4096 - 17 = 4079 bytes, the fourth 4096 - 4079 = 17 bytes and so on. In other words, O(n) transfers are necessary (n = number of sglist entries), whereas the algorithm implemented herein only requires O(1) additional work. Signed-off-by: NLukas Wunner <lukas@wunner.de> Cc: Mathias Duckeck <m.duckeck@kunbus.de> Cc: Frank Pavlic <f.pavlic@kunbus.de> Cc: Martin Sperl <kernel@martin.sperl.org> Cc: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lukas Wunner 提交于
Document the driver's data structure to lower the barrier to entry for contributors. Signed-off-by: NLukas Wunner <lukas@wunner.de> Cc: Mathias Duckeck <m.duckeck@kunbus.de> Cc: Frank Pavlic <f.pavlic@kunbus.de> Cc: Martin Sperl <kernel@martin.sperl.org> Cc: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lukas Wunner 提交于
Commit a30a555d ("spi: bcm2835: transform native-cs to gpio-cs on first spi_setup") disabled the use of hardware-controlled native Chip Select in favour of software-controlled GPIO Chip Select but left code to support the former untouched. Remove it to simplify the driver and ease the addition of new features and further optimizations. Signed-off-by: NLukas Wunner <lukas@wunner.de> Cc: Mathias Duckeck <m.duckeck@kunbus.de> Cc: Frank Pavlic <f.pavlic@kunbus.de> Cc: Martin Sperl <kernel@martin.sperl.org> Cc: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mark Brown 提交于
-
由 Lukas Wunner 提交于
If a DMA transfer finishes orderly right when spi_transfer_one_message() determines that it has timed out, the callbacks bcm2835_spi_dma_done() and bcm2835_spi_handle_err() race to call dmaengine_terminate_all(), potentially leading to double termination. Prevent by atomically changing the dma_pending flag before calling dmaengine_terminate_all(). Signed-off-by: NLukas Wunner <lukas@wunner.de> Fixes: 3ecd37ed ("spi: bcm2835: enable dma modes for transfers meeting certain conditions") Cc: stable@vger.kernel.org # v4.2+ Cc: Mathias Duckeck <m.duckeck@kunbus.de> Cc: Frank Pavlic <f.pavlic@kunbus.de> Cc: Martin Sperl <kernel@martin.sperl.org> Cc: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lukas Wunner 提交于
If submission of a DMA TX transfer succeeds but submission of the corresponding RX transfer does not, the BCM2835 SPI driver terminates the TX transfer but neglects to reset the dma_pending flag to false. Thus, if the next transfer uses interrupt mode (because it is shorter than BCM2835_SPI_DMA_MIN_LENGTH) and runs into a timeout, dmaengine_terminate_all() will be called both for TX (once more) and for RX (which was never started in the first place). Fix it. Signed-off-by: NLukas Wunner <lukas@wunner.de> Fixes: 3ecd37ed ("spi: bcm2835: enable dma modes for transfers meeting certain conditions") Cc: stable@vger.kernel.org # v4.2+ Cc: Mathias Duckeck <m.duckeck@kunbus.de> Cc: Frank Pavlic <f.pavlic@kunbus.de> Cc: Martin Sperl <kernel@martin.sperl.org> Cc: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lukas Wunner 提交于
The IRQ handler bcm2835_spi_interrupt() first reads as much as possible from the RX FIFO, then writes as much as possible to the TX FIFO. Afterwards it decides whether the transfer is finished by checking if the TX FIFO is empty. If very few bytes were written to the TX FIFO, they may already have been transmitted by the time the FIFO's emptiness is checked. As a result, the transfer will be declared finished and the chip will be reset without reading the corresponding received bytes from the RX FIFO. The odds of this happening increase with a high clock frequency (such that the TX FIFO drains quickly) and either passing "threadirqs" on the command line or enabling CONFIG_PREEMPT_RT_BASE (such that the IRQ handler may be preempted between filling the TX FIFO and checking its emptiness). Fix by instead checking whether rx_len has reached zero, which means that the transfer has been received in full. This is also more efficient as it avoids one bus read access per interrupt. Note that bcm2835_spi_transfer_one_poll() likewise uses rx_len to determine whether the transfer has finished. Signed-off-by: NLukas Wunner <lukas@wunner.de> Fixes: e34ff011 ("spi: bcm2835: move to the transfer_one driver model") Cc: stable@vger.kernel.org # v4.1+ Cc: Mathias Duckeck <m.duckeck@kunbus.de> Cc: Frank Pavlic <f.pavlic@kunbus.de> Cc: Martin Sperl <kernel@martin.sperl.org> Cc: Noralf Trønnes <noralf@tronnes.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 27 11月, 2018 4 次提交
-
-
由 Leilk Liu 提交于
this patch add support for mt7629 IC. Signed-off-by: NLeilk Liu <leilk.liu@mediatek.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Radu Pirea 提交于
This patch implements power management callback function for USART as SPI driver. Signed-off-by: NRadu Pirea <radu_nicolae.pirea@upb.ro> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Olof Johansson 提交于
The compiler has no way to know that rsize 1 or 2 are the only valid values. Also simplify the code a bit with early return. The warning was: drivers/spi/spi-npcm-pspi.c:215:6: warning: 'val' may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: NOlof Johansson <olof@lixom.net> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Leilk Liu 提交于
This patch adds a DT binding documentation for the MT7629 soc. Signed-off-by: NLeilk Liu <leilk.liu@mediatek.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 23 11月, 2018 1 次提交
-
-
由 Dan Carpenter 提交于
There is an IS_ERR() vs PTR_ERR() typo here. The current code returns 1 but we want to return the negative error code. Fixes: 2a22f1b3 ("spi: npcm: add NPCM PSPI controller driver") Signed-off-by: NDan Carpenter <dan.carpenter@oracle.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 17 11月, 2018 1 次提交
-
-
由 Lubomir Rintel 提交于
A careless oversight. Sorry. Fixes: 0a897143b7c9 ("spi: pxa2xx: Add slave mode support") Signed-off-by: NLubomir Rintel <lkundrak@v3.sk> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 16 11月, 2018 3 次提交
-
-
由 Tony Lindgren 提交于
I've been wondering still about omap2-mcspi related suspend and resume flakeyness and looks like we're missing calls to spi_master_suspend() and spi_master_resume(). Adding those and using pm_runtime_force_suspend() and pm_runtime_force_resume() makes things work for suspend and resume and allows us to stop using noirq suspend and resume. And while at it, let's use SET_SYSTEM_SLEEP_PM_OPS to simplify things further. Signed-off-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mark Brown 提交于
The refactoring done as part of adding the core support for handling waiting for slave transfer dropped a conditional which meant that we started waiting for completion of all transfers, not just those that the controller asked for. This caused hangs and massive delays on platforms that don't need the core delay. Re-add the delay to fix this. Fixes: 810923f3 (spi: Deal with slaves that return from transfer_one() unfinished) Reported-by: NTony Lindgren <tony@atomide.com> Tested-by: NTony Lindgren <tony@atomide.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 kbuild test robot 提交于
drivers/spi/spi-npcm-pspi.c:470:3-8: No need to set .owner here. The core will do it. Remove .owner field if calls are used which set it automatically Generated by: scripts/coccinelle/api/platform_no_drv_owner.cocci Fixes: 2a22f1b3 ("spi: npcm: add NPCM PSPI controller driver") CC: Tomer Maimon <tmaimon77@gmail.com> Signed-off-by: Nkbuild test robot <fengguang.wu@intel.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 15 11月, 2018 2 次提交
-
-
由 Stefan Wahren 提交于
The license text is specifying GPL v2 or later but the MODULE_LICENSE is set to GPL v2 which means GNU Public License v2 only. So choose the license text as the correct one. Signed-off-by: NStefan Wahren <stefan.wahren@i2se.com> Acked-by: NFlorian Kauer <florian.kauer@koalo.de> Acked-by: NMartin Sperl <kernel@martin.sperl.org> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Colin Ian King 提交于
The u32 variable csgpio is being checked for an error return from the call to of_get_named_gpio, however, since this is unsigned this comparison will always be false. Fix this by making csgpio an int and fix up the %u format specifiers to %d accordingly. Detected by CoverityScan, CID#1475476 ("Unsigned compared against 0") Fixes: 2a22f1b3 ("spi: npcm: add NPCM PSPI controller driver") Signed-off-by: NColin Ian King <colin.king@canonical.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 14 11月, 2018 9 次提交
-
-
由 Tomer Maimon 提交于
Add Nuvoton NPCM BMC Peripheral SPI controller driver. Signed-off-by: NTomer Maimon <tmaimon77@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Tomer Maimon 提交于
Added device tree binding documentation for Nuvoton BMC NPCM Peripheral SPI controller. Signed-off-by: NTomer Maimon <tmaimon77@gmail.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Fredrik Ternerot 提交于
Do not deselect cs when cs_change is set for the last transfer in the message. In this case, cs_change indicates that cs should stay selected until the next transfer. Signed-off-by: NFredrik Ternerot <fredrikt@axis.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lubomir Rintel 提交于
There doesn't seem to be a way to empty TXFIFO on MMP2. The datasheet is super-secret and the method described in Armada 16x manual won't work: "The TXFIFO and RXFIFO are cleared to 0b0 when the SSPx port is reset or disabled (by writing a 0b0 to the <Synchronous Serial Port Enable> field in the SSP Control Register 0)." # devmem 0xd4037008 # read SSSR 0x0000F204 # devmem 0xd4037000 32 0x07 # SSE off in SSCR0 # devmem 0xd4037000 32 0x87 # SSE on # devmem 0xd4037008 0x0000F204 ^ TXFIFO level is still 2. Sigh. The OLPC 1.75 boot firmware leaves two bytes in the TXFIFO. Those are basically throwaway bytes used in response to the messages from the EC. The OLPC kernel copes with this by power-cycling the hardware. Perhaps the firmware should do this instead. Other than that, there's not much we can do other than complain loudly until the garbage gets drained and discard the actual data... For the OLPC EC this will work just fine and pushing more data to TXFIFO would break further transactions. Signed-off-by: NLubomir Rintel <lkundrak@v3.sk> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lubomir Rintel 提交于
Strobe a GPIO line when the slave TX FIFO is filled. This is how the Embedded Controller on an OLPC XO-1.75 machine, that happens to be a SPI master, learns that it can initiate a transaction. Signed-off-by: NLubomir Rintel <lkundrak@v3.sk> Tested-by: NPavel Machek <pavel@ucw.cz> Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lubomir Rintel 提交于
This this is used to let the SPI master know that our FIFO is filled and we're ready to service a transfer. Only useful in slave mode. A signal like this is used by an embedded controller on a OLPC XO 1.75 machine, that happens to be a SPI master. Signed-off-by: NLubomir Rintel <lkundrak@v3.sk> Acked-by: NPavel Machek <pavel@ucw.cz> Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lubomir Rintel 提交于
Tested on an OLPC XO-1.75 machine, where the Embedded Controller happens to be a SPI master. Signed-off-by: NLubomir Rintel <lkundrak@v3.sk> Acked-by: NPavel Machek <pavel@ucw.cz> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lubomir Rintel 提交于
Some drivers, such as spi-pxa2xx return from the transfer_one callback immediately, idicating that the transfer will be finished asynchronously. Normally, spi_transfer_one_message() synchronously waits for the transfer to finish with wait_for_completion_timeout(). For slaves, we don't want the transaction to time out as it can complete in a long time in future. Use wait_for_completion_interruptible() instead. Signed-off-by: NLubomir Rintel <lkundrak@v3.sk> Acked-by: NPavel Machek <pavel@ucw.cz> Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Lubomir Rintel 提交于
This is used to indicate that the chip attached to this controller is a SPI master. Signed-off-by: NLubomir Rintel <lkundrak@v3.sk> Reviewed-by: NRob Herring <robh@kernel.org> Acked-by: NPavel Machek <pavel@ucw.cz> Reviewed-by: NGeert Uytterhoeven <geert+renesas@glider.be> Signed-off-by: NMark Brown <broonie@kernel.org>
-
- 07 11月, 2018 4 次提交
-
-
由 Fabrizio Castro 提交于
Add r8a77470 to the list of examples with soctypes. No driver change is needed as "renesas,qspi" will activate the right code within the corresponding driver. Signed-off-by: NFabrizio Castro <fabrizio.castro@bp.renesas.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Vignesh R 提交于
Enable McSPI driver to be built for K3 platforms, to support McSPI on AM654 SoC of K3 family. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Vignesh R 提交于
AM654 SoC has same McSPI IP as OMAP2+ platforms. Add new compatible to support McSPI on AM654 SoC. Signed-off-by: NVignesh R <vigneshr@ti.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mark Brown 提交于
-
- 05 11月, 2018 5 次提交
-
-
由 Mason Yang 提交于
Document the bindings used by the Macronix controller. Signed-off-by: NMason Yang <masonccyang@mxic.com.tw> Reviewed-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Mason Yang 提交于
Add a driver for Macronix SPI controller IP. Signed-off-by: NMason Yang <masonccyang@mxic.com.tw> Reviewed-by: NBoris Brezillon <boris.brezillon@bootlin.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Wolfram Sang 提交于
We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Wolfram Sang 提交于
We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-
由 Wolfram Sang 提交于
We should get 'driver_data' from 'struct device' directly. Going via platform_device is an unneeded step back and forth. Signed-off-by: NWolfram Sang <wsa+renesas@sang-engineering.com> Signed-off-by: NMark Brown <broonie@kernel.org>
-