aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-timing.h
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:36 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:36 -0400
commitbd887f72d2a28a8202519e67fd9ed93ee3c4e78d (patch)
treece71b2dc1c1575b16846ea2b57f8c18f1f0fbf93 /drivers/ide/ide-timing.h
parent3be53f3f213223f50d8e29b5e1869685bf040a1e (diff)
ide: remove XFER_* masks from ide-timing.h
* Check requested xfer mode against xfer modes instead of XFER_* masks in ide_timing_compute() and cs5535.c::cs5535_set_speed(). * Remove XFER_[MODE,MWDMA,EPIO,PIO] masks. There should be no functional changes caused by this patch. Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/ide-timing.h')
-rw-r--r--drivers/ide/ide-timing.h24
1 files changed, 7 insertions, 17 deletions
diff --git a/drivers/ide/ide-timing.h b/drivers/ide/ide-timing.h
index 724879910ac8..a401d8f82b50 100644
--- a/drivers/ide/ide-timing.h
+++ b/drivers/ide/ide-timing.h
@@ -70,11 +70,6 @@ static struct ide_timing ide_timing[] = {
70#define ENOUGH(v,unit) (((v)-1)/(unit)+1) 70#define ENOUGH(v,unit) (((v)-1)/(unit)+1)
71#define EZ(v,unit) ((v)?ENOUGH(v,unit):0) 71#define EZ(v,unit) ((v)?ENOUGH(v,unit):0)
72 72
73#define XFER_MODE 0xf0
74#define XFER_MWDMA 0x20
75#define XFER_EPIO 0x01
76#define XFER_PIO 0x00
77
78static void ide_timing_quantize(struct ide_timing *t, struct ide_timing *q, int T, int UT) 73static void ide_timing_quantize(struct ide_timing *t, struct ide_timing *q, int T, int UT)
79{ 74{
80 q->setup = EZ(t->setup * 1000, T); 75 q->setup = EZ(t->setup * 1000, T);
@@ -137,17 +132,12 @@ static int ide_timing_compute(ide_drive_t *drive, u8 speed,
137 132
138 memset(&p, 0, sizeof(p)); 133 memset(&p, 0, sizeof(p));
139 134
140 switch (speed & XFER_MODE) { 135 if (speed <= XFER_PIO_2)
141 136 p.cycle = p.cyc8b = id->eide_pio;
142 case XFER_PIO: 137 else if (speed <= XFER_PIO_5)
143 if (speed <= XFER_PIO_2) p.cycle = p.cyc8b = id->eide_pio; 138 p.cycle = p.cyc8b = id->eide_pio_iordy;
144 else p.cycle = p.cyc8b = id->eide_pio_iordy; 139 else if (speed >= XFER_MW_DMA_0 && speed <= XFER_MW_DMA_2)
145 break; 140 p.cycle = id->eide_dma_min;
146
147 case XFER_MWDMA:
148 p.cycle = id->eide_dma_min;
149 break;
150 }
151 141
152 ide_timing_merge(&p, t, t, IDE_TIMING_CYCLE | IDE_TIMING_CYC8B); 142 ide_timing_merge(&p, t, t, IDE_TIMING_CYCLE | IDE_TIMING_CYC8B);
153 } 143 }
@@ -164,7 +154,7 @@ static int ide_timing_compute(ide_drive_t *drive, u8 speed,
164 * slower/equal than the fastest PIO timing. 154 * slower/equal than the fastest PIO timing.
165 */ 155 */
166 156
167 if ((speed & XFER_MODE) != XFER_PIO) { 157 if (speed >= XFER_SW_DMA_0) {
168 u8 pio = ide_get_best_pio_mode(drive, 255, 5); 158 u8 pio = ide_get_best_pio_mode(drive, 255, 5);
169 ide_timing_compute(drive, XFER_PIO_0 + pio, &p, T, UT); 159 ide_timing_compute(drive, XFER_PIO_0 + pio, &p, T, UT);
170 ide_timing_merge(&p, t, t, IDE_TIMING_ALL); 160 ide_timing_merge(&p, t, t, IDE_TIMING_ALL);