aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci
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
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')
-rw-r--r--drivers/ide/pci/ns87415.c46
-rw-r--r--drivers/ide/pci/scc_pata.c12
-rw-r--r--drivers/ide/pci/sgiioc4.c3
-rw-r--r--drivers/ide/pci/siimage.c2
4 files changed, 14 insertions, 49 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)
diff --git a/drivers/ide/pci/scc_pata.c b/drivers/ide/pci/scc_pata.c
index c110f359b03e..38765d9b0314 100644
--- a/drivers/ide/pci/scc_pata.c
+++ b/drivers/ide/pci/scc_pata.c
@@ -188,14 +188,6 @@ static void scc_ide_outb(u8 addr, unsigned long port)
188 out_be32((void*)port, addr); 188 out_be32((void*)port, addr);
189} 189}
190 190
191static void scc_ide_outbsync(ide_hwif_t *hwif, u8 addr, unsigned long port)
192{
193 out_be32((void*)port, addr);
194 eieio();
195 in_be32((void*)(hwif->dma_base + 0x01c));
196 eieio();
197}
198
199static void 191static void
200scc_ide_outsw(unsigned long port, void *addr, u32 count) 192scc_ide_outsw(unsigned long port, void *addr, u32 count)
201{ 193{
@@ -829,10 +821,6 @@ static void __devinit init_mmio_iops_scc(ide_hwif_t *hwif)
829 hwif->input_data = scc_input_data; 821 hwif->input_data = scc_input_data;
830 hwif->output_data = scc_output_data; 822 hwif->output_data = scc_output_data;
831 823
832 hwif->INB = scc_ide_inb;
833 hwif->OUTB = scc_ide_outb;
834 hwif->OUTBSYNC = scc_ide_outbsync;
835
836 hwif->dma_base = dma_base; 824 hwif->dma_base = dma_base;
837 hwif->config_data = ports->ctl; 825 hwif->config_data = ports->ctl;
838} 826}
diff --git a/drivers/ide/pci/sgiioc4.c b/drivers/ide/pci/sgiioc4.c
index 3005a6334a58..86f7c4901837 100644
--- a/drivers/ide/pci/sgiioc4.c
+++ b/drivers/ide/pci/sgiioc4.c
@@ -623,9 +623,6 @@ sgiioc4_ide_setup_pci_device(struct pci_dev *dev)
623 if (hwif == NULL) 623 if (hwif == NULL)
624 goto err; 624 goto err;
625 625
626 /* The IOC4 uses MMIO rather than Port IO. */
627 default_hwif_mmiops(hwif);
628
629 /* Initializing chipset IRQ Registers */ 626 /* Initializing chipset IRQ Registers */
630 writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4)); 627 writel(0x03, (void __iomem *)(irqport + IOC4_INTR_SET * 4));
631 628
diff --git a/drivers/ide/pci/siimage.c b/drivers/ide/pci/siimage.c
index 21d7137f7d6c..5965a35d94ae 100644
--- a/drivers/ide/pci/siimage.c
+++ b/drivers/ide/pci/siimage.c
@@ -601,7 +601,7 @@ static void __devinit init_mmio_iops_siimage(ide_hwif_t *hwif)
601 * Fill in the basic hwif bits 601 * Fill in the basic hwif bits
602 */ 602 */
603 hwif->host_flags |= IDE_HFLAG_MMIO; 603 hwif->host_flags |= IDE_HFLAG_MMIO;
604 default_hwif_mmiops(hwif); 604
605 hwif->hwif_data = addr; 605 hwif->hwif_data = addr;
606 606
607 /* 607 /*