diff options
-rw-r--r-- | drivers/ide/pci/it8213.c | 16 | ||||
-rw-r--r-- | drivers/ide/pci/piix.c | 17 | ||||
-rw-r--r-- | drivers/ide/pci/slc90e66.c | 17 |
3 files changed, 20 insertions, 30 deletions
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c index d07771e06b2d..24ef091ec5b9 100644 --- a/drivers/ide/pci/it8213.c +++ b/drivers/ide/pci/it8213.c | |||
@@ -132,6 +132,11 @@ static int it8213_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
132 | u16 reg4042, reg4a; | 132 | u16 reg4042, reg4a; |
133 | u8 reg48, reg54, reg55; | 133 | u8 reg48, reg54, reg55; |
134 | 134 | ||
135 | if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) { | ||
136 | it8213_tune_pio(drive, speed - XFER_PIO_0); | ||
137 | return ide_config_drive_speed(drive, speed); | ||
138 | } | ||
139 | |||
135 | pci_read_config_word(dev, maslave, ®4042); | 140 | pci_read_config_word(dev, maslave, ®4042); |
136 | pci_read_config_byte(dev, 0x48, ®48); | 141 | pci_read_config_byte(dev, 0x48, ®48); |
137 | pci_read_config_word(dev, 0x4a, ®4a); | 142 | pci_read_config_word(dev, 0x4a, ®4a); |
@@ -151,12 +156,6 @@ static int it8213_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
151 | case XFER_MW_DMA_1: | 156 | case XFER_MW_DMA_1: |
152 | case XFER_SW_DMA_2: | 157 | case XFER_SW_DMA_2: |
153 | break; | 158 | break; |
154 | case XFER_PIO_4: | ||
155 | case XFER_PIO_3: | ||
156 | case XFER_PIO_2: | ||
157 | case XFER_PIO_1: | ||
158 | case XFER_PIO_0: | ||
159 | break; | ||
160 | default: | 159 | default: |
161 | return -1; | 160 | return -1; |
162 | } | 161 | } |
@@ -188,10 +187,7 @@ static int it8213_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
188 | pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); | 187 | pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); |
189 | } | 188 | } |
190 | 189 | ||
191 | if (speed > XFER_PIO_4) | 190 | it8213_tune_pio(drive, it8213_dma_2_pio(speed)); |
192 | it8213_tune_pio(drive, it8213_dma_2_pio(speed)); | ||
193 | else | ||
194 | it8213_tune_pio(drive, speed - XFER_PIO_0); | ||
195 | 191 | ||
196 | return ide_config_drive_speed(drive, speed); | 192 | return ide_config_drive_speed(drive, speed); |
197 | } | 193 | } |
diff --git a/drivers/ide/pci/piix.c b/drivers/ide/pci/piix.c index 07492d71c602..860b929f6e58 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.51 Jul 6, 2007 | 2 | * linux/drivers/ide/pci/piix.c Version 0.52 Jul 14, 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> |
@@ -242,6 +242,11 @@ static int piix_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
242 | u16 reg4042, reg4a; | 242 | u16 reg4042, reg4a; |
243 | u8 reg48, reg54, reg55; | 243 | u8 reg48, reg54, reg55; |
244 | 244 | ||
245 | if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) { | ||
246 | piix_tune_pio(drive, speed - XFER_PIO_0); | ||
247 | return ide_config_drive_speed(drive, speed); | ||
248 | } | ||
249 | |||
245 | pci_read_config_word(dev, maslave, ®4042); | 250 | pci_read_config_word(dev, maslave, ®4042); |
246 | sitre = (reg4042 & 0x4000) ? 1 : 0; | 251 | sitre = (reg4042 & 0x4000) ? 1 : 0; |
247 | pci_read_config_byte(dev, 0x48, ®48); | 252 | pci_read_config_byte(dev, 0x48, ®48); |
@@ -259,11 +264,6 @@ static int piix_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
259 | case XFER_MW_DMA_2: | 264 | case XFER_MW_DMA_2: |
260 | case XFER_MW_DMA_1: | 265 | case XFER_MW_DMA_1: |
261 | case XFER_SW_DMA_2: break; | 266 | case XFER_SW_DMA_2: break; |
262 | case XFER_PIO_4: | ||
263 | case XFER_PIO_3: | ||
264 | case XFER_PIO_2: | ||
265 | case XFER_PIO_1: | ||
266 | case XFER_PIO_0: break; | ||
267 | default: return -1; | 267 | default: return -1; |
268 | } | 268 | } |
269 | 269 | ||
@@ -293,10 +293,7 @@ static int piix_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
293 | pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); | 293 | pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag); |
294 | } | 294 | } |
295 | 295 | ||
296 | if (speed > XFER_PIO_4) | 296 | piix_tune_pio(drive, piix_dma_2_pio(speed)); |
297 | piix_tune_pio(drive, piix_dma_2_pio(speed)); | ||
298 | else | ||
299 | piix_tune_pio(drive, speed - XFER_PIO_0); | ||
300 | 297 | ||
301 | return ide_config_drive_speed(drive, speed); | 298 | return ide_config_drive_speed(drive, speed); |
302 | } | 299 | } |
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index 214d396fc31f..967b939e9d2e 100644 --- a/drivers/ide/pci/slc90e66.c +++ b/drivers/ide/pci/slc90e66.c | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * linux/drivers/ide/pci/slc90e66.c Version 0.15 Jul 6, 2007 | 2 | * linux/drivers/ide/pci/slc90e66.c Version 0.16 Jul 14, 2007 |
3 | * | 3 | * |
4 | * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> | 4 | * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org> |
5 | * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> | 5 | * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com> |
@@ -110,6 +110,11 @@ static int slc90e66_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
110 | int u_speed = 0, u_flag = 1 << drive->dn; | 110 | int u_speed = 0, u_flag = 1 << drive->dn; |
111 | u16 reg4042, reg44, reg48, reg4a; | 111 | u16 reg4042, reg44, reg48, reg4a; |
112 | 112 | ||
113 | if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) { | ||
114 | slc90e66_tune_pio(drive, speed - XFER_PIO_0); | ||
115 | return ide_config_drive_speed(drive, speed); | ||
116 | } | ||
117 | |||
113 | pci_read_config_word(dev, maslave, ®4042); | 118 | pci_read_config_word(dev, maslave, ®4042); |
114 | sitre = (reg4042 & 0x4000) ? 1 : 0; | 119 | sitre = (reg4042 & 0x4000) ? 1 : 0; |
115 | pci_read_config_word(dev, 0x44, ®44); | 120 | pci_read_config_word(dev, 0x44, ®44); |
@@ -125,11 +130,6 @@ static int slc90e66_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
125 | case XFER_MW_DMA_2: | 130 | case XFER_MW_DMA_2: |
126 | case XFER_MW_DMA_1: | 131 | case XFER_MW_DMA_1: |
127 | case XFER_SW_DMA_2: break; | 132 | case XFER_SW_DMA_2: break; |
128 | case XFER_PIO_4: | ||
129 | case XFER_PIO_3: | ||
130 | case XFER_PIO_2: | ||
131 | case XFER_PIO_1: | ||
132 | case XFER_PIO_0: break; | ||
133 | default: return -1; | 133 | default: return -1; |
134 | } | 134 | } |
135 | 135 | ||
@@ -149,10 +149,7 @@ static int slc90e66_tune_chipset(ide_drive_t *drive, const u8 speed) | |||
149 | pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); | 149 | pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); |
150 | } | 150 | } |
151 | 151 | ||
152 | if (speed > XFER_PIO_4) | 152 | slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed)); |
153 | slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed)); | ||
154 | else | ||
155 | slc90e66_tune_pio(drive, speed - XFER_PIO_0); | ||
156 | 153 | ||
157 | return ide_config_drive_speed(drive, speed); | 154 | return ide_config_drive_speed(drive, speed); |
158 | } | 155 | } |