26 #include <linux/kernel.h>
27 #include <linux/module.h>
28 #include <linux/pci.h>
35 #define DRV_NAME "pata_opti"
36 #define DRV_VERSION "0.2.9"
54 static int opti_pre_reset(
struct ata_link *
link,
unsigned long deadline)
58 static const struct pci_bits opti_enable_bits[] = {
59 { 0x45, 1, 0x80, 0x00 },
60 { 0x40, 1, 0x08, 0x00 }
63 if (!pci_test_config_bits(pdev, &opti_enable_bits[ap->
port_no]))
83 void __iomem *regio = ap->ioaddr.cmd_addr;
112 void __iomem *regio = ap->ioaddr.cmd_addr;
116 static const u8 addr_timing[2][5] = {
117 { 0x30, 0x20, 0x20, 0x10, 0x10 },
118 { 0x20, 0x20, 0x10, 0x10, 0x10 }
120 static const u8 data_rec_timing[2][5] = {
121 { 0x6B, 0x56, 0x42, 0x32, 0x31 },
122 { 0x58, 0x44, 0x32, 0x22, 0x21 }
137 if (pair_addr > addr)
143 opti_write_reg(ap, data_rec_timing[clock][pio],
READ_REG);
144 opti_write_reg(ap, data_rec_timing[clock][pio],
WRITE_REG);
158 .set_piomode = opti_set_piomode,
159 .prereset = opti_pre_reset,
167 .port_ops = &opti_port_ops
173 return ata_pci_sff_init_one(dev, ppi, &opti_sht,
NULL, 0);
186 .probe = opti_init_one,
187 .remove = ata_pci_remove_one,
189 .suspend = ata_pci_device_suspend,
190 .resume = ata_pci_device_resume,