aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/ns87415.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:54 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-23 13:55:54 -0400
commit761052e676372465fdeb97c148d5a4b0790fa8a0 (patch)
treec3befdb19fbb5a40f3f8f844a9185018746d9893 /drivers/ide/pci/ns87415.c
parent1823649b5abb77ffe638178bc5253249d3ecd17d (diff)
ide: remove ->INB, ->OUTB and ->OUTBSYNC methods
* Remove no longer needed ->INB, ->OUTB and ->OUTBSYNC methods. Then: * Remove no longer used default_hwif_[mm]iops() and ide_[mm_]outbsync(). * Cleanup SuperIO handling in ns87415.c. There should be no functional changes caused by this patch. Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/ns87415.c')
-rw-r--r--drivers/ide/pci/ns87415.c46
1 files changed, 13 insertions, 33 deletions
diff --git a/drivers/ide/pci/ns87415.c b/drivers/ide/pci/ns87415.c
index b9bb8428b35e..02fd3a877afa 100644
--- a/drivers/ide/pci/ns87415.c
+++ b/drivers/ide/pci/ns87415.c
@@ -28,10 +28,6 @@
28 */ 28 */
29#include <asm/superio.h> 29#include <asm/superio.h>
30 30
31static unsigned long superio_ide_status[2];
32static unsigned long superio_ide_select[2];
33static unsigned long superio_ide_dma_status[2];
34
35#define SUPERIO_IDE_MAX_RETRIES 25 31#define SUPERIO_IDE_MAX_RETRIES 25
36 32
37/* Because of a defect in Super I/O, all reads of the PCI DMA status 33/* Because of a defect in Super I/O, all reads of the PCI DMA status
@@ -40,27 +36,18 @@ static unsigned long superio_ide_dma_status[2];
40 */ 36 */
41static u8 superio_ide_inb (unsigned long port) 37static u8 superio_ide_inb (unsigned long port)
42{ 38{
43 if (port == superio_ide_status[0] || 39 u8 tmp;
44 port == superio_ide_status[1] || 40 int retries = SUPERIO_IDE_MAX_RETRIES;
45 port == superio_ide_select[0] ||
46 port == superio_ide_select[1] ||
47 port == superio_ide_dma_status[0] ||
48 port == superio_ide_dma_status[1]) {
49 u8 tmp;
50 int retries = SUPERIO_IDE_MAX_RETRIES;
51
52 /* printk(" [ reading port 0x%x with retry ] ", port); */
53 41
54 do { 42 /* printk(" [ reading port 0x%x with retry ] ", port); */
55 tmp = inb(port);
56 if (tmp == 0)
57 udelay(50);
58 } while (tmp == 0 && retries-- > 0);
59 43
60 return tmp; 44 do {
61 } 45 tmp = inb(port);
46 if (tmp == 0)
47 udelay(50);
48 } while (tmp == 0 && retries-- > 0);
62 49
63 return inb(port); 50 return tmp;
64} 51}
65 52
66static u8 superio_read_status(ide_hwif_t *hwif) 53static u8 superio_read_status(ide_hwif_t *hwif)
@@ -120,27 +107,20 @@ static void superio_tf_read(ide_drive_t *drive, ide_task_t *task)
120static void __devinit superio_ide_init_iops (struct hwif_s *hwif) 107static void __devinit superio_ide_init_iops (struct hwif_s *hwif)
121{ 108{
122 struct pci_dev *pdev = to_pci_dev(hwif->dev); 109 struct pci_dev *pdev = to_pci_dev(hwif->dev);
123 u32 base, dmabase; 110 u32 dma_stat;
124 u8 port = hwif->channel, tmp; 111 u8 port = hwif->channel, tmp;
125 112
126 base = pci_resource_start(pdev, port * 2) & ~3; 113 dma_stat = (pci_resource_start(pdev, 4) & ~3) + (!port ? 2 : 0xa);
127 dmabase = pci_resource_start(pdev, 4) & ~3;
128
129 superio_ide_status[port] = base + 7;
130 superio_ide_select[port] = base + 6;
131 superio_ide_dma_status[port] = dmabase + (!port ? 2 : 0xa);
132 114
133 /* Clear error/interrupt, enable dma */ 115 /* Clear error/interrupt, enable dma */
134 tmp = superio_ide_inb(superio_ide_dma_status[port]); 116 tmp = superio_ide_inb(dma_stat);
135 outb(tmp | 0x66, superio_ide_dma_status[port]); 117 outb(tmp | 0x66, dma_stat);
136 118
137 hwif->read_status = superio_read_status; 119 hwif->read_status = superio_read_status;
138 hwif->read_sff_dma_status = superio_read_sff_dma_status; 120 hwif->read_sff_dma_status = superio_read_sff_dma_status;
139 121
140 hwif->tf_read = superio_tf_read; 122 hwif->tf_read = superio_tf_read;
141 123
142 /* We need to override inb to workaround a SuperIO errata */
143 hwif->INB = superio_ide_inb;
144} 124}
145 125
146static void __devinit init_iops_ns87415(ide_hwif_t *hwif) 126static void __devinit init_iops_ns87415(ide_hwif_t *hwif)