aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/mach-davinci
diff options
context:
space:
mode:
authorMichael Williamson <michael.williamson@criticallink.com>2011-02-08 07:59:55 -0500
committerKevin Hilman <khilman@ti.com>2011-02-28 17:53:29 -0500
commit2e3e2a5e4fef586ae9b1cfef42823c0aef1797f4 (patch)
tree9b6619631c0798feff53c9f0d907abe2cf3b6394 /arch/arm/mach-davinci
parenta42f18c96da2220eaad603a7586d43cdd12d9f9f (diff)
davinci: spi: move event queue parameter to platform data
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: Michael Williamson <michael.williamson@criticallink.com> Acked-by: Sekhar Nori <nsekhar@ti.com> Acked-by: Grant Likely <grant.likely@secretlab.ca> Signed-off-by: Kevin Hilman <khilman@ti.com>
Diffstat (limited to 'arch/arm/mach-davinci')
-rw-r--r--arch/arm/mach-davinci/dm355.c5
-rw-r--r--arch/arm/mach-davinci/dm365.c5
-rw-r--r--arch/arm/mach-davinci/include/mach/spi.h15
3 files changed, 12 insertions, 13 deletions
diff --git a/arch/arm/mach-davinci/dm355.c b/arch/arm/mach-davinci/dm355.c
index a5f8a80c1f28..76364d1345df 100644
--- a/arch/arm/mach-davinci/dm355.c
+++ b/arch/arm/mach-davinci/dm355.c
@@ -403,16 +403,13 @@ static struct resource dm355_spi0_resources[] = {
403 .start = 16, 403 .start = 16,
404 .flags = IORESOURCE_DMA, 404 .flags = IORESOURCE_DMA,
405 }, 405 },
406 {
407 .start = EVENTQ_1,
408 .flags = IORESOURCE_DMA,
409 },
410}; 406};
411 407
412static struct davinci_spi_platform_data dm355_spi0_pdata = { 408static struct davinci_spi_platform_data dm355_spi0_pdata = {
413 .version = SPI_VERSION_1, 409 .version = SPI_VERSION_1,
414 .num_chipselect = 2, 410 .num_chipselect = 2,
415 .cshold_bug = true, 411 .cshold_bug = true,
412 .dma_event_q = EVENTQ_1,
416}; 413};
417static struct platform_device dm355_spi0_device = { 414static struct platform_device dm355_spi0_device = {
418 .name = "spi_davinci", 415 .name = "spi_davinci",
diff --git a/arch/arm/mach-davinci/dm365.c b/arch/arm/mach-davinci/dm365.c
index 02d2cc380df7..4604e72d7d99 100644
--- a/arch/arm/mach-davinci/dm365.c
+++ b/arch/arm/mach-davinci/dm365.c
@@ -625,6 +625,7 @@ static u64 dm365_spi0_dma_mask = DMA_BIT_MASK(32);
625static struct davinci_spi_platform_data dm365_spi0_pdata = { 625static struct davinci_spi_platform_data dm365_spi0_pdata = {
626 .version = SPI_VERSION_1, 626 .version = SPI_VERSION_1,
627 .num_chipselect = 2, 627 .num_chipselect = 2,
628 .dma_event_q = EVENTQ_3,
628}; 629};
629 630
630static struct resource dm365_spi0_resources[] = { 631static struct resource dm365_spi0_resources[] = {
@@ -645,10 +646,6 @@ static struct resource dm365_spi0_resources[] = {
645 .start = 16, 646 .start = 16,
646 .flags = IORESOURCE_DMA, 647 .flags = IORESOURCE_DMA,
647 }, 648 },
648 {
649 .start = EVENTQ_3,
650 .flags = IORESOURCE_DMA,
651 },
652}; 649};
653 650
654static struct platform_device dm365_spi0_device = { 651static struct platform_device dm365_spi0_device = {
diff --git a/arch/arm/mach-davinci/include/mach/spi.h b/arch/arm/mach-davinci/include/mach/spi.h
index 38f4da5ca135..7af305b37868 100644
--- a/arch/arm/mach-davinci/include/mach/spi.h
+++ b/arch/arm/mach-davinci/include/mach/spi.h
@@ -19,6 +19,8 @@
19#ifndef __ARCH_ARM_DAVINCI_SPI_H 19#ifndef __ARCH_ARM_DAVINCI_SPI_H
20#define __ARCH_ARM_DAVINCI_SPI_H 20#define __ARCH_ARM_DAVINCI_SPI_H
21 21
22#include <mach/edma.h>
23
22#define SPI_INTERN_CS 0xFF 24#define SPI_INTERN_CS 0xFF
23 25
24enum { 26enum {
@@ -39,13 +41,16 @@ enum {
39 * to populate if all chip-selects are internal. 41 * to populate if all chip-selects are internal.
40 * @cshold_bug: set this to true if the SPI controller on your chip requires 42 * @cshold_bug: set this to true if the SPI controller on your chip requires
41 * a write to CSHOLD bit in between transfers (like in DM355). 43 * a write to CSHOLD bit in between transfers (like in DM355).
44 * @dma_event_q: DMA event queue to use if SPI_IO_TYPE_DMA is used for any
45 * device on the bus.
42 */ 46 */
43struct davinci_spi_platform_data { 47struct davinci_spi_platform_data {
44 u8 version; 48 u8 version;
45 u8 num_chipselect; 49 u8 num_chipselect;
46 u8 intr_line; 50 u8 intr_line;
47 u8 *chip_sel; 51 u8 *chip_sel;
48 bool cshold_bug; 52 bool cshold_bug;
53 enum dma_event_q dma_event_q;
49}; 54};
50 55
51/** 56/**