- 31 3月, 2012 1 次提交
-
-
由 Shubhrajyoti D 提交于
The driver uses NULL for dma_unmap_single instead of the struct device that the API expects. Signed-off-by: NShubhrajyoti D <shubhrajyoti@ti.com> Tested-by: NAkshay Shankarmurthy <akshay.s@ti.com> Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
- 25 10月, 2011 1 次提交
-
-
由 Grant Likely 提交于
For simple modules that contain a single platform_driver without any additional setup code then ends up being a block of duplicated boilerplate. This patch adds a new macro, module_platform_driver(), which replaces the module_init()/module_exit() registrations with template functions. Signed-off-by: NGrant Likely <grant.likely@secretlab.ca> Acked-by: NGreg Kroah-Hartman <gregkh@suse.de> Reviewed-by: NMagnus Damm <magnus.damm@gmail.com> Reviewed-by: NMark Brown <broonie@opensource.wolfsonmicro.com> Reviewed-by: NStephen Boyd <sboyd@codeaurora.org>
-
- 06 6月, 2011 1 次提交
-
-
由 Grant Likely 提交于
Sort the SPI makefile and enforce the naming convention spi_*.c for spi drivers. This change also rolls the contents of atmel_spi.h into the .c file since there is only one user of that particular include file. v2: - Use 'spi-' prefix instead of 'spi_' to match what seems to be be the predominant pattern for subsystem prefixes. - Clean up filenames in Kconfig and header comment blocks Signed-off-by: NGrant Likely <grant.likely@secretlab.ca> Acked-by: NWolfram Sang <w.sang@pengutronix.de> Acked-by: NLinus Walleij <linus.walleij@linaro.org>
-
- 15 3月, 2011 2 次提交
-
-
由 Michael Williamson 提交于
The current davinci SPI driver, in DMA mode, is limited to 65535 words for a single transfer. Modify the driver by configuring a 3 dimensional EDMA transfer to support up to 65535x65535 words. Signed-off-by: NMichael Williamson <michael.williamson@criticallink.com> Tested-by: NStefano Babic <sbabic@denx.de> Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
由 Michael Williamson 提交于
The davinci spi driver provides an option to use DMA transfers for data. In the dma_map_single() call, the driver is passing the number of words to be transfered for the mapping size. It should be the number of bytes. Signed-off-by: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NGrant Likely <grant.likely@secretlab.ca>
-
- 01 3月, 2011 1 次提交
-
-
由 Michael Williamson 提交于
For DMA operation, the davinci spi driver needs an event queue number. Currently, this number is passed as a IORESOURCE_DMA. This is not correct, as the event queue is not a DMA channel. Pass the event queue via the platform data structure instead. On dm355 and dm365, move the eventq assignment for spi0 out of resources array and into platform data. Signed-off-by: NMichael Williamson <michael.williamson@criticallink.com> Acked-by: NSekhar Nori <nsekhar@ti.com> Acked-by: NGrant Likely <grant.likely@secretlab.ca> Signed-off-by: NKevin Hilman <khilman@ti.com>
-
- 18 11月, 2010 34 次提交
-
-
由 Sekhar Nori 提交于
Shorten names of local variables and structure members where possible. Local variables: * 'davinci_spi' is being renamed 'dspi' * 'davinci_spi_dma' is being renamed 'dma' Structure members: * 'dma_{tx|rx}_channel' is being renamed '{tx|rx}_channel' since the structure containing them is already called 'davinci_spi_dma' * 'davinci_spi_dma' in 'davinci_spi' structure is being renamed 'dma' Tested-By: NBrian Niebuhr <bniebuhr@efjohnson.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Sekhar Nori 提交于
Remove unnecesary private data member 'region_size' being used to store the size of SPI memory region. Instead, get the memory resource size directly from the platform data. Tested-By: NBrian Niebuhr <bniebuhr@efjohnson.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Add copyright for EF Johnson Technologies since the driver has been majorly overhauled by Brian. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Add comments describing the platform data members and per-chip-select SPI configuration structure. Also, add some comments describing the what happens during the driver probe. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Setup the owner member of the platform driver to THIS_MODULE instead of leaving it NULL. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Enable SPI only when active transfers are in progress. Keep it in local low power when not in use. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
The "clk_internal" platform data member which contols the CLKMOD bit in Global Control Register 1 is not useful since CLKMOD needs be set to 1 *always* to ensure master mode operation. Remove this platform data. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Let DMA operation be specified on a per-device basis instead of selecting it once during probe. A side effect of this is the need to combine the PIO and DMA buffer txrx_bufs routine. This is good since they anyway share some common functionality. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
The DMA code does not use the existing completion variable 'done' which is being used for interrupt mode transfers. Instead it uses two different completion variables specific to DMA mode transfers. Eliminate the usage of new completion variables for DMA mode and use the existing completion variable. [nsekhar@ti.com: To make this process easy, eliminate the two different DMA completion callback functions for tx and rx and use a single callback function instead] Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Do not simply clean the DMA channel on a DMA completion error. Instead, use wcount and rcount members of davinci_spi to detecion non-completion of DMA and signal EIO to the application. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Use a dummy param slot linked to itself to take care of the extra "sync event" that gets sent to EDMA controller after the last byte has been transferred. The dummy PaRAM slot that is linked to the actual DMA PaRAM slot "absorbs" this event and prevents a EDMA CC error to be asserted. Without this provision, the EDMA CC error would be asserted because the channel PaRAM would be empty after the transfer and EDMA would not know what to make out of the extra sync event. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Sekhar Nori 提交于
Do not allocate (and de-allocate) SPI DMA channels during setup (and cleanup) for each SPI device. Instead, allocate the DMA channels once duing probe and use them for the life time of the driver. This makes sense since there are dedicated DMA channels meant for SPI use. This also helps remove the unnecessary DMA "sync_dev" variables being used to store DMA channel information. Also, the "use_dma" platform variable is now eliminated since it is possible to check if the platform supports DMA or not based upon whether DMA resources can be found or not. Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Tested-By: NBrian Niebuhr <bniebuhr@efjohnson.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Do not stop SPI DMA event generation in either transmit or receive DMA event call back because the single setting affects both transmit and receive event generation. Depending on the order in which the callbacks happen, transmit or receive events can get unintentionally stalled. Instead, disable event generation once after both the transmit and receive DMA completes. While at it, remove the largely under-used function to set or clear DMA event generation. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Currently a series of EDMA API calls are being made to setup various aspects of EDMA PaRAM slots for receive and transmit. Instead setup the PaRAM using a local structure and write once to the hardware using edma_write_slot() Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
In keeping with the full duplex nature of the SPI bus. Always start receive DMA along with transmit DMA. If there is no receive buffer provided with the transfer, use a temporary buffer to receive the data to be thrown away. [michael.williamson@criticallink.com: receive DMA size should be same as transfer length to avoid hang-up when transfer length is smaller than temporary rx buffer size (rx buffer not provided)] Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Remove usage of temporary buffer when no transmit data is provided. Instead, use the transmit register itself as the source of data. By choosing the transmit register itself as the source of data, this patch helps remove unnecessary accesses to memory when no real data is being transmitted. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Due to the full duplex nature of the SPI bus, the SPI master on DaVinci needs transmit to be active even if the tranfer is only meant to collect receive data. The current code achieves this by using a temporary zeroed buffer to provide DMA data in case the transfer does not have a transmit buffer provided. However, the transmit DMA is started only if transmit buffer is provided rendering the temporary buffer unused. Instead the code relies on a write to SPIDAT1 register to trigger transmit operation. This however only sends two bytes of data. Fix this by starting transmit DMA always. This changes exposes a bug on DM355 where the CSHOLD bit in SPIDAT1 needs to be written to in between transfers. Handle that by introducing a "cshold_bug" platform data which is set to true for DM355. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Do not store DMA channel related information per chip-select since that information does not depend on the chip select. The same DMA channels can be used for transfers on all chip-selects since the transfer happens one-at-a-time. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Remove unnecessary call to davinci_spi_setup_transfer() at the end of davinci_spi_setup(). davinci_spi_setup_transfer() is registered as the setup_transfer callback for the bitbang layer and is called independently by the bitbang layer to setup the transfer before it begins. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
The function davinci_spi_bufs_prep() is doing stuff that davinci_spi_setup() is doing. Eliminate it and move the work to davinci_spi_setup() Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Configure the data-in, data-out and clock functionality pins in SPIPC0 register only once during probe. No need to set these bits for each transfer. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Add support for SPI interrupt mode operation. Define a per chip-select "io type" variable which specifies if the transfers on this chip-select should happen in interrupt mode or polled mode. Introduce a new function davinci_spi_process_events() to help consolidate the code between interrupt mode processing and polled mode processing. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Use the fact that the get_tx and get_rx can now cope with NULL buffer pointers to simplify the poll mode transfer code. While at it, check for SPI errors every transfer rather than at the end of the whole transfer. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
The interrupt mode support as it stands is another version of poll mode. Even when interrupt mode is selected, the code tight loops on interrupt status register, rendering it totally useless. A completion variable is initialized, but never used. Remove this fake interrupt mode since users can anyway use poll mode with no functional difference. A usefully implemented interrupt mode support can be added later. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
The completion variable 'done' is unnecessarly initialized by the function davinci_spi_bufs_dma() where as it is not used for DMA transfers at all. Remove the unnecessary initialization. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Sekhar Nori 提交于
In davinci_spi_check_error(), Tx interrupt being set is treated as error. This function is only meant to flag bus error conditions and Tx interrupt being set at that point is not a bus error but rather a driver bug. Stop checking for Tx interrupt and flagging that as an IO error. Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Tested-By: NBrian Niebuhr <bniebuhr@efjohnson.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
The variable count in DaVinci SPI driver's private data is largely unused and its minor use can easily be eliminated. Remove the variable. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
In the davinci_spi_bufs_dma() function, SPI is briefly disabled before enabling it immediately back again. Remove this unnecessary disable. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
In the davinci_spi_{tx|rx}_u{8|16}() functions, check for buffer pointer being valid before using it. While providing for better error checking, this change will help simplify code in the caller. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
The EDMA acount (called data_type in davinci_spi_bufs_dma()) is simply the bytes_per_word obtained in the transfer setup function. The current code calculates the acount value from bytes_per_word in a convoluted manner. Simplify the code. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
The count member of davinci_spi is internal to the driver and is not shared with framework. Eliminate its unnecessary update. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
The struct davinci_spi_slave has a single member. Eliminate it and store the per-chipselect data in struct davinci_spi directly. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Several members of struct davinci_spi_slave are unused in code. Remove such members. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-
由 Brian Niebuhr 提交于
Just enabling WAITENA in SPIFMTn register waits for the enable signal from the slave indefinitely. Allow support for finite waiting by adding support for c2e delay (maximum time for addressed slave to respond) and t2e delay (maximum time for slave to respond after transmit data finished). While at it, modify the T2C and C2T defines by prepending the register name as is the convention followed for other register field elsewhere in the driver. Signed-off-by: NBrian Niebuhr <bniebuhr@efjohnson.com> Tested-By: NMichael Williamson <michael.williamson@criticallink.com> Signed-off-by: NSekhar Nori <nsekhar@ti.com>
-