diff options
Diffstat (limited to 'drivers/ide/pci/cmd640.c')
-rw-r--r-- | drivers/ide/pci/cmd640.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c index dc43f009acab..9689494efa24 100644 --- a/drivers/ide/pci/cmd640.c +++ b/drivers/ide/pci/cmd640.c | |||
@@ -633,9 +633,8 @@ static void cmd640_set_mode (unsigned int index, u8 pio_mode, unsigned int cycle | |||
633 | */ | 633 | */ |
634 | static void cmd640_tune_drive (ide_drive_t *drive, u8 mode_wanted) | 634 | static void cmd640_tune_drive (ide_drive_t *drive, u8 mode_wanted) |
635 | { | 635 | { |
636 | unsigned int index = 0, cycle_time; | ||
636 | u8 b; | 637 | u8 b; |
637 | ide_pio_data_t d; | ||
638 | unsigned int index = 0; | ||
639 | 638 | ||
640 | while (drive != cmd_drives[index]) { | 639 | while (drive != cmd_drives[index]) { |
641 | if (++index > 3) { | 640 | if (++index > 3) { |
@@ -662,16 +661,14 @@ static void cmd640_tune_drive (ide_drive_t *drive, u8 mode_wanted) | |||
662 | return; | 661 | return; |
663 | } | 662 | } |
664 | 663 | ||
665 | (void) ide_get_best_pio_mode (drive, mode_wanted, 5, &d); | 664 | mode_wanted = ide_get_best_pio_mode(drive, mode_wanted, 5); |
666 | cmd640_set_mode (index, d.pio_mode, d.cycle_time); | 665 | cycle_time = ide_pio_cycle_time(drive, mode_wanted); |
666 | cmd640_set_mode(index, mode_wanted, cycle_time); | ||
667 | |||
668 | printk("%s: selected cmd640 PIO mode%d (%dns)", | ||
669 | drive->name, mode_wanted, cycle_time); | ||
667 | 670 | ||
668 | printk ("%s: selected cmd640 PIO mode%d (%dns)%s", | ||
669 | drive->name, | ||
670 | d.pio_mode, | ||
671 | d.cycle_time, | ||
672 | d.overridden ? " (overriding vendor mode)" : ""); | ||
673 | display_clocks(index); | 671 | display_clocks(index); |
674 | return; | ||
675 | } | 672 | } |
676 | 673 | ||
677 | #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ | 674 | #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ |
@@ -769,6 +766,7 @@ int __init ide_probe_for_cmd640x (void) | |||
769 | cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr); | 766 | cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr); |
770 | cmd_hwif0->chipset = ide_cmd640; | 767 | cmd_hwif0->chipset = ide_cmd640; |
771 | #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED | 768 | #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED |
769 | cmd_hwif0->pio_mask = ATA_PIO5; | ||
772 | cmd_hwif0->tuneproc = &cmd640_tune_drive; | 770 | cmd_hwif0->tuneproc = &cmd640_tune_drive; |
773 | #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ | 771 | #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ |
774 | 772 | ||
@@ -824,6 +822,7 @@ int __init ide_probe_for_cmd640x (void) | |||
824 | cmd_hwif1->mate = cmd_hwif0; | 822 | cmd_hwif1->mate = cmd_hwif0; |
825 | cmd_hwif1->channel = 1; | 823 | cmd_hwif1->channel = 1; |
826 | #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED | 824 | #ifdef CONFIG_BLK_DEV_CMD640_ENHANCED |
825 | cmd_hwif1->pio_mask = ATA_PIO5; | ||
827 | cmd_hwif1->tuneproc = &cmd640_tune_drive; | 826 | cmd_hwif1->tuneproc = &cmd640_tune_drive; |
828 | #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ | 827 | #endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ |
829 | } | 828 | } |