aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/legacy/ht6560b.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-26 16:44:19 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-26 16:44:19 -0400
commita52b0d25a722e84da999005b75f972aa4824253c (patch)
tree4a3a48305f744e6bde2e3fd663a4473dd712049c /drivers/ide/legacy/ht6560b.c
parent539a5fe22620a1665cce504167953a71a43232ad (diff)
parentf37afdaca711838b50ecd89b9c15fc745270d77c (diff)
Merge git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (46 commits) ide: constify struct ide_dma_ops ide: add struct ide_dma_ops (take 3) ide: add IDE_HFLAG_SERIALIZE_DMA host flag sl82c105: check bridge revision in sl82c105_init_one() au1xxx-ide: use ->init_dma method palm_bk3710: use ->init_dma method sgiioc4: use ->init_dma method icside: use ->init_dma method ide-pmac: use ->init_dma method ide: do complete DMA setup in ->init_dma method (take 2) au1xxx-ide: fix MWDMA support ide: cleanup ide_setup_dma() ide: factor out setting PCI bus-mastering from ide_hwif_setup_dma() ide: export ide_allocate_dma_engine() ide: move ide_setup_dma() call out from ->init_dma method alim15x3: skip DMA initialization completely on revs < 0x20 pdc202xx_old: remove init_dma_pdc202xx() ide: don't display "BIOS" settings in ide_setup_dma() ide: remove ->cds field from ide_hwif_t (take 2) ide: remove ide_dma_iobase() ...
Diffstat (limited to 'drivers/ide/legacy/ht6560b.c')
-rw-r--r--drivers/ide/legacy/ht6560b.c46
1 files changed, 11 insertions, 35 deletions
diff --git a/drivers/ide/legacy/ht6560b.c b/drivers/ide/legacy/ht6560b.c
index 60f52f5158c9..702d8deb5780 100644
--- a/drivers/ide/legacy/ht6560b.c
+++ b/drivers/ide/legacy/ht6560b.c
@@ -328,8 +328,16 @@ int probe_ht6560b = 0;
328module_param_named(probe, probe_ht6560b, bool, 0); 328module_param_named(probe, probe_ht6560b, bool, 0);
329MODULE_PARM_DESC(probe, "probe for HT6560B chipset"); 329MODULE_PARM_DESC(probe, "probe for HT6560B chipset");
330 330
331static const struct ide_port_ops ht6560b_port_ops = {
332 .port_init_devs = ht6560b_port_init_devs,
333 .set_pio_mode = ht6560b_set_pio_mode,
334 .selectproc = ht6560b_selectproc,
335};
336
331static const struct ide_port_info ht6560b_port_info __initdata = { 337static const struct ide_port_info ht6560b_port_info __initdata = {
338 .name = DRV_NAME,
332 .chipset = ide_ht6560b, 339 .chipset = ide_ht6560b,
340 .port_ops = &ht6560b_port_ops,
333 .host_flags = IDE_HFLAG_SERIALIZE | /* is this needed? */ 341 .host_flags = IDE_HFLAG_SERIALIZE | /* is this needed? */
334 IDE_HFLAG_NO_DMA | 342 IDE_HFLAG_NO_DMA |
335 IDE_HFLAG_NO_AUTOTUNE | 343 IDE_HFLAG_NO_AUTOTUNE |
@@ -339,53 +347,21 @@ static const struct ide_port_info ht6560b_port_info __initdata = {
339 347
340static int __init ht6560b_init(void) 348static int __init ht6560b_init(void)
341{ 349{
342 ide_hwif_t *hwif, *mate;
343 static u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
344 hw_regs_t hw[2];
345
346 if (probe_ht6560b == 0) 350 if (probe_ht6560b == 0)
347 return -ENODEV; 351 return -ENODEV;
348 352
349 if (!request_region(HT_CONFIG_PORT, 1, DRV_NAME)) { 353 if (!request_region(HT_CONFIG_PORT, 1, DRV_NAME)) {
350 printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n", 354 printk(KERN_NOTICE "%s: HT_CONFIG_PORT not found\n",
351 __FUNCTION__); 355 __func__);
352 return -ENODEV; 356 return -ENODEV;
353 } 357 }
354 358
355 if (!try_to_init_ht6560b()) { 359 if (!try_to_init_ht6560b()) {
356 printk(KERN_NOTICE "%s: HBA not found\n", __FUNCTION__); 360 printk(KERN_NOTICE "%s: HBA not found\n", __func__);
357 goto release_region; 361 goto release_region;
358 } 362 }
359 363
360 memset(&hw, 0, sizeof(hw)); 364 return ide_legacy_device_add(&ht6560b_port_info, 0);
361
362 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
363 hw[0].irq = 14;
364
365 ide_std_init_ports(&hw[1], 0x170, 0x376);
366 hw[1].irq = 15;
367
368 hwif = ide_find_port();
369 if (hwif) {
370 ide_init_port_hw(hwif, &hw[0]);
371 hwif->selectproc = ht6560b_selectproc;
372 hwif->set_pio_mode = ht6560b_set_pio_mode;
373 hwif->port_init_devs = ht6560b_port_init_devs;
374 idx[0] = hwif->index;
375 }
376
377 mate = ide_find_port();
378 if (mate) {
379 ide_init_port_hw(mate, &hw[1]);
380 mate->selectproc = ht6560b_selectproc;
381 mate->set_pio_mode = ht6560b_set_pio_mode;
382 mate->port_init_devs = ht6560b_port_init_devs;
383 idx[1] = mate->index;
384 }
385
386 ide_device_add(idx, &ht6560b_port_info);
387
388 return 0;
389 365
390release_region: 366release_region:
391 release_region(HT_CONFIG_PORT, 1); 367 release_region(HT_CONFIG_PORT, 1);