aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-dma.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:03 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-01-26 14:13:03 -0500
commit15ce926ada545cb078711bd9a18c083c93fa01d7 (patch)
tree9496cda87cae6ef3390c5f350741ad75418dfe8d /drivers/ide/ide-dma.c
parentf37aaf9edeba3f4ae10d22aefc09c06af9ea39b6 (diff)
ide: merge ->dma_host_{on,off} methods into ->dma_host_set method
Merge ->dma_host_{on,off} methods into ->dma_host_set method which takes 'int on' argument. There should be no functionality changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-dma.c')
-rw-r--r--drivers/ide/ide-dma.c50
1 files changed, 15 insertions, 35 deletions
diff --git a/drivers/ide/ide-dma.c b/drivers/ide/ide-dma.c
index 780911e0537e..c9648b1ef220 100644
--- a/drivers/ide/ide-dma.c
+++ b/drivers/ide/ide-dma.c
@@ -408,23 +408,28 @@ static int dma_timer_expiry (ide_drive_t *drive)
408} 408}
409 409
410/** 410/**
411 * ide_dma_host_off - Generic DMA kill 411 * ide_dma_host_set - Enable/disable DMA on a host
412 * @drive: drive to control 412 * @drive: drive to control
413 * 413 *
414 * Perform the generic IDE controller DMA off operation. This 414 * Enable/disable DMA on an IDE controller following generic
415 * works for most IDE bus mastering controllers 415 * bus-mastering IDE controller behaviour.
416 */ 416 */
417 417
418void ide_dma_host_off(ide_drive_t *drive) 418void ide_dma_host_set(ide_drive_t *drive, int on)
419{ 419{
420 ide_hwif_t *hwif = HWIF(drive); 420 ide_hwif_t *hwif = HWIF(drive);
421 u8 unit = (drive->select.b.unit & 0x01); 421 u8 unit = (drive->select.b.unit & 0x01);
422 u8 dma_stat = hwif->INB(hwif->dma_status); 422 u8 dma_stat = hwif->INB(hwif->dma_status);
423 423
424 hwif->OUTB((dma_stat & ~(1<<(5+unit))), hwif->dma_status); 424 if (on)
425 dma_stat |= (1 << (5 + unit));
426 else
427 dma_stat &= ~(1 << (5 + unit));
428
429 hwif->OUTB(dma_stat, hwif->dma_status);
425} 430}
426 431
427EXPORT_SYMBOL(ide_dma_host_off); 432EXPORT_SYMBOL_GPL(ide_dma_host_set);
428#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 433#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
429 434
430/** 435/**
@@ -439,7 +444,7 @@ void ide_dma_off_quietly(ide_drive_t *drive)
439 drive->using_dma = 0; 444 drive->using_dma = 0;
440 ide_toggle_bounce(drive, 0); 445 ide_toggle_bounce(drive, 0);
441 446
442 drive->hwif->dma_host_off(drive); 447 drive->hwif->dma_host_set(drive, 0);
443} 448}
444 449
445EXPORT_SYMBOL(ide_dma_off_quietly); 450EXPORT_SYMBOL(ide_dma_off_quietly);
@@ -460,29 +465,6 @@ void ide_dma_off(ide_drive_t *drive)
460 465
461EXPORT_SYMBOL(ide_dma_off); 466EXPORT_SYMBOL(ide_dma_off);
462 467
463#ifdef CONFIG_BLK_DEV_IDEDMA_PCI
464/**
465 * ide_dma_host_on - Enable DMA on a host
466 * @drive: drive to enable for DMA
467 *
468 * Enable DMA on an IDE controller following generic bus mastering
469 * IDE controller behaviour
470 */
471
472void ide_dma_host_on(ide_drive_t *drive)
473{
474 if (1) {
475 ide_hwif_t *hwif = HWIF(drive);
476 u8 unit = (drive->select.b.unit & 0x01);
477 u8 dma_stat = hwif->INB(hwif->dma_status);
478
479 hwif->OUTB((dma_stat|(1<<(5+unit))), hwif->dma_status);
480 }
481}
482
483EXPORT_SYMBOL(ide_dma_host_on);
484#endif
485
486/** 468/**
487 * ide_dma_on - Enable DMA on a device 469 * ide_dma_on - Enable DMA on a device
488 * @drive: drive to enable DMA on 470 * @drive: drive to enable DMA on
@@ -495,7 +477,7 @@ void ide_dma_on(ide_drive_t *drive)
495 drive->using_dma = 1; 477 drive->using_dma = 1;
496 ide_toggle_bounce(drive, 1); 478 ide_toggle_bounce(drive, 1);
497 479
498 drive->hwif->dma_host_on(drive); 480 drive->hwif->dma_host_set(drive, 1);
499} 481}
500 482
501EXPORT_SYMBOL(ide_dma_on); 483EXPORT_SYMBOL(ide_dma_on);
@@ -980,10 +962,8 @@ void ide_setup_dma(ide_hwif_t *hwif, unsigned long base, unsigned num_ports)
980 if (!(hwif->dma_prdtable)) 962 if (!(hwif->dma_prdtable))
981 hwif->dma_prdtable = (hwif->dma_base + 4); 963 hwif->dma_prdtable = (hwif->dma_base + 4);
982 964
983 if (!hwif->dma_host_off) 965 if (!hwif->dma_host_set)
984 hwif->dma_host_off = &ide_dma_host_off; 966 hwif->dma_host_set = &ide_dma_host_set;
985 if (!hwif->dma_host_on)
986 hwif->dma_host_on = &ide_dma_host_on;
987 if (!hwif->dma_setup) 967 if (!hwif->dma_setup)
988 hwif->dma_setup = &ide_dma_setup; 968 hwif->dma_setup = &ide_dma_setup;
989 if (!hwif->dma_exec_cmd) 969 if (!hwif->dma_exec_cmd)