aboutsummaryrefslogtreecommitdiff
path: root/drivers/spi
AgeCommit message (Collapse)AuthorFilesLines
2018-11-05spi: rockchip: set min/max speedEmil Renner Berthing1-32/+20
The driver previously checked each transfer if the requested speed was higher than possible with the current spi clock rate and raised the clock rate accordingly. However, there is no check to see if the spi clock was actually set that high and no way to dynamically lower the spi clock rate again. So it seems any potiential users of this functionality are better off just setting the spi clock rate at init using the assigned-clock-rates devicetree property. Removing this dynamic spi clock rate raising allows us let the spi framework handle min/max speeds for us. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-11-05spi: rockchip: simplify use_dma logicEmil Renner Berthing1-11/+7
We only need to know if we're using dma when setting up the transfer, so just use a local variable for that. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-11-05spi: rockchip: remove master pointer from dev dataEmil Renner Berthing1-11/+10
In almost all cases we already have a pointer to the spi master structure where we have the driver data. The only exceptions are the dma callbacks which are easily fixed by passing them the master and using spi_master_get_devdata to retrieve the driver data. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-11-05spi: rockchip: don't store dma channels twiceEmil Renner Berthing1-42/+34
The spi master (aka spi controller) structure already has two fields for storing the rx and tx dma channels. Just use them rather than duplicating them in driver data. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-11-05spi: rockchip: read transfer info directlyEmil Renner Berthing1-46/+24
Just read transfer info directly from the spi device and transfer structures rather than storing it in driver data first. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-11-05spi: rockchip: disable spi on errorEmil Renner Berthing1-25/+5
Successful transfers leave the spi disabled, so if we just make sure to disable the spi on error there should be no need to disable the spi from master->unprepare_message. This also flushes the tx and rx fifos, so no need to do that manually. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-11-05spi: rockchip: use atomic_t stateEmil Renner Berthing1-50/+25
The state field is currently only used to make sure only the last of the tx and rx dma callbacks issue an spi_finalize_current_transfer. Rather than using a spinlock we can get away with just turning the state field into an atomic_t. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-11-05spi: rockchip: always use SPI modeEmil Renner Berthing1-13/+4
The hardware supports 3 different variants of SPI and there were some code around it, but nothing to actually set it to anything but "Motorola SPI". Just drop that code and always use that mode. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-11-05spi: rockchip: use designated init for dma configEmil Renner Berthing1-12/+14
Use C99 designated initializers for dma slave config structures. This also makes sure uninitialized fields are zeroed so we don't need an explicit memset. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-11-05spi: rockchip: make spi_enable_chip take boolEmil Renner Berthing1-9/+9
The spi_enable_chip function takes a boolean argument. Change the type to reflect that. Signed-off-by: Emil Renner Berthing <[email protected]> Tested-by: Heiko Stuebner <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-31spi: mediatek: use correct mata->xfer_len when in fifo transferLeilk Liu1-2/+2
when xfer_len is greater than 64 bytes and use fifo mode to transfer, the actual length from the third time is mata->xfer_len but not len in mtk_spi_interrupt(). Signed-off-by: Leilk Liu <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-25Merge tag 'mfd-next-4.20' of ↵Linus Torvalds3-0/+441
git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd Pull MFD updates from Lee Jones: "New Drivers - Add support for USART SPI to AT91* New Functionality - Add support for Audio CODECs to motorola-cpcap Fix-ups - DT documentation fix-ups; atmel-usart - Staticise functions/structs; spi-at91-usart, arizona-core - Constify; ti-lmu - Fix memory leaks; menelaus - Change device 'wake-up' status; ti_am335x_tscadc, max8997 - Power Management (suspend/resume) semantic changes; ti_am335x_adc, cros_ec, max8997 - SPDX churn; sec-core (+ headers), max* (+ headers), intel* (+ headers), - Trivial (whitespace, email addresses, alphabetisise); Kconfig, adp5520, intel_soc_pmic_* - Build as module; sec-irq - Use new %pOFn printk format for device_node.name; max77620 - Remove unused code; madera - Use generic MACROs; intel_msic, intel_soc_pmic_crc - Move to GPIOD; ti-lmu - Use managed resources; ti-lmu Bug Fixes - Add missing headers; at91-usart - Prevent device from entering low-power mode; arizona-core - Poll for BOOT_DONE to avoid still-booting NACK; madera-core - Prevent ADC read from shutting down device; mc13xxx-core" * tag 'mfd-next-4.20' of git://git.kernel.org/pub/scm/linux/kernel/git/lee/mfd: (45 commits) mfd: cros_ec: Avoid unneeded internal declaration warning mfd: ti-lmu: Use of_device_get_match_data() helper mfd: ti-lmu: Use managed resource for everything mfd: ti-lmu: Switch to GPIOD mfd: ti-lmu: constify mfd_cell tables mfd: max8997: Disable interrupt handling for suspend/resume cycle mfd: max8997: Enale irq-wakeup unconditionally mfd: arizona: Make array mclk_name static, shrinks object size MAINTAINERS: Add myself as designated reviewer of Intel MFD PMIC mfd: Convert Intel PMIC drivers to use SPDX identifier 1;5201;0c Reduce size of duplicated comments by switching to use SPDX identifier. mfd: Sort headers alphabetically for Intel PMIC drivers mfd: intel_soc_pmic_bxtwc: Chain power button IRQs as well mfd: intel_soc_pmic_crc: Use REGMAP_IRQ_REG() macro mfd: intel_soc_pmic_crc: Use DEFINE_RES_IRQ_NAMED() macro mfd: intel_msic: Use DEFINE_RES_IRQ() macro mfd: motorola-cpcap: Add audio-codec support mfd: mc13xxx-core: Fix PMIC shutdown when reading ADC values mfd: madera: Remove unused forward reference mfd: max77620: Convert to using %pOFn instead of device_node.name mfd: madera: Don't use regmap_read_poll_timeout to poll for BOOT_DONE ...
2018-10-21Merge remote-tracking branch 'spi/topic/of' into spi-nextMark Brown1-2/+5
2018-10-21Merge branch 'spi-4.20' into spi-nextMark Brown35-321/+3683
2018-10-21Merge branch 'spi-4.19' into spi-linusMark Brown3-4/+7
2018-10-21spi: Allow building SPI_BCM63XX_HSSPI on ARM-based SoCsFlorian Fainelli1-1/+1
ARM-based 63xx DSL platforms have the spi-bcm63xx-hsspi controller present, allow using this driver there as well. Signed-off-by: Florian Fainelli <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-19spi: omap2-mcspi: Add slave mode supportVignesh R1-16/+122
Add support to use McSPI controller as SPI slave. In slave mode, DMA TX completion does not mean entire data has been shifted out as data might still be stuck in FIFO waiting for master to clock the bus. Therefore, add an IRQ handler for slave mode to know when entire data in FIFO has been shifted out. Signed-off-by: Vignesh R <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-19spi: omap2-mcspi: Set FIFO DMA trigger level to word lengthVignesh R1-19/+7
McSPI has 32 byte FIFO in Transmit-Receive mode. Current code tries to configuration FIFO watermark level for DMA trigger to be GCD of transfer length and max FIFO size which would mean trigger level may be set to 32 for transmit-receive mode if length is aligned. This does not work in case of SPI slave mode where FIFO always needs to have data ready whenever master starts the clock. With DMA trigger size of 32 there will be a small window during slave TX where DMA is still putting data into FIFO but master would have started clock for next byte, resulting in shifting out of stale data. Similarly, on Slave RX side there may be RX FIFO overflow Fix this by setting FIFO watermark for DMA trigger to word length. This means DMA is triggered as soon as FIFO has space for word length bytes and DMA would make sure FIFO is almost always full therefore improving FIFO occupancy in both master and slave mode. Signed-off-by: Vignesh R <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-19spi: omap2-mcspi: Switch to readl_poll_timeout()Vignesh R1-13/+4
Use standard readl_poll_timeout() macro for polling on status bits. Signed-off-by: Vignesh R <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-19spi: spi-mem: add stm32 qspi controllerLudovic Barre3-0/+522
The qspi controller is a specialized communication interface targeting single, dual or quad SPI Flash memories (NOR/NAND). It can operate in any of the following modes: -indirect mode: all the operations are performed using the quadspi registers -read memory-mapped mode: the external Flash memory is mapped to the microcontroller address space and is seen by the system as if it was an internal memory tested on: -NOR: mx66l51235l -NAND: MT29F2G01ABAGD Signed-off-by: Ludovic Barre <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-17spi: pic32-sqi: don't pass GFP_DMA32 to dma_alloc_coherentChristoph Hellwig1-1/+1
The DMA API does its own zone decisions based on the coherent_dma_mask. Signed-off-by: Christoph Hellwig <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-15spi: sh-msiof: fix deferred probingSergei Shtylyov1-2/+2
Since commit 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq") platform_get_irq() can return -EPROBE_DEFER. However, the driver overrides an error returned by that function with -ENOENT which breaks the deferred probing. Propagate upstream an error code returned by platform_get_irq() and remove the bogus "platform" from the error message, while at it... Fixes: 9ec36cafe43b ("of/irq: do irq resolution in platform_get_irq") Signed-off-by: Sergei Shtylyov <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-12spi: imx: use PIO mode if size is smallRobin Gong1-0/+3
Use PIO mode instead if size is smaller than fifo size, since dma may be less efficient. Signed-off-by: Robin Gong <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-12spi: imx: correct wml as the last sg lengthRobin Gong1-10/+19
Correct wml as the last rx sg length instead of the whole transfer length. Otherwise, mtd_stresstest will be failed as below: insmod mtd_stresstest.ko dev=0 ================================================= mtd_stresstest: MTD device: 0 mtd_stresstest: not NAND flash, assume page size is 512 bytes. mtd_stresstest: MTD device size 4194304, eraseblock size 65536, page size 512, count of eraseblocks 64, pa0 mtd_stresstest: doing operations mtd_stresstest: 0 operations done mtd_test: mtd_read from 1ff532, size 880 mtd_test: mtd_read from 20c267, size 64998 spi_master spi0: I/O Error in DMA RX m25p80 spi0.0: SPI transfer failed: -110 spi_master spi0: failed to transfer one message from queue mtd_test: error: read failed at 0x20c267 mtd_stresstest: error -110 occurred ================================================= insmod: ERROR: could not insert module mtd_stresstest.ko: Connection timed out Signed-off-by: Robin Gong <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-12spi: imx: move wml setting to later than setup_transferRobin Gong1-9/+14
Current dynamic burst length is based on the whole transfer length, that's ok if there is only one sg, but is not right in case multi sgs in one transfer,because the tail data should be based on the last sg length instead of the whole transfer length. Move wml setting for DMA to the later place, thus, the next patch could get the right last sg length for wml setting. This patch is a preparation one, no any function change involved. Signed-off-by: Robin Gong <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-12spi: Make GPIO CSs honour the SPI_NO_CS flagPhil Elwell1-1/+3
The SPI configuration state includes an SPI_NO_CS flag that disables all CS line manipulation, for applications that want to manage their own chip selects. However, this flag is ignored by the GPIO CS code in the SPI framework. Correct this omission with a trivial patch. Signed-off-by: Phil Elwell <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: pxa2xx: Add devicetree supportLubomir Rintel1-29/+44
The MMP2 platform, that uses device tree, has this controller. Let's add devicetree alongside platform & PCI. Signed-off-by: Lubomir Rintel <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: pxa2xx: Use an enum for typeLubomir Rintel1-3/+3
That seems to be the correct type. Signed-off-by: Lubomir Rintel <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: spi-geni-qcom: Add SPI driver support for GENI based QUPGirish Mahadevan3-0/+716
This driver supports GENI based SPI Controller in the Qualcomm SOCs. The Qualcomm Generic Interface (GENI) is a programmable module supporting a wide range of serial interfaces including SPI. This driver supports SPI operations using FIFO mode of transfer. Signed-off-by: Girish Mahadevan <[email protected]> Signed-off-by: Dilip Kota <[email protected]> Signed-off-by: Alok Chauhan <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Tested-by: Douglas Anderson <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: rockchip: simplify spi enable logicEmil Renner Berthing1-19/+9
Let the dma/non-dma code paths handle the spi enable flag themselves. This removes some logic to determine if the flag should be turned on before or after dma and also don't leave the spi enabled if the dma path fails. Signed-off-by: Emil Renner Berthing <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: rockchip: directly use direction constantsEmil Renner Berthing1-7/+4
The dma direction for the tx and rx dma channels never change, so just use the constants directly rather than storing them in device data. Signed-off-by: Emil Renner Berthing <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: rockchip: mark use_dma as boolEmil Renner Berthing1-3/+3
The driver data has a u32 field use_dma which is only ever used as a boolean, so change its type to reflect that. Signed-off-by: Emil Renner Berthing <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: rockchip: remove unneeded dma_capsEmil Renner Berthing1-2/+0
We no longer need the dma_caps since the dma driver already clamps the burst length to the hardware limit, so don't request and store dma_caps in device data. Signed-off-by: Emil Renner Berthing <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: rockchip: adjust dma watermark and burstlenHuibin Hong1-9/+3
Signal tx dma when spi fifo is less than half full, and limit tx bursts to half the fifo length. Clamp rx burst length to 1 to avoid alignment issues. Signed-off-by: Huibin Hong <[email protected]> Signed-off-by: Emil Renner Berthing <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: rockchip: initialize dma_slave_config properlyHuibin Hong1-0/+3
The rxconf and txconf structs are allocated on the stack, so make sure we zero them before filling out the relevant fields. Signed-off-by: Huibin Hong <[email protected]> Signed-off-by: Emil Renner Berthing <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: Introduce new driver for Qualcomm QuadSPI controllerGirish Mahadevan3-0/+588
New driver for Qualcomm QuadSPI(QSPI) controller that is used to communicate with slaves such as flash memory devices. The QSPI controller can operate in 2 or 4 wire mode but only supports SPI Mode 0. The controller can also operate in Single or Dual data rate modes. Signed-off-by: Girish Mahadevan <[email protected]> Signed-off-by: Ryan Case <[email protected]> Reviewed-by: Douglas Anderson <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11dw: spi: add support for Amazon's Alpine spi controllerTalel Shenhar3-0/+17
Add support for a new devicetree compatible string called 'amazon,alpine-apb-ssi', which is necessary for the Amazon Alpine spi controller. 'amazon,alpine-dw-apb-ssi' is used in the dw spi driver if specified in the devicetree. Otherwise, fall back to driver default behavior, i.e. original dw IP hw driver behavior. Signed-off-by: Talel Shenhar <[email protected]> Signed-off-by: David Woodhouse <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-11spi: bcm-qspi: switch back to reading flash using smaller chunksRafał Miłecki1-1/+1
Fixing/optimizing bcm_qspi_bspi_read() performance introduced two changes: 1) It added a loop to read all requested data using multiple BSPI ops. 2) It bumped max size of a single BSPI block request from 256 to 512 B. The later change resulted in occasional BSPI timeouts causing a regression. For some unknown reason hardware doesn't always handle reads as expected when using 512 B chunks. In such cases it may happen that BSPI returns amount of requested bytes without the last 1-3 ones. It provides the remaining bytes later but doesn't raise an interrupt until another LR start. Switching back to 256 B reads fixes that problem and regression. Fixes: 345309fa7c0c ("spi: bcm-qspi: Fix bcm_qspi_bspi_read() performance") Signed-off-by: Rafał Miłecki <[email protected]> Signed-off-by: Mark Brown <[email protected]> Cc: [email protected]
2018-10-11spi: bcm-qspi: fix calculation of address lengthRafał Miłecki1-1/+1
During implementation of the new API bcm_qspi_bspi_set_flex_mode() has been modified breaking calculation of address length. An unnecessary multiplication was added breaking flash reads. Fixes: 5f195ee7d830 ("spi: bcm-qspi: Implement the spi_mem interface") Signed-off-by: Rafał Miłecki <[email protected]> Reviewed-by: Boris Brezillon <[email protected]> Signed-off-by: Mark Brown <[email protected]> Cc: [email protected]
2018-10-10spi: spidev: Fix OF tree warning logicTrent Piepho1-5/+3
spidev will make a big fuss if a device tree node binds a device by using "spidev" as the node's compatible property. However, the logic for this isn't looking for "spidev" in the compatible, but rather checking that the device is NOT compatible with spidev's list of devices. This causes a false positive if a device not named "rohm,dh2228fv", etc. binds to spidev, even if a means other than putting "spidev" in the device tree was used. E.g., the sysfs driver_override attribute. Signed-off-by: Trent Piepho <[email protected]> Reviewed-by: Jan Kundrát <[email protected]> Tested-by: Jan Kundrát <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-10spi: Add driver_override SPI device attributeTrent Piepho1-0/+51
This attribute works the same was as the identically named attribute for PCI, AMBA, and platform devices. For reference, see: commit 3cf385713460 ("ARM: 8256/1: driver coamba: add device binding path 'driver_override'") commit 3d713e0e382e ("driver core: platform: add device binding path 'driver_override'") commit 782a985d7af2 ("PCI: Introduce new device binding path using pci_dev.driver_override") If the name of a driver is written to this attribute, then the device will bind to the named driver and only the named driver. The device will bind to the driver even if the driver does not list the device in its id table. This behavior is different than the driver's bind attribute, which only allows binding to devices that are listed as supported by the driver. It can be used to bind a generic driver, like spidev, to a device. Signed-off-by: Trent Piepho <[email protected]> Reviewed-by: Jan Kundrát <[email protected]> Tested-by: Jan Kundrát <[email protected]> Reviewed-by: Geert Uytterhoeven <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-10spi: rb4xx: Use SPI_BPW_MASK to set bits_per_word_maskAxel Lin1-1/+1
Improve readability a bit. Signed-off-by: Axel Lin <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-10spi: fsl-lpspi: Prevent FIFO under/overrun by defaultHieu Tran Dang1-1/+1
Certain devices don't work well when a transmit FIFO underrun or receive FIFO overrun occurs. Example is the SAF400x radio chip when running at high speed which leads to garbage being sent to/received from the chip. In which case, it should stall waiting for further data to be available before proceeding. This patch unset the NOSTALL bit in CFGR1 by default to prevent this issue. Signed-off-by: Hieu Tran Dang <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-09spi: spi-ep93xx: Use dma_data_direction for ep93xx_spi_dma_{finish,prepare}Nathan Chancellor1-11/+25
Clang warns when one enumerated type is implicitly converted to another. drivers/spi/spi-ep93xx.c:342:62: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] nents = dma_map_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ./include/linux/dma-mapping.h:428:58: note: expanded from macro 'dma_map_sg' #define dma_map_sg(d, s, n, r) dma_map_sg_attrs(d, s, n, r, 0) ~~~~~~~~~~~~~~~~ ^ drivers/spi/spi-ep93xx.c:348:57: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ./include/linux/dma-mapping.h:429:62: note: expanded from macro 'dma_unmap_sg' #define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0) ~~~~~~~~~~~~~~~~~~ ^ drivers/spi/spi-ep93xx.c:377:56: warning: implicit conversion from enumeration type 'enum dma_transfer_direction' to different enumeration type 'enum dma_data_direction' [-Wenum-conversion] dma_unmap_sg(chan->device->dev, sgt->sgl, sgt->nents, dir); ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~ ./include/linux/dma-mapping.h:429:62: note: expanded from macro 'dma_unmap_sg' #define dma_unmap_sg(d, s, n, r) dma_unmap_sg_attrs(d, s, n, r, 0) ~~~~~~~~~~~~~~~~~~ ^ 3 warnings generated. dma_{,un}map_sg expect an enum of type dma_data_direction but this driver uses dma_transfer_direction for everything. Convert the driver to use dma_data_direction for these two functions. There are two places that strictly require an enum of type dma_transfer_direction: the direction member in struct dma_slave_config and the direction parameter in dmaengine_prep_slave_sg. To avoid using an explicit cast, add a simple function, ep93xx_dma_data_to_trans_dir, to safely map between the two types because they are not 1 to 1 in meaning. Signed-off-by: Nathan Chancellor <[email protected]> Reviewed-by: Nick Desaulniers <[email protected]> Reviewed-by: Mika Westerberg <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-08spidev: Enable the Liebherr's BK4 board to work with spidev driverLukasz Majewski1-0/+1
With this commit the DSPI driver on the BK4 board can be used for SPI transmission managed from user space (via /dev/spidev0.0). Example usage/testing: insmod ./spi-fsl-dspi.ko ./spidev_test -D /dev/spidev0.0 -s 3000000 -v -H -b 8 -p "\xCC\x11\x22\x74" Signed-off-by: Lukasz Majewski <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-04spi: pxa2xx: Rewrite switch code block in interrupt_transferGustavo A. R. Silva1-1/+3
Rewrite switch code block to directly do the expected number of shifts in each case and have break statements. Addresses-Coverity-ID: 1056539 ("Missing break in switch") Suggested-by: Mark Brown <[email protected]> Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-10-03spi: slave: Fix missing break in switchGustavo A. R. Silva1-0/+1
Apparently, this code does not actually fall through to the next case because the machine restarts before it has a chance. However, for the sake of maintenance and readability, we better add the missing break statement. Addresses-Coverity-ID: 1437892 ("Missing break in switch") Signed-off-by: Gustavo A. R. Silva <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-09-28Merge tag 'spi-fix-v4.19-rc5' of ↵Greg Kroah-Hartman4-15/+82
https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi Mark writes: "spi: Fixes for v4.19 Quite a few fixes for the Renesas drivers in here, plus a fix for the Tegra driver and some documentation fixes for the recently added spi-mem code. The Tegra fix is relatively large but fairly straightforward and mechanical, it runs on probe so it's been reasonably well covered in -next testing." * tag 'spi-fix-v4.19-rc5' of https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi: spi: spi-mem: Move the DMA-able constraint doc to the kerneldoc header spi: spi-mem: Add missing description for data.nbytes field spi: rspi: Fix interrupted DMA transfers spi: rspi: Fix invalid SPI use during system suspend spi: sh-msiof: Fix handling of write value for SISTR register spi: sh-msiof: Fix invalid SPI use during system suspend spi: gpio: Fix copy-and-paste error spi: tegra20-slink: explicitly enable/disable clock
2018-09-28spi: mediatek: add spi slave for Mediatek MT2712Leilk Liu3-0/+565
This patch adds basic spi slave for MT2712. Signed-off-by: Leilk Liu <[email protected]> Signed-off-by: Mark Brown <[email protected]>
2018-09-27spi: make OF helper available for othersMarco Felsch1-2/+5
The of_find_spi_device_by_node() helper function is useful for other modules too. Export the funciton as GPL like all other spi helper functions and make it available if CONFIG_OF is enabled, because it isn't related to the CONFIG_OF_DYNAMIC context. Finally add a stub if CONFIG_OF isn't enabled, so others must not care about it. Signed-off-by: Marco Felsch <[email protected]> Signed-off-by: Mark Brown <[email protected]>