aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/tx4938ide.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/tx4938ide.c')
-rw-r--r--drivers/ide/tx4938ide.c41
1 files changed, 12 insertions, 29 deletions
diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c
index 657a61890b1c..4cb79c4c2604 100644
--- a/drivers/ide/tx4938ide.c
+++ b/drivers/ide/tx4938ide.c
@@ -92,13 +92,6 @@ static void tx4938ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd)
92 if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED) 92 if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED)
93 HIHI = 0xFF; 93 HIHI = 0xFF;
94 94
95 if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) {
96 u16 data = (tf->hob_data << 8) | tf->data;
97
98 /* no endian swap */
99 __raw_writew(data, (void __iomem *)io_ports->data_addr);
100 }
101
102 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) 95 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE)
103 tx4938ide_outb(tf->hob_feature, io_ports->feature_addr); 96 tx4938ide_outb(tf->hob_feature, io_ports->feature_addr);
104 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_NSECT) 97 if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_NSECT)
@@ -132,20 +125,11 @@ static void tx4938ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
132 struct ide_io_ports *io_ports = &hwif->io_ports; 125 struct ide_io_ports *io_ports = &hwif->io_ports;
133 struct ide_taskfile *tf = &cmd->tf; 126 struct ide_taskfile *tf = &cmd->tf;
134 127
135 if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) {
136 u16 data;
137
138 /* no endian swap */
139 data = __raw_readw((void __iomem *)io_ports->data_addr);
140 tf->data = data & 0xff;
141 tf->hob_data = (data >> 8) & 0xff;
142 }
143
144 /* be sure we're looking at the low order bits */ 128 /* be sure we're looking at the low order bits */
145 tx4938ide_outb(ATA_DEVCTL_OBS & ~0x80, io_ports->ctl_addr); 129 tx4938ide_outb(ATA_DEVCTL_OBS, io_ports->ctl_addr);
146 130
147 if (cmd->tf_flags & IDE_TFLAG_IN_FEATURE) 131 if (cmd->tf_flags & IDE_TFLAG_IN_ERROR)
148 tf->feature = tx4938ide_inb(io_ports->feature_addr); 132 tf->error = tx4938ide_inb(io_ports->feature_addr);
149 if (cmd->tf_flags & IDE_TFLAG_IN_NSECT) 133 if (cmd->tf_flags & IDE_TFLAG_IN_NSECT)
150 tf->nsect = tx4938ide_inb(io_ports->nsect_addr); 134 tf->nsect = tx4938ide_inb(io_ports->nsect_addr);
151 if (cmd->tf_flags & IDE_TFLAG_IN_LBAL) 135 if (cmd->tf_flags & IDE_TFLAG_IN_LBAL)
@@ -158,19 +142,18 @@ static void tx4938ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd)
158 tf->device = tx4938ide_inb(io_ports->device_addr); 142 tf->device = tx4938ide_inb(io_ports->device_addr);
159 143
160 if (cmd->tf_flags & IDE_TFLAG_LBA48) { 144 if (cmd->tf_flags & IDE_TFLAG_LBA48) {
161 tx4938ide_outb(ATA_DEVCTL_OBS | 0x80, io_ports->ctl_addr); 145 tx4938ide_outb(ATA_HOB | ATA_DEVCTL_OBS, io_ports->ctl_addr);
162 146
163 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_FEATURE) 147 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_ERROR)
164 tf->hob_feature = 148 tf->hob_error = tx4938ide_inb(io_ports->feature_addr);
165 tx4938ide_inb(io_ports->feature_addr);
166 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT) 149 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_NSECT)
167 tf->hob_nsect = tx4938ide_inb(io_ports->nsect_addr); 150 tf->hob_nsect = tx4938ide_inb(io_ports->nsect_addr);
168 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL) 151 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAL)
169 tf->hob_lbal = tx4938ide_inb(io_ports->lbal_addr); 152 tf->hob_lbal = tx4938ide_inb(io_ports->lbal_addr);
170 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM) 153 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAM)
171 tf->hob_lbam = tx4938ide_inb(io_ports->lbam_addr); 154 tf->hob_lbam = tx4938ide_inb(io_ports->lbam_addr);
172 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH) 155 if (cmd->tf_flags & IDE_TFLAG_IN_HOB_LBAH)
173 tf->hob_lbah = tx4938ide_inb(io_ports->lbah_addr); 156 tf->hob_lbah = tx4938ide_inb(io_ports->lbah_addr);
174 } 157 }
175} 158}
176 159
@@ -204,9 +187,9 @@ static const struct ide_tp_ops tx4938ide_tp_ops = {
204 .exec_command = ide_exec_command, 187 .exec_command = ide_exec_command,
205 .read_status = ide_read_status, 188 .read_status = ide_read_status,
206 .read_altstatus = ide_read_altstatus, 189 .read_altstatus = ide_read_altstatus,
190 .write_devctl = ide_write_devctl,
207 191
208 .set_irq = ide_set_irq, 192 .dev_select = ide_dev_select,
209
210 .tf_load = tx4938ide_tf_load, 193 .tf_load = tx4938ide_tf_load,
211 .tf_read = tx4938ide_tf_read, 194 .tf_read = tx4938ide_tf_read,
212 195