diff options
Diffstat (limited to 'drivers/ide/pci/aec62xx.c')
-rw-r--r-- | drivers/ide/pci/aec62xx.c | 39 |
1 files changed, 18 insertions, 21 deletions
diff --git a/drivers/ide/pci/aec62xx.c b/drivers/ide/pci/aec62xx.c index cfb3265bc1a8..7f46c224b7c4 100644 --- a/drivers/ide/pci/aec62xx.c +++ b/drivers/ide/pci/aec62xx.c | |||
@@ -135,12 +135,12 @@ static void aec6260_set_mode(ide_drive_t *drive, const u8 speed) | |||
135 | 135 | ||
136 | static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio) | 136 | static void aec_set_pio_mode(ide_drive_t *drive, const u8 pio) |
137 | { | 137 | { |
138 | drive->hwif->set_dma_mode(drive, pio + XFER_PIO_0); | 138 | drive->hwif->port_ops->set_dma_mode(drive, pio + XFER_PIO_0); |
139 | } | 139 | } |
140 | 140 | ||
141 | static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name) | 141 | static unsigned int __devinit init_chipset_aec62xx(struct pci_dev *dev, const char *name) |
142 | { | 142 | { |
143 | int bus_speed = system_bus_clock(); | 143 | int bus_speed = ide_pci_clk ? ide_pci_clk : system_bus_clock(); |
144 | 144 | ||
145 | if (bus_speed <= 33) | 145 | if (bus_speed <= 33) |
146 | pci_set_drvdata(dev, (void *) aec6xxx_33_base); | 146 | pci_set_drvdata(dev, (void *) aec6xxx_33_base); |
@@ -175,27 +175,23 @@ static u8 __devinit atp86x_cable_detect(ide_hwif_t *hwif) | |||
175 | return (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; | 175 | return (ata66 & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; |
176 | } | 176 | } |
177 | 177 | ||
178 | static void __devinit init_hwif_aec62xx(ide_hwif_t *hwif) | 178 | static const struct ide_port_ops atp850_port_ops = { |
179 | { | 179 | .set_pio_mode = aec_set_pio_mode, |
180 | struct pci_dev *dev = to_pci_dev(hwif->dev); | 180 | .set_dma_mode = aec6210_set_mode, |
181 | 181 | }; | |
182 | hwif->set_pio_mode = &aec_set_pio_mode; | ||
183 | |||
184 | if (dev->device == PCI_DEVICE_ID_ARTOP_ATP850UF) | ||
185 | hwif->set_dma_mode = &aec6210_set_mode; | ||
186 | else { | ||
187 | hwif->set_dma_mode = &aec6260_set_mode; | ||
188 | 182 | ||
189 | hwif->cable_detect = atp86x_cable_detect; | 183 | static const struct ide_port_ops atp86x_port_ops = { |
190 | } | 184 | .set_pio_mode = aec_set_pio_mode, |
191 | } | 185 | .set_dma_mode = aec6260_set_mode, |
186 | .cable_detect = atp86x_cable_detect, | ||
187 | }; | ||
192 | 188 | ||
193 | static const struct ide_port_info aec62xx_chipsets[] __devinitdata = { | 189 | static const struct ide_port_info aec62xx_chipsets[] __devinitdata = { |
194 | { /* 0 */ | 190 | { /* 0 */ |
195 | .name = "AEC6210", | 191 | .name = "AEC6210", |
196 | .init_chipset = init_chipset_aec62xx, | 192 | .init_chipset = init_chipset_aec62xx, |
197 | .init_hwif = init_hwif_aec62xx, | ||
198 | .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, | 193 | .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, |
194 | .port_ops = &atp850_port_ops, | ||
199 | .host_flags = IDE_HFLAG_SERIALIZE | | 195 | .host_flags = IDE_HFLAG_SERIALIZE | |
200 | IDE_HFLAG_NO_ATAPI_DMA | | 196 | IDE_HFLAG_NO_ATAPI_DMA | |
201 | IDE_HFLAG_NO_DSC | | 197 | IDE_HFLAG_NO_DSC | |
@@ -207,7 +203,7 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = { | |||
207 | },{ /* 1 */ | 203 | },{ /* 1 */ |
208 | .name = "AEC6260", | 204 | .name = "AEC6260", |
209 | .init_chipset = init_chipset_aec62xx, | 205 | .init_chipset = init_chipset_aec62xx, |
210 | .init_hwif = init_hwif_aec62xx, | 206 | .port_ops = &atp86x_port_ops, |
211 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA | | 207 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | IDE_HFLAG_NO_AUTODMA | |
212 | IDE_HFLAG_ABUSE_SET_DMA_MODE | | 208 | IDE_HFLAG_ABUSE_SET_DMA_MODE | |
213 | IDE_HFLAG_OFF_BOARD, | 209 | IDE_HFLAG_OFF_BOARD, |
@@ -217,17 +213,18 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = { | |||
217 | },{ /* 2 */ | 213 | },{ /* 2 */ |
218 | .name = "AEC6260R", | 214 | .name = "AEC6260R", |
219 | .init_chipset = init_chipset_aec62xx, | 215 | .init_chipset = init_chipset_aec62xx, |
220 | .init_hwif = init_hwif_aec62xx, | ||
221 | .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, | 216 | .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, |
217 | .port_ops = &atp86x_port_ops, | ||
222 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | | 218 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | |
223 | IDE_HFLAG_ABUSE_SET_DMA_MODE, | 219 | IDE_HFLAG_ABUSE_SET_DMA_MODE | |
220 | IDE_HFLAG_NON_BOOTABLE, | ||
224 | .pio_mask = ATA_PIO4, | 221 | .pio_mask = ATA_PIO4, |
225 | .mwdma_mask = ATA_MWDMA2, | 222 | .mwdma_mask = ATA_MWDMA2, |
226 | .udma_mask = ATA_UDMA4, | 223 | .udma_mask = ATA_UDMA4, |
227 | },{ /* 3 */ | 224 | },{ /* 3 */ |
228 | .name = "AEC6280", | 225 | .name = "AEC6280", |
229 | .init_chipset = init_chipset_aec62xx, | 226 | .init_chipset = init_chipset_aec62xx, |
230 | .init_hwif = init_hwif_aec62xx, | 227 | .port_ops = &atp86x_port_ops, |
231 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | | 228 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | |
232 | IDE_HFLAG_ABUSE_SET_DMA_MODE | | 229 | IDE_HFLAG_ABUSE_SET_DMA_MODE | |
233 | IDE_HFLAG_OFF_BOARD, | 230 | IDE_HFLAG_OFF_BOARD, |
@@ -237,8 +234,8 @@ static const struct ide_port_info aec62xx_chipsets[] __devinitdata = { | |||
237 | },{ /* 4 */ | 234 | },{ /* 4 */ |
238 | .name = "AEC6280R", | 235 | .name = "AEC6280R", |
239 | .init_chipset = init_chipset_aec62xx, | 236 | .init_chipset = init_chipset_aec62xx, |
240 | .init_hwif = init_hwif_aec62xx, | ||
241 | .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, | 237 | .enablebits = {{0x4a,0x02,0x02}, {0x4a,0x04,0x04}}, |
238 | .port_ops = &atp86x_port_ops, | ||
242 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | | 239 | .host_flags = IDE_HFLAG_NO_ATAPI_DMA | |
243 | IDE_HFLAG_ABUSE_SET_DMA_MODE | | 240 | IDE_HFLAG_ABUSE_SET_DMA_MODE | |
244 | IDE_HFLAG_OFF_BOARD, | 241 | IDE_HFLAG_OFF_BOARD, |