20 #include <linux/kernel.h>
21 #include <linux/module.h>
22 #include <linux/pci.h>
29 #define DRV_NAME "pata_ns87410"
30 #define DRV_VERSION "0.4.6"
40 static int ns87410_pre_reset(
struct ata_link *
link,
unsigned long deadline)
44 static const struct pci_bits ns87410_enable_bits[] = {
45 { 0x43, 1, 0x08, 0x08 },
46 { 0x47, 1, 0x08, 0x08 }
49 if (!pci_test_config_bits(pdev, &ns87410_enable_bits[ap->
port_no]))
71 static const u8 activebits[15] = {
77 static const u8 recoverbits[12] = {
78 0, 1, 2, 3, 4, 5, 6, 6, 7, 7, 7, 7
81 pci_read_config_byte(pdev, port + 3, &idefr);
97 idetcr = (
at.setup << 6) | (recoverbits[
at.recover] << 3) | activebits[
at.active];
99 pci_write_config_byte(pdev, port, idetcr);
100 pci_write_config_byte(pdev, port + 3, idefr);
126 ns87410_set_piomode(ap, adev);
137 .qc_issue = ns87410_qc_issue,
139 .set_piomode = ns87410_set_piomode,
140 .prereset = ns87410_pre_reset,
148 .port_ops = &ns87410_port_ops
151 return ata_pci_sff_init_one(dev, ppi, &ns87410_sht,
NULL, 0);
160 static struct pci_driver ns87410_pci_driver = {
163 .probe = ns87410_init_one,
164 .remove = ata_pci_remove_one,
166 .suspend = ata_pci_device_suspend,
167 .resume = ata_pci_device_resume,