aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/qd65xx.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/legacy/qd65xx.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/legacy/qd65xx.c')
-rw-r--r--drivers/ide/legacy/qd65xx.c23
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/ide/legacy/qd65xx.c b/drivers/ide/legacy/qd65xx.c
index 37534bb483a7..60a6ed1088df 100644
--- a/drivers/ide/legacy/qd65xx.c
+++ b/drivers/ide/legacy/qd65xx.c
@@ -308,15 +308,10 @@ static int __init qd_testreg(int port)
308static void __init qd_setup(ide_hwif_t *hwif, int base, int config, 308static void __init qd_setup(ide_hwif_t *hwif, int base, int config,
309 unsigned int data0, unsigned int data1) 309 unsigned int data0, unsigned int data1)
310{ 310{
311 hwif->chipset = ide_qd65xx;
312 hwif->channel = hwif->index;
313 hwif->select_data = base; 311 hwif->select_data = base;
314 hwif->config_data = config; 312 hwif->config_data = config;
315 hwif->drives[0].drive_data = data0; 313 hwif->drives[0].drive_data = data0;
316 hwif->drives[1].drive_data = data1; 314 hwif->drives[1].drive_data = data1;
317 hwif->drives[0].io_32bit =
318 hwif->drives[1].io_32bit = 1;
319 hwif->pio_mask = ATA_PIO4;
320} 315}
321 316
322/* 317/*
@@ -356,6 +351,14 @@ static void __exit qd_unsetup(ide_hwif_t *hwif)
356} 351}
357*/ 352*/
358 353
354static const struct ide_port_info qd65xx_port_info __initdata = {
355 .chipset = ide_qd65xx,
356 .host_flags = IDE_HFLAG_IO_32BIT |
357 IDE_HFLAG_NO_DMA |
358 IDE_HFLAG_NO_AUTOTUNE,
359 .pio_mask = ATA_PIO4,
360};
361
359/* 362/*
360 * qd_probe: 363 * qd_probe:
361 * 364 *
@@ -397,9 +400,9 @@ static int __init qd_probe(int base)
397 400
398 hwif->set_pio_mode = &qd6500_set_pio_mode; 401 hwif->set_pio_mode = &qd6500_set_pio_mode;
399 402
400 idx[0] = unit; 403 idx[unit] = unit;
401 404
402 ide_device_add(idx); 405 ide_device_add(idx, &qd65xx_port_info);
403 406
404 return 1; 407 return 1;
405 } 408 }
@@ -431,9 +434,9 @@ static int __init qd_probe(int base)
431 434
432 hwif->set_pio_mode = &qd6580_set_pio_mode; 435 hwif->set_pio_mode = &qd6580_set_pio_mode;
433 436
434 idx[0] = unit; 437 idx[unit] = unit;
435 438
436 ide_device_add(idx); 439 ide_device_add(idx, &qd65xx_port_info);
437 440
438 outb(QD_DEF_CONTR, QD_CONTROL_PORT); 441 outb(QD_DEF_CONTR, QD_CONTROL_PORT);
439 442
@@ -460,7 +463,7 @@ static int __init qd_probe(int base)
460 idx[0] = 0; 463 idx[0] = 0;
461 idx[1] = 1; 464 idx[1] = 1;
462 465
463 ide_device_add(idx); 466 ide_device_add(idx, &qd65xx_port_info);
464 467
465 outb(QD_DEF_CONTR, QD_CONTROL_PORT); 468 outb(QD_DEF_CONTR, QD_CONTROL_PORT);
466 469