aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy')
-rw-r--r--drivers/ide/legacy/Makefile1
-rw-r--r--drivers/ide/legacy/ali14xx.c12
-rw-r--r--drivers/ide/legacy/dtc2278.c12
-rw-r--r--drivers/ide/legacy/ht6560b.c25
-rw-r--r--drivers/ide/legacy/ide-4drives.c50
-rw-r--r--drivers/ide/legacy/ide-cs.c8
-rw-r--r--drivers/ide/legacy/ide_platform.c2
-rw-r--r--drivers/ide/legacy/qd65xx.c19
-rw-r--r--drivers/ide/legacy/umc8672.c12
9 files changed, 128 insertions, 13 deletions
diff --git a/drivers/ide/legacy/Makefile b/drivers/ide/legacy/Makefile
index 7043ec7d1e0..6939329f89e 100644
--- a/drivers/ide/legacy/Makefile
+++ b/drivers/ide/legacy/Makefile
@@ -6,6 +6,7 @@ obj-$(CONFIG_BLK_DEV_UMC8672) += umc8672.o
6obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o 6obj-$(CONFIG_BLK_DEV_DTC2278) += dtc2278.o
7obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o 7obj-$(CONFIG_BLK_DEV_HT6560B) += ht6560b.o
8obj-$(CONFIG_BLK_DEV_QD65XX) += qd65xx.o 8obj-$(CONFIG_BLK_DEV_QD65XX) += qd65xx.o
9obj-$(CONFIG_BLK_DEV_4DRIVES) += ide-4drives.o
9 10
10obj-$(CONFIG_BLK_DEV_GAYLE) += gayle.o 11obj-$(CONFIG_BLK_DEV_GAYLE) += gayle.o
11obj-$(CONFIG_BLK_DEV_FALCON_IDE) += falconide.o 12obj-$(CONFIG_BLK_DEV_FALCON_IDE) += falconide.o
diff --git a/drivers/ide/legacy/ali14xx.c b/drivers/ide/legacy/ali14xx.c
index d4d1a6bea59..bc8b1f8de61 100644
--- a/drivers/ide/legacy/ali14xx.c
+++ b/drivers/ide/legacy/ali14xx.c
@@ -200,6 +200,7 @@ static const struct ide_port_info ali14xx_port_info = {
200static int __init ali14xx_probe(void) 200static int __init ali14xx_probe(void)
201{ 201{
202 static u8 idx[4] = { 0, 1, 0xff, 0xff }; 202 static u8 idx[4] = { 0, 1, 0xff, 0xff };
203 hw_regs_t hw[2];
203 204
204 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n", 205 printk(KERN_DEBUG "ali14xx: base=0x%03x, regOn=0x%02x.\n",
205 basePort, regOn); 206 basePort, regOn);
@@ -210,6 +211,17 @@ static int __init ali14xx_probe(void)
210 return 1; 211 return 1;
211 } 212 }
212 213
214 memset(&hw, 0, sizeof(hw));
215
216 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
217 hw[0].irq = 14;
218
219 ide_std_init_ports(&hw[1], 0x170, 0x376);
220 hw[1].irq = 15;
221
222 ide_init_port_hw(&ide_hwifs[0], &hw[0]);
223 ide_init_port_hw(&ide_hwifs[1], &hw[1]);
224
213 ide_hwifs[0].set_pio_mode = &ali14xx_set_pio_mode; 225 ide_hwifs[0].set_pio_mode = &ali14xx_set_pio_mode;
214 ide_hwifs[1].set_pio_mode = &ali14xx_set_pio_mode; 226 ide_hwifs[1].set_pio_mode = &ali14xx_set_pio_mode;
215 227
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c
index 73396f70f2b..5f69cd2ea6f 100644
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -103,6 +103,7 @@ static int __init dtc2278_probe(void)
103 unsigned long flags; 103 unsigned long flags;
104 ide_hwif_t *hwif, *mate; 104 ide_hwif_t *hwif, *mate;
105 static u8 idx[4] = { 0, 1, 0xff, 0xff }; 105 static u8 idx[4] = { 0, 1, 0xff, 0xff };
106 hw_regs_t hw[2];
106 107
107 hwif = &ide_hwifs[0]; 108 hwif = &ide_hwifs[0];
108 mate = &ide_hwifs[1]; 109 mate = &ide_hwifs[1];
@@ -128,6 +129,17 @@ static int __init dtc2278_probe(void)
128#endif 129#endif
129 local_irq_restore(flags); 130 local_irq_restore(flags);
130 131
132 memset(&hw, 0, sizeof(hw));
133
134 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
135 hw[0].irq = 14;
136
137 ide_std_init_ports(&hw[1], 0x170, 0x376);
138 hw[1].irq = 15;
139
140 ide_init_port_hw(hwif, &hw[0]);
141 ide_init_port_hw(mate, &hw[1]);
142
131 hwif->set_pio_mode = &dtc2278_set_pio_mode; 143 hwif->set_pio_mode = &dtc2278_set_pio_mode;
132 144
133 ide_device_add(idx, &dtc2278_port_info); 145 ide_device_add(idx, &dtc2278_port_info);
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 78ca68e60f9..88fe9070c9c 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -82,7 +82,7 @@
82 * out how they setup those cycle time interfacing values, as they at Holtek 82 * out how they setup those cycle time interfacing values, as they at Holtek
83 * call them. IDESETUP.COM that is supplied with the drivers figures out 83 * call them. IDESETUP.COM that is supplied with the drivers figures out
84 * optimal values and fetches those values to drivers. I found out that 84 * optimal values and fetches those values to drivers. I found out that
85 * they use IDE_SELECT_REG to fetch timings to the ide board right after 85 * they use Select register to fetch timings to the ide board right after
86 * interface switching. After that it was quite easy to add code to 86 * interface switching. After that it was quite easy to add code to
87 * ht6560b.c. 87 * ht6560b.c.
88 * 88 *
@@ -127,6 +127,7 @@
127 */ 127 */
128static void ht6560b_selectproc (ide_drive_t *drive) 128static void ht6560b_selectproc (ide_drive_t *drive)
129{ 129{
130 ide_hwif_t *hwif = drive->hwif;
130 unsigned long flags; 131 unsigned long flags;
131 static u8 current_select = 0; 132 static u8 current_select = 0;
132 static u8 current_timing = 0; 133 static u8 current_timing = 0;
@@ -155,8 +156,8 @@ static void ht6560b_selectproc (ide_drive_t *drive)
155 /* 156 /*
156 * Set timing for this drive: 157 * Set timing for this drive:
157 */ 158 */
158 outb(timing, IDE_SELECT_REG); 159 outb(timing, hwif->io_ports[IDE_SELECT_OFFSET]);
159 (void)inb(IDE_STATUS_REG); 160 (void)inb(hwif->io_ports[IDE_STATUS_OFFSET]);
160#ifdef DEBUG 161#ifdef DEBUG
161 printk("ht6560b: %s: select=%#x timing=%#x\n", 162 printk("ht6560b: %s: select=%#x timing=%#x\n",
162 drive->name, select, timing); 163 drive->name, select, timing);
@@ -193,9 +194,9 @@ static int __init try_to_init_ht6560b(void)
193 * Ht6560b autodetected 194 * Ht6560b autodetected
194 */ 195 */
195 outb(HT_CONFIG_DEFAULT, HT_CONFIG_PORT); 196 outb(HT_CONFIG_DEFAULT, HT_CONFIG_PORT);
196 outb(HT_TIMING_DEFAULT, 0x1f6); /* IDE_SELECT_REG */ 197 outb(HT_TIMING_DEFAULT, 0x1f6); /* Select register */
197 (void) inb(0x1f7); /* IDE_STATUS_REG */ 198 (void)inb(0x1f7); /* Status register */
198 199
199 printk("ht6560b " HT6560B_VERSION 200 printk("ht6560b " HT6560B_VERSION
200 ": chipset detected and initialized" 201 ": chipset detected and initialized"
201#ifdef DEBUG 202#ifdef DEBUG
@@ -339,6 +340,7 @@ static int __init ht6560b_init(void)
339{ 340{
340 ide_hwif_t *hwif, *mate; 341 ide_hwif_t *hwif, *mate;
341 static u8 idx[4] = { 0, 1, 0xff, 0xff }; 342 static u8 idx[4] = { 0, 1, 0xff, 0xff };
343 hw_regs_t hw[2];
342 344
343 if (probe_ht6560b == 0) 345 if (probe_ht6560b == 0)
344 return -ENODEV; 346 return -ENODEV;
@@ -357,6 +359,17 @@ static int __init ht6560b_init(void)
357 goto release_region; 359 goto release_region;
358 } 360 }
359 361
362 memset(&hw, 0, sizeof(hw));
363
364 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
365 hw[0].irq = 14;
366
367 ide_std_init_ports(&hw[1], 0x170, 0x376);
368 hw[1].irq = 15;
369
370 ide_init_port_hw(hwif, &hw[0]);
371 ide_init_port_hw(mate, &hw[1]);
372
360 hwif->selectproc = &ht6560b_selectproc; 373 hwif->selectproc = &ht6560b_selectproc;
361 hwif->set_pio_mode = &ht6560b_set_pio_mode; 374 hwif->set_pio_mode = &ht6560b_set_pio_mode;
362 375
diff --git a/drivers/ide/legacy/ide-4drives.c b/drivers/ide/legacy/ide-4drives.c
new file mode 100644
index 00000000000..ecd7f355355
--- /dev/null
+++ b/drivers/ide/legacy/ide-4drives.c
@@ -0,0 +1,50 @@
1
2#include <linux/kernel.h>
3#include <linux/init.h>
4#include <linux/module.h>
5#include <linux/ide.h>
6
7int probe_4drives = 0;
8
9module_param_named(probe, probe_4drives, bool, 0);
10MODULE_PARM_DESC(probe, "probe for generic IDE chipset with 4 drives/port");
11
12static int __init ide_4drives_init(void)
13{
14 ide_hwif_t *hwif, *mate;
15 u8 idx[4] = { 0, 1, 0xff, 0xff };
16 hw_regs_t hw;
17
18 if (probe_4drives == 0)
19 return -ENODEV;
20
21 hwif = &ide_hwifs[0];
22 mate = &ide_hwifs[1];
23
24 memset(&hw, 0, sizeof(hw));
25
26 ide_std_init_ports(&hw, 0x1f0, 0x3f6);
27 hw.irq = 14;
28 hw.chipset = ide_4drives;
29
30 ide_init_port_hw(hwif, &hw);
31 ide_init_port_hw(mate, &hw);
32
33 mate->drives[0].select.all ^= 0x20;
34 mate->drives[1].select.all ^= 0x20;
35
36 hwif->mate = mate;
37 mate->mate = hwif;
38
39 hwif->serialized = mate->serialized = 1;
40
41 ide_device_add(idx, NULL);
42
43 return 0;
44}
45
46module_init(ide_4drives_init);
47
48MODULE_AUTHOR("Bartlomiej Zolnierkiewicz");
49MODULE_DESCRIPTION("generic IDE chipset with 4 drives/port support");
50MODULE_LICENSE("GPL");
diff --git a/drivers/ide/legacy/ide-cs.c b/drivers/ide/legacy/ide-cs.c
index 15ccf6944ae..9a23b94f293 100644
--- a/drivers/ide/legacy/ide-cs.c
+++ b/drivers/ide/legacy/ide-cs.c
@@ -156,15 +156,15 @@ static int idecs_register(unsigned long io, unsigned long ctl, unsigned long irq
156 hw.chipset = ide_pci; 156 hw.chipset = ide_pci;
157 hw.dev = &handle->dev; 157 hw.dev = &handle->dev;
158 158
159 hwif = ide_deprecated_find_port(hw.io_ports[IDE_DATA_OFFSET]); 159 hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
160 if (hwif == NULL) 160 if (hwif == NULL)
161 return -1; 161 return -1;
162 162
163 i = hwif->index; 163 i = hwif->index;
164 164
165 if (hwif->present) 165 if (hwif->present)
166 ide_unregister(i, 0, 0); 166 ide_unregister(i);
167 else if (!hwif->hold) 167 else
168 ide_init_port_data(hwif, i); 168 ide_init_port_data(hwif, i);
169 169
170 ide_init_port_hw(hwif, &hw); 170 ide_init_port_hw(hwif, &hw);
@@ -360,7 +360,7 @@ void ide_release(struct pcmcia_device *link)
360 if (info->ndev) { 360 if (info->ndev) {
361 /* FIXME: if this fails we need to queue the cleanup somehow 361 /* FIXME: if this fails we need to queue the cleanup somehow
362 -- need to investigate the required PCMCIA magic */ 362 -- need to investigate the required PCMCIA magic */
363 ide_unregister(info->hd, 0, 0); 363 ide_unregister(info->hd);
364 } 364 }
365 info->ndev = 0; 365 info->ndev = 0;
366 366
diff --git a/drivers/ide/legacy/ide_platform.c b/drivers/ide/legacy/ide_platform.c
index 688fcae1748..249651e2da4 100644
--- a/drivers/ide/legacy/ide_platform.c
+++ b/drivers/ide/legacy/ide_platform.c
@@ -122,7 +122,7 @@ static int __devexit plat_ide_remove(struct platform_device *pdev)
122{ 122{
123 ide_hwif_t *hwif = pdev->dev.driver_data; 123 ide_hwif_t *hwif = pdev->dev.driver_data;
124 124
125 ide_unregister(hwif->index, 0, 0); 125 ide_unregister(hwif->index);
126 126
127 return 0; 127 return 0;
128} 128}
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index 2f4f47ad602..7016bdf4fcc 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -352,9 +352,9 @@ static const struct ide_port_info qd65xx_port_info __initdata = {
352static int __init qd_probe(int base) 352static int __init qd_probe(int base)
353{ 353{
354 ide_hwif_t *hwif; 354 ide_hwif_t *hwif;
355 u8 config, unit;
355 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 356 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
356 u8 config; 357 hw_regs_t hw[2];
357 u8 unit;
358 358
359 config = inb(QD_CONFIG_PORT); 359 config = inb(QD_CONFIG_PORT);
360 360
@@ -363,6 +363,14 @@ static int __init qd_probe(int base)
363 363
364 unit = ! (config & QD_CONFIG_IDE_BASEPORT); 364 unit = ! (config & QD_CONFIG_IDE_BASEPORT);
365 365
366 memset(&hw, 0, sizeof(hw));
367
368 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
369 hw[0].irq = 14;
370
371 ide_std_init_ports(&hw[1], 0x170, 0x376);
372 hw[1].irq = 15;
373
366 if ((config & 0xf0) == QD_CONFIG_QD6500) { 374 if ((config & 0xf0) == QD_CONFIG_QD6500) {
367 375
368 if (qd_testreg(base)) return 1; /* bad register */ 376 if (qd_testreg(base)) return 1; /* bad register */
@@ -379,6 +387,8 @@ static int __init qd_probe(int base)
379 return 1; 387 return 1;
380 } 388 }
381 389
390 ide_init_port_hw(hwif, &hw[unit]);
391
382 qd_setup(hwif, base, config); 392 qd_setup(hwif, base, config);
383 393
384 hwif->port_init_devs = qd6500_port_init_devs; 394 hwif->port_init_devs = qd6500_port_init_devs;
@@ -416,6 +426,8 @@ static int __init qd_probe(int base)
416 printk(KERN_INFO "%s: qd6580: single IDE board\n", 426 printk(KERN_INFO "%s: qd6580: single IDE board\n",
417 hwif->name); 427 hwif->name);
418 428
429 ide_init_port_hw(hwif, &hw[unit]);
430
419 qd_setup(hwif, base, config | (control << 8)); 431 qd_setup(hwif, base, config | (control << 8));
420 432
421 hwif->port_init_devs = qd6580_port_init_devs; 433 hwif->port_init_devs = qd6580_port_init_devs;
@@ -435,6 +447,9 @@ static int __init qd_probe(int base)
435 printk(KERN_INFO "%s&%s: qd6580: dual IDE board\n", 447 printk(KERN_INFO "%s&%s: qd6580: dual IDE board\n",
436 hwif->name, mate->name); 448 hwif->name, mate->name);
437 449
450 ide_init_port_hw(hwif, &hw[0]);
451 ide_init_port_hw(mate, &hw[1]);
452
438 qd_setup(hwif, base, config | (control << 8)); 453 qd_setup(hwif, base, config | (control << 8));
439 454
440 hwif->port_init_devs = qd6580_port_init_devs; 455 hwif->port_init_devs = qd6580_port_init_devs;
diff --git a/drivers/ide/legacy/umc8672.c b/drivers/ide/legacy/umc8672.c
index 5696ba02600..bc1944811b9 100644
--- a/drivers/ide/legacy/umc8672.c
+++ b/drivers/ide/legacy/umc8672.c
@@ -130,6 +130,7 @@ static int __init umc8672_probe(void)
130{ 130{
131 unsigned long flags; 131 unsigned long flags;
132 static u8 idx[4] = { 0, 1, 0xff, 0xff }; 132 static u8 idx[4] = { 0, 1, 0xff, 0xff };
133 hw_regs_t hw[2];
133 134
134 if (!request_region(0x108, 2, "umc8672")) { 135 if (!request_region(0x108, 2, "umc8672")) {
135 printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n"); 136 printk(KERN_ERR "umc8672: ports 0x108-0x109 already in use.\n");
@@ -148,6 +149,17 @@ static int __init umc8672_probe(void)
148 umc_set_speeds (current_speeds); 149 umc_set_speeds (current_speeds);
149 local_irq_restore(flags); 150 local_irq_restore(flags);
150 151
152 memset(&hw, 0, sizeof(hw));
153
154 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
155 hw[0].irq = 14;
156
157 ide_std_init_ports(&hw[1], 0x170, 0x376);
158 hw[1].irq = 15;
159
160 ide_init_port_hw(&ide_hwifs[0], &hw[0]);
161 ide_init_port_hw(&ide_hwifs[1], &hw[1]);
162
151 ide_hwifs[0].set_pio_mode = &umc_set_pio_mode; 163 ide_hwifs[0].set_pio_mode = &umc_set_pio_mode;
152 ide_hwifs[1].set_pio_mode = &umc_set_pio_mode; 164 ide_hwifs[1].set_pio_mode = &umc_set_pio_mode;
153 165