Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 185796
b: refs/heads/master
c: 68d0a03
h: refs/heads/master
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and David S. Miller committed Jan 19, 2010
1 parent 76aeacf commit 128e851
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 3 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: a354ae8747d0687093ce244e76b15b6174d2f098
refs/heads/master: 68d0a036162f12d8be07c9fc140507cc1c8c6120
19 changes: 17 additions & 2 deletions trunk/drivers/ide/via82cxxx.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,25 @@ static void via_set_speed(ide_hwif_t *hwif, u8 dn, struct ide_timing *timing)
case ATA_UDMA4: t = timing->udma ? (0xe8 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x0f; break;
case ATA_UDMA5: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x07; break;
case ATA_UDMA6: t = timing->udma ? (0xe0 | (clamp_val(timing->udma, 2, 9) - 2)) : 0x07; break;
default: return;
}

pci_write_config_byte(dev, VIA_UDMA_TIMING + (3 - dn), t);
/* Set UDMA unless device is not UDMA capable */
if (vdev->via_config->udma_mask) {
u8 udma_etc;

pci_read_config_byte(dev, VIA_UDMA_TIMING + 3 - dn, &udma_etc);

/* clear transfer mode bit */
udma_etc &= ~0x20;

if (timing->udma) {
/* preserve 80-wire cable detection bit */
udma_etc &= 0x10;
udma_etc |= t;
}

pci_write_config_byte(dev, VIA_UDMA_TIMING + 3 - dn, udma_etc);
}
}

/**
Expand Down

0 comments on commit 128e851

Please sign in to comment.