diff options
Diffstat (limited to 'drivers/ide/pci/cs5530.c')
-rw-r--r-- | drivers/ide/pci/cs5530.c | 45 |
1 files changed, 8 insertions, 37 deletions
diff --git a/drivers/ide/pci/cs5530.c b/drivers/ide/pci/cs5530.c index e4121577cef0..0d23b8aabe9c 100644 --- a/drivers/ide/pci/cs5530.c +++ b/drivers/ide/pci/cs5530.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/cs5530.c Version 0.74 Jul 28 2007 | 2 | * linux/drivers/ide/pci/cs5530.c Version 0.76 Aug 3 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 2000 Andre Hedrick <andre@linux-ide.org> |
5 | * Copyright (C) 2000 Mark Lord <mlord@pobox.com> | 5 | * Copyright (C) 2000 Mark Lord <mlord@pobox.com> |
@@ -104,22 +104,6 @@ out: | |||
104 | return mask; | 104 | return mask; |
105 | } | 105 | } |
106 | 106 | ||
107 | /** | ||
108 | * cs5530_config_dma - set DMA/UDMA mode | ||
109 | * @drive: drive to tune | ||
110 | * | ||
111 | * cs5530_config_dma() handles setting of DMA/UDMA mode | ||
112 | * for both the chipset and drive. | ||
113 | */ | ||
114 | |||
115 | static int cs5530_config_dma(ide_drive_t *drive) | ||
116 | { | ||
117 | if (ide_tune_dma(drive)) | ||
118 | return 0; | ||
119 | |||
120 | return 1; | ||
121 | } | ||
122 | |||
123 | static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode) | 107 | static void cs5530_set_dma_mode(ide_drive_t *drive, const u8 mode) |
124 | { | 108 | { |
125 | unsigned long basereg; | 109 | unsigned long basereg; |
@@ -260,7 +244,6 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif) | |||
260 | { | 244 | { |
261 | unsigned long basereg; | 245 | unsigned long basereg; |
262 | u32 d0_timings; | 246 | u32 d0_timings; |
263 | hwif->autodma = 0; | ||
264 | 247 | ||
265 | if (hwif->mate) | 248 | if (hwif->mate) |
266 | hwif->serialized = hwif->mate->serialized = 1; | 249 | hwif->serialized = hwif->mate->serialized = 1; |
@@ -270,20 +253,13 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif) | |||
270 | 253 | ||
271 | basereg = CS5530_BASEREG(hwif); | 254 | basereg = CS5530_BASEREG(hwif); |
272 | d0_timings = inl(basereg + 0); | 255 | d0_timings = inl(basereg + 0); |
273 | if (CS5530_BAD_PIO(d0_timings)) { | 256 | if (CS5530_BAD_PIO(d0_timings)) |
274 | /* PIO timings not initialized? */ | ||
275 | outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 0); | 257 | outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 0); |
276 | if (!hwif->drives[0].autotune) | 258 | if (CS5530_BAD_PIO(inl(basereg + 8))) |
277 | hwif->drives[0].autotune = 1; | ||
278 | /* needs autotuning later */ | ||
279 | } | ||
280 | if (CS5530_BAD_PIO(inl(basereg + 8))) { | ||
281 | /* PIO timings not initialized? */ | ||
282 | outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 8); | 259 | outl(cs5530_pio_timings[(d0_timings >> 31) & 1][0], basereg + 8); |
283 | if (!hwif->drives[1].autotune) | 260 | |
284 | hwif->drives[1].autotune = 1; | 261 | hwif->drives[0].autotune = 1; |
285 | /* needs autotuning later */ | 262 | hwif->drives[1].autotune = 1; |
286 | } | ||
287 | 263 | ||
288 | if (hwif->dma_base == 0) | 264 | if (hwif->dma_base == 0) |
289 | return; | 265 | return; |
@@ -293,11 +269,6 @@ static void __devinit init_hwif_cs5530 (ide_hwif_t *hwif) | |||
293 | hwif->mwdma_mask = 0x07; | 269 | hwif->mwdma_mask = 0x07; |
294 | 270 | ||
295 | hwif->udma_filter = cs5530_udma_filter; | 271 | hwif->udma_filter = cs5530_udma_filter; |
296 | hwif->ide_dma_check = &cs5530_config_dma; | ||
297 | if (!noautodma) | ||
298 | hwif->autodma = 1; | ||
299 | hwif->drives[0].autodma = hwif->autodma; | ||
300 | hwif->drives[1].autodma = hwif->autodma; | ||
301 | } | 272 | } |
302 | 273 | ||
303 | static ide_pci_device_t cs5530_chipset __devinitdata = { | 274 | static ide_pci_device_t cs5530_chipset __devinitdata = { |
@@ -315,8 +286,8 @@ static int __devinit cs5530_init_one(struct pci_dev *dev, const struct pci_devic | |||
315 | return ide_setup_pci_device(dev, &cs5530_chipset); | 286 | return ide_setup_pci_device(dev, &cs5530_chipset); |
316 | } | 287 | } |
317 | 288 | ||
318 | static struct pci_device_id cs5530_pci_tbl[] = { | 289 | static const struct pci_device_id cs5530_pci_tbl[] = { |
319 | { PCI_VENDOR_ID_CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE, PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0}, | 290 | { PCI_VDEVICE(CYRIX, PCI_DEVICE_ID_CYRIX_5530_IDE), 0 }, |
320 | { 0, }, | 291 | { 0, }, |
321 | }; | 292 | }; |
322 | MODULE_DEVICE_TABLE(pci, cs5530_pci_tbl); | 293 | MODULE_DEVICE_TABLE(pci, cs5530_pci_tbl); |