diff options
author | Brian Niebuhr <bniebuhr@efjohnson.com> | 2010-09-28 04:29:26 -0400 |
---|---|---|
committer | Sekhar Nori <nsekhar@ti.com> | 2010-11-18 08:08:33 -0500 |
commit | c29e3c60e75d1cc1262ac8af379738b6fd851f33 (patch) | |
tree | 19697ab9c0a16e8152f31825ddb8a413ef3b1b72 /arch | |
parent | 96fd881f22b44fc14772316a6b9231012393cda8 (diff) |
spi: davinci: always start transmit DMA
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: Brian Niebuhr <bniebuhr@efjohnson.com>
Tested-By: Michael Williamson <michael.williamson@criticallink.com>
Signed-off-by: Sekhar Nori <nsekhar@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-davinci/dm355.c | 1 | ||||
-rw-r--r-- | arch/arm/mach-davinci/include/mach/spi.h | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c index e311f29ffb57..27ee870b2d27 100644 --- a/arch/arm/mach-davinci/dm355.c +++ b/arch/arm/mach-davinci/dm355.c | |||
@@ -413,6 +413,7 @@ static struct davinci_spi_platform_data dm355_spi0_pdata = { | |||
413 | .version = SPI_VERSION_1, | 413 | .version = SPI_VERSION_1, |
414 | .num_chipselect = 2, | 414 | .num_chipselect = 2, |
415 | .clk_internal = 1, | 415 | .clk_internal = 1, |
416 | .cshold_bug = true, | ||
416 | }; | 417 | }; |
417 | static struct platform_device dm355_spi0_device = { | 418 | static struct platform_device dm355_spi0_device = { |
418 | .name = "spi_davinci", | 419 | .name = "spi_davinci", |
diff --git a/arch/arm/mach-davinci/include/mach/spi.h b/arch/arm/mach-davinci/include/mach/spi.h index ab45b89a0c5f..68db6d5daaf4 100644 --- a/arch/arm/mach-davinci/include/mach/spi.h +++ b/arch/arm/mach-davinci/include/mach/spi.h | |||
@@ -33,6 +33,7 @@ struct davinci_spi_platform_data { | |||
33 | u8 intr_line; | 33 | u8 intr_line; |
34 | u8 use_dma; | 34 | u8 use_dma; |
35 | u8 *chip_sel; | 35 | u8 *chip_sel; |
36 | bool cshold_bug; | ||
36 | }; | 37 | }; |
37 | 38 | ||
38 | struct davinci_spi_config { | 39 | struct davinci_spi_config { |