diff options
Diffstat (limited to 'drivers/ide/pci/pdc202xx_old.c')
-rw-r--r-- | drivers/ide/pci/pdc202xx_old.c | 35 |
1 files changed, 22 insertions, 13 deletions
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c index 23844687dee..41ac4a94959 100644 --- a/drivers/ide/pci/pdc202xx_old.c +++ b/drivers/ide/pci/pdc202xx_old.c | |||
@@ -152,8 +152,10 @@ static void pdc202xx_tune_drive(ide_drive_t *drive, u8 pio) | |||
152 | static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif) | 152 | static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif) |
153 | { | 153 | { |
154 | u16 CIS = 0, mask = (hwif->channel) ? (1<<11) : (1<<10); | 154 | u16 CIS = 0, mask = (hwif->channel) ? (1<<11) : (1<<10); |
155 | |||
155 | pci_read_config_word(hwif->pci_dev, 0x50, &CIS); | 156 | pci_read_config_word(hwif->pci_dev, 0x50, &CIS); |
156 | return (CIS & mask) ? 1 : 0; | 157 | |
158 | return (CIS & mask) ? ATA_CBL_PATA40 : ATA_CBL_PATA80; | ||
157 | } | 159 | } |
158 | 160 | ||
159 | /* | 161 | /* |
@@ -267,18 +269,24 @@ somebody_else: | |||
267 | return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ | 269 | return (dma_stat & 4) == 4; /* return 1 if INTR asserted */ |
268 | } | 270 | } |
269 | 271 | ||
270 | static int pdc202xx_ide_dma_lostirq(ide_drive_t *drive) | 272 | static void pdc202xx_dma_lost_irq(ide_drive_t *drive) |
271 | { | 273 | { |
272 | if (HWIF(drive)->resetproc != NULL) | 274 | ide_hwif_t *hwif = HWIF(drive); |
273 | HWIF(drive)->resetproc(drive); | 275 | |
274 | return __ide_dma_lostirq(drive); | 276 | if (hwif->resetproc != NULL) |
277 | hwif->resetproc(drive); | ||
278 | |||
279 | ide_dma_lost_irq(drive); | ||
275 | } | 280 | } |
276 | 281 | ||
277 | static int pdc202xx_ide_dma_timeout(ide_drive_t *drive) | 282 | static void pdc202xx_dma_timeout(ide_drive_t *drive) |
278 | { | 283 | { |
279 | if (HWIF(drive)->resetproc != NULL) | 284 | ide_hwif_t *hwif = HWIF(drive); |
280 | HWIF(drive)->resetproc(drive); | 285 | |
281 | return __ide_dma_timeout(drive); | 286 | if (hwif->resetproc != NULL) |
287 | hwif->resetproc(drive); | ||
288 | |||
289 | ide_dma_timeout(drive); | ||
282 | } | 290 | } |
283 | 291 | ||
284 | static void pdc202xx_reset_host (ide_hwif_t *hwif) | 292 | static void pdc202xx_reset_host (ide_hwif_t *hwif) |
@@ -347,12 +355,13 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif) | |||
347 | hwif->err_stops_fifo = 1; | 355 | hwif->err_stops_fifo = 1; |
348 | 356 | ||
349 | hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; | 357 | hwif->ide_dma_check = &pdc202xx_config_drive_xfer_rate; |
350 | hwif->ide_dma_lostirq = &pdc202xx_ide_dma_lostirq; | 358 | hwif->dma_lost_irq = &pdc202xx_dma_lost_irq; |
351 | hwif->ide_dma_timeout = &pdc202xx_ide_dma_timeout; | 359 | hwif->dma_timeout = &pdc202xx_dma_timeout; |
352 | 360 | ||
353 | if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { | 361 | if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) { |
354 | if (!(hwif->udma_four)) | 362 | if (hwif->cbl != ATA_CBL_PATA40_SHORT) |
355 | hwif->udma_four = (pdc202xx_old_cable_detect(hwif)) ? 0 : 1; | 363 | hwif->cbl = pdc202xx_old_cable_detect(hwif); |
364 | |||
356 | hwif->dma_start = &pdc202xx_old_ide_dma_start; | 365 | hwif->dma_start = &pdc202xx_old_ide_dma_start; |
357 | hwif->ide_dma_end = &pdc202xx_old_ide_dma_end; | 366 | hwif->ide_dma_end = &pdc202xx_old_ide_dma_end; |
358 | } | 367 | } |