Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 61888
b: refs/heads/master
c: 485efc6
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jul 19, 2007
1 parent cd02899 commit 77c2828
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 9702b5d5c26be12d376e1baf2a8e5b82e6c06b66
refs/heads/master: 485efc6cf507eae2b8e83b56e179c8fa3980641a
32 changes: 19 additions & 13 deletions trunk/drivers/ide/pci/atiixp.c
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
/*
* linux/drivers/ide/pci/atiixp.c Version 0.01-bart2 Feb. 26, 2004
* linux/drivers/ide/pci/atiixp.c Version 0.02 Jun 16 2007
*
* Copyright (C) 2003 ATI Inc. <hyu@ati.com>
* Copyright (C) 2004 Bartlomiej Zolnierkiewicz
*
* Copyright (C) 2004,2007 Bartlomiej Zolnierkiewicz
*/

#include <linux/types.h>
Expand Down Expand Up @@ -123,14 +122,14 @@ static void atiixp_dma_host_off(ide_drive_t *drive)
}

/**
* atiixp_tune_drive - tune a drive attached to a ATIIXP
* atiixp_tune_pio - tune a drive attached to a ATIIXP
* @drive: drive to tune
* @pio: desired PIO mode
*
* Set the interface PIO mode.
*/

static void atiixp_tuneproc(ide_drive_t *drive, u8 pio)
static void atiixp_tune_pio(ide_drive_t *drive, u8 pio)
{
struct pci_dev *dev = drive->hwif->pci_dev;
unsigned long flags;
Expand All @@ -154,6 +153,13 @@ static void atiixp_tuneproc(ide_drive_t *drive, u8 pio)
spin_unlock_irqrestore(&atiixp_lock, flags);
}

static void atiixp_tuneproc(ide_drive_t *drive, u8 pio)
{
pio = ide_get_best_pio_mode(drive, pio, 4, NULL);
atiixp_tune_pio(drive, pio);
(void)ide_config_drive_speed(drive, XFER_PIO_0 + pio);
}

/**
* atiixp_tune_chipset - tune a ATIIXP interface
* @drive: IDE drive to tune
Expand All @@ -175,6 +181,11 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed)

speed = ide_rate_filter(drive, xferspeed);

if (speed >= XFER_PIO_0 && speed <= XFER_PIO_4) {
atiixp_tune_pio(drive, speed - XFER_PIO_0);
return ide_config_drive_speed(drive, speed);
}

spin_lock_irqsave(&atiixp_lock, flags);

save_mdma_mode[drive->dn] = 0;
Expand All @@ -201,7 +212,7 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed)
else
pio = speed - XFER_PIO_0;

atiixp_tuneproc(drive, pio);
atiixp_tune_pio(drive, pio);

return ide_config_drive_speed(drive, speed);
}
Expand All @@ -216,18 +227,13 @@ static int atiixp_speedproc(ide_drive_t *drive, u8 xferspeed)

static int atiixp_dma_check(ide_drive_t *drive)
{
u8 tspeed, speed;

drive->init_speed = 0;

if (ide_tune_dma(drive))
return 0;

if (ide_use_fast_pio(drive)) {
tspeed = ide_get_best_pio_mode(drive, 255, 5, NULL);
speed = atiixp_dma_2_pio(XFER_PIO_0 + tspeed) + XFER_PIO_0;
atiixp_speedproc(drive, speed);
}
if (ide_use_fast_pio(drive))
atiixp_tuneproc(drive, 255);

return -1;
}
Expand Down

0 comments on commit 77c2828

Please sign in to comment.