aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/qd65xx.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2009-03-31 14:15:32 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2009-03-31 14:15:32 -0400
commitabb596b25edac1ec1acc4ef53df190771661c3d2 (patch)
treed20ea24960358ce03e0f27eefd2e6911afd1309c /drivers/ide/qd65xx.c
parent0f861e8c47ede537a8ad280c61d5d00d541f04db (diff)
ide: turn selectproc() method into dev_select() method (take 5)
Turn selectproc() method into dev_select() method by teaching it to write to the device register and moving it from 'struct ide_port_ops' to 'struct ide_tp_ops'. Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: benh@kernel.crashing.org Cc: petkovbb@gmail.com [bart: add ->dev_select to at91_ide.c and tx4939.c (__BIG_ENDIAN case)] Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
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,