aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/ppc
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:38 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-07-16 14:33:38 -0400
commit8a97206e31dc2e2f8f9b4d97e234b5c701fe9894 (patch)
tree317b1c340bd04ace82a20be30d5d9eecd84d8ef8 /drivers/ide/ppc
parentb96f7384646519da54ad50bfad8d53b915b70cb3 (diff)
ide-pmac: convert to use ide_timing_find_mode()
Also update my Copyrights while at it. 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/ppc')
-rw-r--r--drivers/ide/ppc/pmac.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/ide/ppc/pmac.c b/drivers/ide/ppc/pmac.c
index 5b91d23269d3..cfa103a51b31 100644
--- a/drivers/ide/ppc/pmac.c
+++ b/drivers/ide/ppc/pmac.c
@@ -5,7 +5,7 @@
5 * for doing DMA. 5 * for doing DMA.
6 * 6 *
7 * Copyright (C) 1998-2003 Paul Mackerras & Ben. Herrenschmidt 7 * Copyright (C) 1998-2003 Paul Mackerras & Ben. Herrenschmidt
8 * Copyright (C) 2007 Bartlomiej Zolnierkiewicz 8 * Copyright (C) 2007-2008 Bartlomiej Zolnierkiewicz
9 * 9 *
10 * This program is free software; you can redistribute it and/or 10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License 11 * modify it under the terms of the GNU General Public License
@@ -493,6 +493,7 @@ static void pmac_outbsync(ide_hwif_t *hwif, u8 value, unsigned long port)
493static void 493static void
494pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio) 494pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
495{ 495{
496 struct ide_timing *tim = ide_timing_find_mode(XFER_PIO_0 + pio);
496 u32 *timings, t; 497 u32 *timings, t;
497 unsigned accessTicks, recTicks; 498 unsigned accessTicks, recTicks;
498 unsigned accessTime, recTime; 499 unsigned accessTime, recTime;
@@ -524,10 +525,9 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
524 } 525 }
525 case controller_kl_ata4: 526 case controller_kl_ata4:
526 /* 66Mhz cell */ 527 /* 66Mhz cell */
527 recTime = cycle_time - ide_pio_timings[pio].active_time 528 recTime = cycle_time - tim->active - tim->setup;
528 - ide_pio_timings[pio].setup_time;
529 recTime = max(recTime, 150U); 529 recTime = max(recTime, 150U);
530 accessTime = ide_pio_timings[pio].active_time; 530 accessTime = tim->active;
531 accessTime = max(accessTime, 150U); 531 accessTime = max(accessTime, 150U);
532 accessTicks = SYSCLK_TICKS_66(accessTime); 532 accessTicks = SYSCLK_TICKS_66(accessTime);
533 accessTicks = min(accessTicks, 0x1fU); 533 accessTicks = min(accessTicks, 0x1fU);
@@ -540,10 +540,9 @@ pmac_ide_set_pio_mode(ide_drive_t *drive, const u8 pio)
540 default: { 540 default: {
541 /* 33Mhz cell */ 541 /* 33Mhz cell */
542 int ebit = 0; 542 int ebit = 0;
543 recTime = cycle_time - ide_pio_timings[pio].active_time 543 recTime = cycle_time - tim->active - tim->setup;
544 - ide_pio_timings[pio].setup_time;
545 recTime = max(recTime, 150U); 544 recTime = max(recTime, 150U);
546 accessTime = ide_pio_timings[pio].active_time; 545 accessTime = tim->active;
547 accessTime = max(accessTime, 150U); 546 accessTime = max(accessTime, 150U);
548 accessTicks = SYSCLK_TICKS(accessTime); 547 accessTicks = SYSCLK_TICKS(accessTime);
549 accessTicks = min(accessTicks, 0x1fU); 548 accessTicks = min(accessTicks, 0x1fU);