]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ide/arm/bast-ide.c
ide-tape: remove pipelined mode tape control flags
[linux-2.6-omap-h63xx.git] / drivers / ide / arm / bast-ide.c
index 48db6167bb90f6005927590431ba56a231061cd3..d158f579bde23d7eb4786ab2c1077928bf131a46 100644 (file)
@@ -1,5 +1,4 @@
-/* linux/drivers/ide/arm/bast-ide.c
- *
+/*
  * Copyright (c) 2003-2004 Simtec Electronics
  *  Ben Dooks <ben@simtec.co.uk>
  *
 #include <asm/arch/bast-map.h>
 #include <asm/arch/bast-irq.h>
 
-/* list of registered interfaces */
-static ide_hwif_t *ifs[2];
+#define DRV_NAME "bast-ide"
 
-static int __init
-bastide_register(unsigned int base, unsigned int aux, int irq,
-                ide_hwif_t **hwif)
+static int __init bastide_register(unsigned int base, unsigned int aux, int irq)
 {
+       ide_hwif_t *hwif;
        hw_regs_t hw;
        int i;
+       u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
 
        memset(&hw, 0, sizeof(hw));
 
@@ -45,13 +43,31 @@ bastide_register(unsigned int base, unsigned int aux, int irq,
        hw.io_ports[IDE_CONTROL_OFFSET] = aux + (6 * 0x20);
        hw.irq = irq;
 
-       ide_register_hw(&hw, NULL, 0, hwif);
+       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_hw(hwif, &hw);
+       hwif->port_ops = NULL;
+
+       idx[0] = i;
 
+       ide_device_add(idx, NULL);
+out:
        return 0;
 }
 
 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()))
@@ -59,8 +75,14 @@ static int __init bastide_init(void)
 
        printk("BAST: IDE driver, (c) 2003-2004 Simtec Electronics\n");
 
-       bastide_register(BAST_VA_IDEPRI, BAST_VA_IDEPRIAUX, IRQ_IDE0, &ifs[0]);
-       bastide_register(BAST_VA_IDESEC, BAST_VA_IDESECAUX, IRQ_IDE1, &ifs[1]);
+       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);
+
        return 0;
 }