]> err.no Git - linux-2.6/blobdiff - drivers/ide/legacy/ht6560b.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee1394...
[linux-2.6] / drivers / ide / legacy / ht6560b.c
index 78ca68e60f97e141dd9fc96806aa8d33bcaafb10..88fe9070c9c30668878ac79eb75853ab4cbe0392 100644 (file)
@@ -82,7 +82,7 @@
  * out how they setup those cycle time interfacing values, as they at Holtek
  * call them. IDESETUP.COM that is supplied with the drivers figures out
  * optimal values and fetches those values to drivers. I found out that
- * they use IDE_SELECT_REG to fetch timings to the ide board right after
+ * they use Select register to fetch timings to the ide board right after
  * interface switching. After that it was quite easy to add code to
  * ht6560b.c.
  *
  */
 static void ht6560b_selectproc (ide_drive_t *drive)
 {
+       ide_hwif_t *hwif = drive->hwif;
        unsigned long flags;
        static u8 current_select = 0;
        static u8 current_timing = 0;
@@ -155,8 +156,8 @@ static void ht6560b_selectproc (ide_drive_t *drive)
                /*
                 * Set timing for this drive:
                 */
-               outb(timing, IDE_SELECT_REG);
-               (void)inb(IDE_STATUS_REG);
+               outb(timing, hwif->io_ports[IDE_SELECT_OFFSET]);
+               (void)inb(hwif->io_ports[IDE_STATUS_OFFSET]);
 #ifdef DEBUG
                printk("ht6560b: %s: select=%#x timing=%#x\n",
                        drive->name, select, timing);
@@ -193,9 +194,9 @@ static int __init try_to_init_ht6560b(void)
         * Ht6560b autodetected
         */
        outb(HT_CONFIG_DEFAULT, HT_CONFIG_PORT);
-       outb(HT_TIMING_DEFAULT, 0x1f6);  /* IDE_SELECT_REG */
-       (void) inb(0x1f7);               /* IDE_STATUS_REG */
-       
+       outb(HT_TIMING_DEFAULT, 0x1f6); /* Select register */
+       (void)inb(0x1f7);               /* Status register */
+
        printk("ht6560b " HT6560B_VERSION
               ": chipset detected and initialized"
 #ifdef DEBUG
@@ -339,6 +340,7 @@ static int __init ht6560b_init(void)
 {
        ide_hwif_t *hwif, *mate;
        static u8 idx[4] = { 0, 1, 0xff, 0xff };
+       hw_regs_t hw[2];
 
        if (probe_ht6560b == 0)
                return -ENODEV;
@@ -357,6 +359,17 @@ static int __init ht6560b_init(void)
                goto release_region;
        }
 
+       memset(&hw, 0, sizeof(hw));
+
+       ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
+       hw[0].irq = 14;
+
+       ide_std_init_ports(&hw[1], 0x170, 0x376);
+       hw[1].irq = 15;
+
+       ide_init_port_hw(hwif, &hw[0]);
+       ide_init_port_hw(mate, &hw[1]);
+
        hwif->selectproc = &ht6560b_selectproc;
        hwif->set_pio_mode = &ht6560b_set_pio_mode;