aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
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
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')
-rw-r--r--drivers/ide/arm/icside.c5
-rw-r--r--drivers/ide/arm/palm_bk3710.c2
-rw-r--r--drivers/ide/arm/rapide.c2
-rw-r--r--drivers/ide/h8300/ide-h8300.c2
-rw-r--r--drivers/ide/ide-iops.c28
-rw-r--r--drivers/ide/ide.c1
-rw-r--r--drivers/ide/legacy/ide_platform.c4
-rw-r--r--drivers/ide/mips/swarm.c3
-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
-rw-r--r--drivers/ide/ppc/pmac.c13
13 files changed, 15 insertions, 108 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index f73422dd8474..0fd01d630f12 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -469,8 +469,6 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
469 if (!hwif) 469 if (!hwif)
470 return -ENODEV; 470 return -ENODEV;
471 471
472 default_hwif_mmiops(hwif);
473
474 state->hwif[0] = hwif; 472 state->hwif[0] = hwif;
475 473
476 ecard_set_drvdata(ec, state); 474 ecard_set_drvdata(ec, state);
@@ -547,14 +545,11 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
547 return -ENODEV; 545 return -ENODEV;
548 546
549 hwif->chipset = ide_acorn; 547 hwif->chipset = ide_acorn;
550 default_hwif_mmiops(hwif);
551 548
552 idx[0] = hwif->index; 549 idx[0] = hwif->index;
553 550
554 mate = ide_find_port(); 551 mate = ide_find_port();
555 if (mate) { 552 if (mate) {
556 default_hwif_mmiops(mate);
557
558 hws[1] = &hw[1]; 553 hws[1] = &hw[1];
559 idx[1] = mate->index; 554 idx[1] = mate->index;
560 } 555 }
diff --git a/drivers/ide/arm/palm_bk3710.c b/drivers/ide/arm/palm_bk3710.c
index 0229d794d909..545563bc7e23 100644
--- a/drivers/ide/arm/palm_bk3710.c
+++ b/drivers/ide/arm/palm_bk3710.c
@@ -399,8 +399,6 @@ static int __devinit palm_bk3710_probe(struct platform_device *pdev)
399 399
400 i = hwif->index; 400 i = hwif->index;
401 401
402 default_hwif_mmiops(hwif);
403
404 idx[0] = i; 402 idx[0] = i;
405 403
406 ide_device_add(idx, &palm_bk3710_port_info, hws); 404 ide_device_add(idx, &palm_bk3710_port_info, hws);
diff --git a/drivers/ide/arm/rapide.c b/drivers/ide/arm/rapide.c
index 01896f6e8acf..a45c2f694949 100644
--- a/drivers/ide/arm/rapide.c
+++ b/drivers/ide/arm/rapide.c
@@ -59,8 +59,6 @@ rapide_probe(struct expansion_card *ec, const struct ecard_id *id)
59 goto release; 59 goto release;
60 } 60 }
61 61
62 default_hwif_mmiops(hwif);
63
64 idx[0] = hwif->index; 62 idx[0] = hwif->index;
65 63
66 ide_device_add(idx, &rapide_port_info, hws); 64 ide_device_add(idx, &rapide_port_info, hws);
diff --git a/drivers/ide/h8300/ide-h8300.c b/drivers/ide/h8300/ide-h8300.c
index 548a2bf232c9..0795d6554913 100644
--- a/drivers/ide/h8300/ide-h8300.c
+++ b/drivers/ide/h8300/ide-h8300.c
@@ -171,8 +171,6 @@ static inline void hw_setup(hw_regs_t *hw)
171 171
172static inline void hwif_setup(ide_hwif_t *hwif) 172static inline void hwif_setup(ide_hwif_t *hwif)
173{ 173{
174 default_hwif_iops(hwif);
175
176 hwif->tf_load = h8300_tf_load; 174 hwif->tf_load = h8300_tf_load;
177 hwif->tf_read = h8300_tf_read; 175 hwif->tf_read = h8300_tf_read;
178 176
diff --git a/drivers/ide/ide-iops.c b/drivers/ide/ide-iops.c
index cb11c7861a50..6c54fe1f9841 100644
--- a/drivers/ide/ide-iops.c
+++ b/drivers/ide/ide-iops.c
@@ -42,18 +42,6 @@ static void ide_outb (u8 val, unsigned long port)
42 outb(val, port); 42 outb(val, port);
43} 43}
44 44
45static void ide_outbsync(ide_hwif_t *hwif, u8 addr, unsigned long port)
46{
47 outb(addr, port);
48}
49
50void default_hwif_iops (ide_hwif_t *hwif)
51{
52 hwif->OUTB = ide_outb;
53 hwif->OUTBSYNC = ide_outbsync;
54 hwif->INB = ide_inb;
55}
56
57/* 45/*
58 * MMIO operations, typically used for SATA controllers 46 * MMIO operations, typically used for SATA controllers
59 */ 47 */
@@ -68,22 +56,6 @@ static void ide_mm_outb (u8 value, unsigned long port)
68 writeb(value, (void __iomem *) port); 56 writeb(value, (void __iomem *) port);
69} 57}
70 58
71static void ide_mm_outbsync(ide_hwif_t *hwif, u8 value, unsigned long port)
72{
73 writeb(value, (void __iomem *) port);
74}
75
76void default_hwif_mmiops (ide_hwif_t *hwif)
77{
78 hwif->OUTB = ide_mm_outb;
79 /* Most systems will need to override OUTBSYNC, alas however
80 this one is controller specific! */
81 hwif->OUTBSYNC = ide_mm_outbsync;
82 hwif->INB = ide_mm_inb;
83}
84
85EXPORT_SYMBOL(default_hwif_mmiops);
86
87void SELECT_DRIVE (ide_drive_t *drive) 59void SELECT_DRIVE (ide_drive_t *drive)
88{ 60{
89 ide_hwif_t *hwif = drive->hwif; 61 ide_hwif_t *hwif = drive->hwif;
diff --git a/drivers/ide/ide.c b/drivers/ide/ide.c
index b6018f7b0907..434dd02a4bdc 100644
--- a/drivers/ide/ide.c
+++ b/drivers/ide/ide.c
@@ -101,7 +101,6 @@ void ide_init_port_data(ide_hwif_t *hwif, unsigned int index)
101 101
102 init_completion(&hwif->gendev_rel_comp); 102 init_completion(&hwif->gendev_rel_comp);
103 103
104 default_hwif_iops(hwif);
105 default_hwif_transport(hwif); 104 default_hwif_transport(hwif);
106 105
107 ide_port_init_devices_data(hwif); 106 ide_port_init_devices_data(hwif);
diff --git a/drivers/ide/legacy/ide_platform.c b/drivers/ide/legacy/ide_platform.c
index 609da0d43196..3d71e336a221 100644
--- a/drivers/ide/legacy/ide_platform.c
+++ b/drivers/ide/legacy/ide_platform.c
@@ -103,10 +103,8 @@ static int __devinit plat_ide_probe(struct platform_device *pdev)
103 plat_ide_setup_ports(&hw, base, alt_base, pdata, res_irq->start); 103 plat_ide_setup_ports(&hw, base, alt_base, pdata, res_irq->start);
104 hw.dev = &pdev->dev; 104 hw.dev = &pdev->dev;
105 105
106 if (mmio) { 106 if (mmio)
107 d.host_flags |= IDE_HFLAG_MMIO; 107 d.host_flags |= IDE_HFLAG_MMIO;
108 default_hwif_mmiops(hwif);
109 }
110 108
111 idx[0] = hwif->index; 109 idx[0] = hwif->index;
112 110
diff --git a/drivers/ide/mips/swarm.c b/drivers/ide/mips/swarm.c
index 6da6844d2d8c..c1ffb83a2de7 100644
--- a/drivers/ide/mips/swarm.c
+++ b/drivers/ide/mips/swarm.c
@@ -120,9 +120,6 @@ static int __devinit swarm_ide_probe(struct device *dev)
120 if (hwif == NULL) 120 if (hwif == NULL)
121 goto err; 121 goto err;
122 122
123 /* Setup MMIO ops. */
124 default_hwif_mmiops(hwif);
125
126 idx[0] = hwif->index; 123 idx[0] = hwif->index;
127 124
128 ide_device_add(idx, &swarm_port_info, hws); 125 ide_device_add(idx, &swarm_port_info, hws);
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 /*
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index a0d66480a797..ed073c6635a8 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -486,15 +486,6 @@ pmac_ide_do_update_timings(ide_drive_t *drive)
486 pmac_ide_selectproc(drive); 486 pmac_ide_selectproc(drive);
487} 487}
488 488
489static void pmac_outbsync(ide_hwif_t *hwif, u8 value, unsigned long port)
490{
491 u32 tmp;
492
493 writeb(value, (void __iomem *) port);
494 tmp = readl((void __iomem *)(hwif->io_ports.data_addr
495 + IDE_TIMING_CONFIG));
496}
497
498static void pmac_exec_command(ide_hwif_t *hwif, u8 cmd) 489static void pmac_exec_command(ide_hwif_t *hwif, u8 cmd)
499{ 490{
500 writeb(cmd, (void __iomem *)hwif->io_ports.command_addr); 491 writeb(cmd, (void __iomem *)hwif->io_ports.command_addr);
@@ -1118,10 +1109,6 @@ static int __devinit pmac_ide_setup_device(pmac_ide_hwif_t *pmif, hw_regs_t *hw)
1118 hwif->exec_command = pmac_exec_command; 1109 hwif->exec_command = pmac_exec_command;
1119 hwif->set_irq = pmac_set_irq; 1110 hwif->set_irq = pmac_set_irq;
1120 1111
1121 /* Setup MMIO ops */
1122 default_hwif_mmiops(hwif);
1123 hwif->OUTBSYNC = pmac_outbsync;
1124
1125 idx[0] = hwif->index; 1112 idx[0] = hwif->index;
1126 1113
1127 ide_device_add(idx, &d, hws); 1114 ide_device_add(idx, &d, hws);