]> err.no Git - linux-2.6/blobdiff - drivers/ide/arm/bast-ide.c
pcmcia ide kingston compactflash's have a new manufacturer id
[linux-2.6] / drivers / ide / arm / bast-ide.c
index ec46c44b061cfaa27342ce31e03ef7a2b9c2f9e4..8e8c28104b4543cd0c78ef4b57d728e41010034b 100644 (file)
@@ -21,6 +21,8 @@
 #include <asm/arch/bast-map.h>
 #include <asm/arch/bast-irq.h>
 
+#define DRV_NAME "bast-ide"
+
 static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
 {
        ide_hwif_t *hwif;
@@ -33,27 +35,24 @@ static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
        base += BAST_IDE_CS;
        aux  += BAST_IDE_CS;
 
-       for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) {
-               hw.io_ports[i] = (unsigned long)base;
+       for (i = 0; i <= 7; i++) {
+               hw.io_ports_array[i] = (unsigned long)base;
                base += 0x20;
        }
 
-       hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
+       hw.io_ports.ctl_addr = aux + (6 * 0x20);
        hw.irq = irq;
+       hw.chipset = ide_generic;
 
-       hwif = ide_find_port(hw.io_ports[IDE_DATA_OFFSET]);
+       hwif = ide_find_port();
        if (hwif == NULL)
                goto out;
 
        i = hwif->index;
 
-       if (hwif->present)
-               ide_unregister(i);
-       else
-               ide_init_port_data(hwif, i);
-
+       ide_init_port_data(hwif, i);
        ide_init_port_hw(hwif, &hw);
-       hwif->quirkproc = NULL;
+       hwif->port_ops = NULL;
 
        idx[0] = i;
 
@@ -64,6 +63,8 @@ out:
 
 static int __init bastide_init(void)
 {
+       unsigned long base = BAST_VA_IDEPRI + BAST_IDE_CS;
+
        /* we can treat the VR1000 and the BAST the same */
 
        if (!(machine_is_bast() || machine_is_vr1000()))
@@ -71,6 +72,11 @@ static int __init bastide_init(void)
 
        printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n");
 
+       if (!request_mem_region(base, 0x400000, DRV_NAME)) {
+               printk(KERN_ERR "%s: resources busy\n", DRV_NAME);
+               return -EBUSY;
+       }
+
        bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0);
        bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1);