aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/qd65xx.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/qd65xx.c')
-rw-r--r--drivers/ide/qd65xx.c21
1 files changed, 18 insertions, 3 deletions
diff --git a/drivers/ide/qd65xx.c b/drivers/ide/qd65xx.c
index 08c4fa35e9b1..c9a134986891 100644
--- a/drivers/ide/qd65xx.c
+++ b/drivers/ide/qd65xx.c
@@ -90,13 +90,15 @@ static int timings[4]={-1,-1,-1,-1}; /* stores current timing for each timer */
90 * This routine is invoked to prepare for access to a given drive. 90 * This routine is invoked to prepare for access to a given drive.
91 */ 91 */
92 92
93static void qd65xx_select(ide_drive_t *drive) 93static void qd65xx_dev_select(ide_drive_t *drive)
94{ 94{
95 u8 index = (( (QD_TIMREG(drive)) & 0x80 ) >> 7) | 95 u8 index = (( (QD_TIMREG(drive)) & 0x80 ) >> 7) |
96 (QD_TIMREG(drive) & 0x02); 96 (QD_TIMREG(drive) & 0x02);
97 97
98 if (timings[index] != QD_TIMING(drive)) 98 if (timings[index] != QD_TIMING(drive))
99 outb(timings[index] = QD_TIMING(drive), QD_TIMREG(drive)); 99 outb(timings[index] = QD_TIMING(drive), QD_TIMREG(drive));
100
101 outb(drive->select | ATA_DEVICE_OBS, drive->hwif->io_ports.device_addr);
100} 102}
101 103
102/* 104/*
@@ -309,20 +311,33 @@ static void __init qd6580_init_dev(ide_drive_t *drive)
309 drive->drive_data = (drive->dn & 1) ? t2 : t1; 311 drive->drive_data = (drive->dn & 1) ? t2 : t1;
310} 312}
311 313
314static const struct ide_tp_ops qd65xx_tp_ops = {
315 .exec_command = ide_exec_command,
316 .read_status = ide_read_status,
317 .read_altstatus = ide_read_altstatus,
318 .write_devctl = ide_write_devctl,
319
320 .dev_select = qd65xx_dev_select,
321 .tf_load = ide_tf_load,
322 .tf_read = ide_tf_read,
323
324 .input_data = ide_input_data,
325 .output_data = ide_output_data,
326};
327
312static const struct ide_port_ops qd6500_port_ops = { 328static const struct ide_port_ops qd6500_port_ops = {
313 .init_dev = qd6500_init_dev, 329 .init_dev = qd6500_init_dev,
314 .set_pio_mode = qd6500_set_pio_mode, 330 .set_pio_mode = qd6500_set_pio_mode,
315 .selectproc = qd65xx_select,
316}; 331};
317 332
318static const struct ide_port_ops qd6580_port_ops = { 333static const struct ide_port_ops qd6580_port_ops = {
319 .init_dev = qd6580_init_dev, 334 .init_dev = qd6580_init_dev,
320 .set_pio_mode = qd6580_set_pio_mode, 335 .set_pio_mode = qd6580_set_pio_mode,
321 .selectproc = qd65xx_select,
322}; 336};
323 337
324static const struct ide_port_info qd65xx_port_info __initdata = { 338static const struct ide_port_info qd65xx_port_info __initdata = {
325 .name = DRV_NAME, 339 .name = DRV_NAME,
340 .tp_ops = &qd65xx_tp_ops,
326 .chipset = ide_qd65xx, 341 .chipset = ide_qd65xx,
327 .host_flags = IDE_HFLAG_IO_32BIT | 342 .host_flags = IDE_HFLAG_IO_32BIT |
328 IDE_HFLAG_NO_DMA, 343 IDE_HFLAG_NO_DMA,