aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/piix.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-08-01 17:46:46 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-08-01 17:46:46 -0400
commit0c8de52d76e4bec6e9168b47be29f11b3bb92768 (patch)
tree8017e7a07d2d63cf28c35e094944e67022957730 /drivers/ide/pci/piix.c
parent8b6b33be3280fd776335079124ecd176e6a40797 (diff)
piix/slc90e66: fix PIO1 handling in ->speedproc method (take 2)
* Don't call {piix,slc90e66}_dma_2_pio() for PIO modes in {piix,slc90e66}_tune_chipset(). * Add PIO1 handling to {piix,slc90e66}_tune_chipset(). * Bump driver version. v2: * Remove PIO modes from {piix,slc90e66}_dma_2_pio(), they are no longer needed there (Noticed by Sergei) Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/piix.c')
-rw-r--r--drivers/ide/pci/piix.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c
index 4f69cd067e5e..5cfa9378bbb8 100644
--- a/drivers/ide/pci/piix.c
+++ b/drivers/ide/pci/piix.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/drivers/ide/pci/piix.c Version 0.50 Jun 10, 2007 2 * linux/drivers/ide/pci/piix.c Version 0.51 Jul 6, 2007
3 * 3 *
4 * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer 4 * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer
5 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org> 5 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>
@@ -109,7 +109,7 @@ static int no_piix_dma;
109 * piix_dma_2_pio - return the PIO mode matching DMA 109 * piix_dma_2_pio - return the PIO mode matching DMA
110 * @xfer_rate: transfer speed 110 * @xfer_rate: transfer speed
111 * 111 *
112 * Returns the nearest equivalent PIO timing for the PIO or DMA 112 * Returns the nearest equivalent PIO timing for the DMA
113 * mode requested by the controller. 113 * mode requested by the controller.
114 */ 114 */
115 115
@@ -123,20 +123,14 @@ static u8 piix_dma_2_pio (u8 xfer_rate) {
123 case XFER_UDMA_1: 123 case XFER_UDMA_1:
124 case XFER_UDMA_0: 124 case XFER_UDMA_0:
125 case XFER_MW_DMA_2: 125 case XFER_MW_DMA_2:
126 case XFER_PIO_4:
127 return 4; 126 return 4;
128 case XFER_MW_DMA_1: 127 case XFER_MW_DMA_1:
129 case XFER_PIO_3:
130 return 3; 128 return 3;
131 case XFER_SW_DMA_2: 129 case XFER_SW_DMA_2:
132 case XFER_PIO_2:
133 return 2; 130 return 2;
134 case XFER_MW_DMA_0: 131 case XFER_MW_DMA_0:
135 case XFER_SW_DMA_1: 132 case XFER_SW_DMA_1:
136 case XFER_SW_DMA_0: 133 case XFER_SW_DMA_0:
137 case XFER_PIO_1:
138 case XFER_PIO_0:
139 case XFER_PIO_SLOW:
140 default: 134 default:
141 return 0; 135 return 0;
142 } 136 }
@@ -269,6 +263,7 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed)
269 case XFER_PIO_4: 263 case XFER_PIO_4:
270 case XFER_PIO_3: 264 case XFER_PIO_3:
271 case XFER_PIO_2: 265 case XFER_PIO_2:
266 case XFER_PIO_1:
272 case XFER_PIO_0: break; 267 case XFER_PIO_0: break;
273 default: return -1; 268 default: return -1;
274 } 269 }
@@ -299,7 +294,11 @@ static int piix_tune_chipset (ide_drive_t *drive, u8 xferspeed)
299 pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); 294 pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);
300 } 295 }
301 296
302 piix_tune_pio(drive, piix_dma_2_pio(speed)); 297 if (speed > XFER_PIO_4)
298 piix_tune_pio(drive, piix_dma_2_pio(speed));
299 else
300 piix_tune_pio(drive, speed - XFER_PIO_0);
301
303 return ide_config_drive_speed(drive, speed); 302 return ide_config_drive_speed(drive, speed);
304} 303}
305 304