diff options
author | Sergei Shtylyov <sshtylyov@ru.mvista.com> | 2009-03-31 14:15:31 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2009-03-31 14:15:31 -0400 |
commit | bac08cee93f9cb37b40ecfa8eaf1f6d8daf3909b (patch) | |
tree | e3a5a3dd993077d64e16699e866e37ad66d652c8 | |
parent | deae17fd5d147ae65e277905343b7ea578574d12 (diff) |
ide: call {in|out}put_data() methods from tf_{read|load}() methods (take 2)
Handle IDE_FTFLAG_{IN|OUT}_DATA flags in tf_{read|load}() methods by calling
{in|out}put_data() methods to transfer 2 bytes -- this will allow us to move
that handling out of those methods altogether...
Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
-rw-r--r-- | drivers/ide/at91_ide.c | 13 | ||||
-rw-r--r-- | drivers/ide/ide-h8300.c | 15 | ||||
-rw-r--r-- | drivers/ide/ide-io-std.c | 18 | ||||
-rw-r--r-- | drivers/ide/ns87415.c | 8 | ||||
-rw-r--r-- | drivers/ide/scc_pata.c | 16 | ||||
-rw-r--r-- | drivers/ide/tx4938ide.c | 15 | ||||
-rw-r--r-- | drivers/ide/tx4939ide.c | 15 |
7 files changed, 52 insertions, 48 deletions
diff --git a/drivers/ide/at91_ide.c b/drivers/ide/at91_ide.c index 9dce793d93b4..b7be66d600f8 100644 --- a/drivers/ide/at91_ide.c +++ b/drivers/ide/at91_ide.c | |||
@@ -196,9 +196,9 @@ static void at91_ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | |||
196 | HIHI = 0xFF; | 196 | HIHI = 0xFF; |
197 | 197 | ||
198 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { | 198 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { |
199 | u16 data = (tf->hob_data << 8) | tf->data; | 199 | u8 data[2] = { tf->data, tf->hob_data }; |
200 | 200 | ||
201 | at91_ide_output_data(drive, NULL, &data, 2); | 201 | at91_ide_output_data(drive, cmd, data, 2); |
202 | } | 202 | } |
203 | 203 | ||
204 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) | 204 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) |
@@ -234,11 +234,12 @@ static void at91_ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
234 | struct ide_taskfile *tf = &cmd->tf; | 234 | struct ide_taskfile *tf = &cmd->tf; |
235 | 235 | ||
236 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { | 236 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { |
237 | u16 data; | 237 | u8 data[2]; |
238 | 238 | ||
239 | at91_ide_input_data(drive, NULL, &data, 2); | 239 | at91_ide_input_data(drive, cmd, data, 2); |
240 | tf->data = data & 0xff; | 240 | |
241 | tf->hob_data = (data >> 8) & 0xff; | 241 | tf->data = data[0]; |
242 | tf->hob_data = data[1]; | ||
242 | } | 243 | } |
243 | 244 | ||
244 | /* be sure we're looking at the low order bits */ | 245 | /* be sure we're looking at the low order bits */ |
diff --git a/drivers/ide/ide-h8300.c b/drivers/ide/ide-h8300.c index 1d45cd5b6a1c..6cb1785d32e6 100644 --- a/drivers/ide/ide-h8300.c +++ b/drivers/ide/ide-h8300.c | |||
@@ -54,8 +54,11 @@ static void h8300_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | |||
54 | if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED) | 54 | if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED) |
55 | HIHI = 0xFF; | 55 | HIHI = 0xFF; |
56 | 56 | ||
57 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) | 57 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { |
58 | mm_outw((tf->hob_data << 8) | tf->data, io_ports->data_addr); | 58 | u8 data[2] = { tf->data, tf->hob_data }; |
59 | |||
60 | h8300_output_data(drive, cmd, data, 2); | ||
61 | } | ||
59 | 62 | ||
60 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) | 63 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) |
61 | outb(tf->hob_feature, io_ports->feature_addr); | 64 | outb(tf->hob_feature, io_ports->feature_addr); |
@@ -91,10 +94,12 @@ static void h8300_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
91 | struct ide_taskfile *tf = &cmd->tf; | 94 | struct ide_taskfile *tf = &cmd->tf; |
92 | 95 | ||
93 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { | 96 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { |
94 | u16 data = mm_inw(io_ports->data_addr); | 97 | u8 data[2]; |
98 | |||
99 | h8300_input_data(drive, cmd, data, 2); | ||
95 | 100 | ||
96 | tf->data = data & 0xff; | 101 | tf->data = data[0]; |
97 | tf->hob_data = (data >> 8) & 0xff; | 102 | tf->hob_data = data[1]; |
98 | } | 103 | } |
99 | 104 | ||
100 | /* be sure we're looking at the low order bits */ | 105 | /* be sure we're looking at the low order bits */ |
diff --git a/drivers/ide/ide-io-std.c b/drivers/ide/ide-io-std.c index 96a537da8925..f06940df255e 100644 --- a/drivers/ide/ide-io-std.c +++ b/drivers/ide/ide-io-std.c | |||
@@ -91,12 +91,9 @@ void ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | |||
91 | HIHI = 0xFF; | 91 | HIHI = 0xFF; |
92 | 92 | ||
93 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { | 93 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { |
94 | u16 data = (tf->hob_data << 8) | tf->data; | 94 | u8 data[2] = { tf->data, tf->hob_data }; |
95 | 95 | ||
96 | if (mmio) | 96 | ide_output_data(drive, cmd, data, 2); |
97 | writew(data, (void __iomem *)io_ports->data_addr); | ||
98 | else | ||
99 | outw(data, io_ports->data_addr); | ||
100 | } | 97 | } |
101 | 98 | ||
102 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) | 99 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) |
@@ -145,15 +142,12 @@ void ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
145 | } | 142 | } |
146 | 143 | ||
147 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { | 144 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { |
148 | u16 data; | 145 | u8 data[2]; |
149 | 146 | ||
150 | if (mmio) | 147 | ide_input_data(drive, cmd, data, 2); |
151 | data = readw((void __iomem *)io_ports->data_addr); | ||
152 | else | ||
153 | data = inw(io_ports->data_addr); | ||
154 | 148 | ||
155 | tf->data = data & 0xff; | 149 | tf->data = data[0]; |
156 | tf->hob_data = (data >> 8) & 0xff; | 150 | tf->hob_data = data[1]; |
157 | } | 151 | } |
158 | 152 | ||
159 | /* be sure we're looking at the low order bits */ | 153 | /* be sure we're looking at the low order bits */ |
diff --git a/drivers/ide/ns87415.c b/drivers/ide/ns87415.c index 0a6cf74c3265..7d64bc079fa8 100644 --- a/drivers/ide/ns87415.c +++ b/drivers/ide/ns87415.c | |||
@@ -67,10 +67,12 @@ static void superio_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
67 | struct ide_taskfile *tf = &cmd->tf; | 67 | struct ide_taskfile *tf = &cmd->tf; |
68 | 68 | ||
69 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { | 69 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { |
70 | u16 data = inw(io_ports->data_addr); | 70 | u8 data[2]; |
71 | 71 | ||
72 | tf->data = data & 0xff; | 72 | ide_input_data(drive, cmd, data, 2); |
73 | tf->hob_data = (data >> 8) & 0xff; | 73 | |
74 | tf->data = data[0]; | ||
75 | tf->hob_data = data[1]; | ||
74 | } | 76 | } |
75 | 77 | ||
76 | /* be sure we're looking at the low order bits */ | 78 | /* be sure we're looking at the low order bits */ |
diff --git a/drivers/ide/scc_pata.c b/drivers/ide/scc_pata.c index ea0a9752c6f9..9c47cbf8c506 100644 --- a/drivers/ide/scc_pata.c +++ b/drivers/ide/scc_pata.c | |||
@@ -656,9 +656,11 @@ static void scc_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | |||
656 | if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED) | 656 | if (cmd->ftf_flags & IDE_FTFLAG_FLAGGED) |
657 | HIHI = 0xFF; | 657 | HIHI = 0xFF; |
658 | 658 | ||
659 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) | 659 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { |
660 | out_be32((void *)io_ports->data_addr, | 660 | u8 data[2] = { tf->data, tf->hob_data }; |
661 | (tf->hob_data << 8) | tf->data); | 661 | |
662 | scc_output_data(drive, NULL, data, 2); | ||
663 | } | ||
662 | 664 | ||
663 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) | 665 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) |
664 | scc_ide_outb(tf->hob_feature, io_ports->feature_addr); | 666 | scc_ide_outb(tf->hob_feature, io_ports->feature_addr); |
@@ -693,10 +695,12 @@ static void scc_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
693 | struct ide_taskfile *tf = &cmd->tf; | 695 | struct ide_taskfile *tf = &cmd->tf; |
694 | 696 | ||
695 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { | 697 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { |
696 | u16 data = (u16)in_be32((void *)io_ports->data_addr); | 698 | u8 data[2]; |
699 | |||
700 | scc_input_data(drive, cmd, data, 2); | ||
697 | 701 | ||
698 | tf->data = data & 0xff; | 702 | tf->data = data[0]; |
699 | tf->hob_data = (data >> 8) & 0xff; | 703 | tf->hob_data = data[1]; |
700 | } | 704 | } |
701 | 705 | ||
702 | /* be sure we're looking at the low order bits */ | 706 | /* be sure we're looking at the low order bits */ |
diff --git a/drivers/ide/tx4938ide.c b/drivers/ide/tx4938ide.c index 606c37f5267d..c075464308a0 100644 --- a/drivers/ide/tx4938ide.c +++ b/drivers/ide/tx4938ide.c | |||
@@ -93,10 +93,9 @@ static void tx4938ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | |||
93 | HIHI = 0xFF; | 93 | HIHI = 0xFF; |
94 | 94 | ||
95 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { | 95 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { |
96 | u16 data = (tf->hob_data << 8) | tf->data; | 96 | u8 data[2] = { tf->data, tf->hob_data }; |
97 | 97 | ||
98 | /* no endian swap */ | 98 | hwif->tp_ops->output_data(drive, cmd, data, 2); |
99 | __raw_writew(data, (void __iomem *)io_ports->data_addr); | ||
100 | } | 99 | } |
101 | 100 | ||
102 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) | 101 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) |
@@ -133,12 +132,12 @@ static void tx4938ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
133 | struct ide_taskfile *tf = &cmd->tf; | 132 | struct ide_taskfile *tf = &cmd->tf; |
134 | 133 | ||
135 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { | 134 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { |
136 | u16 data; | 135 | u8 data[2]; |
137 | 136 | ||
138 | /* no endian swap */ | 137 | hwif->tp_ops->input_data(drive, cmd, data, 2); |
139 | data = __raw_readw((void __iomem *)io_ports->data_addr); | 138 | |
140 | tf->data = data & 0xff; | 139 | tf->data = data[0]; |
141 | tf->hob_data = (data >> 8) & 0xff; | 140 | tf->hob_data = data[1]; |
142 | } | 141 | } |
143 | 142 | ||
144 | /* be sure we're looking at the low order bits */ | 143 | /* be sure we're looking at the low order bits */ |
diff --git a/drivers/ide/tx4939ide.c b/drivers/ide/tx4939ide.c index f1e9da71110c..c350d0c7ba4a 100644 --- a/drivers/ide/tx4939ide.c +++ b/drivers/ide/tx4939ide.c | |||
@@ -458,10 +458,9 @@ static void tx4939ide_tf_load(ide_drive_t *drive, struct ide_cmd *cmd) | |||
458 | HIHI = 0xFF; | 458 | HIHI = 0xFF; |
459 | 459 | ||
460 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { | 460 | if (cmd->ftf_flags & IDE_FTFLAG_OUT_DATA) { |
461 | u16 data = (tf->hob_data << 8) | tf->data; | 461 | u8 data[2] = { tf->data, tf->hob_data }; |
462 | 462 | ||
463 | /* no endian swap */ | 463 | hwif->tp_ops->output_data(drive, cmd, data, 2); |
464 | __raw_writew(data, (void __iomem *)io_ports->data_addr); | ||
465 | } | 464 | } |
466 | 465 | ||
467 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) | 466 | if (cmd->tf_flags & IDE_TFLAG_OUT_HOB_FEATURE) |
@@ -500,12 +499,12 @@ static void tx4939ide_tf_read(ide_drive_t *drive, struct ide_cmd *cmd) | |||
500 | struct ide_taskfile *tf = &cmd->tf; | 499 | struct ide_taskfile *tf = &cmd->tf; |
501 | 500 | ||
502 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { | 501 | if (cmd->ftf_flags & IDE_FTFLAG_IN_DATA) { |
503 | u16 data; | 502 | u8 data[2]; |
504 | 503 | ||
505 | /* no endian swap */ | 504 | hwif->tp_ops->input_data(drive, cmd, data, 2); |
506 | data = __raw_readw((void __iomem *)io_ports->data_addr); | 505 | |
507 | tf->data = data & 0xff; | 506 | tf->data = data[0]; |
508 | tf->hob_data = (data >> 8) & 0xff; | 507 | tf->hob_data = data[1]; |
509 | } | 508 | } |
510 | 509 | ||
511 | /* be sure we're looking at the low order bits */ | 510 | /* be sure we're looking at the low order bits */ |