aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide')
-rw-r--r--drivers/ide/Kconfig1
-rw-r--r--drivers/ide/pci/cmd640.c8
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/ide/Kconfig b/drivers/ide/Kconfig
index cadce92047fb..e072bdea907a 100644
--- a/drivers/ide/Kconfig
+++ b/drivers/ide/Kconfig
@@ -329,6 +329,7 @@ config BLK_DEV_PLATFORM
329config BLK_DEV_CMD640 329config BLK_DEV_CMD640
330 tristate "CMD640 chipset bugfix/support" 330 tristate "CMD640 chipset bugfix/support"
331 depends on X86 331 depends on X86
332 select IDE_TIMINGS
332 ---help--- 333 ---help---
333 The CMD-Technologies CMD640 IDE chip is used on many common 486 and 334 The CMD-Technologies CMD640 IDE chip is used on many common 486 and
334 Pentium motherboards, usually in combination with a "Neptune" or 335 Pentium motherboards, usually in combination with a "Neptune" or
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index cd1ba14984ab..baa26a26709a 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -521,6 +521,7 @@ static void program_drive_counts(ide_drive_t *drive, unsigned int index)
521static void cmd640_set_mode(ide_drive_t *drive, unsigned int index, 521static void cmd640_set_mode(ide_drive_t *drive, unsigned int index,
522 u8 pio_mode, unsigned int cycle_time) 522 u8 pio_mode, unsigned int cycle_time)
523{ 523{
524 struct ide_timing *t;
524 int setup_time, active_time, recovery_time, clock_time; 525 int setup_time, active_time, recovery_time, clock_time;
525 u8 setup_count, active_count, recovery_count, recovery_count2, cycle_count; 526 u8 setup_count, active_count, recovery_count, recovery_count2, cycle_count;
526 int bus_speed; 527 int bus_speed;
@@ -532,8 +533,11 @@ static void cmd640_set_mode(ide_drive_t *drive, unsigned int index,
532 533
533 if (pio_mode > 5) 534 if (pio_mode > 5)
534 pio_mode = 5; 535 pio_mode = 5;
535 setup_time = ide_pio_timings[pio_mode].setup_time; 536
536 active_time = ide_pio_timings[pio_mode].active_time; 537 t = ide_timing_find_mode(XFER_PIO_0 + pio_mode);
538 setup_time = t->setup;
539 active_time = t->active;
540
537 recovery_time = cycle_time - (setup_time + active_time); 541 recovery_time = cycle_time - (setup_time + active_time);
538 clock_time = 1000 / bus_speed; 542 clock_time = 1000 / bus_speed;
539 cycle_count = DIV_ROUND_UP(cycle_time, clock_time); 543 cycle_count = DIV_ROUND_UP(cycle_time, clock_time);