diff options
Diffstat (limited to 'drivers/ide/legacy/falconide.c')
-rw-r--r-- | drivers/ide/legacy/falconide.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/drivers/ide/legacy/falconide.c b/drivers/ide/legacy/falconide.c index 56cdaa0eeea5..83555ca513b5 100644 --- a/drivers/ide/legacy/falconide.c +++ b/drivers/ide/legacy/falconide.c | |||
@@ -44,6 +44,28 @@ | |||
44 | int falconide_intr_lock; | 44 | int falconide_intr_lock; |
45 | EXPORT_SYMBOL(falconide_intr_lock); | 45 | EXPORT_SYMBOL(falconide_intr_lock); |
46 | 46 | ||
47 | static void falconide_input_data(ide_drive_t *drive, struct request *rq, | ||
48 | void *buf, unsigned int len) | ||
49 | { | ||
50 | unsigned long data_addr = drive->hwif->io_ports.data_addr; | ||
51 | |||
52 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) | ||
53 | return insw(data_addr, buf, (len + 1) / 2); | ||
54 | |||
55 | insw_swapw(data_addr, buf, (len + 1) / 2); | ||
56 | } | ||
57 | |||
58 | static void falconide_output_data(ide_drive_t *drive, struct request *rq, | ||
59 | void *buf, unsigned int len) | ||
60 | { | ||
61 | unsigned long data_addr = drive->hwif->io_ports.data_addr; | ||
62 | |||
63 | if (drive->media == ide_disk && rq && rq->cmd_type == REQ_TYPE_FS) | ||
64 | return outsw(data_adr, buf, (len + 1) / 2); | ||
65 | |||
66 | outsw_swapw(data_addr, buf, (len + 1) / 2); | ||
67 | } | ||
68 | |||
47 | static void __init falconide_setup_ports(hw_regs_t *hw) | 69 | static void __init falconide_setup_ports(hw_regs_t *hw) |
48 | { | 70 | { |
49 | int i; | 71 | int i; |
@@ -90,6 +112,10 @@ static int __init falconide_init(void) | |||
90 | ide_init_port_data(hwif, index); | 112 | ide_init_port_data(hwif, index); |
91 | ide_init_port_hw(hwif, &hw); | 113 | ide_init_port_hw(hwif, &hw); |
92 | 114 | ||
115 | /* Atari has a byte-swapped IDE interface */ | ||
116 | hwif->input_data = falconide_input_data; | ||
117 | hwif->output_data = falconide_output_data; | ||
118 | |||
93 | ide_get_lock(NULL, NULL); | 119 | ide_get_lock(NULL, NULL); |
94 | ide_device_add(idx, NULL); | 120 | ide_device_add(idx, NULL); |
95 | ide_release_lock(); | 121 | ide_release_lock(); |