diff options
author | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-02-16 20:40:20 -0500 |
---|---|---|
committer | Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> | 2007-02-16 20:40:20 -0500 |
commit | 296d9bcc00c7180d327235d6f1e4b7f4ac0166a1 (patch) | |
tree | d5d64df844484336db2a8dc6cd7afaf966b1196c /drivers/ide/pci/hpt34x.c | |
parent | 8a03d9a498eaf02c8a118752050a5154852c13bf (diff) |
hpt34x: hpt34x_tune_chipset() (->speedproc) fix
* remember to clear reg2 bits for the current device before setting mode
* remove no longer needed hpt34x_clear_chipset()
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/hpt34x.c')
-rw-r--r-- | drivers/ide/pci/hpt34x.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/drivers/ide/pci/hpt34x.c b/drivers/ide/pci/hpt34x.c index ce7b08f08a09..6707f3944d44 100644 --- a/drivers/ide/pci/hpt34x.c +++ b/drivers/ide/pci/hpt34x.c | |||
@@ -48,19 +48,6 @@ static u8 hpt34x_ratemask (ide_drive_t *drive) | |||
48 | return 1; | 48 | return 1; |
49 | } | 49 | } |
50 | 50 | ||
51 | static void hpt34x_clear_chipset (ide_drive_t *drive) | ||
52 | { | ||
53 | struct pci_dev *dev = HWIF(drive)->pci_dev; | ||
54 | u32 reg1 = 0, tmp1 = 0, reg2 = 0, tmp2 = 0; | ||
55 | |||
56 | pci_read_config_dword(dev, 0x44, ®1); | ||
57 | pci_read_config_dword(dev, 0x48, ®2); | ||
58 | tmp1 = ((0x00 << (3*drive->dn)) | (reg1 & ~(7 << (3*drive->dn)))); | ||
59 | tmp2 = (reg2 & ~(0x11 << drive->dn)); | ||
60 | pci_write_config_dword(dev, 0x44, tmp1); | ||
61 | pci_write_config_dword(dev, 0x48, tmp2); | ||
62 | } | ||
63 | |||
64 | static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed) | 51 | static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed) |
65 | { | 52 | { |
66 | struct pci_dev *dev = HWIF(drive)->pci_dev; | 53 | struct pci_dev *dev = HWIF(drive)->pci_dev; |
@@ -81,7 +68,7 @@ static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
81 | pci_read_config_dword(dev, 0x44, ®1); | 68 | pci_read_config_dword(dev, 0x44, ®1); |
82 | pci_read_config_dword(dev, 0x48, ®2); | 69 | pci_read_config_dword(dev, 0x48, ®2); |
83 | tmp1 = ((lo_speed << (3*drive->dn)) | (reg1 & ~(7 << (3*drive->dn)))); | 70 | tmp1 = ((lo_speed << (3*drive->dn)) | (reg1 & ~(7 << (3*drive->dn)))); |
84 | tmp2 = ((hi_speed << drive->dn) | reg2); | 71 | tmp2 = ((hi_speed << drive->dn) | (reg2 & ~(0x11 << drive->dn))); |
85 | pci_write_config_dword(dev, 0x44, tmp1); | 72 | pci_write_config_dword(dev, 0x44, tmp1); |
86 | pci_write_config_dword(dev, 0x48, tmp2); | 73 | pci_write_config_dword(dev, 0x48, tmp2); |
87 | 74 | ||
@@ -99,7 +86,6 @@ static int hpt34x_tune_chipset (ide_drive_t *drive, u8 xferspeed) | |||
99 | static void hpt34x_tune_drive (ide_drive_t *drive, u8 pio) | 86 | static void hpt34x_tune_drive (ide_drive_t *drive, u8 pio) |
100 | { | 87 | { |
101 | pio = ide_get_best_pio_mode(drive, pio, 5, NULL); | 88 | pio = ide_get_best_pio_mode(drive, pio, 5, NULL); |
102 | hpt34x_clear_chipset(drive); | ||
103 | (void) hpt34x_tune_chipset(drive, (XFER_PIO_0 + pio)); | 89 | (void) hpt34x_tune_chipset(drive, (XFER_PIO_0 + pio)); |
104 | } | 90 | } |
105 | 91 | ||
@@ -117,7 +103,6 @@ static int config_chipset_for_dma (ide_drive_t *drive) | |||
117 | if (!(speed)) | 103 | if (!(speed)) |
118 | return 0; | 104 | return 0; |
119 | 105 | ||
120 | hpt34x_clear_chipset(drive); | ||
121 | (void) hpt34x_tune_chipset(drive, speed); | 106 | (void) hpt34x_tune_chipset(drive, speed); |
122 | return ide_dma_enable(drive); | 107 | return ide_dma_enable(drive); |
123 | } | 108 | } |