7 #include <linux/kernel.h>
8 #include <linux/module.h>
13 #include <linux/device.h>
21 #define DRV_NAME "pata_acpi"
22 #define DRV_VERSION "0.2.3"
38 static int pacpi_pre_reset(
struct ata_link *
link,
unsigned long deadline)
55 static int pacpi_cable_detect(
struct ata_port *ap)
74 static unsigned long pacpi_discover_modes(
struct ata_port *ap,
struct ata_device *adev)
78 unsigned int xfer_mask;
101 static unsigned long pacpi_mode_filter(
struct ata_device *adev,
unsigned long mask)
119 if (!(acpi->
gtm.flags & 0x10))
138 int unit = adev->
devno;
142 if (!(acpi->
gtm.flags & 0x10))
149 acpi->
gtm.flags |= (1 << (2 *
unit));
152 acpi->
gtm.flags &= ~(1 << (2 *
unit));
174 if (acpi->
gtm.flags & 0x10)
175 return ata_bmdma_qc_issue(qc);
177 if (adev != acpi->
last) {
178 pacpi_set_piomode(ap, adev);
179 if (ata_dma_enabled(adev))
180 pacpi_set_dmamode(ap, adev);
183 return ata_bmdma_qc_issue(qc);
193 static int pacpi_port_start(
struct ata_port *ap)
204 acpi->
mask[0] = pacpi_discover_modes(ap, &ap->
link.device[0]);
205 acpi->
mask[1] = pacpi_discover_modes(ap, &ap->
link.device[1]);
206 return ata_bmdma_port_start(ap);
214 .inherits = &ata_bmdma_port_ops,
215 .qc_issue = pacpi_qc_issue,
216 .cable_detect = pacpi_cable_detect,
217 .mode_filter = pacpi_mode_filter,
218 .set_piomode = pacpi_set_piomode,
219 .set_dmamode = pacpi_set_dmamode,
220 .prereset = pacpi_pre_reset,
221 .port_start = pacpi_port_start,
248 .port_ops = &pacpi_ops,
257 return ata_pci_bmdma_init_one(pdev, ppi, &pacpi_sht,
NULL, 0);
267 .id_table = pacpi_pci_tbl,
268 .probe = pacpi_init_one,
269 .remove = ata_pci_remove_one,
271 .suspend = ata_pci_device_suspend,
272 .resume = ata_pci_device_resume,