diff options
author | Mika Westerberg <mika.westerberg@iki.fi> | 2011-05-29 06:10:06 -0400 |
---|---|---|
committer | Grant Likely <grant.likely@secretlab.ca> | 2011-06-08 17:46:12 -0400 |
commit | 626a96db11698119a67eeda130488e869aa6f14e (patch) | |
tree | 1d5fd7da4a7919596bd81e0136d96679196e1152 /arch/arm/mach-ep93xx | |
parent | 71cebd700257a4f644066631bf02187d8f67817e (diff) |
spi/ep93xx: add DMA support
This patch adds DMA support for the EP93xx SPI driver. By default the DMA is
not enabled but it can be enabled by setting ep93xx_spi_info.use_dma to true
in board configuration file.
Note that the SPI driver still uses PIO for small transfers (<= 8 bytes) for
performance reasons.
Signed-off-by: Mika Westerberg <mika.westerberg@iki.fi>
Acked-by: H Hartley Sweeten <hsweeten@visionengravers.com>
Acked-by: Vinod Koul <vinod.koul@intel.com>
Signed-off-by: Grant Likely <grant.likely@secretlab.ca>
Diffstat (limited to 'arch/arm/mach-ep93xx')
-rw-r--r-- | arch/arm/mach-ep93xx/core.c | 6 | ||||
-rw-r--r-- | arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/arch/arm/mach-ep93xx/core.c b/arch/arm/mach-ep93xx/core.c index 82079545adc4..cc9f1d4b104d 100644 --- a/arch/arm/mach-ep93xx/core.c +++ b/arch/arm/mach-ep93xx/core.c | |||
@@ -488,11 +488,15 @@ static struct resource ep93xx_spi_resources[] = { | |||
488 | }, | 488 | }, |
489 | }; | 489 | }; |
490 | 490 | ||
491 | static u64 ep93xx_spi_dma_mask = DMA_BIT_MASK(32); | ||
492 | |||
491 | static struct platform_device ep93xx_spi_device = { | 493 | static struct platform_device ep93xx_spi_device = { |
492 | .name = "ep93xx-spi", | 494 | .name = "ep93xx-spi", |
493 | .id = 0, | 495 | .id = 0, |
494 | .dev = { | 496 | .dev = { |
495 | .platform_data = &ep93xx_spi_master_data, | 497 | .platform_data = &ep93xx_spi_master_data, |
498 | .coherent_dma_mask = DMA_BIT_MASK(32), | ||
499 | .dma_mask = &ep93xx_spi_dma_mask, | ||
496 | }, | 500 | }, |
497 | .num_resources = ARRAY_SIZE(ep93xx_spi_resources), | 501 | .num_resources = ARRAY_SIZE(ep93xx_spi_resources), |
498 | .resource = ep93xx_spi_resources, | 502 | .resource = ep93xx_spi_resources, |
diff --git a/arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h b/arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h index 0a37961b3453..9bb63ac13f04 100644 --- a/arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h +++ b/arch/arm/mach-ep93xx/include/mach/ep93xx_spi.h | |||
@@ -7,9 +7,11 @@ struct spi_device; | |||
7 | * struct ep93xx_spi_info - EP93xx specific SPI descriptor | 7 | * struct ep93xx_spi_info - EP93xx specific SPI descriptor |
8 | * @num_chipselect: number of chip selects on this board, must be | 8 | * @num_chipselect: number of chip selects on this board, must be |
9 | * at least one | 9 | * at least one |
10 | * @use_dma: use DMA for the transfers | ||
10 | */ | 11 | */ |
11 | struct ep93xx_spi_info { | 12 | struct ep93xx_spi_info { |
12 | int num_chipselect; | 13 | int num_chipselect; |
14 | bool use_dma; | ||
13 | }; | 15 | }; |
14 | 16 | ||
15 | /** | 17 | /** |