aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy')
-rw-r--r--drivers/ide/legacy/buddha.c2
-rw-r--r--drivers/ide/legacy/falconide.c2
-rw-r--r--drivers/ide/legacy/gayle.c6
-rw-r--r--drivers/ide/legacy/ide-cs.c41
-rw-r--r--drivers/ide/legacy/macide.c5
-rw-r--r--drivers/ide/legacy/q40ide.c2
6 files changed, 37 insertions, 21 deletions
diff --git a/drivers/ide/legacy/buddha.c b/drivers/ide/legacy/buddha.c
index 5c730e4dd735..9a1d27ef3f8a 100644
--- a/drivers/ide/legacy/buddha.c
+++ b/drivers/ide/legacy/buddha.c
@@ -138,6 +138,8 @@ static void __init buddha_setup_ports(hw_regs_t *hw, unsigned long base,
138 138
139 hw->irq = IRQ_AMIGA_PORTS; 139 hw->irq = IRQ_AMIGA_PORTS;
140 hw->ack_intr = ack_intr; 140 hw->ack_intr = ack_intr;
141
142 hw->chipset = ide_generic;
141} 143}
142 144
143 /* 145 /*
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c
index 9e449a0c623f..af11028b4794 100644
--- a/drivers/ide/legacy/falconide.c
+++ b/drivers/ide/legacy/falconide.c
@@ -81,6 +81,8 @@ static void __init falconide_setup_ports(hw_regs_t *hw)
81 81
82 hw->irq = IRQ_MFP_IDE; 82 hw->irq = IRQ_MFP_IDE;
83 hw->ack_intr = NULL; 83 hw->ack_intr = NULL;
84
85 hw->chipset = ide_generic;
84} 86}
85 87
86 /* 88 /*
diff --git a/drivers/ide/legacy/gayle.c b/drivers/ide/legacy/gayle.c
index a9c2593a898c..fed7d812761c 100644
--- a/drivers/ide/legacy/gayle.c
+++ b/drivers/ide/legacy/gayle.c
@@ -16,6 +16,7 @@
16#include <linux/ide.h> 16#include <linux/ide.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/zorro.h> 18#include <linux/zorro.h>
19#include <linux/module.h>
19 20
20#include <asm/setup.h> 21#include <asm/setup.h>
21#include <asm/amigahw.h> 22#include <asm/amigahw.h>
@@ -62,7 +63,10 @@
62 GAYLE_NUM_HWIFS-1) 63 GAYLE_NUM_HWIFS-1)
63#define GAYLE_HAS_CONTROL_REG (!ide_doubler) 64#define GAYLE_HAS_CONTROL_REG (!ide_doubler)
64#define GAYLE_IDEREG_SIZE (ide_doubler ? 0x1000 : 0x2000) 65#define GAYLE_IDEREG_SIZE (ide_doubler ? 0x1000 : 0x2000)
66
65int ide_doubler = 0; /* support IDE doublers? */ 67int ide_doubler = 0; /* support IDE doublers? */
68EXPORT_SYMBOL_GPL(ide_doubler);
69
66module_param_named(doubler, ide_doubler, bool, 0); 70module_param_named(doubler, ide_doubler, bool, 0);
67MODULE_PARM_DESC(doubler, "enable support for IDE doublers"); 71MODULE_PARM_DESC(doubler, "enable support for IDE doublers");
68#endif /* CONFIG_BLK_DEV_IDEDOUBLER */ 72#endif /* CONFIG_BLK_DEV_IDEDOUBLER */
@@ -112,6 +116,8 @@ static void __init gayle_setup_ports(hw_regs_t *hw, unsigned long base,
112 116
113 hw->irq = IRQ_AMIGA_PORTS; 117 hw->irq = IRQ_AMIGA_PORTS;
114 hw->ack_intr = ack_intr; 118 hw->ack_intr = ack_intr;
119
120 hw->chipset = ide_generic;
115} 121}
116 122
117 /* 123 /*
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index aa2ea3deac85..f633b6b3c7f3 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -135,13 +135,17 @@ static void ide_detach(struct pcmcia_device *link)
135{ 135{
136 ide_info_t *info = link->priv; 136 ide_info_t *info = link->priv;
137 ide_hwif_t *hwif = info->hwif; 137 ide_hwif_t *hwif = info->hwif;
138 unsigned long data_addr, ctl_addr;
138 139
139 DEBUG(0, "ide_detach(0x%p)\n", link); 140 DEBUG(0, "ide_detach(0x%p)\n", link);
140 141
142 data_addr = hwif->io_ports.data_addr;
143 ctl_addr = hwif->io_ports.ctl_addr;
144
141 ide_release(link); 145 ide_release(link);
142 146
143 release_region(hwif->io_ports.ctl_addr, 1); 147 release_region(ctl_addr, 1);
144 release_region(hwif->io_ports.data_addr, 8); 148 release_region(data_addr, 8);
145 149
146 kfree(info); 150 kfree(info);
147} /* ide_detach */ 151} /* ide_detach */
@@ -194,6 +198,16 @@ static ide_hwif_t *idecs_register(unsigned long io, unsigned long ctl,
194 if (hwif->present) 198 if (hwif->present)
195 return hwif; 199 return hwif;
196 200
201 /* retry registration in case device is still spinning up */
202 for (i = 0; i < 10; i++) {
203 msleep(100);
204 ide_port_scan(hwif);
205 if (hwif->present)
206 return hwif;
207 }
208
209 return hwif;
210
197out_release: 211out_release:
198 release_region(ctl, 1); 212 release_region(ctl, 1);
199 release_region(io, 8); 213 release_region(io, 8);
@@ -222,7 +236,7 @@ static int ide_config(struct pcmcia_device *link)
222 cistpl_cftable_entry_t dflt; 236 cistpl_cftable_entry_t dflt;
223 } *stk = NULL; 237 } *stk = NULL;
224 cistpl_cftable_entry_t *cfg; 238 cistpl_cftable_entry_t *cfg;
225 int i, pass, last_ret = 0, last_fn = 0, is_kme = 0; 239 int pass, last_ret = 0, last_fn = 0, is_kme = 0;
226 unsigned long io_base, ctl_base; 240 unsigned long io_base, ctl_base;
227 ide_hwif_t *hwif; 241 ide_hwif_t *hwif;
228 242
@@ -319,30 +333,15 @@ static int ide_config(struct pcmcia_device *link)
319 if (is_kme) 333 if (is_kme)
320 outb(0x81, ctl_base+1); 334 outb(0x81, ctl_base+1);
321 335
322 /* retry registration in case device is still spinning up */ 336 hwif = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link);
323 for (i = 0; i < 10; i++) { 337 if (hwif == NULL && link->io.NumPorts1 == 0x20) {
324 hwif = idecs_register(io_base, ctl_base, link->irq.AssignedIRQ, link);
325 if (hwif)
326 break;
327 if (link->io.NumPorts1 == 0x20) {
328 outb(0x02, ctl_base + 0x10); 338 outb(0x02, ctl_base + 0x10);
329 hwif = idecs_register(io_base + 0x10, ctl_base + 0x10, 339 hwif = idecs_register(io_base + 0x10, ctl_base + 0x10,
330 link->irq.AssignedIRQ, link); 340 link->irq.AssignedIRQ, link);
331 if (hwif) {
332 io_base += 0x10;
333 ctl_base += 0x10;
334 break;
335 }
336 }
337 msleep(100);
338 } 341 }
339 342
340 if (hwif == NULL) { 343 if (hwif == NULL)
341 printk(KERN_NOTICE "ide-cs: ide_register() at 0x%3lx & 0x%3lx"
342 ", irq %u failed\n", io_base, ctl_base,
343 link->irq.AssignedIRQ);
344 goto failed; 344 goto failed;
345 }
346 345
347 info->ndev = 1; 346 info->ndev = 1;
348 sprintf(info->node.dev_name, "hd%c", 'a' + hwif->index * 2); 347 sprintf(info->node.dev_name, "hd%c", 'a' + hwif->index * 2);
diff --git a/drivers/ide/legacy/macide.c b/drivers/ide/legacy/macide.c
index 1f527bbf8d96..2e84290d0bcc 100644
--- a/drivers/ide/legacy/macide.c
+++ b/drivers/ide/legacy/macide.c
@@ -78,6 +78,8 @@ static void __init macide_setup_ports(hw_regs_t *hw, unsigned long base,
78 78
79 hw->irq = irq; 79 hw->irq = irq;
80 hw->ack_intr = ack_intr; 80 hw->ack_intr = ack_intr;
81
82 hw->chipset = ide_generic;
81} 83}
82 84
83static const char *mac_ide_name[] = 85static const char *mac_ide_name[] =
@@ -95,6 +97,9 @@ static int __init macide_init(void)
95 int irq; 97 int irq;
96 hw_regs_t hw; 98 hw_regs_t hw;
97 99
100 if (!MACH_IS_MAC)
101 return -ENODEV;
102
98 switch (macintosh_config->ide_type) { 103 switch (macintosh_config->ide_type) {
99 case MAC_IDE_QUADRA: 104 case MAC_IDE_QUADRA:
100 base = IDE_BASE; 105 base = IDE_BASE;
diff --git a/drivers/ide/legacy/q40ide.c b/drivers/ide/legacy/q40ide.c
index 6f535d00e638..8ff6e2d20834 100644
--- a/drivers/ide/legacy/q40ide.c
+++ b/drivers/ide/legacy/q40ide.c
@@ -70,6 +70,8 @@ static void q40_ide_setup_ports(hw_regs_t *hw, unsigned long base,
70 70
71 hw->irq = irq; 71 hw->irq = irq;
72 hw->ack_intr = ack_intr; 72 hw->ack_intr = ack_intr;
73
74 hw->chipset = ide_generic;
73} 75}
74 76
75static void q40ide_input_data(ide_drive_t *drive, struct request *rq, 77static void q40ide_input_data(ide_drive_t *drive, struct request *rq,