aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/arm/icside.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:31 -0500
committerBartlomiej Zolnierkiewicz <bzolnier@gmail.com>2008-02-02 13:56:31 -0500
commitc413b9b94d9a8e7548cc4b2e04b7df0439ce76fd (patch)
tree5d23110a0d1f87ad0c88fb1746194e532808eaab /drivers/ide/arm/icside.c
parent1ebf74936b1fccb5b65940f99ccddd74ec4d1fef (diff)
ide: add struct ide_port_info instances to legacy host drivers
* Remove 'struct pci_dev *dev' argument from ide_hwif_setup_dma(). * Un-static ide_hwif_setup_dma() and add CONFIG_BLK_DEV_IDEDMA_PCI=n version. * Add 'const struct ide_port_info *d' argument to ide_device_add[_all](). * Factor out generic ports init from ide_pci_setup_ports() to ide_init_port(), move it to ide-probe.c and call it in in ide_device_add_all() instead of ide_pci_setup_ports(). * Move ->mate setup to ide_device_add_all() from ide_port_init(). * Add IDE_HFLAG_NO_AUTOTUNE host flag for host drivers that don't enable ->autotune currently. * Setup hwif->chipset in ide_init_port() but iff pi->chipset is set (to not override setup done by ide_hwif_configure()). * Add ETRAX host handling to ide_device_add_all(). * cmd640.c: set IDE_HFLAG_ABUSE_* also for CONFIG_BLK_DEV_CMD640_ENHANCED=n. * pmac.c: make pmac_ide_setup_dma() return an error value and move DMA masks setup to pmac_ide_setup_device(). * Add 'struct ide_port_info' instances to legacy host drivers, pass them to ide_device_add() calls and then remove open-coded ports initialization. Reviewed-by: Sergei Shtylyov <sshtylyov@ru.mvista.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Diffstat (limited to 'drivers/ide/arm/icside.c')
-rw-r--r--drivers/ide/arm/icside.c25
1 files changed, 13 insertions, 12 deletions
diff --git a/drivers/ide/arm/icside.c b/drivers/ide/arm/icside.c
index 8d2cc47a362e..fb00f3827ecd 100644
--- a/drivers/ide/arm/icside.c
+++ b/drivers/ide/arm/icside.c
@@ -377,9 +377,6 @@ static void icside_dma_lost_irq(ide_drive_t *drive)
377 377
378static void icside_dma_init(ide_hwif_t *hwif) 378static void icside_dma_init(ide_hwif_t *hwif)
379{ 379{
380 hwif->mwdma_mask = 7; /* MW0..2 */
381 hwif->swdma_mask = 7; /* SW0..2 */
382
383 hwif->dmatable_cpu = NULL; 380 hwif->dmatable_cpu = NULL;
384 hwif->dmatable_dma = 0; 381 hwif->dmatable_dma = 0;
385 hwif->set_dma_mode = icside_set_dma_mode; 382 hwif->set_dma_mode = icside_set_dma_mode;
@@ -459,11 +456,19 @@ icside_register_v5(struct icside_state *state, struct expansion_card *ec)
459 456
460 idx[0] = hwif->index; 457 idx[0] = hwif->index;
461 458
462 ide_device_add(idx); 459 ide_device_add(idx, NULL);
463 460
464 return 0; 461 return 0;
465} 462}
466 463
464static const struct ide_port_info icside_v6_port_info __initdata = {
465 .host_flags = IDE_HFLAG_SERIALIZE |
466 IDE_HFLAG_NO_DMA | /* no SFF-style DMA */
467 IDE_HFLAG_NO_AUTOTUNE,
468 .mwdma_mask = ATA_MWDMA2,
469 .swdma_mask = ATA_SWDMA2,
470};
471
467static int __init 472static int __init
468icside_register_v6(struct icside_state *state, struct expansion_card *ec) 473icside_register_v6(struct icside_state *state, struct expansion_card *ec)
469{ 474{
@@ -472,6 +477,7 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
472 unsigned int sel = 0; 477 unsigned int sel = 0;
473 int ret; 478 int ret;
474 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 479 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
480 struct ide_port_info d = icside_v6_port_info;
475 481
476 ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0); 482 ioc_base = ecardm_iomap(ec, ECARD_RES_IOCFAST, 0, 0);
477 if (!ioc_base) { 483 if (!ioc_base) {
@@ -521,30 +527,25 @@ icside_register_v6(struct icside_state *state, struct expansion_card *ec)
521 state->hwif[1] = mate; 527 state->hwif[1] = mate;
522 528
523 hwif->maskproc = icside_maskproc; 529 hwif->maskproc = icside_maskproc;
524 hwif->channel = 0;
525 hwif->hwif_data = state; 530 hwif->hwif_data = state;
526 hwif->mate = mate;
527 hwif->serialized = 1;
528 hwif->config_data = (unsigned long)ioc_base; 531 hwif->config_data = (unsigned long)ioc_base;
529 hwif->select_data = sel; 532 hwif->select_data = sel;
530 533
531 mate->maskproc = icside_maskproc; 534 mate->maskproc = icside_maskproc;
532 mate->channel = 1;
533 mate->hwif_data = state; 535 mate->hwif_data = state;
534 mate->mate = hwif;
535 mate->serialized = 1;
536 mate->config_data = (unsigned long)ioc_base; 536 mate->config_data = (unsigned long)ioc_base;
537 mate->select_data = sel | 1; 537 mate->select_data = sel | 1;
538 538
539 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) { 539 if (ec->dma != NO_DMA && !request_dma(ec->dma, hwif->name)) {
540 icside_dma_init(hwif); 540 icside_dma_init(hwif);
541 icside_dma_init(mate); 541 icside_dma_init(mate);
542 } 542 } else
543 d.mwdma_mask = d.swdma_mask = 0;
543 544
544 idx[0] = hwif->index; 545 idx[0] = hwif->index;
545 idx[1] = mate->index; 546 idx[1] = mate->index;
546 547
547 ide_device_add(idx); 548 ide_device_add(idx, &d);
548 549
549 return 0; 550 return 0;
550 551