diff options
Diffstat (limited to 'arch/arm/common')
-rw-r--r-- | arch/arm/common/amba.c | 2 | ||||
-rw-r--r-- | arch/arm/common/dmabounce.c | 36 | ||||
-rw-r--r-- | arch/arm/common/sa1111.c | 13 | ||||
-rw-r--r-- | arch/arm/common/sharpsl_param.c | 2 |
4 files changed, 30 insertions, 23 deletions
diff --git a/arch/arm/common/amba.c b/arch/arm/common/amba.c index a0507f8c33fe..c6beb751f2a9 100644 --- a/arch/arm/common/amba.c +++ b/arch/arm/common/amba.c | |||
@@ -169,7 +169,7 @@ static void amba_device_release(struct device *dev) | |||
169 | } | 169 | } |
170 | 170 | ||
171 | #define amba_attr(name,fmt,arg...) \ | 171 | #define amba_attr(name,fmt,arg...) \ |
172 | static ssize_t show_##name(struct device *_dev, char *buf) \ | 172 | static ssize_t show_##name(struct device *_dev, struct device_attribute *attr, char *buf) \ |
173 | { \ | 173 | { \ |
174 | struct amba_device *dev = to_amba_device(_dev); \ | 174 | struct amba_device *dev = to_amba_device(_dev); \ |
175 | return sprintf(buf, fmt, arg); \ | 175 | return sprintf(buf, fmt, arg); \ |
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index 5797b1b100a1..cbf2165476b0 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include <linux/dmapool.h> | 30 | #include <linux/dmapool.h> |
31 | #include <linux/list.h> | 31 | #include <linux/list.h> |
32 | 32 | ||
33 | #include <asm/cacheflush.h> | ||
34 | |||
33 | #undef DEBUG | 35 | #undef DEBUG |
34 | 36 | ||
35 | #undef STATS | 37 | #undef STATS |
@@ -91,15 +93,12 @@ static void print_alloc_stats(struct dmabounce_device_info *device_info) | |||
91 | static inline struct dmabounce_device_info * | 93 | static inline struct dmabounce_device_info * |
92 | find_dmabounce_dev(struct device *dev) | 94 | find_dmabounce_dev(struct device *dev) |
93 | { | 95 | { |
94 | struct list_head *entry; | 96 | struct dmabounce_device_info *d; |
95 | |||
96 | list_for_each(entry, &dmabounce_devs) { | ||
97 | struct dmabounce_device_info *d = | ||
98 | list_entry(entry, struct dmabounce_device_info, node); | ||
99 | 97 | ||
98 | list_for_each_entry(d, &dmabounce_devs, node) | ||
100 | if (d->dev == dev) | 99 | if (d->dev == dev) |
101 | return d; | 100 | return d; |
102 | } | 101 | |
103 | return NULL; | 102 | return NULL; |
104 | } | 103 | } |
105 | 104 | ||
@@ -170,15 +169,11 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr, | |||
170 | static inline struct safe_buffer * | 169 | static inline struct safe_buffer * |
171 | find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr) | 170 | find_safe_buffer(struct dmabounce_device_info *device_info, dma_addr_t safe_dma_addr) |
172 | { | 171 | { |
173 | struct list_head *entry; | 172 | struct safe_buffer *b; |
174 | |||
175 | list_for_each(entry, &device_info->safe_buffers) { | ||
176 | struct safe_buffer *b = | ||
177 | list_entry(entry, struct safe_buffer, node); | ||
178 | 173 | ||
174 | list_for_each_entry(b, &device_info->safe_buffers, node) | ||
179 | if (b->safe_dma_addr == safe_dma_addr) | 175 | if (b->safe_dma_addr == safe_dma_addr) |
180 | return b; | 176 | return b; |
181 | } | ||
182 | 177 | ||
183 | return NULL; | 178 | return NULL; |
184 | } | 179 | } |
@@ -299,15 +294,26 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
299 | __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), | 294 | __func__, buf->ptr, (void *) virt_to_dma(dev, buf->ptr), |
300 | buf->safe, (void *) buf->safe_dma_addr); | 295 | buf->safe, (void *) buf->safe_dma_addr); |
301 | 296 | ||
302 | |||
303 | DO_STATS ( device_info->bounce_count++ ); | 297 | DO_STATS ( device_info->bounce_count++ ); |
304 | 298 | ||
305 | if ((dir == DMA_FROM_DEVICE) || | 299 | if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { |
306 | (dir == DMA_BIDIRECTIONAL)) { | 300 | unsigned long ptr; |
301 | |||
307 | dev_dbg(dev, | 302 | dev_dbg(dev, |
308 | "%s: copy back safe %p to unsafe %p size %d\n", | 303 | "%s: copy back safe %p to unsafe %p size %d\n", |
309 | __func__, buf->safe, buf->ptr, size); | 304 | __func__, buf->safe, buf->ptr, size); |
310 | memcpy(buf->ptr, buf->safe, size); | 305 | memcpy(buf->ptr, buf->safe, size); |
306 | |||
307 | /* | ||
308 | * DMA buffers must have the same cache properties | ||
309 | * as if they were really used for DMA - which means | ||
310 | * data must be written back to RAM. Note that | ||
311 | * we don't use dmac_flush_range() here for the | ||
312 | * bidirectional case because we know the cache | ||
313 | * lines will be coherent with the data written. | ||
314 | */ | ||
315 | ptr = (unsigned long)buf->ptr; | ||
316 | dmac_clean_range(ptr, ptr + size); | ||
311 | } | 317 | } |
312 | free_safe_buffer(device_info, buf); | 318 | free_safe_buffer(device_info, buf); |
313 | } | 319 | } |
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index 21fce3414ed1..38c2eb667eb9 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c | |||
@@ -721,16 +721,17 @@ __sa1111_probe(struct device *me, struct resource *mem, int irq) | |||
721 | return ret; | 721 | return ret; |
722 | } | 722 | } |
723 | 723 | ||
724 | static int sa1111_remove_one(struct device *dev, void *data) | ||
725 | { | ||
726 | device_unregister(dev); | ||
727 | return 0; | ||
728 | } | ||
729 | |||
724 | static void __sa1111_remove(struct sa1111 *sachip) | 730 | static void __sa1111_remove(struct sa1111 *sachip) |
725 | { | 731 | { |
726 | struct list_head *l, *n; | ||
727 | void __iomem *irqbase = sachip->base + SA1111_INTC; | 732 | void __iomem *irqbase = sachip->base + SA1111_INTC; |
728 | 733 | ||
729 | list_for_each_safe(l, n, &sachip->dev->children) { | 734 | device_for_each_child(sachip->dev, NULL, sa1111_remove_one); |
730 | struct device *d = list_to_dev(l); | ||
731 | |||
732 | device_unregister(d); | ||
733 | } | ||
734 | 735 | ||
735 | /* disable all IRQs */ | 736 | /* disable all IRQs */ |
736 | sa1111_writel(0, irqbase + SA1111_INTEN0); | 737 | sa1111_writel(0, irqbase + SA1111_INTEN0); |
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c index c2c557a224c2..c94864c5b1af 100644 --- a/arch/arm/common/sharpsl_param.c +++ b/arch/arm/common/sharpsl_param.c | |||
@@ -22,7 +22,7 @@ | |||
22 | * them early in the boot process, then pass them to the appropriate drivers. | 22 | * them early in the boot process, then pass them to the appropriate drivers. |
23 | * Not all devices use all paramaters but the format is common to all. | 23 | * Not all devices use all paramaters but the format is common to all. |
24 | */ | 24 | */ |
25 | #ifdef ARCH_SA1100 | 25 | #ifdef CONFIG_ARCH_SA1100 |
26 | #define PARAM_BASE 0xe8ffc000 | 26 | #define PARAM_BASE 0xe8ffc000 |
27 | #else | 27 | #else |
28 | #define PARAM_BASE 0xa0000a00 | 28 | #define PARAM_BASE 0xa0000a00 |