aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ata/pata_cs5520.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ata/pata_cs5520.c')
-rw-r--r--drivers/ata/pata_cs5520.c39
1 files changed, 1 insertions, 38 deletions
diff --git a/drivers/ata/pata_cs5520.c b/drivers/ata/pata_cs5520.c
index 0df83cf74233..95ebdac517f2 100644
--- a/drivers/ata/pata_cs5520.c
+++ b/drivers/ata/pata_cs5520.c
@@ -90,48 +90,12 @@ static void cs5520_set_timings(struct ata_port *ap, struct ata_device *adev, int
90} 90}
91 91
92/** 92/**
93 * cs5520_enable_dma - turn on DMA bits
94 *
95 * Turn on the DMA bits for this disk. Needed because the BIOS probably
96 * has not done the work for us. Belongs in the core SATA code.
97 */
98
99static void cs5520_enable_dma(struct ata_port *ap, struct ata_device *adev)
100{
101 /* Set the DMA enable/disable flag */
102 u8 reg = ioread8(ap->ioaddr.bmdma_addr + 0x02);
103 reg |= 1<<(adev->devno + 5);
104 iowrite8(reg, ap->ioaddr.bmdma_addr + 0x02);
105}
106
107/**
108 * cs5520_set_dmamode - program DMA timings
109 * @ap: ATA port
110 * @adev: ATA device
111 *
112 * Program the DMA mode timings for the controller according to the pio
113 * clocking table. Note that this device sets the DMA timings to PIO
114 * mode values. This may seem bizarre but the 5520 architecture talks
115 * PIO mode to the disk and DMA mode to the controller so the underlying
116 * transfers are PIO timed.
117 */
118
119static void cs5520_set_dmamode(struct ata_port *ap, struct ata_device *adev)
120{
121 static const int dma_xlate[3] = { XFER_PIO_0, XFER_PIO_3, XFER_PIO_4 };
122 cs5520_set_timings(ap, adev, dma_xlate[adev->dma_mode]);
123 cs5520_enable_dma(ap, adev);
124}
125
126/**
127 * cs5520_set_piomode - program PIO timings 93 * cs5520_set_piomode - program PIO timings
128 * @ap: ATA port 94 * @ap: ATA port
129 * @adev: ATA device 95 * @adev: ATA device
130 * 96 *
131 * Program the PIO mode timings for the controller according to the pio 97 * Program the PIO mode timings for the controller according to the pio
132 * clocking table. We know pio_mode will equal dma_mode because of the 98 * clocking table.
133 * CS5520 architecture. At least once we turned DMA on and wrote a
134 * mode setter.
135 */ 99 */
136 100
137static void cs5520_set_piomode(struct ata_port *ap, struct ata_device *adev) 101static void cs5520_set_piomode(struct ata_port *ap, struct ata_device *adev)
@@ -149,7 +113,6 @@ static struct ata_port_operations cs5520_port_ops = {
149 .qc_prep = ata_sff_dumb_qc_prep, 113 .qc_prep = ata_sff_dumb_qc_prep,
150 .cable_detect = ata_cable_40wire, 114 .cable_detect = ata_cable_40wire,
151 .set_piomode = cs5520_set_piomode, 115 .set_piomode = cs5520_set_piomode,
152 .set_dmamode = cs5520_set_dmamode,
153}; 116};
154 117
155static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id) 118static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id)