diff options
author | David Brownell <david-b@pacbell.net> | 2007-06-22 22:17:57 -0400 |
---|---|---|
committer | Haavard Skinnemoen <hskinnemoen@atmel.com> | 2007-06-23 08:53:16 -0400 |
commit | 6b84bbfc7133ee493f3e9529a42b5ee53ea69dfe (patch) | |
tree | 6f3cb3157e248d0d716a1c47b5db5de497a89132 /arch/avr32 | |
parent | 7f8b9acae8a76fcce5f4af0dfac735a1b7b4fdbf (diff) |
[AVR32] Initialize dma_mask and dma_coherent_mask
The current at32ap7000 platform devices aren't declared as supporting DMA,
so that layered drivers can't tell whether they need to manage DMA.
This patch makes all those platform devices report that they support DMA.
Most do, but in a few cases this is inappropriate.
Signed-off-by: David Brownell <dbrownell@users.sourceforge.net>
Signed-off-by: Haavard Skinnemoen <hskinnemoen@atmel.com>
Diffstat (limited to 'arch/avr32')
-rw-r--r-- | arch/avr32/mach-at32ap/at32ap7000.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/arch/avr32/mach-at32ap/at32ap7000.c b/arch/avr32/mach-at32ap/at32ap7000.c index 1d2bf347a1d..4dda42d3f6d 100644 --- a/arch/avr32/mach-at32ap/at32ap7000.c +++ b/arch/avr32/mach-at32ap/at32ap7000.c | |||
@@ -9,6 +9,7 @@ | |||
9 | #include <linux/fb.h> | 9 | #include <linux/fb.h> |
10 | #include <linux/init.h> | 10 | #include <linux/init.h> |
11 | #include <linux/platform_device.h> | 11 | #include <linux/platform_device.h> |
12 | #include <linux/dma-mapping.h> | ||
12 | #include <linux/spi/spi.h> | 13 | #include <linux/spi/spi.h> |
13 | 14 | ||
14 | #include <asm/io.h> | 15 | #include <asm/io.h> |
@@ -45,19 +46,30 @@ | |||
45 | .flags = IORESOURCE_IRQ, \ | 46 | .flags = IORESOURCE_IRQ, \ |
46 | } | 47 | } |
47 | 48 | ||
49 | /* REVISIT these assume *every* device supports DMA, but several | ||
50 | * don't ... tc, smc, pio, rtc, watchdog, pwm, ps2, and more. | ||
51 | */ | ||
48 | #define DEFINE_DEV(_name, _id) \ | 52 | #define DEFINE_DEV(_name, _id) \ |
53 | static u64 _name##_id##_dma_mask = DMA_32BIT_MASK; \ | ||
49 | static struct platform_device _name##_id##_device = { \ | 54 | static struct platform_device _name##_id##_device = { \ |
50 | .name = #_name, \ | 55 | .name = #_name, \ |
51 | .id = _id, \ | 56 | .id = _id, \ |
57 | .dev = { \ | ||
58 | .dma_mask = &_name##_id##_dma_mask, \ | ||
59 | .coherent_dma_mask = DMA_32BIT_MASK, \ | ||
60 | }, \ | ||
52 | .resource = _name##_id##_resource, \ | 61 | .resource = _name##_id##_resource, \ |
53 | .num_resources = ARRAY_SIZE(_name##_id##_resource), \ | 62 | .num_resources = ARRAY_SIZE(_name##_id##_resource), \ |
54 | } | 63 | } |
55 | #define DEFINE_DEV_DATA(_name, _id) \ | 64 | #define DEFINE_DEV_DATA(_name, _id) \ |
65 | static u64 _name##_id##_dma_mask = DMA_32BIT_MASK; \ | ||
56 | static struct platform_device _name##_id##_device = { \ | 66 | static struct platform_device _name##_id##_device = { \ |
57 | .name = #_name, \ | 67 | .name = #_name, \ |
58 | .id = _id, \ | 68 | .id = _id, \ |
59 | .dev = { \ | 69 | .dev = { \ |
70 | .dma_mask = &_name##_id##_dma_mask, \ | ||
60 | .platform_data = &_name##_id##_data, \ | 71 | .platform_data = &_name##_id##_data, \ |
72 | .coherent_dma_mask = DMA_32BIT_MASK, \ | ||
61 | }, \ | 73 | }, \ |
62 | .resource = _name##_id##_resource, \ | 74 | .resource = _name##_id##_resource, \ |
63 | .num_resources = ARRAY_SIZE(_name##_id##_resource), \ | 75 | .num_resources = ARRAY_SIZE(_name##_id##_resource), \ |