diff options
Diffstat (limited to 'drivers/ide/pci/via82cxxx.c')
-rw-r--r-- | drivers/ide/pci/via82cxxx.c | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/drivers/ide/pci/via82cxxx.c b/drivers/ide/pci/via82cxxx.c index 27e92fb9f95e..581316f9581d 100644 --- a/drivers/ide/pci/via82cxxx.c +++ b/drivers/ide/pci/via82cxxx.c | |||
@@ -1,6 +1,6 @@ | |||
1 | /* | 1 | /* |
2 | * | 2 | * |
3 | * Version 3.45 | 3 | * Version 3.46 |
4 | * | 4 | * |
5 | * VIA IDE driver for Linux. Supported southbridges: | 5 | * VIA IDE driver for Linux. Supported southbridges: |
6 | * | 6 | * |
@@ -203,10 +203,8 @@ static int via_set_drive(ide_drive_t *drive, u8 speed) | |||
203 | 203 | ||
204 | static void via82cxxx_tune_drive(ide_drive_t *drive, u8 pio) | 204 | static void via82cxxx_tune_drive(ide_drive_t *drive, u8 pio) |
205 | { | 205 | { |
206 | if (pio == 255) { | 206 | if (pio == 255) |
207 | via_set_drive(drive, ide_find_best_pio_mode(drive)); | 207 | pio = ide_get_best_pio_mode(drive, 255, 5); |
208 | return; | ||
209 | } | ||
210 | 208 | ||
211 | via_set_drive(drive, XFER_PIO_0 + min_t(u8, pio, 5)); | 209 | via_set_drive(drive, XFER_PIO_0 + min_t(u8, pio, 5)); |
212 | } | 210 | } |
@@ -223,12 +221,14 @@ static int via82cxxx_ide_dma_check (ide_drive_t *drive) | |||
223 | { | 221 | { |
224 | u8 speed = ide_max_dma_mode(drive); | 222 | u8 speed = ide_max_dma_mode(drive); |
225 | 223 | ||
226 | if (speed == 0) | 224 | if (speed == 0) { |
227 | speed = ide_find_best_pio_mode(drive); | 225 | via82cxxx_tune_drive(drive, 255); |
226 | return -1; | ||
227 | } | ||
228 | 228 | ||
229 | via_set_drive(drive, speed); | 229 | via_set_drive(drive, speed); |
230 | 230 | ||
231 | if (drive->autodma && (speed & XFER_MODE) != XFER_PIO) | 231 | if (drive->autodma) |
232 | return 0; | 232 | return 0; |
233 | 233 | ||
234 | return -1; | 234 | return -1; |
@@ -498,18 +498,22 @@ static ide_pci_device_t via82cxxx_chipsets[] __devinitdata = { | |||
498 | .name = "VP_IDE", | 498 | .name = "VP_IDE", |
499 | .init_chipset = init_chipset_via82cxxx, | 499 | .init_chipset = init_chipset_via82cxxx, |
500 | .init_hwif = init_hwif_via82cxxx, | 500 | .init_hwif = init_hwif_via82cxxx, |
501 | .channels = 2, | ||
502 | .autodma = NOAUTODMA, | 501 | .autodma = NOAUTODMA, |
503 | .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, | 502 | .enablebits = {{0x40,0x02,0x02}, {0x40,0x01,0x01}}, |
504 | .bootable = ON_BOARD | 503 | .bootable = ON_BOARD, |
504 | .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | ||
505 | | IDE_HFLAG_PIO_NO_DOWNGRADE, | ||
506 | .pio_mask = ATA_PIO5, | ||
505 | },{ /* 1 */ | 507 | },{ /* 1 */ |
506 | .name = "VP_IDE", | 508 | .name = "VP_IDE", |
507 | .init_chipset = init_chipset_via82cxxx, | 509 | .init_chipset = init_chipset_via82cxxx, |
508 | .init_hwif = init_hwif_via82cxxx, | 510 | .init_hwif = init_hwif_via82cxxx, |
509 | .channels = 2, | ||
510 | .autodma = AUTODMA, | 511 | .autodma = AUTODMA, |
511 | .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, | 512 | .enablebits = {{0x00,0x00,0x00}, {0x00,0x00,0x00}}, |
512 | .bootable = ON_BOARD, | 513 | .bootable = ON_BOARD, |
514 | .host_flags = IDE_HFLAG_PIO_NO_BLACKLIST | ||
515 | | IDE_HFLAG_PIO_NO_DOWNGRADE, | ||
516 | .pio_mask = ATA_PIO5, | ||
513 | } | 517 | } |
514 | }; | 518 | }; |
515 | 519 | ||