Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 76266
b: refs/heads/master
c: ad4ba7d
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz committed Jan 25, 2008
1 parent bca0f21 commit 9698c86
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 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: 3071a9d00b8684899d93f368e670c4de0293df29
refs/heads/master: ad4ba7dcef285c92a6856e0dd9feb780c1a79b87
26 changes: 10 additions & 16 deletions trunk/drivers/ide/pci/pdc202xx_new.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ static struct udma_timing {
{ 0x1a, 0x01, 0xcb }, /* UDMA mode 6 */
};

static void pdcnew_set_mode(ide_drive_t *drive, const u8 speed)
static void pdcnew_set_dma_mode(ide_drive_t *drive, const u8 speed)
{
ide_hwif_t *hwif = HWIF(drive);
u8 adj = (drive->dn & 1) ? 0x08 : 0x00;
Expand Down Expand Up @@ -177,7 +177,6 @@ static void pdcnew_set_mode(ide_drive_t *drive, const u8 speed)
set_indexed_reg(hwif, 0x12 + adj,
udma_timings[mode].reg12);
break;

case XFER_MW_DMA_2:
case XFER_MW_DMA_1:
case XFER_MW_DMA_0:
Expand All @@ -186,18 +185,6 @@ static void pdcnew_set_mode(ide_drive_t *drive, const u8 speed)
set_indexed_reg(hwif, 0x0f + adj,
mwdma_timings[mode].reg0f);
break;
case XFER_PIO_4:
case XFER_PIO_3:
case XFER_PIO_2:
case XFER_PIO_1:
case XFER_PIO_0:
set_indexed_reg(hwif, 0x0c + adj,
pio_timings[mode].reg0c);
set_indexed_reg(hwif, 0x0d + adj,
pio_timings[mode].reg0d);
set_indexed_reg(hwif, 0x13 + adj,
pio_timings[mode].reg13);
break;
default:
printk(KERN_ERR "pdc202xx_new: "
"Unknown speed %d ignored\n", speed);
Expand All @@ -212,7 +199,14 @@ static void pdcnew_set_mode(ide_drive_t *drive, const u8 speed)

static void pdcnew_set_pio_mode(ide_drive_t *drive, const u8 pio)
{
pdcnew_set_mode(drive, XFER_PIO_0 + pio);
ide_hwif_t *hwif = drive->hwif;
u8 adj = (drive->dn & 1) ? 0x08 : 0x00;

if (max_dma_rate(hwif->pci_dev) == 4) {
set_indexed_reg(hwif, 0x0c + adj, pio_timings[pio].reg0c);
set_indexed_reg(hwif, 0x0d + adj, pio_timings[pio].reg0d);
set_indexed_reg(hwif, 0x13 + adj, pio_timings[pio].reg13);
}
}

static u8 pdcnew_cable_detect(ide_hwif_t *hwif)
Expand Down Expand Up @@ -466,7 +460,7 @@ static unsigned int __devinit init_chipset_pdcnew(struct pci_dev *dev, const cha
static void __devinit init_hwif_pdc202new(ide_hwif_t *hwif)
{
hwif->set_pio_mode = &pdcnew_set_pio_mode;
hwif->set_dma_mode = &pdcnew_set_mode;
hwif->set_dma_mode = &pdcnew_set_dma_mode;

hwif->quirkproc = &pdcnew_quirkproc;
hwif->resetproc = &pdcnew_reset;
Expand Down

0 comments on commit 9698c86

Please sign in to comment.