aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/ht6560b.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy/ht6560b.c')
-rw-r--r--drivers/ide/legacy/ht6560b.c25
1 files changed, 19 insertions, 6 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 78ca68e60f97..88fe9070c9c3 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