aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/ide/pci/cmd640.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/ide/pci/cmd640.c')
-rw-r--r--drivers/ide/pci/cmd640.c33
1 files changed, 14 insertions, 19 deletions
diff --git a/drivers/ide/pci/cmd640.c b/drivers/ide/pci/cmd640.c
index 7240c20b9593..bd24dad3cfc6 100644
--- a/drivers/ide/pci/cmd640.c
+++ b/drivers/ide/pci/cmd640.c
@@ -103,10 +103,6 @@
103#include <linux/types.h> 103#include <linux/types.h>
104#include <linux/kernel.h> 104#include <linux/kernel.h>
105#include <linux/delay.h> 105#include <linux/delay.h>
106#include <linux/timer.h>
107#include <linux/mm.h>
108#include <linux/ioport.h>
109#include <linux/blkdev.h>
110#include <linux/hdreg.h> 106#include <linux/hdreg.h>
111#include <linux/ide.h> 107#include <linux/ide.h>
112#include <linux/init.h> 108#include <linux/init.h>
@@ -703,6 +699,18 @@ static int pci_conf2(void)
703 return 0; 699 return 0;
704} 700}
705 701
702static const struct ide_port_info cmd640_port_info __initdata = {
703 .chipset = ide_cmd640,
704 .host_flags = IDE_HFLAG_SERIALIZE |
705 IDE_HFLAG_NO_DMA |
706 IDE_HFLAG_NO_AUTOTUNE |
707 IDE_HFLAG_ABUSE_PREFETCH |
708 IDE_HFLAG_ABUSE_FAST_DEVSEL,
709#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
710 .pio_mask = ATA_PIO5,
711#endif
712};
713
706/* 714/*
707 * Probe for a cmd640 chipset, and initialize it if found. 715 * Probe for a cmd640 chipset, and initialize it if found.
708 */ 716 */
@@ -760,11 +768,7 @@ static int __init cmd640x_init(void)
760 setup_device_ptrs (); 768 setup_device_ptrs ();
761 printk("%s: buggy cmd640%c interface on %s, config=0x%02x\n", 769 printk("%s: buggy cmd640%c interface on %s, config=0x%02x\n",
762 cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr); 770 cmd_hwif0->name, 'a' + cmd640_chip_version - 1, bus_type, cfr);
763 cmd_hwif0->chipset = ide_cmd640;
764#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED 771#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
765 cmd_hwif0->host_flags = IDE_HFLAG_ABUSE_PREFETCH |
766 IDE_HFLAG_ABUSE_FAST_DEVSEL;
767 cmd_hwif0->pio_mask = ATA_PIO5;
768 cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode; 772 cmd_hwif0->set_pio_mode = &cmd640_set_pio_mode;
769#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ 773#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
770 774
@@ -815,23 +819,14 @@ static int __init cmd640x_init(void)
815 * Initialize data for secondary cmd640 port, if enabled 819 * Initialize data for secondary cmd640 port, if enabled
816 */ 820 */
817 if (second_port_cmd640) { 821 if (second_port_cmd640) {
818 cmd_hwif0->serialized = 1;
819 cmd_hwif1->serialized = 1;
820 cmd_hwif1->chipset = ide_cmd640;
821 cmd_hwif0->mate = cmd_hwif1;
822 cmd_hwif1->mate = cmd_hwif0;
823 cmd_hwif1->channel = 1;
824#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED 822#ifdef CONFIG_BLK_DEV_CMD640_ENHANCED
825 cmd_hwif1->host_flags = IDE_HFLAG_ABUSE_PREFETCH |
826 IDE_HFLAG_ABUSE_FAST_DEVSEL;
827 cmd_hwif1->pio_mask = ATA_PIO5;
828 cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode; 823 cmd_hwif1->set_pio_mode = &cmd640_set_pio_mode;
829#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */ 824#endif /* CONFIG_BLK_DEV_CMD640_ENHANCED */
830 825
831 idx[1] = cmd_hwif1->index; 826 idx[1] = cmd_hwif1->index;
832 } 827 }
833 printk(KERN_INFO "%s: %sserialized, secondary interface %s\n", cmd_hwif1->name, 828 printk(KERN_INFO "%s: %sserialized, secondary interface %s\n", cmd_hwif1->name,
834 cmd_hwif0->serialized ? "" : "not ", port2); 829 second_port_cmd640 ? "" : "not ", port2);
835 830
836 /* 831 /*
837 * Establish initial timings/prefetch for all drives. 832 * Establish initial timings/prefetch for all drives.
@@ -876,7 +871,7 @@ static int __init cmd640x_init(void)
876 cmd640_dump_regs(); 871 cmd640_dump_regs();
877#endif 872#endif
878 873
879 ide_device_add(idx); 874 ide_device_add(idx, &cmd640_port_info);
880 875
881 return 1; 876 return 1;
882} 877}