aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/dtc2278.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/legacy/dtc2278.c')
-rw-r--r--drivers/ide/legacy/dtc2278.c39
1 files changed, 11 insertions, 28 deletions
diff --git a/drivers/ide/legacy/dtc2278.c b/drivers/ide/legacy/dtc2278.c
index 5f69cd2ea6f7..af791a02a120 100644
--- a/drivers/ide/legacy/dtc2278.c
+++ b/drivers/ide/legacy/dtc2278.c
@@ -16,6 +16,8 @@
16 16
17#include <asm/io.h> 17#include <asm/io.h>
18 18
19#define DRV_NAME "dtc2278"
20
19/* 21/*
20 * Changing this #undef to #define may solve start up problems in some systems. 22 * Changing this #undef to #define may solve start up problems in some systems.
21 */ 23 */
@@ -86,30 +88,26 @@ static void dtc2278_set_pio_mode(ide_drive_t *drive, const u8 pio)
86 } 88 }
87} 89}
88 90
91static const struct ide_port_ops dtc2278_port_ops = {
92 .set_pio_mode = dtc2278_set_pio_mode,
93};
94
89static const struct ide_port_info dtc2278_port_info __initdata = { 95static const struct ide_port_info dtc2278_port_info __initdata = {
96 .name = DRV_NAME,
90 .chipset = ide_dtc2278, 97 .chipset = ide_dtc2278,
98 .port_ops = &dtc2278_port_ops,
91 .host_flags = IDE_HFLAG_SERIALIZE | 99 .host_flags = IDE_HFLAG_SERIALIZE |
92 IDE_HFLAG_NO_UNMASK_IRQS | 100 IDE_HFLAG_NO_UNMASK_IRQS |
93 IDE_HFLAG_IO_32BIT | 101 IDE_HFLAG_IO_32BIT |
94 /* disallow ->io_32bit changes */ 102 /* disallow ->io_32bit changes */
95 IDE_HFLAG_NO_IO_32BIT | 103 IDE_HFLAG_NO_IO_32BIT |
96 IDE_HFLAG_NO_DMA | 104 IDE_HFLAG_NO_DMA,
97 IDE_HFLAG_NO_AUTOTUNE,
98 .pio_mask = ATA_PIO4, 105 .pio_mask = ATA_PIO4,
99}; 106};
100 107
101static int __init dtc2278_probe(void) 108static int __init dtc2278_probe(void)
102{ 109{
103 unsigned long flags; 110 unsigned long flags;
104 ide_hwif_t *hwif, *mate;
105 static u8 idx[4] = { 0, 1, 0xff, 0xff };
106 hw_regs_t hw[2];
107
108 hwif = &ide_hwifs[0];
109 mate = &ide_hwifs[1];
110
111 if (hwif->chipset != ide_unknown || mate->chipset != ide_unknown)
112 return 1;
113 111
114 local_irq_save(flags); 112 local_irq_save(flags);
115 /* 113 /*
@@ -129,25 +127,10 @@ static int __init dtc2278_probe(void)
129#endif 127#endif
130 local_irq_restore(flags); 128 local_irq_restore(flags);
131 129
132 memset(&hw, 0, sizeof(hw)); 130 return ide_legacy_device_add(&dtc2278_port_info, 0);
133
134 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
135 hw[0].irq = 14;
136
137 ide_std_init_ports(&hw[1], 0x170, 0x376);
138 hw[1].irq = 15;
139
140 ide_init_port_hw(hwif, &hw[0]);
141 ide_init_port_hw(mate, &hw[1]);
142
143 hwif->set_pio_mode = &dtc2278_set_pio_mode;
144
145 ide_device_add(idx, &dtc2278_port_info);
146
147 return 0;
148} 131}
149 132
150int probe_dtc2278 = 0; 133static int probe_dtc2278;
151 134
152module_param_named(probe, probe_dtc2278, bool, 0); 135module_param_named(probe, probe_dtc2278, bool, 0);
153MODULE_PARM_DESC(probe, "probe for DTC2278xx chipsets"); 136MODULE_PARM_DESC(probe, "probe for DTC2278xx chipsets");