28 #include <linux/kernel.h>
29 #include <linux/module.h>
30 #include <linux/pci.h>
37 #define DRV_NAME "pata_mpiix"
38 #define DRV_VERSION "0.7.7"
49 static int mpiix_pre_reset(
struct ata_link *
link,
unsigned long deadline)
53 static const struct pci_bits mpiix_enable_bits = { 0x6D, 1, 0x80, 0x80 };
55 if (!pci_test_config_bits(pdev, &mpiix_enable_bits))
89 pci_read_config_word(pdev,
IDETIM, &idetim);
101 idetim &= ~(0x07 << (4 * adev->
devno));
102 idetim |= control << (4 * adev->
devno);
104 idetim |= (timings[
pio][0] << 12) | (timings[pio][1] << 8);
105 pci_write_config_word(pdev,
IDETIM, idetim);
134 mpiix_set_piomode(ap, adev);
145 .qc_issue = mpiix_qc_issue,
147 .set_piomode = mpiix_set_piomode,
148 .prereset = mpiix_pre_reset,
157 void __iomem *cmd_addr, *ctl_addr;
172 pci_read_config_word(dev,
IDETIM, &idetim);
187 cmd_addr = devm_ioport_map(&dev->
dev, cmd, 8);
188 ctl_addr = devm_ioport_map(&dev->
dev, ctl, 1);
189 if (!cmd_addr || !ctl_addr)
200 ap->
ops = &mpiix_port_ops;
204 ap->ioaddr.cmd_addr = cmd_addr;
205 ap->ioaddr.ctl_addr = ctl_addr;
206 ap->ioaddr.altstatus_addr = ctl_addr;
225 .probe = mpiix_init_one,
226 .remove = ata_pci_remove_one,
228 .suspend = ata_pci_device_suspend,
229 .resume = ata_pci_device_resume,