aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/cmd640.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 11:39:24 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2008-04-18 11:39:24 -0400
commit188da98800893691e47eea9335a234378e32aceb (patch)
tree57dbf491d23676e011b4946ec1867a6d55a02eef /drivers/ide/pci/cmd640.c
parent07fe944e87d79f8d7e1b090913fe9f2ace78f41d (diff)
parent273b8385e5817a4765f82257004c5ec661a6a5b2 (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: (58 commits) ide: remove ide_init_default_irq() macro ide: move default IDE ports setup to ide_generic host driver ide: remove obsoleted "idex=noprobe" kernel parameter (take 2) ide: remove needless hwif->irq check from ide_hwif_configure() ide: init hwif->{io_ports,irq} explicitly in legacy VLB host drivers ide: limit legacy VLB host drivers to alpha, x86 and mips cmd640: init hwif->{io_ports,irq} explicitly cmd640: cleanup setup_device_ptrs() ide: add ide-4drives host driver (take 3) ide: remove ppc ifdef from init_ide_data() ide: remove ide_default_io_ctl() macro ide: remove CONFIG_IDE_ARCH_OBSOLETE_INIT ide: add CONFIG_IDE_ARCH_OBSOLETE_DEFAULTS (take 2) ppc/pmac: remove no longer needed IDE quirk ppc: don't include <linux/ide.h> ppc: remove ppc_ide_md ppc/pplus: remove ppc_ide_md.ide_init_hwif hook ppc/sandpoint: remove ppc_ide_md hooks ppc/lopec: remove ppc_ide_md hooks ppc/mpc8xx: remove ppc_ide_md hooks ...
Diffstat (limited to 'drivers/ide/pci/cmd640.c')
-rw-r--r--drivers/ide/pci/cmd640.c34
1 files changed, 18 insertions, 16 deletions
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index 29fbc5ead03b..a1cfe033a55f 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -409,19 +409,9 @@ static void __init check_prefetch (unsigned int index)
409 */ 409 */
410static void __init setup_device_ptrs (void) 410static void __init setup_device_ptrs (void)
411{ 411{
412 unsigned int i; 412 cmd_hwif0 = &ide_hwifs[0];
413 cmd_hwif1 = &ide_hwifs[1];
413 414
414 cmd_hwif0 = &ide_hwifs[0]; /* default, if not found below */
415 cmd_hwif1 = &ide_hwifs[1]; /* default, if not found below */
416 for (i = 0; i < MAX_HWIFS; i++) {
417 ide_hwif_t *hwif = &ide_hwifs[i];
418 if (hwif->chipset == ide_unknown || hwif->chipset == ide_forced) {
419 if (hwif->io_ports[IDE_DATA_OFFSET] == 0x1f0)
420 cmd_hwif0 = hwif;
421 else if (hwif->io_ports[IDE_DATA_OFFSET] == 0x170)
422 cmd_hwif1 = hwif;
423 }
424 }
425 cmd_drives[0] = &cmd_hwif0->drives[0]; 415 cmd_drives[0] = &cmd_hwif0->drives[0];
426 cmd_drives[1] = &cmd_hwif0->drives[1]; 416 cmd_drives[1] = &cmd_hwif0->drives[1];
427 cmd_drives[2] = &cmd_hwif1->drives[0]; 417 cmd_drives[2] = &cmd_hwif1->drives[0];
@@ -724,6 +714,7 @@ static int __init cmd640x_init(void)
724 unsigned int index; 714 unsigned int index;
725 u8 b, cfr; 715 u8 b, cfr;
726 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff }; 716 u8 idx[4] = { 0xff, 0xff, 0xff, 0xff };
717 hw_regs_t hw[2];
727 718
728 if (cmd640_vlb && probe_for_cmd640_vlb()) { 719 if (cmd640_vlb && probe_for_cmd640_vlb()) {
729 bus_type = "VLB"; 720 bus_type = "VLB";
@@ -762,12 +753,23 @@ static int __init cmd640x_init(void)
762 return 0; 753 return 0;
763 } 754 }
764 755
756 memset(&hw, 0, sizeof(hw));
757
758 ide_std_init_ports(&hw[0], 0x1f0, 0x3f6);
759 hw[0].irq = 14;
760
761 ide_std_init_ports(&hw[1], 0x170, 0x376);
762 hw[1].irq = 15;
763
764 printk(KERN_INFO "cmd640: buggy cmd640%c interface on %s, config=0x%02x"
765 "\n", 'a' + cmd640_chip_version - 1, bus_type, cfr);
766
765 /* 767 /*
766 * Initialize data for primary port 768 * Initialize data for primary port
767 */ 769 */
768 setup_device_ptrs (); 770 setup_device_ptrs ();
769 printk("%s: buggy cmd640%c interface on %s, config=0x%02x\n", 771
770 cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr); 772 ide_init_port_hw(cmd_hwif0, &hw[0]);
771#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED 773#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
772 cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode; 774 cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode;
773#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ 775#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
@@ -787,8 +789,7 @@ static int __init cmd640x_init(void)
787 /* 789 /*
788 * Try to enable the secondary interface, if not already enabled 790 * Try to enable the secondary interface, if not already enabled
789 */ 791 */
790 if (cmd_hwif1->noprobe || 792 if (cmd_hwif1->drives[0].noprobe && cmd_hwif1->drives[1].noprobe) {
791 (cmd_hwif1->drives[0].noprobe && cmd_hwif1->drives[1].noprobe)) {
792 port2 = "not probed"; 793 port2 = "not probed";
793 } else { 794 } else {
794 b = get_cmd640_reg(CNTRL); 795 b = get_cmd640_reg(CNTRL);
@@ -820,6 +821,7 @@ static int __init cmd640x_init(void)
820 * Initialize data for secondary cmd640 port, if enabled 821 * Initialize data for secondary cmd640 port, if enabled
821 */ 822 */
822 if (second_port_cmd640) { 823 if (second_port_cmd640) {
824 ide_init_port_hw(cmd_hwif1, &hw[1]);
823#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED 825#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
824 cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode; 826 cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode;
825#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ 827#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */