diff options
author | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-07-04 03:32:21 -0400 |
---|---|---|
committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2011-07-04 03:39:55 -0400 |
commit | 0703ed2a6b260cd743adf49a8281eb064d728832 (patch) | |
tree | 95740f9e1beb8901f163c7168b3e2666eb2158c9 /arch/arm/common/it8152.c | |
parent | c289b2e0ccff1142908e20398930dc2e14697e74 (diff) |
ARM: dmabounce: get rid of dma_needs_bounce global function
Pass the device type specific needs_bounce function in at dmabounce
register time, avoiding the need for a platform specific global
function to do this.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk>
Diffstat (limited to 'arch/arm/common/it8152.c')
-rw-r--r-- | arch/arm/common/it8152.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c index 7a21927c52e1..80b49e1e0992 100644 --- a/arch/arm/common/it8152.c +++ b/arch/arm/common/it8152.c | |||
@@ -243,6 +243,13 @@ static struct resource it8152_mem = { | |||
243 | * ITE8152 chip can address up to 64MByte, so all the devices | 243 | * ITE8152 chip can address up to 64MByte, so all the devices |
244 | * connected to ITE8152 (PCI and USB) should have limited DMA window | 244 | * connected to ITE8152 (PCI and USB) should have limited DMA window |
245 | */ | 245 | */ |
246 | static int it8152_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size) | ||
247 | { | ||
248 | dev_dbg(dev, "%s: dma_addr %08x, size %08x\n", | ||
249 | __func__, dma_addr, size); | ||
250 | return dev->bus == &pci_bus_type && | ||
251 | (dma_addr + size - PHYS_OFFSET) >= SZ_64M; | ||
252 | } | ||
246 | 253 | ||
247 | /* | 254 | /* |
248 | * Setup DMA mask to 64MB on devices connected to ITE8152. Ignore all | 255 | * Setup DMA mask to 64MB on devices connected to ITE8152. Ignore all |
@@ -254,7 +261,7 @@ static int it8152_pci_platform_notify(struct device *dev) | |||
254 | if (dev->dma_mask) | 261 | if (dev->dma_mask) |
255 | *dev->dma_mask = (SZ_64M - 1) | PHYS_OFFSET; | 262 | *dev->dma_mask = (SZ_64M - 1) | PHYS_OFFSET; |
256 | dev->coherent_dma_mask = (SZ_64M - 1) | PHYS_OFFSET; | 263 | dev->coherent_dma_mask = (SZ_64M - 1) | PHYS_OFFSET; |
257 | dmabounce_register_dev(dev, 2048, 4096); | 264 | dmabounce_register_dev(dev, 2048, 4096, it8152_needs_bounce); |
258 | } | 265 | } |
259 | return 0; | 266 | return 0; |
260 | } | 267 | } |
@@ -267,14 +274,6 @@ static int it8152_pci_platform_notify_remove(struct device *dev) | |||
267 | return 0; | 274 | return 0; |
268 | } | 275 | } |
269 | 276 | ||
270 | int dma_needs_bounce(struct device *dev, dma_addr_t dma_addr, size_t size) | ||
271 | { | ||
272 | dev_dbg(dev, "%s: dma_addr %08x, size %08x\n", | ||
273 | __func__, dma_addr, size); | ||
274 | return (dev->bus == &pci_bus_type) && | ||
275 | ((dma_addr + size - PHYS_OFFSET) >= SZ_64M); | ||
276 | } | ||
277 | |||
278 | int dma_set_coherent_mask(struct device *dev, u64 mask) | 277 | int dma_set_coherent_mask(struct device *dev, u64 mask) |
279 | { | 278 | { |
280 | if (mask >= PHYS_OFFSET + SZ_64M - 1) | 279 | if (mask >= PHYS_OFFSET + SZ_64M - 1) |