diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-11 13:09:45 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-10-11 13:09:45 -0400 |
| commit | 7cc4e87f912bbefa440a51856b8d076e5d1f554a (patch) | |
| tree | 1b8df8683f3de37d2e8211ffa8d151f60d59af62 /arch/arm/common | |
| parent | 5ba2f67afb02c5302b2898949ed6fc3b3d37dcf1 (diff) | |
| parent | 69fc7eed5f56bce15b239e5110de2575a6970df4 (diff) | |
Merge branch 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm
* 'for-linus' of master.kernel.org:/home/rmk/linux-2.6-arm: (236 commits)
[ARM] 5300/1: fixup spitz reset during boot
[ARM] 5295/1: make ZONE_DMA optional
[ARM] 5239/1: Palm Zire 72 power management support
[ARM] 5298/1: Drop desc_handle_irq()
[ARM] 5297/1: [KS8695] Fix two compile-time warnings
[ARM] 5296/1: [KS8695] Replace macro's with trailing underscores.
[ARM] pxa: allow multi-machine PCMCIA builds
[ARM] pxa: add preliminary CPUFREQ support for PXA3xx
[ARM] pxa: add missing ACCR bit definitions to pxa3xx-regs.h
[ARM] pxa: rename cpu-pxa.c to cpufreq-pxa2xx.c
[ARM] pxa/zylonite: add support for USB OHCI
[ARM] ohci-pxa27x: use ioremap() and offset for register access
[ARM] ohci-pxa27x: introduce pxa27x_clear_otgph()
[ARM] ohci-pxa27x: use platform_get_{irq,resource} for the resource
[ARM] ohci-pxa27x: move OHCI controller specific registers into the driver
[ARM] ohci-pxa27x: introduce flags to avoid direct access to OHCI registers
[ARM] pxa: move I2S register and bit definitions into pxa2xx-i2s.c
[ARM] pxa: simplify DMA register definitions
[ARM] pxa: make additional DCSR bits valid for PXA3xx
[ARM] pxa: move i2c register and bit definitions into i2c-pxa.c
...
Fixed up conflicts in
arch/arm/mach-versatile/core.c
sound/soc/pxa/pxa2xx-ac97.c
sound/soc/pxa/pxa2xx-i2s.c
manually.
Diffstat (limited to 'arch/arm/common')
| -rw-r--r-- | arch/arm/common/Kconfig | 3 | ||||
| -rw-r--r-- | arch/arm/common/dmabounce.c | 287 | ||||
| -rw-r--r-- | arch/arm/common/gic.c | 2 | ||||
| -rw-r--r-- | arch/arm/common/it8152.c | 14 | ||||
| -rw-r--r-- | arch/arm/common/locomo.c | 28 | ||||
| -rw-r--r-- | arch/arm/common/sa1111.c | 2 | ||||
| -rw-r--r-- | arch/arm/common/scoop.c | 2 | ||||
| -rw-r--r-- | arch/arm/common/sharpsl_param.c | 2 | ||||
| -rw-r--r-- | arch/arm/common/time-acorn.c | 2 | ||||
| -rw-r--r-- | arch/arm/common/uengine.c | 2 | ||||
| -rw-r--r-- | arch/arm/common/via82c505.c | 2 | ||||
| -rw-r--r-- | arch/arm/common/vic.c | 2 |
12 files changed, 107 insertions, 241 deletions
diff --git a/arch/arm/common/Kconfig b/arch/arm/common/Kconfig index 3e073467cac..2e32acca02f 100644 --- a/arch/arm/common/Kconfig +++ b/arch/arm/common/Kconfig | |||
| @@ -12,7 +12,8 @@ config ICST307 | |||
| 12 | 12 | ||
| 13 | config SA1111 | 13 | config SA1111 |
| 14 | bool | 14 | bool |
| 15 | select DMABOUNCE | 15 | select DMABOUNCE if !ARCH_PXA |
| 16 | select ZONE_DMA if !ARCH_PXA | ||
| 16 | 17 | ||
| 17 | config DMABOUNCE | 18 | config DMABOUNCE |
| 18 | bool | 19 | bool |
diff --git a/arch/arm/common/dmabounce.c b/arch/arm/common/dmabounce.c index aecc6c3f908..f030f0775be 100644 --- a/arch/arm/common/dmabounce.c +++ b/arch/arm/common/dmabounce.c | |||
| @@ -154,9 +154,7 @@ alloc_safe_buffer(struct dmabounce_device_info *device_info, void *ptr, | |||
| 154 | #endif | 154 | #endif |
| 155 | 155 | ||
| 156 | write_lock_irqsave(&device_info->lock, flags); | 156 | write_lock_irqsave(&device_info->lock, flags); |
| 157 | |||
| 158 | list_add(&buf->node, &device_info->safe_buffers); | 157 | list_add(&buf->node, &device_info->safe_buffers); |
| 159 | |||
| 160 | write_unlock_irqrestore(&device_info->lock, flags); | 158 | write_unlock_irqrestore(&device_info->lock, flags); |
| 161 | 159 | ||
| 162 | return buf; | 160 | return buf; |
| @@ -205,8 +203,22 @@ free_safe_buffer(struct dmabounce_device_info *device_info, struct safe_buffer * | |||
| 205 | 203 | ||
| 206 | /* ************************************************** */ | 204 | /* ************************************************** */ |
| 207 | 205 | ||
| 208 | static inline dma_addr_t | 206 | static struct safe_buffer *find_safe_buffer_dev(struct device *dev, |
| 209 | map_single(struct device *dev, void *ptr, size_t size, | 207 | dma_addr_t dma_addr, const char *where) |
| 208 | { | ||
| 209 | if (!dev || !dev->archdata.dmabounce) | ||
| 210 | return NULL; | ||
| 211 | if (dma_mapping_error(dev, dma_addr)) { | ||
| 212 | if (dev) | ||
| 213 | dev_err(dev, "Trying to %s invalid mapping\n", where); | ||
| 214 | else | ||
| 215 | pr_err("unknown device: Trying to %s invalid mapping\n", where); | ||
| 216 | return NULL; | ||
| 217 | } | ||
| 218 | return find_safe_buffer(dev->archdata.dmabounce, dma_addr); | ||
| 219 | } | ||
| 220 | |||
| 221 | static inline dma_addr_t map_single(struct device *dev, void *ptr, size_t size, | ||
| 210 | enum dma_data_direction dir) | 222 | enum dma_data_direction dir) |
| 211 | { | 223 | { |
| 212 | struct dmabounce_device_info *device_info = dev->archdata.dmabounce; | 224 | struct dmabounce_device_info *device_info = dev->archdata.dmabounce; |
| @@ -270,33 +282,21 @@ map_single(struct device *dev, void *ptr, size_t size, | |||
| 270 | return dma_addr; | 282 | return dma_addr; |
| 271 | } | 283 | } |
| 272 | 284 | ||
| 273 | static inline void | 285 | static inline void unmap_single(struct device *dev, dma_addr_t dma_addr, |
| 274 | unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | 286 | size_t size, enum dma_data_direction dir) |
| 275 | enum dma_data_direction dir) | ||
| 276 | { | 287 | { |
| 277 | struct dmabounce_device_info *device_info = dev->archdata.dmabounce; | 288 | struct safe_buffer *buf = find_safe_buffer_dev(dev, dma_addr, "unmap"); |
| 278 | struct safe_buffer *buf = NULL; | ||
| 279 | |||
| 280 | /* | ||
| 281 | * Trying to unmap an invalid mapping | ||
| 282 | */ | ||
| 283 | if (dma_mapping_error(dev, dma_addr)) { | ||
| 284 | dev_err(dev, "Trying to unmap invalid mapping\n"); | ||
| 285 | return; | ||
| 286 | } | ||
| 287 | |||
| 288 | if (device_info) | ||
| 289 | buf = find_safe_buffer(device_info, dma_addr); | ||
| 290 | 289 | ||
| 291 | if (buf) { | 290 | if (buf) { |
| 292 | BUG_ON(buf->size != size); | 291 | BUG_ON(buf->size != size); |
| 292 | BUG_ON(buf->direction != dir); | ||
| 293 | 293 | ||
| 294 | dev_dbg(dev, | 294 | dev_dbg(dev, |
| 295 | "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", | 295 | "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", |
| 296 | __func__, buf->ptr, virt_to_dma(dev, buf->ptr), | 296 | __func__, buf->ptr, virt_to_dma(dev, buf->ptr), |
| 297 | buf->safe, buf->safe_dma_addr); | 297 | buf->safe, buf->safe_dma_addr); |
| 298 | 298 | ||
| 299 | DO_STATS ( device_info->bounce_count++ ); | 299 | DO_STATS(dev->archdata.dmabounce->bounce_count++); |
| 300 | 300 | ||
| 301 | if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { | 301 | if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { |
| 302 | void *ptr = buf->ptr; | 302 | void *ptr = buf->ptr; |
| @@ -317,74 +317,7 @@ unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
| 317 | dmac_clean_range(ptr, ptr + size); | 317 | dmac_clean_range(ptr, ptr + size); |
| 318 | outer_clean_range(__pa(ptr), __pa(ptr) + size); | 318 | outer_clean_range(__pa(ptr), __pa(ptr) + size); |
| 319 | } | 319 | } |
| 320 | free_safe_buffer(device_info, buf); | 320 | free_safe_buffer(dev->archdata.dmabounce, buf); |
| 321 | } | ||
| 322 | } | ||
| 323 | |||
| 324 | static int sync_single(struct device *dev, dma_addr_t dma_addr, size_t size, | ||
| 325 | enum dma_data_direction dir) | ||
| 326 | { | ||
| 327 | struct dmabounce_device_info *device_info = dev->archdata.dmabounce; | ||
| 328 | struct safe_buffer *buf = NULL; | ||
| 329 | |||
| 330 | if (device_info) | ||
| 331 | buf = find_safe_buffer(device_info, dma_addr); | ||
| 332 | |||
| 333 | if (buf) { | ||
| 334 | /* | ||
| 335 | * Both of these checks from original code need to be | ||
| 336 | * commented out b/c some drivers rely on the following: | ||
| 337 | * | ||
| 338 | * 1) Drivers may map a large chunk of memory into DMA space | ||
| 339 | * but only sync a small portion of it. Good example is | ||
| 340 | * allocating a large buffer, mapping it, and then | ||
| 341 | * breaking it up into small descriptors. No point | ||
| 342 | * in syncing the whole buffer if you only have to | ||
| 343 | * touch one descriptor. | ||
| 344 | * | ||
| 345 | * 2) Buffers that are mapped as DMA_BIDIRECTIONAL are | ||
| 346 | * usually only synced in one dir at a time. | ||
| 347 | * | ||
| 348 | * See drivers/net/eepro100.c for examples of both cases. | ||
| 349 | * | ||
| 350 | * -ds | ||
| 351 | * | ||
| 352 | * BUG_ON(buf->size != size); | ||
| 353 | * BUG_ON(buf->direction != dir); | ||
| 354 | */ | ||
| 355 | |||
| 356 | dev_dbg(dev, | ||
| 357 | "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", | ||
| 358 | __func__, buf->ptr, virt_to_dma(dev, buf->ptr), | ||
| 359 | buf->safe, buf->safe_dma_addr); | ||
| 360 | |||
| 361 | DO_STATS ( device_info->bounce_count++ ); | ||
| 362 | |||
| 363 | switch (dir) { | ||
| 364 | case DMA_FROM_DEVICE: | ||
| 365 | dev_dbg(dev, | ||
| 366 | "%s: copy back safe %p to unsafe %p size %d\n", | ||
| 367 | __func__, buf->safe, buf->ptr, size); | ||
| 368 | memcpy(buf->ptr, buf->safe, size); | ||
| 369 | break; | ||
| 370 | case DMA_TO_DEVICE: | ||
| 371 | dev_dbg(dev, | ||
| 372 | "%s: copy out unsafe %p to safe %p, size %d\n", | ||
| 373 | __func__,buf->ptr, buf->safe, size); | ||
| 374 | memcpy(buf->safe, buf->ptr, size); | ||
| 375 | break; | ||
| 376 | case DMA_BIDIRECTIONAL: | ||
| 377 | BUG(); /* is this allowed? what does it mean? */ | ||
| 378 | default: | ||
| 379 | BUG(); | ||
| 380 | } | ||
| 381 | /* | ||
| 382 | * No need to sync the safe buffer - it was allocated | ||
| 383 | * via the coherent allocators. | ||
| 384 | */ | ||
| 385 | return 0; | ||
| 386 | } else { | ||
| 387 | return 1; | ||
| 388 | } | 321 | } |
| 389 | } | 322 | } |
| 390 | 323 | ||
| @@ -396,21 +329,29 @@ static int sync_single(struct device *dev, dma_addr_t dma_addr, size_t size, | |||
| 396 | * substitute the safe buffer for the unsafe one. | 329 | * substitute the safe buffer for the unsafe one. |
| 397 | * (basically move the buffer from an unsafe area to a safe one) | 330 | * (basically move the buffer from an unsafe area to a safe one) |
| 398 | */ | 331 | */ |
| 399 | dma_addr_t | 332 | dma_addr_t dma_map_single(struct device *dev, void *ptr, size_t size, |
| 400 | dma_map_single(struct device *dev, void *ptr, size_t size, | ||
| 401 | enum dma_data_direction dir) | 333 | enum dma_data_direction dir) |
| 402 | { | 334 | { |
| 403 | dma_addr_t dma_addr; | ||
| 404 | |||
| 405 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", | 335 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", |
| 406 | __func__, ptr, size, dir); | 336 | __func__, ptr, size, dir); |
| 407 | 337 | ||
| 408 | BUG_ON(dir == DMA_NONE); | 338 | BUG_ON(!valid_dma_direction(dir)); |
| 409 | 339 | ||
| 410 | dma_addr = map_single(dev, ptr, size, dir); | 340 | return map_single(dev, ptr, size, dir); |
| 341 | } | ||
| 342 | EXPORT_SYMBOL(dma_map_single); | ||
| 411 | 343 | ||
| 412 | return dma_addr; | 344 | dma_addr_t dma_map_page(struct device *dev, struct page *page, |
| 345 | unsigned long offset, size_t size, enum dma_data_direction dir) | ||
| 346 | { | ||
| 347 | dev_dbg(dev, "%s(page=%p,off=%#lx,size=%zx,dir=%x)\n", | ||
| 348 | __func__, page, offset, size, dir); | ||
| 349 | |||
| 350 | BUG_ON(!valid_dma_direction(dir)); | ||
| 351 | |||
| 352 | return map_single(dev, page_address(page) + offset, size, dir); | ||
| 413 | } | 353 | } |
| 354 | EXPORT_SYMBOL(dma_map_page); | ||
| 414 | 355 | ||
| 415 | /* | 356 | /* |
| 416 | * see if a mapped address was really a "safe" buffer and if so, copy | 357 | * see if a mapped address was really a "safe" buffer and if so, copy |
| @@ -419,126 +360,76 @@ dma_map_single(struct device *dev, void *ptr, size_t size, | |||
| 419 | * should be) | 360 | * should be) |
| 420 | */ | 361 | */ |
| 421 | 362 | ||
| 422 | void | 363 | void dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, |
| 423 | dma_unmap_single(struct device *dev, dma_addr_t dma_addr, size_t size, | 364 | enum dma_data_direction dir) |
| 424 | enum dma_data_direction dir) | ||
| 425 | { | 365 | { |
| 426 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", | 366 | dev_dbg(dev, "%s(ptr=%p,size=%d,dir=%x)\n", |
| 427 | __func__, (void *) dma_addr, size, dir); | 367 | __func__, (void *) dma_addr, size, dir); |
| 428 | 368 | ||
| 429 | BUG_ON(dir == DMA_NONE); | ||
| 430 | |||
| 431 | unmap_single(dev, dma_addr, size, dir); | 369 | unmap_single(dev, dma_addr, size, dir); |
| 432 | } | 370 | } |
| 371 | EXPORT_SYMBOL(dma_unmap_single); | ||
| 433 | 372 | ||
| 434 | int | 373 | int dmabounce_sync_for_cpu(struct device *dev, dma_addr_t addr, |
| 435 | dma_map_sg(struct device *dev, struct scatterlist *sg, int nents, | 374 | unsigned long off, size_t sz, enum dma_data_direction dir) |
| 436 | enum dma_data_direction dir) | ||
| 437 | { | 375 | { |
| 438 | int i; | 376 | struct safe_buffer *buf; |
| 439 | |||
| 440 | dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n", | ||
| 441 | __func__, sg, nents, dir); | ||
| 442 | |||
| 443 | BUG_ON(dir == DMA_NONE); | ||
| 444 | |||
| 445 | for (i = 0; i < nents; i++, sg++) { | ||
| 446 | struct page *page = sg_page(sg); | ||
| 447 | unsigned int offset = sg->offset; | ||
| 448 | unsigned int length = sg->length; | ||
| 449 | void *ptr = page_address(page) + offset; | ||
| 450 | 377 | ||
| 451 | sg->dma_address = | 378 | dev_dbg(dev, "%s(dma=%#x,off=%#lx,sz=%zx,dir=%x)\n", |
| 452 | map_single(dev, ptr, length, dir); | 379 | __func__, addr, off, sz, dir); |
| 453 | } | ||
| 454 | 380 | ||
| 455 | return nents; | 381 | buf = find_safe_buffer_dev(dev, addr, __func__); |
| 456 | } | 382 | if (!buf) |
| 457 | 383 | return 1; | |
| 458 | void | ||
| 459 | dma_unmap_sg(struct device *dev, struct scatterlist *sg, int nents, | ||
| 460 | enum dma_data_direction dir) | ||
| 461 | { | ||
| 462 | int i; | ||
| 463 | 384 | ||
| 464 | dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n", | 385 | BUG_ON(buf->direction != dir); |
| 465 | __func__, sg, nents, dir); | ||
| 466 | 386 | ||
| 467 | BUG_ON(dir == DMA_NONE); | 387 | dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", |
| 388 | __func__, buf->ptr, virt_to_dma(dev, buf->ptr), | ||
| 389 | buf->safe, buf->safe_dma_addr); | ||
| 468 | 390 | ||
| 469 | for (i = 0; i < nents; i++, sg++) { | 391 | DO_STATS(dev->archdata.dmabounce->bounce_count++); |
| 470 | dma_addr_t dma_addr = sg->dma_address; | ||
| 471 | unsigned int length = sg->length; | ||
| 472 | 392 | ||
| 473 | unmap_single(dev, dma_addr, length, dir); | 393 | if (dir == DMA_FROM_DEVICE || dir == DMA_BIDIRECTIONAL) { |
| 394 | dev_dbg(dev, "%s: copy back safe %p to unsafe %p size %d\n", | ||
| 395 | __func__, buf->safe + off, buf->ptr + off, sz); | ||
| 396 | memcpy(buf->ptr + off, buf->safe + off, sz); | ||
| 474 | } | 397 | } |
| 398 | return 0; | ||
| 475 | } | 399 | } |
| 400 | EXPORT_SYMBOL(dmabounce_sync_for_cpu); | ||
| 476 | 401 | ||
| 477 | void dma_sync_single_range_for_cpu(struct device *dev, dma_addr_t dma_addr, | 402 | int dmabounce_sync_for_device(struct device *dev, dma_addr_t addr, |
| 478 | unsigned long offset, size_t size, | 403 | unsigned long off, size_t sz, enum dma_data_direction dir) |
| 479 | enum dma_data_direction dir) | ||
| 480 | { | ||
| 481 | dev_dbg(dev, "%s(dma=%#x,off=%#lx,size=%zx,dir=%x)\n", | ||
| 482 | __func__, dma_addr, offset, size, dir); | ||
| 483 | |||
| 484 | if (sync_single(dev, dma_addr, offset + size, dir)) | ||
| 485 | dma_cache_maint(dma_to_virt(dev, dma_addr) + offset, size, dir); | ||
| 486 | } | ||
| 487 | EXPORT_SYMBOL(dma_sync_single_range_for_cpu); | ||
| 488 | |||
| 489 | void dma_sync_single_range_for_device(struct device *dev, dma_addr_t dma_addr, | ||
| 490 | unsigned long offset, size_t size, | ||
| 491 | enum dma_data_direction dir) | ||
| 492 | { | ||
| 493 | dev_dbg(dev, "%s(dma=%#x,off=%#lx,size=%zx,dir=%x)\n", | ||
| 494 | __func__, dma_addr, offset, size, dir); | ||
| 495 | |||
| 496 | if (sync_single(dev, dma_addr, offset + size, dir)) | ||
| 497 | dma_cache_maint(dma_to_virt(dev, dma_addr) + offset, size, dir); | ||
| 498 | } | ||
| 499 | EXPORT_SYMBOL(dma_sync_single_range_for_device); | ||
| 500 | |||
| 501 | void | ||
| 502 | dma_sync_sg_for_cpu(struct device *dev, struct scatterlist *sg, int nents, | ||
| 503 | enum dma_data_direction dir) | ||
| 504 | { | 404 | { |
| 505 | int i; | 405 | struct safe_buffer *buf; |
| 506 | |||
| 507 | dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n", | ||
| 508 | __func__, sg, nents, dir); | ||
| 509 | |||
| 510 | BUG_ON(dir == DMA_NONE); | ||
| 511 | 406 | ||
| 512 | for (i = 0; i < nents; i++, sg++) { | 407 | dev_dbg(dev, "%s(dma=%#x,off=%#lx,sz=%zx,dir=%x)\n", |
| 513 | dma_addr_t dma_addr = sg->dma_address; | 408 | __func__, addr, off, sz, dir); |
| 514 | unsigned int length = sg->length; | ||
| 515 | 409 | ||
| 516 | sync_single(dev, dma_addr, length, dir); | 410 | buf = find_safe_buffer_dev(dev, addr, __func__); |
| 517 | } | 411 | if (!buf) |
| 518 | } | 412 | return 1; |
| 519 | |||
| 520 | void | ||
| 521 | dma_sync_sg_for_device(struct device *dev, struct scatterlist *sg, int nents, | ||
| 522 | enum dma_data_direction dir) | ||
| 523 | { | ||
| 524 | int i; | ||
| 525 | 413 | ||
| 526 | dev_dbg(dev, "%s(sg=%p,nents=%d,dir=%x)\n", | 414 | BUG_ON(buf->direction != dir); |
| 527 | __func__, sg, nents, dir); | ||
| 528 | 415 | ||
| 529 | BUG_ON(dir == DMA_NONE); | 416 | dev_dbg(dev, "%s: unsafe buffer %p (dma=%#x) mapped to %p (dma=%#x)\n", |
| 417 | __func__, buf->ptr, virt_to_dma(dev, buf->ptr), | ||
| 418 | buf->safe, buf->safe_dma_addr); | ||
| 530 | 419 | ||
| 531 | for (i = 0; i < nents; i++, sg++) { | 420 | DO_STATS(dev->archdata.dmabounce->bounce_count++); |
| 532 | dma_addr_t dma_addr = sg->dma_address; | ||
| 533 | unsigned int length = sg->length; | ||
| 534 | 421 | ||
| 535 | sync_single(dev, dma_addr, length, dir); | 422 | if (dir == DMA_TO_DEVICE || dir == DMA_BIDIRECTIONAL) { |
| 423 | dev_dbg(dev, "%s: copy out unsafe %p to safe %p, size %d\n", | ||
| 424 | __func__,buf->ptr + off, buf->safe + off, sz); | ||
| 425 | memcpy(buf->safe + off, buf->ptr + off, sz); | ||
| 536 | } | 426 | } |
| 427 | return 0; | ||
| 537 | } | 428 | } |
| 429 | EXPORT_SYMBOL(dmabounce_sync_for_device); | ||
| 538 | 430 | ||
| 539 | static int | 431 | static int dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, |
| 540 | dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, const char *name, | 432 | const char *name, unsigned long size) |
| 541 | unsigned long size) | ||
| 542 | { | 433 | { |
| 543 | pool->size = size; | 434 | pool->size = size; |
| 544 | DO_STATS(pool->allocs = 0); | 435 | DO_STATS(pool->allocs = 0); |
| @@ -549,9 +440,8 @@ dmabounce_init_pool(struct dmabounce_pool *pool, struct device *dev, const char | |||
| 549 | return pool->pool ? 0 : -ENOMEM; | 440 | return pool->pool ? 0 : -ENOMEM; |
| 550 | } | 441 | } |
| 551 | 442 | ||
| 552 | int | 443 | int dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size, |
| 553 | dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size, | 444 | unsigned long large_buffer_size) |
| 554 | unsigned long large_buffer_size) | ||
| 555 | { | 445 | { |
| 556 | struct dmabounce_device_info *device_info; | 446 | struct dmabounce_device_info *device_info; |
| 557 | int ret; | 447 | int ret; |
| @@ -607,9 +497,9 @@ dmabounce_register_dev(struct device *dev, unsigned long small_buffer_size, | |||
| 607 | kfree(device_info); | 497 | kfree(device_info); |
| 608 | return ret; | 498 | return ret; |
| 609 | } | 499 | } |
| 500 | EXPORT_SYMBOL(dmabounce_register_dev); | ||
| 610 | 501 | ||
| 611 | void | 502 | void dmabounce_unregister_dev(struct device *dev) |
| 612 | dmabounce_unregister_dev(struct device *dev) | ||
| 613 | { | 503 | { |
| 614 | struct dmabounce_device_info *device_info = dev->archdata.dmabounce; | 504 | struct dmabounce_device_info *device_info = dev->archdata.dmabounce; |
| 615 | 505 | ||
| @@ -642,15 +532,6 @@ dmabounce_unregister_dev(struct device *dev) | |||
| 642 | 532 | ||
| 643 | dev_info(dev, "dmabounce: device unregistered\n"); | 533 | dev_info(dev, "dmabounce: device unregistered\n"); |
| 644 | } | 534 | } |
| 645 | |||
| 646 | |||
| 647 | EXPORT_SYMBOL(dma_map_single); | ||
| 648 | EXPORT_SYMBOL(dma_unmap_single); | ||
| 649 | EXPORT_SYMBOL(dma_map_sg); | ||
| 650 | EXPORT_SYMBOL(dma_unmap_sg); | ||
| 651 | EXPORT_SYMBOL(dma_sync_sg_for_cpu); | ||
| 652 | EXPORT_SYMBOL(dma_sync_sg_for_device); | ||
| 653 | EXPORT_SYMBOL(dmabounce_register_dev); | ||
| 654 | EXPORT_SYMBOL(dmabounce_unregister_dev); | 535 | EXPORT_SYMBOL(dmabounce_unregister_dev); |
| 655 | 536 | ||
| 656 | MODULE_AUTHOR("Christopher Hoover <ch@hpl.hp.com>, Deepak Saxena <dsaxena@plexity.net>"); | 537 | MODULE_AUTHOR("Christopher Hoover <ch@hpl.hp.com>, Deepak Saxena <dsaxena@plexity.net>"); |
diff --git a/arch/arm/common/gic.c b/arch/arm/common/gic.c index 0c89bd35e06..7fc9860a97d 100644 --- a/arch/arm/common/gic.c +++ b/arch/arm/common/gic.c | |||
| @@ -27,9 +27,9 @@ | |||
| 27 | #include <linux/list.h> | 27 | #include <linux/list.h> |
| 28 | #include <linux/smp.h> | 28 | #include <linux/smp.h> |
| 29 | #include <linux/cpumask.h> | 29 | #include <linux/cpumask.h> |
| 30 | #include <linux/io.h> | ||
| 30 | 31 | ||
| 31 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
| 32 | #include <asm/io.h> | ||
| 33 | #include <asm/mach/irq.h> | 33 | #include <asm/mach/irq.h> |
| 34 | #include <asm/hardware/gic.h> | 34 | #include <asm/hardware/gic.h> |
| 35 | 35 | ||
diff --git a/arch/arm/common/it8152.c b/arch/arm/common/it8152.c index 5fe9588db07..2793447621c 100644 --- a/arch/arm/common/it8152.c +++ b/arch/arm/common/it8152.c | |||
| @@ -66,14 +66,6 @@ static void it8152_unmask_irq(unsigned int irq) | |||
| 66 | } | 66 | } |
| 67 | } | 67 | } |
| 68 | 68 | ||
| 69 | static inline void it8152_irq(int irq) | ||
| 70 | { | ||
| 71 | struct irq_desc *desc; | ||
| 72 | |||
| 73 | desc = irq_desc + irq; | ||
| 74 | desc_handle_irq(irq, desc); | ||
| 75 | } | ||
| 76 | |||
| 77 | static struct irq_chip it8152_irq_chip = { | 69 | static struct irq_chip it8152_irq_chip = { |
| 78 | .name = "it8152", | 70 | .name = "it8152", |
| 79 | .ack = it8152_mask_irq, | 71 | .ack = it8152_mask_irq, |
| @@ -128,21 +120,21 @@ void it8152_irq_demux(unsigned int irq, struct irq_desc *desc) | |||
| 128 | bits_pd &= ((1 << IT8152_PD_IRQ_COUNT) - 1); | 120 | bits_pd &= ((1 << IT8152_PD_IRQ_COUNT) - 1); |
| 129 | while (bits_pd) { | 121 | while (bits_pd) { |
| 130 | i = __ffs(bits_pd); | 122 | i = __ffs(bits_pd); |
| 131 | it8152_irq(IT8152_PD_IRQ(i)); | 123 | generic_handle_irq(IT8152_PD_IRQ(i)); |
| 132 | bits_pd &= ~(1 << i); | 124 | bits_pd &= ~(1 << i); |
| 133 | } | 125 | } |
| 134 | 126 | ||
| 135 | bits_lp &= ((1 << IT8152_LP_IRQ_COUNT) - 1); | 127 | bits_lp &= ((1 << IT8152_LP_IRQ_COUNT) - 1); |
| 136 | while (bits_lp) { | 128 | while (bits_lp) { |
| 137 | i = __ffs(bits_lp); | 129 | i = __ffs(bits_lp); |
| 138 | it8152_irq(IT8152_LP_IRQ(i)); | 130 | generic_handle_irq(IT8152_LP_IRQ(i)); |
| 139 | bits_lp &= ~(1 << i); | 131 | bits_lp &= ~(1 << i); |
| 140 | } | 132 | } |
| 141 | 133 | ||
| 142 | bits_ld &= ((1 << IT8152_LD_IRQ_COUNT) - 1); | 134 | bits_ld &= ((1 << IT8152_LD_IRQ_COUNT) - 1); |
| 143 | while (bits_ld) { | 135 | while (bits_ld) { |
| 144 | i = __ffs(bits_ld); | 136 | i = __ffs(bits_ld); |
| 145 | it8152_irq(IT8152_LD_IRQ(i)); | 137 | generic_handle_irq(IT8152_LD_IRQ(i)); |
| 146 | bits_ld &= ~(1 << i); | 138 | bits_ld &= ~(1 << i); |
| 147 | } | 139 | } |
| 148 | } | 140 | } |
diff --git a/arch/arm/common/locomo.c b/arch/arm/common/locomo.c index 283051eaf93..7c6b4b99a2d 100644 --- a/arch/arm/common/locomo.c +++ b/arch/arm/common/locomo.c | |||
| @@ -24,9 +24,9 @@ | |||
| 24 | #include <linux/platform_device.h> | 24 | #include <linux/platform_device.h> |
| 25 | #include <linux/slab.h> | 25 | #include <linux/slab.h> |
| 26 | #include <linux/spinlock.h> | 26 | #include <linux/spinlock.h> |
| 27 | #include <linux/io.h> | ||
| 27 | 28 | ||
| 28 | #include <mach/hardware.h> | 29 | #include <mach/hardware.h> |
| 29 | #include <asm/io.h> | ||
| 30 | #include <asm/irq.h> | 30 | #include <asm/irq.h> |
| 31 | #include <asm/mach/irq.h> | 31 | #include <asm/mach/irq.h> |
| 32 | 32 | ||
| @@ -169,7 +169,6 @@ static struct locomo_dev_info locomo_devices[] = { | |||
| 169 | static void locomo_handler(unsigned int irq, struct irq_desc *desc) | 169 | static void locomo_handler(unsigned int irq, struct irq_desc *desc) |
| 170 | { | 170 | { |
| 171 | int req, i; | 171 | int req, i; |
| 172 | struct irq_desc *d; | ||
| 173 | void __iomem *mapbase = get_irq_chip_data(irq); | 172 | void __iomem *mapbase = get_irq_chip_data(irq); |
| 174 | 173 | ||
| 175 | /* Acknowledge the parent IRQ */ | 174 | /* Acknowledge the parent IRQ */ |
| @@ -181,10 +180,9 @@ static void locomo_handler(unsigned int irq, struct irq_desc *desc) | |||
| 181 | if (req) { | 180 | if (req) { |
| 182 | /* generate the next interrupt(s) */ | 181 | /* generate the next interrupt(s) */ |
| 183 | irq = LOCOMO_IRQ_START; | 182 | irq = LOCOMO_IRQ_START; |
| 184 | d = irq_desc + irq; | 183 | for (i = 0; i <= 3; i++, irq++) { |
| 185 | for (i = 0; i <= 3; i++, d++, irq++) { | ||
| 186 | if (req & (0x0100 << i)) { | 184 | if (req & (0x0100 << i)) { |
| 187 | desc_handle_irq(irq, d); | 185 | generic_handle_irq(irq); |
| 188 | } | 186 | } |
| 189 | 187 | ||
| 190 | } | 188 | } |
| @@ -222,12 +220,10 @@ static struct irq_chip locomo_chip = { | |||
| 222 | 220 | ||
| 223 | static void locomo_key_handler(unsigned int irq, struct irq_desc *desc) | 221 | static void locomo_key_handler(unsigned int irq, struct irq_desc *desc) |
| 224 | { | 222 | { |
| 225 | struct irq_desc *d; | ||
| 226 | void __iomem *mapbase = get_irq_chip_data(irq); | 223 | void __iomem *mapbase = get_irq_chip_data(irq); |
| 227 | 224 | ||
| 228 | if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) { | 225 | if (locomo_readl(mapbase + LOCOMO_KEYBOARD + LOCOMO_KIC) & 0x0001) { |
| 229 | d = irq_desc + LOCOMO_IRQ_KEY_START; | 226 | generic_handle_irq(LOCOMO_IRQ_KEY_START); |
| 230 | desc_handle_irq(LOCOMO_IRQ_KEY_START, d); | ||
| 231 | } | 227 | } |
| 232 | } | 228 | } |
| 233 | 229 | ||
| @@ -268,7 +264,6 @@ static struct irq_chip locomo_key_chip = { | |||
| 268 | static void locomo_gpio_handler(unsigned int irq, struct irq_desc *desc) | 264 | static void locomo_gpio_handler(unsigned int irq, struct irq_desc *desc) |
| 269 | { | 265 | { |
| 270 | int req, i; | 266 | int req, i; |
| 271 | struct irq_desc *d; | ||
| 272 | void __iomem *mapbase = get_irq_chip_data(irq); | 267 | void __iomem *mapbase = get_irq_chip_data(irq); |
| 273 | 268 | ||
| 274 | req = locomo_readl(mapbase + LOCOMO_GIR) & | 269 | req = locomo_readl(mapbase + LOCOMO_GIR) & |
| @@ -277,10 +272,9 @@ static void locomo_gpio_handler(unsigned int irq, struct irq_desc *desc) | |||
| 277 | 272 | ||
| 278 | if (req) { | 273 | if (req) { |
| 279 | irq = LOCOMO_IRQ_GPIO_START; | 274 | irq = LOCOMO_IRQ_GPIO_START; |
| 280 | d = irq_desc + LOCOMO_IRQ_GPIO_START; | 275 | for (i = 0; i <= 15; i++, irq++) { |
| 281 | for (i = 0; i <= 15; i++, irq++, d++) { | ||
| 282 | if (req & (0x0001 << i)) { | 276 | if (req & (0x0001 << i)) { |
| 283 | desc_handle_irq(irq, d); | 277 | generic_handle_irq(irq); |
| 284 | } | 278 | } |
| 285 | } | 279 | } |
| 286 | } | 280 | } |
| @@ -361,12 +355,10 @@ static struct irq_chip locomo_gpio_chip = { | |||
| 361 | 355 | ||
| 362 | static void locomo_lt_handler(unsigned int irq, struct irq_desc *desc) | 356 | static void locomo_lt_handler(unsigned int irq, struct irq_desc *desc) |
| 363 | { | 357 | { |
| 364 | struct irq_desc *d; | ||
| 365 | void __iomem *mapbase = get_irq_chip_data(irq); | 358 | void __iomem *mapbase = get_irq_chip_data(irq); |
| 366 | 359 | ||
| 367 | if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) { | 360 | if (locomo_readl(mapbase + LOCOMO_LTINT) & 0x0001) { |
| 368 | d = irq_desc + LOCOMO_IRQ_LT_START; | 361 | generic_handle_irq(LOCOMO_IRQ_LT_START); |
| 369 | desc_handle_irq(LOCOMO_IRQ_LT_START, d); | ||
| 370 | } | 362 | } |
| 371 | } | 363 | } |
| 372 | 364 | ||
| @@ -407,17 +399,15 @@ static struct irq_chip locomo_lt_chip = { | |||
| 407 | static void locomo_spi_handler(unsigned int irq, struct irq_desc *desc) | 399 | static void locomo_spi_handler(unsigned int irq, struct irq_desc *desc) |
| 408 | { | 400 | { |
| 409 | int req, i; | 401 | int req, i; |
| 410 | struct irq_desc *d; | ||
| 411 | void __iomem *mapbase = get_irq_chip_data(irq); | 402 | void __iomem *mapbase = get_irq_chip_data(irq); |
| 412 | 403 | ||
| 413 | req = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIR) & 0x000F; | 404 | req = locomo_readl(mapbase + LOCOMO_SPI + LOCOMO_SPIIR) & 0x000F; |
| 414 | if (req) { | 405 | if (req) { |
| 415 | irq = LOCOMO_IRQ_SPI_START; | 406 | irq = LOCOMO_IRQ_SPI_START; |
| 416 | d = irq_desc + irq; | ||
| 417 | 407 | ||
| 418 | for (i = 0; i <= 3; i++, irq++, d++) { | 408 | for (i = 0; i <= 3; i++, irq++) { |
| 419 | if (req & (0x0001 << i)) { | 409 | if (req & (0x0001 << i)) { |
| 420 | desc_handle_irq(irq, d); | 410 | generic_handle_irq(irq); |
| 421 | } | 411 | } |
| 422 | } | 412 | } |
| 423 | } | 413 | } |
diff --git a/arch/arm/common/sa1111.c b/arch/arm/common/sa1111.c index ec8a5471bf0..fb86f248aab 100644 --- a/arch/arm/common/sa1111.c +++ b/arch/arm/common/sa1111.c | |||
| @@ -25,10 +25,10 @@ | |||
| 25 | #include <linux/spinlock.h> | 25 | #include <linux/spinlock.h> |
| 26 | #include <linux/dma-mapping.h> | 26 | #include <linux/dma-mapping.h> |
| 27 | #include <linux/clk.h> | 27 | #include <linux/clk.h> |
| 28 | #include <linux/io.h> | ||
| 28 | 29 | ||
| 29 | #include <mach/hardware.h> | 30 | #include <mach/hardware.h> |
| 30 | #include <asm/mach-types.h> | 31 | #include <asm/mach-types.h> |
| 31 | #include <asm/io.h> | ||
| 32 | #include <asm/irq.h> | 32 | #include <asm/irq.h> |
| 33 | #include <asm/mach/irq.h> | 33 | #include <asm/mach/irq.h> |
| 34 | #include <asm/sizes.h> | 34 | #include <asm/sizes.h> |
diff --git a/arch/arm/common/scoop.c b/arch/arm/common/scoop.c index ae39553589d..697c6491399 100644 --- a/arch/arm/common/scoop.c +++ b/arch/arm/common/scoop.c | |||
| @@ -15,7 +15,7 @@ | |||
| 15 | #include <linux/string.h> | 15 | #include <linux/string.h> |
| 16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
| 17 | #include <linux/platform_device.h> | 17 | #include <linux/platform_device.h> |
| 18 | #include <asm/io.h> | 18 | #include <linux/io.h> |
| 19 | #include <asm/gpio.h> | 19 | #include <asm/gpio.h> |
| 20 | #include <asm/hardware/scoop.h> | 20 | #include <asm/hardware/scoop.h> |
| 21 | 21 | ||
diff --git a/arch/arm/common/sharpsl_param.c b/arch/arm/common/sharpsl_param.c index aad4d94ba8f..d56c932580e 100644 --- a/arch/arm/common/sharpsl_param.c +++ b/arch/arm/common/sharpsl_param.c | |||
| @@ -12,6 +12,7 @@ | |||
| 12 | */ | 12 | */ |
| 13 | 13 | ||
| 14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
| 15 | #include <linux/module.h> | ||
| 15 | #include <linux/string.h> | 16 | #include <linux/string.h> |
| 16 | #include <asm/mach/sharpsl_param.h> | 17 | #include <asm/mach/sharpsl_param.h> |
| 17 | 18 | ||
| @@ -36,6 +37,7 @@ | |||
| 36 | #define PHAD_MAGIC MAGIC_CHG('P','H','A','D') | 37 | #define PHAD_MAGIC MAGIC_CHG('P','H','A','D') |
| 37 | 38 | ||
| 38 | struct sharpsl_param_info sharpsl_param; | 39 | struct sharpsl_param_info sharpsl_param; |
| 40 | EXPORT_SYMBOL(sharpsl_param); | ||
| 39 | 41 | ||
| 40 | void sharpsl_save_param(void) | 42 | void sharpsl_save_param(void) |
| 41 | { | 43 | { |
diff --git a/arch/arm/common/time-acorn.c b/arch/arm/common/time-acorn.c index df0983aafe6..deeed561b16 100644 --- a/arch/arm/common/time-acorn.c +++ b/arch/arm/common/time-acorn.c | |||
| @@ -17,9 +17,9 @@ | |||
| 17 | #include <linux/init.h> | 17 | #include <linux/init.h> |
| 18 | #include <linux/interrupt.h> | 18 | #include <linux/interrupt.h> |
| 19 | #include <linux/irq.h> | 19 | #include <linux/irq.h> |
| 20 | #include <linux/io.h> | ||
| 20 | 21 | ||
| 21 | #include <mach/hardware.h> | 22 | #include <mach/hardware.h> |
| 22 | #include <asm/io.h> | ||
| 23 | #include <asm/hardware/ioc.h> | 23 | #include <asm/hardware/ioc.h> |
| 24 | 24 | ||
| 25 | #include <asm/mach/time.h> | 25 | #include <asm/mach/time.h> |
diff --git a/arch/arm/common/uengine.c b/arch/arm/common/uengine.c index 7ecd3c0ab01..b520e56216a 100644 --- a/arch/arm/common/uengine.c +++ b/arch/arm/common/uengine.c | |||
| @@ -16,9 +16,9 @@ | |||
| 16 | #include <linux/slab.h> | 16 | #include <linux/slab.h> |
| 17 | #include <linux/module.h> | 17 | #include <linux/module.h> |
| 18 | #include <linux/string.h> | 18 | #include <linux/string.h> |
| 19 | #include <linux/io.h> | ||
| 19 | #include <mach/hardware.h> | 20 | #include <mach/hardware.h> |
| 20 | #include <asm/hardware/uengine.h> | 21 | #include <asm/hardware/uengine.h> |
| 21 | #include <asm/io.h> | ||
| 22 | 22 | ||
| 23 | #if defined(CONFIG_ARCH_IXP2000) | 23 | #if defined(CONFIG_ARCH_IXP2000) |
| 24 | #define IXP_UENGINE_CSR_VIRT_BASE IXP2000_UENGINE_CSR_VIRT_BASE | 24 | #define IXP_UENGINE_CSR_VIRT_BASE IXP2000_UENGINE_CSR_VIRT_BASE |
diff --git a/arch/arm/common/via82c505.c b/arch/arm/common/via82c505.c index 79a8206e62a..8421d39109b 100644 --- a/arch/arm/common/via82c505.c +++ b/arch/arm/common/via82c505.c | |||
| @@ -4,8 +4,8 @@ | |||
| 4 | #include <linux/mm.h> | 4 | #include <linux/mm.h> |
| 5 | #include <linux/init.h> | 5 | #include <linux/init.h> |
| 6 | #include <linux/ioport.h> | 6 | #include <linux/ioport.h> |
| 7 | #include <linux/io.h> | ||
| 7 | 8 | ||
| 8 | #include <asm/io.h> | ||
| 9 | #include <asm/system.h> | 9 | #include <asm/system.h> |
| 10 | 10 | ||
| 11 | #include <asm/mach/pci.h> | 11 | #include <asm/mach/pci.h> |
diff --git a/arch/arm/common/vic.c b/arch/arm/common/vic.c index c026fa2214a..f1e4b8f60ca 100644 --- a/arch/arm/common/vic.c +++ b/arch/arm/common/vic.c | |||
| @@ -20,8 +20,8 @@ | |||
| 20 | */ | 20 | */ |
| 21 | #include <linux/init.h> | 21 | #include <linux/init.h> |
| 22 | #include <linux/list.h> | 22 | #include <linux/list.h> |
| 23 | #include <linux/io.h> | ||
| 23 | 24 | ||
| 24 | #include <asm/io.h> | ||
| 25 | #include <asm/mach/irq.h> | 25 | #include <asm/mach/irq.h> |
| 26 | #include <asm/hardware/vic.h> | 26 | #include <asm/hardware/vic.h> |
| 27 | 27 | ||
