aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/trm290.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/trm290.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/trm290.c')
-rw-r--r--drivers/ide/pci/trm290.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/drivers/ide/pci/trm290.c b/drivers/ide/pci/trm290.c
index 7e354d33323b..c506e97cd716 100644
--- a/drivers/ide/pci/trm290.c
+++ b/drivers/ide/pci/trm290.c
@@ -214,7 +214,7 @@ static void trm290_dma_start(ide_drive_t *drive)
214{ 214{
215} 215}
216 216
217static int trm290_ide_dma_end (ide_drive_t *drive) 217static int trm290_dma_end(ide_drive_t *drive)
218{ 218{
219 u16 status; 219 u16 status;
220 220
@@ -225,7 +225,7 @@ static int trm290_ide_dma_end (ide_drive_t *drive)
225 return status != 0x00ff; 225 return status != 0x00ff;
226} 226}
227 227
228static int trm290_ide_dma_test_irq (ide_drive_t *drive) 228static int trm290_dma_test_irq(ide_drive_t *drive)
229{ 229{
230 u16 status; 230 u16 status;
231 231
@@ -280,12 +280,6 @@ static void __devinit init_hwif_trm290(ide_hwif_t *hwif)
280 /* sharing IRQ with mate */ 280 /* sharing IRQ with mate */
281 hwif->irq = hwif->mate->irq; 281 hwif->irq = hwif->mate->irq;
282 282
283 hwif->dma_host_set = &trm290_dma_host_set;
284 hwif->dma_setup = &trm290_dma_setup;
285 hwif->dma_exec_cmd = &trm290_dma_exec_cmd;
286 hwif->dma_start = &trm290_dma_start;
287 hwif->ide_dma_end = &trm290_ide_dma_end;
288 hwif->ide_dma_test_irq = &trm290_ide_dma_test_irq;
289#if 1 283#if 1
290 { 284 {
291 /* 285 /*
@@ -319,11 +313,21 @@ static const struct ide_port_ops trm290_port_ops = {
319 .selectproc = trm290_selectproc, 313 .selectproc = trm290_selectproc,
320}; 314};
321 315
316static struct ide_dma_ops trm290_dma_ops = {
317 .dma_host_set = trm290_dma_host_set,
318 .dma_setup = trm290_dma_setup,
319 .dma_exec_cmd = trm290_dma_exec_cmd,
320 .dma_start = trm290_dma_start,
321 .dma_end = trm290_dma_end,
322 .dma_test_irq = trm290_dma_test_irq,
323};
324
322static const struct ide_port_info trm290_chipset __devinitdata = { 325static const struct ide_port_info trm290_chipset __devinitdata = {
323 .name = "TRM290", 326 .name = "TRM290",
324 .init_hwif = init_hwif_trm290, 327 .init_hwif = init_hwif_trm290,
325 .chipset = ide_trm290, 328 .chipset = ide_trm290,
326 .port_ops = &trm290_port_ops, 329 .port_ops = &trm290_port_ops,
330 .dma_ops = &trm290_dma_ops,
327 .host_flags = IDE_HFLAG_NO_ATAPI_DMA | 331 .host_flags = IDE_HFLAG_NO_ATAPI_DMA |
328#if 0 /* play it safe for now */ 332#if 0 /* play it safe for now */
329 IDE_HFLAG_TRUST_BIOS_FOR_DMA | 333 IDE_HFLAG_TRUST_BIOS_FOR_DMA |