Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 172875
b: refs/heads/master
c: 940a68d
h: refs/heads/master
i:
  172873: 4dbb0d5
  172871: 0043e18
v: v3
  • Loading branch information
Bartlomiej Zolnierkiewicz authored and Jeff Garzik committed Dec 3, 2009
1 parent 27cfd1a commit 2b272d0
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 39 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: dd221f9ce97c33e560a63999c74c17d13ef780b4
refs/heads/master: 940a68de56c1952c29d9f3c1a769a82b1bdd2b67
39 changes: 1 addition & 38 deletions trunk/drivers/ata/pata_cs5520.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,49 +89,13 @@ static void cs5520_set_timings(struct ata_port *ap, struct ata_device *adev, int
(cs5520_pio_clocks[pio].assert));
}

/**
* cs5520_enable_dma - turn on DMA bits
*
* Turn on the DMA bits for this disk. Needed because the BIOS probably
* has not done the work for us. Belongs in the core SATA code.
*/

static void cs5520_enable_dma(struct ata_port *ap, struct ata_device *adev)
{
/* Set the DMA enable/disable flag */
u8 reg = ioread8(ap->ioaddr.bmdma_addr + 0x02);
reg |= 1<<(adev->devno + 5);
iowrite8(reg, ap->ioaddr.bmdma_addr + 0x02);
}

/**
* cs5520_set_dmamode - program DMA timings
* @ap: ATA port
* @adev: ATA device
*
* Program the DMA mode timings for the controller according to the pio
* clocking table. Note that this device sets the DMA timings to PIO
* mode values. This may seem bizarre but the 5520 architecture talks
* PIO mode to the disk and DMA mode to the controller so the underlying
* transfers are PIO timed.
*/

static void cs5520_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
static const int dma_xlate[3] = { XFER_PIO_0, XFER_PIO_3, XFER_PIO_4 };
cs5520_set_timings(ap, adev, dma_xlate[adev->dma_mode]);
cs5520_enable_dma(ap, adev);
}

/**
* cs5520_set_piomode - program PIO timings
* @ap: ATA port
* @adev: ATA device
*
* Program the PIO mode timings for the controller according to the pio
* clocking table. We know pio_mode will equal dma_mode because of the
* CS5520 architecture. At least once we turned DMA on and wrote a
* mode setter.
* clocking table.
*/

static void cs5520_set_piomode(struct ata_port *ap, struct ata_device *adev)
Expand All @@ -149,7 +113,6 @@ static struct ata_port_operations cs5520_port_ops = {
.qc_prep = ata_sff_dumb_qc_prep,
.cable_detect = ata_cable_40wire,
.set_piomode = cs5520_set_piomode,
.set_dmamode = cs5520_set_dmamode,
};

static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
Expand Down

0 comments on commit 2b272d0

Please sign in to comment.