aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-taskfile.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:26 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-17 18:46:26 -0400
commit23579a2a170265aacf78069f4817a41c1d6e9323 (patch)
treea20db3f337b64b13e482a2cb2f41e03b13d52e66 /drivers/ide/ide-taskfile.c
parent7616c0ad2087c7d244b8985390c63059a6223c45 (diff)
ide: remove IDE_*_REG macros
* Add IDE_{ALTSTATUS,IREASON,BCOUNTL,BCOUNTH}_OFFSET defines. * Remove IDE_*_REG macros - this results in more readable and slightly smaller code. There should be no functional changes caused by this patch. Cc: Borislav Petkov <petkovbb@gmail.com> Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-taskfile.c')
-rw-r--r--drivers/ide/ide-taskfile.c29
1 files changed, 16 insertions, 13 deletions
diff --git a/drivers/ide/ide-taskfile.c b/drivers/ide/ide-taskfile.c
index 4c86a8d84b4c..155cc904f4eb 100644
--- a/drivers/ide/ide-taskfile.c
+++ b/drivers/ide/ide-taskfile.c
@@ -59,32 +59,34 @@ void ide_tf_load(ide_drive_t *drive, ide_task_t *task)
59 SELECT_MASK(drive, 0); 59 SELECT_MASK(drive, 0);
60 60
61 if (task->tf_flags & IDE_TFLAG_OUT_DATA) 61 if (task->tf_flags & IDE_TFLAG_OUT_DATA)
62 hwif->OUTW((tf->hob_data << 8) | tf->data, IDE_DATA_REG); 62 hwif->OUTW((tf->hob_data << 8) | tf->data,
63 hwif->io_ports[IDE_DATA_OFFSET]);
63 64
64 if (task->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) 65 if (task->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
65 hwif->OUTB(tf->hob_feature, IDE_FEATURE_REG); 66 hwif->OUTB(tf->hob_feature, hwif->io_ports[IDE_FEATURE_OFFSET]);
66 if (task->tf_flags & IDE_TFLAG_OUT_HOB_NSECT) 67 if (task->tf_flags & IDE_TFLAG_OUT_HOB_NSECT)
67 hwif->OUTB(tf->hob_nsect, IDE_NSECTOR_REG); 68 hwif->OUTB(tf->hob_nsect, hwif->io_ports[IDE_NSECTOR_OFFSET]);
68 if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAL) 69 if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAL)
69 hwif->OUTB(tf->hob_lbal, IDE_SECTOR_REG); 70 hwif->OUTB(tf->hob_lbal, hwif->io_ports[IDE_SECTOR_OFFSET]);
70 if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAM) 71 if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAM)
71 hwif->OUTB(tf->hob_lbam, IDE_LCYL_REG); 72 hwif->OUTB(tf->hob_lbam, hwif->io_ports[IDE_LCYL_OFFSET]);
72 if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAH) 73 if (task->tf_flags & IDE_TFLAG_OUT_HOB_LBAH)
73 hwif->OUTB(tf->hob_lbah, IDE_HCYL_REG); 74 hwif->OUTB(tf->hob_lbah, hwif->io_ports[IDE_HCYL_OFFSET]);
74 75
75 if (task->tf_flags & IDE_TFLAG_OUT_FEATURE) 76 if (task->tf_flags & IDE_TFLAG_OUT_FEATURE)
76 hwif->OUTB(tf->feature, IDE_FEATURE_REG); 77 hwif->OUTB(tf->feature, hwif->io_ports[IDE_FEATURE_OFFSET]);
77 if (task->tf_flags & IDE_TFLAG_OUT_NSECT) 78 if (task->tf_flags & IDE_TFLAG_OUT_NSECT)
78 hwif->OUTB(tf->nsect, IDE_NSECTOR_REG); 79 hwif->OUTB(tf->nsect, hwif->io_ports[IDE_NSECTOR_OFFSET]);
79 if (task->tf_flags & IDE_TFLAG_OUT_LBAL) 80 if (task->tf_flags & IDE_TFLAG_OUT_LBAL)
80 hwif->OUTB(tf->lbal, IDE_SECTOR_REG); 81 hwif->OUTB(tf->lbal, hwif->io_ports[IDE_SECTOR_OFFSET]);
81 if (task->tf_flags & IDE_TFLAG_OUT_LBAM) 82 if (task->tf_flags & IDE_TFLAG_OUT_LBAM)
82 hwif->OUTB(tf->lbam, IDE_LCYL_REG); 83 hwif->OUTB(tf->lbam, hwif->io_ports[IDE_LCYL_OFFSET]);
83 if (task->tf_flags & IDE_TFLAG_OUT_LBAH) 84 if (task->tf_flags & IDE_TFLAG_OUT_LBAH)
84 hwif->OUTB(tf->lbah, IDE_HCYL_REG); 85 hwif->OUTB(tf->lbah, hwif->io_ports[IDE_HCYL_OFFSET]);
85 86
86 if (task->tf_flags & IDE_TFLAG_OUT_DEVICE) 87 if (task->tf_flags & IDE_TFLAG_OUT_DEVICE)
87 hwif->OUTB((tf->device & HIHI) | drive->select.all, IDE_SELECT_REG); 88 hwif->OUTB((tf->device & HIHI) | drive->select.all,
89 hwif->io_ports[IDE_SELECT_OFFSET]);
88} 90}
89 91
90int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf) 92int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf)
@@ -152,7 +154,8 @@ ide_startstop_t do_rw_taskfile (ide_drive_t *drive, ide_task_t *task)
152 switch (task->data_phase) { 154 switch (task->data_phase) {
153 case TASKFILE_MULTI_OUT: 155 case TASKFILE_MULTI_OUT:
154 case TASKFILE_OUT: 156 case TASKFILE_OUT:
155 hwif->OUTBSYNC(drive, tf->command, IDE_COMMAND_REG); 157 hwif->OUTBSYNC(drive, tf->command,
158 hwif->io_ports[IDE_COMMAND_OFFSET]);
156 ndelay(400); /* FIXME */ 159 ndelay(400); /* FIXME */
157 return pre_task_out_intr(drive, task->rq); 160 return pre_task_out_intr(drive, task->rq);
158 case TASKFILE_MULTI_IN: 161 case TASKFILE_MULTI_IN: