aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/hpt366.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-18 18:30:08 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-10-18 18:30:08 -0400
commit31e8a465a265886a207427e5652aafb9a591c3fa (patch)
tree138a3c6fcb7ecba2c636586566d84e9eeeacf305 /drivers/ide/pci/hpt366.c
parentfc212bb1fb538f9453d9ea2cca09749e602055a6 (diff)
ide: use I/O ops directly part #2 (take 2)
v2: - bump host driver versions (as suggested by Sergei) - use I/O ops directly in drivers/ide/setup-pci.c Cc: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/hpt366.c')
-rw-r--r--drivers/ide/pci/hpt366.c45
1 files changed, 21 insertions, 24 deletions
diff --git a/drivers/ide/pci/hpt366.c b/drivers/ide/pci/hpt366.c
index e643b9654c75..26c15f20537e 100644
--- a/drivers/ide/pci/hpt366.c
+++ b/drivers/ide/pci/hpt366.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/hpt366.c Version 1.14 Oct 1, 2007 2 * linux/drivers/ide/pci/hpt366.c Version 1.15 Oct 1, 2007
3 * 3 *
4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1999-2003 Andre Hedrick <andre@linux-ide.org>
5 * Portions Copyright (C) 2001 Sun Microsystems, Inc. 5 * Portions Copyright (C) 2001 Sun Microsystems, Inc.
@@ -676,12 +676,11 @@ static int hpt3xx_quirkproc(ide_drive_t *drive)
676 676
677static void hpt3xx_intrproc(ide_drive_t *drive) 677static void hpt3xx_intrproc(ide_drive_t *drive)
678{ 678{
679 ide_hwif_t *hwif = HWIF(drive);
680
681 if (drive->quirk_list) 679 if (drive->quirk_list)
682 return; 680 return;
681
683 /* drives in the quirk_list may not like intr setups/cleanups */ 682 /* drives in the quirk_list may not like intr setups/cleanups */
684 hwif->OUTB(drive->ctl | 2, IDE_CONTROL_REG); 683 outb(drive->ctl | 2, IDE_CONTROL_REG);
685} 684}
686 685
687static void hpt3xx_maskproc(ide_drive_t *drive, int mask) 686static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
@@ -709,8 +708,8 @@ static void hpt3xx_maskproc(ide_drive_t *drive, int mask)
709 enable_irq (hwif->irq); 708 enable_irq (hwif->irq);
710 } 709 }
711 } else 710 } else
712 hwif->OUTB(mask ? (drive->ctl | 2) : (drive->ctl & ~2), 711 outb(mask ? (drive->ctl | 2) : (drive->ctl & ~2),
713 IDE_CONTROL_REG); 712 IDE_CONTROL_REG);
714} 713}
715 714
716/* 715/*
@@ -750,9 +749,9 @@ static void hpt370_irq_timeout(ide_drive_t *drive)
750 printk(KERN_DEBUG "%s: %d bytes in FIFO\n", drive->name, bfifo & 0x1ff); 749 printk(KERN_DEBUG "%s: %d bytes in FIFO\n", drive->name, bfifo & 0x1ff);
751 750
752 /* get DMA command mode */ 751 /* get DMA command mode */
753 dma_cmd = hwif->INB(hwif->dma_command); 752 dma_cmd = inb(hwif->dma_command);
754 /* stop DMA */ 753 /* stop DMA */
755 hwif->OUTB(dma_cmd & ~0x1, hwif->dma_command); 754 outb(dma_cmd & ~0x1, hwif->dma_command);
756 hpt370_clear_engine(drive); 755 hpt370_clear_engine(drive);
757} 756}
758 757
@@ -767,12 +766,12 @@ static void hpt370_ide_dma_start(ide_drive_t *drive)
767static int hpt370_ide_dma_end(ide_drive_t *drive) 766static int hpt370_ide_dma_end(ide_drive_t *drive)
768{ 767{
769 ide_hwif_t *hwif = HWIF(drive); 768 ide_hwif_t *hwif = HWIF(drive);
770 u8 dma_stat = hwif->INB(hwif->dma_status); 769 u8 dma_stat = inb(hwif->dma_status);
771 770
772 if (dma_stat & 0x01) { 771 if (dma_stat & 0x01) {
773 /* wait a little */ 772 /* wait a little */
774 udelay(20); 773 udelay(20);
775 dma_stat = hwif->INB(hwif->dma_status); 774 dma_stat = inb(hwif->dma_status);
776 if (dma_stat & 0x01) 775 if (dma_stat & 0x01)
777 hpt370_irq_timeout(drive); 776 hpt370_irq_timeout(drive);
778 } 777 }
@@ -833,34 +832,32 @@ static int hpt374_ide_dma_end(ide_drive_t *drive)
833 832
834static void hpt3xxn_set_clock(ide_hwif_t *hwif, u8 mode) 833static void hpt3xxn_set_clock(ide_hwif_t *hwif, u8 mode)
835{ 834{
836 u8 scr2 = hwif->INB(hwif->dma_master + 0x7b); 835 u8 scr2 = inb(hwif->dma_master + 0x7b);
837 836
838 if ((scr2 & 0x7f) == mode) 837 if ((scr2 & 0x7f) == mode)
839 return; 838 return;
840 839
841 /* Tristate the bus */ 840 /* Tristate the bus */
842 hwif->OUTB(0x80, hwif->dma_master + 0x73); 841 outb(0x80, hwif->dma_master + 0x73);
843 hwif->OUTB(0x80, hwif->dma_master + 0x77); 842 outb(0x80, hwif->dma_master + 0x77);
844 843
845 /* Switch clock and reset channels */ 844 /* Switch clock and reset channels */
846 hwif->OUTB(mode, hwif->dma_master + 0x7b); 845 outb(mode, hwif->dma_master + 0x7b);
847 hwif->OUTB(0xc0, hwif->dma_master + 0x79); 846 outb(0xc0, hwif->dma_master + 0x79);
848 847
849 /* 848 /*
850 * Reset the state machines. 849 * Reset the state machines.
851 * NOTE: avoid accidentally enabling the disabled channels. 850 * NOTE: avoid accidentally enabling the disabled channels.
852 */ 851 */
853 hwif->OUTB(hwif->INB(hwif->dma_master + 0x70) | 0x32, 852 outb(inb(hwif->dma_master + 0x70) | 0x32, hwif->dma_master + 0x70);
854 hwif->dma_master + 0x70); 853 outb(inb(hwif->dma_master + 0x74) | 0x32, hwif->dma_master + 0x74);
855 hwif->OUTB(hwif->INB(hwif->dma_master + 0x74) | 0x32,
856 hwif->dma_master + 0x74);
857 854
858 /* Complete reset */ 855 /* Complete reset */
859 hwif->OUTB(0x00, hwif->dma_master + 0x79); 856 outb(0x00, hwif->dma_master + 0x79);
860 857
861 /* Reconnect channels to bus */ 858 /* Reconnect channels to bus */
862 hwif->OUTB(0x00, hwif->dma_master + 0x73); 859 outb(0x00, hwif->dma_master + 0x73);
863 hwif->OUTB(0x00, hwif->dma_master + 0x77); 860 outb(0x00, hwif->dma_master + 0x77);
864} 861}
865 862
866/** 863/**
@@ -1351,7 +1348,7 @@ static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase)
1351 u8 dma_new = 0, dma_old = 0; 1348 u8 dma_new = 0, dma_old = 0;
1352 unsigned long flags; 1349 unsigned long flags;
1353 1350
1354 dma_old = hwif->INB(dmabase + 2); 1351 dma_old = inb(dmabase + 2);
1355 1352
1356 local_irq_save(flags); 1353 local_irq_save(flags);
1357 1354
@@ -1362,7 +1359,7 @@ static void __devinit init_dma_hpt366(ide_hwif_t *hwif, unsigned long dmabase)
1362 if (masterdma & 0x30) dma_new |= 0x20; 1359 if (masterdma & 0x30) dma_new |= 0x20;
1363 if ( slavedma & 0x30) dma_new |= 0x40; 1360 if ( slavedma & 0x30) dma_new |= 0x40;
1364 if (dma_new != dma_old) 1361 if (dma_new != dma_old)
1365 hwif->OUTB(dma_new, dmabase + 2); 1362 outb(dma_new, dmabase + 2);
1366 1363
1367 local_irq_restore(flags); 1364 local_irq_restore(flags);
1368 1365