diff options
-rw-r--r-- | drivers/ide/pci/hpt366.c | 45 | ||||
-rw-r--r-- | drivers/ide/pci/piix.c | 6 | ||||
-rw-r--r-- | drivers/ide/pci/tc86c001.c | 14 | ||||
-rw-r--r-- | drivers/ide/setup-pci.c | 6 |
4 files changed, 34 insertions, 37 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 | ||
677 | static void hpt3xx_intrproc(ide_drive_t *drive) | 677 | static 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 | ||
687 | static void hpt3xx_maskproc(ide_drive_t *drive, int mask) | 686 | static 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) | |||
767 | static int hpt370_ide_dma_end(ide_drive_t *drive) | 766 | static 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 | ||
834 | static void hpt3xxn_set_clock(ide_hwif_t *hwif, u8 mode) | 833 | static 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 | ||
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index cbfc27b92ede..3f3879cff3c1 100644 --- a/drivers/ide/pci/piix.c +++ b/drivers/ide/pci/piix.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/piix.c Version 0.53 Aug 9, 2007 | 2 | * linux/drivers/ide/pci/piix.c Version 0.54 Sep 5, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer | 4 | * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer |
5 | * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> | 5 | * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> |
@@ -318,9 +318,9 @@ static void piix_dma_clear_irq(ide_drive_t *drive) | |||
318 | u8 dma_stat; | 318 | u8 dma_stat; |
319 | 319 | ||
320 | /* clear the INTR & ERROR bits */ | 320 | /* clear the INTR & ERROR bits */ |
321 | dma_stat = hwif->INB(hwif->dma_status); | 321 | dma_stat = inb(hwif->dma_status); |
322 | /* Should we force the bit as well ? */ | 322 | /* Should we force the bit as well ? */ |
323 | hwif->OUTB(dma_stat, hwif->dma_status); | 323 | outb(dma_stat, hwif->dma_status); |
324 | } | 324 | } |
325 | 325 | ||
326 | struct ich_laptop { | 326 | struct ich_laptop { |
diff --git a/drivers/ide/pci/tc86c001.c b/drivers/ide/pci/tc86c001.c index 9f50927e9098..04fe9b7f6e72 100644 --- a/drivers/ide/pci/tc86c001.c +++ b/drivers/ide/pci/tc86c001.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * drivers/ide/pci/tc86c001.c Version 1.00 Dec 12, 2006 | 2 | * drivers/ide/pci/tc86c001.c Version 1.01 Sep 5, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 2002 Toshiba Corporation | 4 | * Copyright (C) 2002 Toshiba Corporation |
5 | * Copyright (C) 2005-2006 MontaVista Software, Inc. <source@mvista.com> | 5 | * Copyright (C) 2005-2006 MontaVista Software, Inc. <source@mvista.com> |
@@ -17,7 +17,7 @@ static void tc86c001_set_mode(ide_drive_t *drive, const u8 speed) | |||
17 | { | 17 | { |
18 | ide_hwif_t *hwif = HWIF(drive); | 18 | ide_hwif_t *hwif = HWIF(drive); |
19 | unsigned long scr_port = hwif->config_data + (drive->dn ? 0x02 : 0x00); | 19 | unsigned long scr_port = hwif->config_data + (drive->dn ? 0x02 : 0x00); |
20 | u16 mode, scr = hwif->INW(scr_port); | 20 | u16 mode, scr = inw(scr_port); |
21 | 21 | ||
22 | switch (speed) { | 22 | switch (speed) { |
23 | case XFER_UDMA_4: mode = 0x00c0; break; | 23 | case XFER_UDMA_4: mode = 0x00c0; break; |
@@ -65,7 +65,7 @@ static int tc86c001_timer_expiry(ide_drive_t *drive) | |||
65 | ide_hwif_t *hwif = HWIF(drive); | 65 | ide_hwif_t *hwif = HWIF(drive); |
66 | ide_expiry_t *expiry = ide_get_hwifdata(hwif); | 66 | ide_expiry_t *expiry = ide_get_hwifdata(hwif); |
67 | ide_hwgroup_t *hwgroup = HWGROUP(drive); | 67 | ide_hwgroup_t *hwgroup = HWGROUP(drive); |
68 | u8 dma_stat = hwif->INB(hwif->dma_status); | 68 | u8 dma_stat = inb(hwif->dma_status); |
69 | 69 | ||
70 | /* Restore a higher level driver's expiry handler first. */ | 70 | /* Restore a higher level driver's expiry handler first. */ |
71 | hwgroup->expiry = expiry; | 71 | hwgroup->expiry = expiry; |
@@ -73,7 +73,7 @@ static int tc86c001_timer_expiry(ide_drive_t *drive) | |||
73 | if ((dma_stat & 5) == 1) { /* DMA active and no interrupt */ | 73 | if ((dma_stat & 5) == 1) { /* DMA active and no interrupt */ |
74 | unsigned long sc_base = hwif->config_data; | 74 | unsigned long sc_base = hwif->config_data; |
75 | unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04); | 75 | unsigned long twcr_port = sc_base + (drive->dn ? 0x06 : 0x04); |
76 | u8 dma_cmd = hwif->INB(hwif->dma_command); | 76 | u8 dma_cmd = inb(hwif->dma_command); |
77 | 77 | ||
78 | printk(KERN_WARNING "%s: DMA interrupt possibly stuck, " | 78 | printk(KERN_WARNING "%s: DMA interrupt possibly stuck, " |
79 | "attempting recovery...\n", drive->name); | 79 | "attempting recovery...\n", drive->name); |
@@ -135,7 +135,7 @@ static int tc86c001_busproc(ide_drive_t *drive, int state) | |||
135 | u16 scr1; | 135 | u16 scr1; |
136 | 136 | ||
137 | /* System Control 1 Register bit 11 (ATA Hard Reset) read */ | 137 | /* System Control 1 Register bit 11 (ATA Hard Reset) read */ |
138 | scr1 = hwif->INW(sc_base + 0x00); | 138 | scr1 = inw(sc_base + 0x00); |
139 | 139 | ||
140 | switch (state) { | 140 | switch (state) { |
141 | case BUSSTATE_ON: | 141 | case BUSSTATE_ON: |
@@ -165,7 +165,7 @@ static int tc86c001_busproc(ide_drive_t *drive, int state) | |||
165 | static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | 165 | static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) |
166 | { | 166 | { |
167 | unsigned long sc_base = pci_resource_start(hwif->pci_dev, 5); | 167 | unsigned long sc_base = pci_resource_start(hwif->pci_dev, 5); |
168 | u16 scr1 = hwif->INW(sc_base + 0x00);; | 168 | u16 scr1 = inw(sc_base + 0x00); |
169 | 169 | ||
170 | /* System Control 1 Register bit 15 (Soft Reset) set */ | 170 | /* System Control 1 Register bit 15 (Soft Reset) set */ |
171 | outw(scr1 | 0x8000, sc_base + 0x00); | 171 | outw(scr1 | 0x8000, sc_base + 0x00); |
@@ -205,7 +205,7 @@ static void __devinit init_hwif_tc86c001(ide_hwif_t *hwif) | |||
205 | * System Control 1 Register bit 13 (PDIAGN): | 205 | * System Control 1 Register bit 13 (PDIAGN): |
206 | * 0=80-pin cable, 1=40-pin cable | 206 | * 0=80-pin cable, 1=40-pin cable |
207 | */ | 207 | */ |
208 | scr1 = hwif->INW(sc_base + 0x00); | 208 | scr1 = inw(sc_base + 0x00); |
209 | hwif->cbl = (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; | 209 | hwif->cbl = (scr1 & 0x2000) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; |
210 | } | 210 | } |
211 | } | 211 | } |
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c index f187889de70f..1da9935ba948 100644 --- a/drivers/ide/setup-pci.c +++ b/drivers/ide/setup-pci.c | |||
@@ -185,9 +185,9 @@ static unsigned long ide_get_or_set_dma_base(ide_pci_device_t *d, ide_hwif_t *hw | |||
185 | case PCI_DEVICE_ID_CMD_643: | 185 | case PCI_DEVICE_ID_CMD_643: |
186 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: | 186 | case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE: |
187 | case PCI_DEVICE_ID_REVOLUTION: | 187 | case PCI_DEVICE_ID_REVOLUTION: |
188 | simplex_stat = hwif->INB(dma_base + 2); | 188 | simplex_stat = inb(dma_base + 2); |
189 | hwif->OUTB((simplex_stat&0x60),(dma_base + 2)); | 189 | outb(simplex_stat & 0x60, dma_base + 2); |
190 | simplex_stat = hwif->INB(dma_base + 2); | 190 | simplex_stat = inb(dma_base + 2); |
191 | if (simplex_stat & 0x80) { | 191 | if (simplex_stat & 0x80) { |
192 | printk(KERN_INFO "%s: simplex device: " | 192 | printk(KERN_INFO "%s: simplex device: " |
193 | "DMA forced\n", | 193 | "DMA forced\n", |