10 #include <linux/kernel.h>
11 #include <linux/module.h>
12 #include <linux/pci.h>
16 #include <linux/device.h>
21 #define DRV_NAME "pata_jmicron"
22 #define DRV_VERSION "0.1.5"
42 static int jmicron_pre_reset(
struct ata_link *
link,
unsigned long deadline)
48 int port_mask = 1<< (4 * ap->
port_no);
53 pci_read_config_dword(pdev, 0x40, &control);
54 if ((control & port_mask) == 0)
60 if (control & (1 << 23)) {
70 pci_read_config_dword(pdev, 0x80, &control5);
71 if (control5 & (1<<24))
75 if (control & (1 << 22))
83 switch (port_map[port]) {
85 if ((control & (1 << 5)) == 0)
87 if (control & (1 << 3))
94 if ((control5 & (1 << 21)) == 0)
96 if (control5 & (1 << 19))
115 .inherits = &ata_bmdma_port_ops,
116 .prereset = jmicron_pre_reset,
143 .port_ops = &jmicron_ops,
147 return ata_pci_bmdma_init_one(pdev, ppi, &jmicron_sht,
NULL, 0);
156 static struct pci_driver jmicron_pci_driver = {
158 .id_table = jmicron_pci_tbl,
159 .probe = jmicron_init_one,
160 .remove = ata_pci_remove_one,
162 .suspend = ata_pci_device_suspend,
163 .resume = ata_pci_device_resume,