aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/it8213.c
diff options
context:
space:
mode:
authorPaul Mackerras <paulus@samba.org>2007-05-10 07:08:37 -0400
committerPaul Mackerras <paulus@samba.org>2007-05-10 07:08:37 -0400
commit2ecf042ef530dd0943e41d84b6344f507941af3e (patch)
tree73100361dd74e3f80f14c7c81ba4675948983f44 /drivers/ide/pci/it8213.c
parent32a56ebb24f23da1bbaf24292acf85b6c04526ab (diff)
parentde5603748af8bf7deac403e6ba92887f8d18e812 (diff)
Merge branch 'linux-2.6'
Diffstat (limited to 'drivers/ide/pci/it8213.c')
-rw-r--r--drivers/ide/pci/it8213.c39
1 files changed, 2 insertions, 37 deletions
diff --git a/drivers/ide/pci/it8213.c b/drivers/ide/pci/it8213.c
index 424f00bb160d..c04a02687b95 100644
--- a/drivers/ide/pci/it8213.c
+++ b/drivers/ide/pci/it8213.c
@@ -17,22 +17,6 @@
17 17
18#include <asm/io.h> 18#include <asm/io.h>
19 19
20/*
21 * it8213_ratemask - Compute available modes
22 * @drive: IDE drive
23 *
24 * Compute the available speeds for the devices on the interface. This
25 * is all modes to ATA133 clipped by drive cable setup.
26 */
27
28static u8 it8213_ratemask (ide_drive_t *drive)
29{
30 u8 mode = 4;
31 if (!eighty_ninty_three(drive))
32 mode = min_t(u8, mode, 1);
33 return mode;
34}
35
36/** 20/**
37 * it8213_dma_2_pio - return the PIO mode matching DMA 21 * it8213_dma_2_pio - return the PIO mode matching DMA
38 * @xfer_rate: transfer speed 22 * @xfer_rate: transfer speed
@@ -145,7 +129,7 @@ static int it8213_tune_chipset (ide_drive_t *drive, u8 xferspeed)
145 ide_hwif_t *hwif = HWIF(drive); 129 ide_hwif_t *hwif = HWIF(drive);
146 struct pci_dev *dev = hwif->pci_dev; 130 struct pci_dev *dev = hwif->pci_dev;
147 u8 maslave = 0x40; 131 u8 maslave = 0x40;
148 u8 speed = ide_rate_filter(it8213_ratemask(drive), xferspeed); 132 u8 speed = ide_rate_filter(drive, xferspeed);
149 int a_speed = 3 << (drive->dn * 4); 133 int a_speed = 3 << (drive->dn * 4);
150 int u_flag = 1 << drive->dn; 134 int u_flag = 1 << drive->dn;
151 int v_flag = 0x01 << drive->dn; 135 int v_flag = 0x01 << drive->dn;
@@ -213,25 +197,6 @@ static int it8213_tune_chipset (ide_drive_t *drive, u8 xferspeed)
213 return ide_config_drive_speed(drive, speed); 197 return ide_config_drive_speed(drive, speed);
214} 198}
215 199
216/*
217 * config_chipset_for_dma - configure for DMA
218 * @drive: drive to configure
219 *
220 * Called by the IDE layer when it wants the timings set up.
221 */
222
223static int config_chipset_for_dma (ide_drive_t *drive)
224{
225 u8 speed = ide_dma_speed(drive, it8213_ratemask(drive));
226
227 if (!speed)
228 return 0;
229
230 it8213_tune_chipset(drive, speed);
231
232 return ide_dma_enable(drive);
233}
234
235/** 200/**
236 * it8213_configure_drive_for_dma - set up for DMA transfers 201 * it8213_configure_drive_for_dma - set up for DMA transfers
237 * @drive: drive we are going to set up 202 * @drive: drive we are going to set up
@@ -246,7 +211,7 @@ static int it8213_config_drive_for_dma (ide_drive_t *drive)
246{ 211{
247 u8 pio; 212 u8 pio;
248 213
249 if (ide_use_dma(drive) && config_chipset_for_dma(drive)) 214 if (ide_tune_dma(drive))
250 return 0; 215 return 0;
251 216
252 pio = ide_get_best_pio_mode(drive, 255, 4, NULL); 217 pio = ide_get_best_pio_mode(drive, 255, 4, NULL);