15 #include <linux/kernel.h>
16 #include <linux/module.h>
17 #include <linux/pci.h>
21 #include <linux/device.h>
26 #define DRV_NAME "pata_radisys"
27 #define DRV_VERSION "0.4.4"
66 pci_read_config_word(dev, 0x40, &idetm_data);
71 idetm_data |= (control << (4 * adev->
devno));
72 idetm_data |= (timings[
pio][0] << 12) |
73 (timings[pio][1] << 8);
74 pci_write_config_word(dev, 0x40, idetm_data);
109 pci_read_config_word(dev, 0x40, &idetm_data);
110 pci_read_config_byte(dev, 0x48, &udma_enable);
114 const unsigned int needed_pio[3] = {
123 if (adev->
pio_mode < needed_pio[mwdma])
129 idetm_data &= 0xCCCC;
130 idetm_data |= control << (4 * adev->
devno);
131 idetm_data |= (timings[
pio][0] << 12) | (timings[pio][1] << 8);
133 udma_enable &= ~(1 << adev->
devno);
139 pci_read_config_byte(dev, 0x4A, &udma_mode);
142 udma_mode &= ~(2 << (adev->
devno * 4));
144 udma_mode |= (2 << (adev->
devno * 4));
146 pci_write_config_byte(dev, 0x4A, udma_mode);
148 udma_enable |= (1 << adev->
devno);
150 pci_write_config_word(dev, 0x40, idetm_data);
151 pci_write_config_byte(dev, 0x48, udma_enable);
177 radisys_set_dmamode(ap, adev);
179 radisys_set_piomode(ap, adev);
182 return ata_bmdma_qc_issue(qc);
191 .inherits = &ata_bmdma_port_ops,
192 .qc_issue = radisys_qc_issue,
194 .set_piomode = radisys_set_piomode,
195 .set_dmamode = radisys_set_dmamode,
221 .port_ops = &radisys_pata_ops,
227 return ata_pci_bmdma_init_one(pdev, ppi, &radisys_sht,
NULL, 0);
236 static struct pci_driver radisys_pci_driver = {
238 .id_table = radisys_pci_tbl,
239 .probe = radisys_init_one,
240 .remove = ata_pci_remove_one,
242 .suspend = ata_pci_device_suspend,
243 .resume = ata_pci_device_resume,