aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/pdc202xx_old.c
diff options
context:
space:
mode:
authorSergei Shtylyov <sshtylyov@ru.mvista.com>2007-02-16 20:40:22 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-02-16 20:40:22 -0500
commitfed21641be7b31338dcf6753ef7f8a396242a410 (patch)
tree9b6f963d016bc69630268a3cc9ac2146dbd4a870 /drivers/ide/pci/pdc202xx_old.c
parent075cb65511df94b6900ef3288a76cd92185d5170 (diff)
pdc202xx_old: fix PIO mode setup
Fix the driver's tuneproc() method to always set the PIO mode requested and not pick the best possible one, rename it to pdc202xx_tune_drive(), and change the calls to it accordingly; remove the preceding comment which has nothing to do with the code. Sergei Shtylyov wrote: > The tuneproc() method should take arg 255 for auto-selecting the best PIO > mode, not 5 as it did here + this driver's method always auto-selected instead > of setting the mode it's been told to -- issue typical to drivers/ide/... Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/pdc202xx_old.c')
-rw-r--r--drivers/ide/pci/pdc202xx_old.c24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/ide/pci/pdc202xx_old.c b/drivers/ide/pci/pdc202xx_old.c
index 730e8d1ec2f5..e76c1d91533f 100644
--- a/drivers/ide/pci/pdc202xx_old.c
+++ b/drivers/ide/pci/pdc202xx_old.c
@@ -2,6 +2,7 @@
2 * linux/drivers/ide/pci/pdc202xx_old.c Version 0.36 Sept 11, 2002 2 * linux/drivers/ide/pci/pdc202xx_old.c Version 0.36 Sept 11, 2002
3 * 3 *
4 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org> 4 * Copyright (C) 1998-2002 Andre Hedrick <andre@linux-ide.org>
5 * Copyright (C) 2006-2007 MontaVista Software, Inc.
5 * 6 *
6 * Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this 7 * Promise Ultra33 cards with BIOS v1.20 through 1.28 will need this
7 * compiled into the kernel if you have more than one card installed. 8 * compiled into the kernel if you have more than one card installed.
@@ -216,21 +217,10 @@ static int pdc202xx_tune_chipset (ide_drive_t *drive, u8 xferspeed)
216} 217}
217 218
218 219
219/* 0 1 2 3 4 5 6 7 8 220static void pdc202xx_tune_drive(ide_drive_t *drive, u8 pio)
220 * 960, 480, 390, 300, 240, 180, 120, 90, 60
221 * 180, 150, 120, 90, 60
222 * DMA_Speed
223 * 180, 120, 90, 90, 90, 60, 30
224 * 11, 5, 4, 3, 2, 1, 0
225 */
226static void config_chipset_for_pio (ide_drive_t *drive, u8 pio)
227{ 221{
228 u8 speed = 0; 222 pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
229 223 pdc202xx_tune_chipset(drive, XFER_PIO_0 + pio);
230 if (pio == 5) pio = 4;
231 speed = XFER_PIO_0 + ide_get_best_pio_mode(drive, 255, pio, NULL);
232
233 pdc202xx_tune_chipset(drive, speed);
234} 224}
235 225
236static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif) 226static u8 pdc202xx_old_cable_detect (ide_hwif_t *hwif)
@@ -348,7 +338,7 @@ static int pdc202xx_config_drive_xfer_rate (ide_drive_t *drive)
348 338
349 } else if ((id->capability & 8) || (id->field_valid & 2)) { 339 } else if ((id->capability & 8) || (id->field_valid & 2)) {
350fast_ata_pio: 340fast_ata_pio:
351 hwif->tuneproc(drive, 5); 341 pdc202xx_tune_drive(drive, 255);
352 return hwif->ide_dma_off_quietly(drive); 342 return hwif->ide_dma_off_quietly(drive);
353 } 343 }
354 /* IORDY not supported */ 344 /* IORDY not supported */
@@ -463,7 +453,7 @@ static void pdc202xx_reset (ide_drive_t *drive)
463 453
464 pdc202xx_reset_host(hwif); 454 pdc202xx_reset_host(hwif);
465 pdc202xx_reset_host(mate); 455 pdc202xx_reset_host(mate);
466 hwif->tuneproc(drive, 5); 456 pdc202xx_tune_drive(drive, 255);
467} 457}
468 458
469static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev, 459static unsigned int __devinit init_chipset_pdc202xx(struct pci_dev *dev,
@@ -490,7 +480,7 @@ static void __devinit init_hwif_pdc202xx(ide_hwif_t *hwif)
490 hwif->rqsize = 256; 480 hwif->rqsize = 256;
491 481
492 hwif->autodma = 0; 482 hwif->autodma = 0;
493 hwif->tuneproc = &config_chipset_for_pio; 483 hwif->tuneproc = &pdc202xx_tune_drive;
494 hwif->quirkproc = &pdc202xx_quirkproc; 484 hwif->quirkproc = &pdc202xx_quirkproc;
495 485
496 if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246) 486 if (hwif->pci_dev->device != PCI_DEVICE_ID_PROMISE_20246)