aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/sc1200.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:24 -0400
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-04-26 16:25:24 -0400
commit5e37bdc081a980dd0d669e6387bcf15ca9666f81 (patch)
treed842166c3bd23fbf3dfba0ccaa0f9ed5cc3096db /drivers/ide/pci/sc1200.c
parent1fd1890594bd355a4217f5658a34763e77decee3 (diff)
ide: add struct ide_dma_ops (take 3)
Add struct ide_dma_ops and convert core code + drivers to use it. While at it: * Drop "ide_" prefix from ->ide_dma_end and ->ide_dma_test_irq methods. * Drop "ide_" "infixes" from DMA methods. * au1xxx-ide.c: - use auide_dma_{test_irq,end}() directly in auide_dma_timeout() * pdc202xx_old.c: - drop "old_" "infixes" from DMA methods * siimage.c: - add siimage_dma_test_irq() helper - print SATA warning in siimage_init_one() * Remove no longer needed ->init_hwif implementations. v2: * Changes based on review from Sergei: - s/siimage_ide_dma_test_irq/siimage_dma_test_irq/ - s/drive->hwif/hwif/ in idefloppy_pc_intr(). - fix patch description w.r.t. au1xxx-ide changes - fix au1xxx-ide build - fix naming for cmd64*_dma_ops - drop "ide_" and "old_" infixes - s/hpt3xxx_dma_ops/hpt37x_dma_ops/ - s/hpt370x_dma_ops/hpt370_dma_ops/ - use correct DMA ops for HPT302/N, HPT371/N and HPT374 - s/it821x_smart_dma_ops/it821x_pass_through_dma_ops/ v3: * Two bugs slipped in v2 (noticed by Sergei): - use correct DMA ops for HPT374 (for real this time) - handle HPT370/HPT370A properly Acked-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/pci/sc1200.c')
-rw-r--r--drivers/ide/pci/sc1200.c22
1 files changed, 7 insertions, 15 deletions
diff --git a/drivers/ide/pci/sc1200.c b/drivers/ide/pci/sc1200.c
index 0c144770a8da..303bcfb2a441 100644
--- a/drivers/ide/pci/sc1200.c
+++ b/drivers/ide/pci/sc1200.c
@@ -165,7 +165,7 @@ static void sc1200_set_dma_mode(ide_drive_t *drive, const u8 mode)
165 * 165 *
166 * returns 1 on error, 0 otherwise 166 * returns 1 on error, 0 otherwise
167 */ 167 */
168static int sc1200_ide_dma_end (ide_drive_t *drive) 168static int sc1200_dma_end(ide_drive_t *drive)
169{ 169{
170 ide_hwif_t *hwif = HWIF(drive); 170 ide_hwif_t *hwif = HWIF(drive);
171 unsigned long dma_base = hwif->dma_base; 171 unsigned long dma_base = hwif->dma_base;
@@ -214,7 +214,7 @@ static void sc1200_set_pio_mode(ide_drive_t *drive, const u8 pio)
214 printk("SC1200: %s: changing (U)DMA mode\n", drive->name); 214 printk("SC1200: %s: changing (U)DMA mode\n", drive->name);
215 ide_dma_off_quietly(drive); 215 ide_dma_off_quietly(drive);
216 if (ide_set_dma_mode(drive, mode) == 0 && drive->using_dma) 216 if (ide_set_dma_mode(drive, mode) == 0 && drive->using_dma)
217 hwif->dma_host_set(drive, 1); 217 hwif->dma_ops->dma_host_set(drive, 1);
218 return; 218 return;
219 } 219 }
220 220
@@ -286,28 +286,20 @@ static int sc1200_resume (struct pci_dev *dev)
286} 286}
287#endif 287#endif
288 288
289/*
290 * This gets invoked by the IDE driver once for each channel,
291 * and performs channel-specific pre-initialization before drive probing.
292 */
293static void __devinit init_hwif_sc1200 (ide_hwif_t *hwif)
294{
295 if (hwif->dma_base == 0)
296 return;
297
298 hwif->ide_dma_end = &sc1200_ide_dma_end;
299}
300
301static const struct ide_port_ops sc1200_port_ops = { 289static const struct ide_port_ops sc1200_port_ops = {
302 .set_pio_mode = sc1200_set_pio_mode, 290 .set_pio_mode = sc1200_set_pio_mode,
303 .set_dma_mode = sc1200_set_dma_mode, 291 .set_dma_mode = sc1200_set_dma_mode,
304 .udma_filter = sc1200_udma_filter, 292 .udma_filter = sc1200_udma_filter,
305}; 293};
306 294
295static struct ide_dma_ops sc1200_dma_ops = {
296 .dma_end = sc1200_dma_end,
297};
298
307static const struct ide_port_info sc1200_chipset __devinitdata = { 299static const struct ide_port_info sc1200_chipset __devinitdata = {
308 .name = "SC1200", 300 .name = "SC1200",
309 .init_hwif = init_hwif_sc1200,
310 .port_ops = &sc1200_port_ops, 301 .port_ops = &sc1200_port_ops,
302 .dma_ops = &sc1200_dma_ops,
311 .host_flags = IDE_HFLAG_SERIALIZE | 303 .host_flags = IDE_HFLAG_SERIALIZE |
312 IDE_HFLAG_POST_SET_MODE | 304 IDE_HFLAG_POST_SET_MODE |
313 IDE_HFLAG_ABUSE_DMA_MODES, 305 IDE_HFLAG_ABUSE_DMA_MODES,