aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ide-timing.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/ide-timing.h')
-rw-r--r--drivers/ide/ide-timing.h18
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/ide/ide-timing.h b/drivers/ide/ide-timing.h
index 9b5afebafbf4..daffbb9797e1 100644
--- a/drivers/ide/ide-timing.h
+++ b/drivers/ide/ide-timing.h
@@ -106,21 +106,6 @@ static struct ide_timing ide_timing[] = {
106#define XFER_EPIO 0x01 106#define XFER_EPIO 0x01
107#define XFER_PIO 0x00 107#define XFER_PIO 0x00
108 108
109static short ide_find_best_pio_mode(ide_drive_t *drive)
110{
111 struct hd_driveid *id = drive->id;
112 short best = 0;
113
114 /* EIDE PIO modes */
115 if ((id->field_valid & 2) && (id->capability & 8)) {
116 if ((best = (drive->id->eide_pio_modes & 4) ? XFER_PIO_5 :
117 (drive->id->eide_pio_modes & 2) ? XFER_PIO_4 :
118 (drive->id->eide_pio_modes & 1) ? XFER_PIO_3 : 0)) return best;
119 }
120
121 return XFER_PIO_0 + min_t(u8, id->tPIO, 2);
122}
123
124static void ide_timing_quantize(struct ide_timing *t, struct ide_timing *q, int T, int UT) 109static void ide_timing_quantize(struct ide_timing *t, struct ide_timing *q, int T, int UT)
125{ 110{
126 q->setup = EZ(t->setup * 1000, T); 111 q->setup = EZ(t->setup * 1000, T);
@@ -210,7 +195,8 @@ static int ide_timing_compute(ide_drive_t *drive, short speed, struct ide_timing
210 */ 195 */
211 196
212 if ((speed & XFER_MODE) != XFER_PIO) { 197 if ((speed & XFER_MODE) != XFER_PIO) {
213 ide_timing_compute(drive, ide_find_best_pio_mode(drive), &p, T, UT); 198 u8 pio = ide_get_best_pio_mode(drive, 255, 5);
199 ide_timing_compute(drive, XFER_PIO_0 + pio, &p, T, UT);
214 ide_timing_merge(&p, t, t, IDE_TIMING_ALL); 200 ide_timing_merge(&p, t, t, IDE_TIMING_ALL);
215 } 201 }
216 202