15 #include <linux/kernel.h>
16 #include <linux/module.h>
17 #include <linux/pci.h>
25 #define DRV_NAME "pata_atiixp"
26 #define DRV_VERSION "0.4.6"
37 static const struct dmi_system_id attixp_cable_override_dmi_table[] = {
40 .ident =
"MSI E350DM-E33",
49 static int atiixp_cable_detect(
struct ata_port *ap)
60 if ((udma & 0x07) >= 0x04 || (udma & 0x70) >= 0x40)
76 static int atiixp_prereset(
struct ata_link *
link,
unsigned long deadline)
78 static const struct pci_bits atiixp_enable_bits[] = {
79 { 0x48, 1, 0x01, 0x00 },
80 { 0x48, 1, 0x08, 0x00 }
86 if (!pci_test_config_bits(pdev, &atiixp_enable_bits[ap->
port_no]))
104 static u8 pio_timings[5] = { 0x5D, 0x47, 0x34, 0x22, 0x20 };
108 int timing_shift = (16 * ap->
port_no) + 8 * (adev->
devno ^ 1);
113 pio_mode_data &= ~(0x7 << (4 *
dn));
114 pio_mode_data |= pio << (4 *
dn);
118 pio_timing_data &= ~(0xFF << timing_shift);
119 pio_timing_data |= (pio_timings[
pio] << timing_shift);
137 spin_unlock_irqrestore(&atiixp_lock, flags);
151 static u8 mwdma_timings[5] = { 0x77, 0x21, 0x20 };
167 udma_mode_data &= ~(0x7 << (4 *
dn));
168 udma_mode_data |= dma << (4 *
dn);
171 int timing_shift = (16 * ap->
port_no) + 8 * (adev->
devno ^ 1);
172 u32 mwdma_timing_data;
178 mwdma_timing_data &= ~(0xFF << timing_shift);
179 mwdma_timing_data |= (mwdma_timings[
dma] << timing_shift);
196 atiixp_set_pio_timing(ap, adev, wanted_pio);
197 spin_unlock_irqrestore(&atiixp_lock, flags);
221 if (ata_using_udma(adev))
259 .inherits = &ata_bmdma_port_ops,
261 .qc_prep = ata_bmdma_dumb_qc_prep,
262 .bmdma_start = atiixp_bmdma_start,
263 .bmdma_stop = atiixp_bmdma_stop,
265 .prereset = atiixp_prereset,
266 .cable_detect = atiixp_cable_detect,
267 .set_piomode = atiixp_set_piomode,
268 .set_dmamode = atiixp_set_dmamode,
278 .port_ops = &atiixp_port_ops
282 return ata_pci_bmdma_init_one(pdev, ppi, &atiixp_sht,
NULL,
297 static struct pci_driver atiixp_pci_driver = {
300 .probe = atiixp_init_one,
301 .remove = ata_pci_remove_one,
303 .resume = ata_pci_device_resume,
304 .suspend = ata_pci_device_suspend,