diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-08-01 17:46:46 -0400 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-08-01 17:46:46 -0400 |
commit | 0c8de52d76e4bec6e9168b47be29f11b3bb92768 (patch) | |
tree | 8017e7a07d2d63cf28c35e094944e67022957730 /drivers/ide/pci/slc90e66.c | |
parent | 8b6b33be3280fd776335079124ecd176e6a40797 (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/slc90e66.c')
-rw-r--r-- | drivers/ide/pci/slc90e66.c | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/drivers/ide/pci/slc90e66.c b/drivers/ide/pci/slc90e66.c index 8e655f2db5cb..628b0664f576 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.14 February 8, 2007 | 2 | * linux/drivers/ide/pci/slc90e66.c Version 0.15 Jul 6, 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> |
@@ -29,20 +29,14 @@ static u8 slc90e66_dma_2_pio (u8 xfer_rate) { | |||
29 | case XFER_UDMA_1: | 29 | case XFER_UDMA_1: |
30 | case XFER_UDMA_0: | 30 | case XFER_UDMA_0: |
31 | case XFER_MW_DMA_2: | 31 | case XFER_MW_DMA_2: |
32 | case XFER_PIO_4: | ||
33 | return 4; | 32 | return 4; |
34 | case XFER_MW_DMA_1: | 33 | case XFER_MW_DMA_1: |
35 | case XFER_PIO_3: | ||
36 | return 3; | 34 | return 3; |
37 | case XFER_SW_DMA_2: | 35 | case XFER_SW_DMA_2: |
38 | case XFER_PIO_2: | ||
39 | return 2; | 36 | return 2; |
40 | case XFER_MW_DMA_0: | 37 | case XFER_MW_DMA_0: |
41 | case XFER_SW_DMA_1: | 38 | case XFER_SW_DMA_1: |
42 | case XFER_SW_DMA_0: | 39 | case XFER_SW_DMA_0: |
43 | case XFER_PIO_1: | ||
44 | case XFER_PIO_0: | ||
45 | case XFER_PIO_SLOW: | ||
46 | default: | 40 | default: |
47 | return 0; | 41 | return 0; |
48 | } | 42 | } |
@@ -136,6 +130,7 @@ static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
136 | case XFER_PIO_4: | 130 | case XFER_PIO_4: |
137 | case XFER_PIO_3: | 131 | case XFER_PIO_3: |
138 | case XFER_PIO_2: | 132 | case XFER_PIO_2: |
133 | case XFER_PIO_1: | ||
139 | case XFER_PIO_0: break; | 134 | case XFER_PIO_0: break; |
140 | default: return -1; | 135 | default: return -1; |
141 | } | 136 | } |
@@ -156,7 +151,11 @@ static int slc90e66_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
156 | pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); | 151 | pci_write_config_word(dev, 0x4a, reg4a & ~a_speed); |
157 | } | 152 | } |
158 | 153 | ||
159 | slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed)); | 154 | if (speed > XFER_PIO_4) |
155 | slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed)); | ||
156 | else | ||
157 | slc90e66_tune_pio(drive, speed - XFER_PIO_0); | ||
158 | |||
160 | return ide_config_drive_speed(drive, speed); | 159 | return ide_config_drive_speed(drive, speed); |
161 | } | 160 | } |
162 | 161 | ||