diff options
Diffstat (limited to 'drivers/ide/arm/icside.c')
-rw-r--r-- | drivers/ide/arm/icside.c | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c index fd12bbe93f11..7d642f44e35b 100644 --- a/drivers/ide/arm/icside.c +++ b/drivers/ide/arm/icside.c | |||
@@ -191,6 +191,10 @@ static void icside_maskproc(ide_drive_t *drive, int mask) | |||
191 | local_irq_restore(flags); | 191 | local_irq_restore(flags); |
192 | } | 192 | } |
193 | 193 | ||
194 | static const struct ide_port_ops icside_v6_no_dma_port_ops = { | ||
195 | .maskproc = icside_maskproc, | ||
196 | }; | ||
197 | |||
194 | #ifdef CONFIG_BLK_DEV_IDEDMA_ICS | 198 | #ifdef CONFIG_BLK_DEV_IDEDMA_ICS |
195 | /* | 199 | /* |
196 | * SG-DMA support. | 200 | * SG-DMA support. |
@@ -266,6 +270,11 @@ static void icside_set_dma_mode(ide_drive_t *drive, const u8 xfer_mode) | |||
266 | ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data); | 270 | ide_xfer_verbose(xfer_mode), 2000 / drive->drive_data); |
267 | } | 271 | } |
268 | 272 | ||
273 | static const struct ide_port_ops icside_v6_port_ops = { | ||
274 | .set_dma_mode = icside_set_dma_mode, | ||
275 | .maskproc = icside_maskproc, | ||
276 | }; | ||
277 | |||
269 | static void icside_dma_host_set(ide_drive_t *drive, int on) | 278 | static void icside_dma_host_set(ide_drive_t *drive, int on) |
270 | { | 279 | { |
271 | } | 280 | } |
@@ -375,25 +384,33 @@ static void icside_dma_lost_irq(ide_drive_t *drive) | |||
375 | printk(KERN_ERR "%s: IRQ lost\n", drive->name); | 384 | printk(KERN_ERR "%s: IRQ lost\n", drive->name); |
376 | } | 385 | } |
377 | 386 | ||
378 | static void icside_dma_init(ide_hwif_t *hwif) | 387 | static int icside_dma_init(ide_hwif_t *hwif, const struct ide_port_info *d) |
379 | { | 388 | { |
380 | hwif->dmatable_cpu = NULL; | 389 | hwif->dmatable_cpu = NULL; |
381 | hwif->dmatable_dma = 0; | 390 | hwif->dmatable_dma = 0; |
382 | hwif->set_dma_mode = icside_set_dma_mode; | 391 | |
383 | 392 | return 0; | |
384 | hwif->dma_host_set = icside_dma_host_set; | ||
385 | hwif->dma_setup = icside_dma_setup; | ||
386 | hwif->dma_exec_cmd = icside_dma_exec_cmd; | ||
387 | hwif->dma_start = icside_dma_start; | ||
388 | hwif->ide_dma_end = icside_dma_end; | ||
389 | hwif->ide_dma_test_irq = icside_dma_test_irq; | ||
390 | hwif->dma_timeout = icside_dma_timeout; | ||
391 | hwif->dma_lost_irq = icside_dma_lost_irq; | ||
392 | } | 393 | } |
394 | |||
395 | static const struct ide_dma_ops icside_v6_dma_ops = { | ||
396 | .dma_host_set = icside_dma_host_set, | ||
397 | .dma_setup = icside_dma_setup, | ||
398 | .dma_exec_cmd = icside_dma_exec_cmd, | ||
399 | .dma_start = icside_dma_start, | ||
400 | .dma_end = icside_dma_end, | ||
401 | .dma_test_irq = icside_dma_test_irq, | ||
402 | .dma_timeout = icside_dma_timeout, | ||
403 | .dma_lost_irq = icside_dma_lost_irq, | ||
404 | }; | ||
393 | #else | 405 | #else |
394 | #define icside_dma_init(hwif) (0) | 406 | #define icside_v6_dma_ops NULL |
395 | #endif | 407 | #endif |
396 | 408 | ||
409 | static int icside_dma_off_init(ide_hwif_t *hwif, const struct ide_port_info *d) | ||
410 | { | ||
411 | return -EOPNOTSUPP; | ||
412 | } | ||
413 | |||
397 | static ide_hwif_t * | 414 | static ide_hwif_t * |
398 | icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec) | 415 | icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *ec) |
399 | { | 416 | { |
@@ -408,7 +425,6 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e | |||
408 | * Ensure we're using MMIO | 425 | * Ensure we're using MMIO |
409 | */ | 426 | */ |
410 | default_hwif_mmiops(hwif); | 427 | default_hwif_mmiops(hwif); |
411 | hwif->mmio = 1; | ||
412 | 428 | ||
413 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { | 429 | for (i = IDE_DATA_OFFSET; i <= IDE_STATUS_OFFSET; i++) { |
414 | hwif->io_ports[i] = port; | 430 | hwif->io_ports[i] = port; |
@@ -416,7 +432,6 @@ icside_setup(void __iomem *base, struct cardinfo *info, struct expansion_card *e | |||
416 | } | 432 | } |
417 | hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset; | 433 | hwif->io_ports[IDE_CONTROL_OFFSET] = (unsigned long)base + info->ctrloffset; |
418 | hwif->irq = ec->irq; | 434 | hwif->irq = ec->irq; |
419 | hwif->noprobe = 0; | ||
420 | hwif->chipset = ide_acorn; | 435 | hwif->chipset = ide_acorn; |
421 | hwif->gendev.parent = &ec->dev; | 436 | hwif->gendev.parent = &ec->dev; |
422 | hwif->dev = &ec->dev; | 437 | hwif->dev = &ec->dev; |
@@ -462,8 +477,10 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec) | |||
462 | } | 477 | } |
463 | 478 | ||
464 | static const struct ide_port_info icside_v6_port_info __initdata = { | 479 | static const struct ide_port_info icside_v6_port_info __initdata = { |
480 | .init_dma = icside_dma_off_init, | ||
481 | .port_ops = &icside_v6_no_dma_port_ops, | ||
482 | .dma_ops = &icside_v6_dma_ops, | ||
465 | .host_flags = IDE_HFLAG_SERIALIZE | | 483 | .host_flags = IDE_HFLAG_SERIALIZE | |
466 | IDE_HFLAG_NO_DMA | /* no SFF-style DMA */ | ||
467 | IDE_HFLAG_NO_AUTOTUNE, | 484 | IDE_HFLAG_NO_AUTOTUNE, |
468 | .mwdma_mask = ATA_MWDMA2, | 485 | .mwdma_mask = ATA_MWDMA2, |
469 | .swdma_mask = ATA_SWDMA2, | 486 | .swdma_mask = ATA_SWDMA2, |
@@ -526,7 +543,6 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec) | |||
526 | state->hwif[0] = hwif; | 543 | state->hwif[0] = hwif; |
527 | state->hwif[1] = mate; | 544 | state->hwif[1] = mate; |
528 | 545 | ||
529 | hwif->maskproc = icside_maskproc; | ||
530 | hwif->hwif_data = state; | 546 | hwif->hwif_data = state; |
531 | hwif->config_data = (unsigned long)ioc_base; | 547 | hwif->config_data = (unsigned long)ioc_base; |
532 | hwif->select_data = sel; | 548 | hwif->select_data = sel; |
@@ -537,10 +553,10 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec) | |||
537 | mate->select_data = sel | 1; | 553 | mate->select_data = sel | 1; |
538 | 554 | ||
539 | if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { | 555 | if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { |
540 | icside_dma_init(hwif); | 556 | d.init_dma = icside_dma_init; |
541 | icside_dma_init(mate); | 557 | d.port_ops = &icside_v6_dma_port_ops; |
542 | } else | 558 | d.dma_ops = NULL; |
543 | d.mwdma_mask = d.swdma_mask = 0; | 559 | } |
544 | 560 | ||
545 | idx[0] = hwif->index; | 561 | idx[0] = hwif->index; |
546 | idx[1] = mate->index; | 562 | idx[1] = mate->index; |