aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/cmd64x.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-19 19:11:56 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2007-07-19 19:11:56 -0400
commit7dd00083b1160b560fa2a0a486799b57baa5d035 (patch)
tree22e8cf2c740d55ff9b4fdf57b9593a357d0092b7 /drivers/ide/pci/cmd64x.c
parent31c4df441cce6b9ec541e7f722f50bfbc617dd76 (diff)
ide: add ide_pio_cycle_time() helper (take 2)
* Add ide_pio_cycle_time() helper. * Use it in ali14xx/ht6560b/qd65xx/cmd64{0,x}/sl82c105 and pmac host drivers (previously cycle time given by the device was only used for "pio" == 255). * Remove no longer needed ide_pio_data_t.cycle_time field. v2: * Fix "ata_" prefix (Noticed by Jeff). Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Cc: Jeff Garzik <jeff@garzik.org> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/cmd64x.c')
-rw-r--r--drivers/ide/pci/cmd64x.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/drivers/ide/pci/cmd64x.c b/drivers/ide/pci/cmd64x.c
index 8150a023dd7a..c383f6dc67dd 100644
--- a/drivers/ide/pci/cmd64x.c
+++ b/drivers/ide/pci/cmd64x.c
@@ -221,16 +221,18 @@ static u8 cmd64x_tune_pio (ide_drive_t *drive, u8 mode_wanted)
221{ 221{
222 ide_hwif_t *hwif = HWIF(drive); 222 ide_hwif_t *hwif = HWIF(drive);
223 struct pci_dev *dev = hwif->pci_dev; 223 struct pci_dev *dev = hwif->pci_dev;
224 ide_pio_data_t pio; 224 unsigned int cycle_time;
225 u8 pio_mode, setup_count, arttim = 0; 225 u8 pio_mode, setup_count, arttim = 0;
226 static const u8 setup_values[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0}; 226 static const u8 setup_values[] = {0x40, 0x40, 0x40, 0x80, 0, 0xc0};
227 static const u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23}; 227 static const u8 arttim_regs[4] = {ARTTIM0, ARTTIM1, ARTTIM23, ARTTIM23};
228 pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, &pio); 228
229 pio_mode = ide_get_best_pio_mode(drive, mode_wanted, 5, NULL);
230 cycle_time = ide_pio_cycle_time(drive, pio_mode);
229 231
230 cmdprintk("%s: PIO mode wanted %d, selected %d (%d ns)\n", 232 cmdprintk("%s: PIO mode wanted %d, selected %d (%d ns)\n",
231 drive->name, mode_wanted, pio_mode, pio.cycle_time); 233 drive->name, mode_wanted, pio_mode, cycle_time);
232 234
233 program_cycle_times(drive, pio.cycle_time, 235 program_cycle_times(drive, cycle_time,
234 ide_pio_timings[pio_mode].active_time); 236 ide_pio_timings[pio_mode].active_time);
235 237
236 setup_count = quantize_timing(ide_pio_timings[pio_mode].setup_time, 238 setup_count = quantize_timing(ide_pio_timings[pio_mode].setup_time,