26 #include <linux/kernel.h>
27 #include <linux/module.h>
28 #include <linux/pci.h>
36 #define DRV_NAME "pata_cs5530"
37 #define DRV_VERSION "0.7.4"
41 unsigned long bmdma = (
unsigned long)ap->ioaddr.bmdma_addr;
57 static const unsigned int cs5530_pio_timings[2][5] = {
58 {0x00009172, 0x00012171, 0x00020080, 0x00032010, 0x00040010},
59 {0xd1329172, 0x71212171, 0x30200080, 0x20102010, 0x00100010}
67 format = (tuning & 0x80000000
UL) ? 1 : 0;
88 void __iomem *base = cs5530_port_base(ap);
97 timing = 0x00921250;
break;
99 timing = 0x00911140;
break;
101 timing = 0x00911030;
break;
103 timing = 0x00077771;
break;
105 timing = 0x00012121;
break;
107 timing = 0x00002020;
break;
112 timing |= (tuning & 0x80000000
UL);
113 if (adev->
devno == 0)
116 if (timing & 0x00100000)
117 tuning |= 0x00100000;
119 tuning &= ~0x00100000;
126 reg |= (1 << (5 + adev->
devno));
151 if (ata_dma_enabled(adev) && adev != prev && prev !=
NULL) {
153 if ((ata_using_udma(adev) && !ata_using_udma(prev)) ||
154 (ata_using_udma(prev) && !ata_using_udma(adev)))
156 cs5530_set_dmamode(ap, adev);
159 return ata_bmdma_qc_issue(qc);
168 .inherits = &ata_bmdma_port_ops,
170 .qc_prep = ata_bmdma_dumb_qc_prep,
171 .qc_issue = cs5530_qc_issue,
174 .set_piomode = cs5530_set_piomode,
175 .set_dmamode = cs5530_set_dmamode,
180 .ident =
"Palmax PD1100",
189 static int cs5530_is_palmax(
void)
206 static int cs5530_init_chip(
void)
211 switch (dev->device) {
246 pci_write_config_word(cs5530_0, 0xd0, 0x5006);
254 pci_write_config_byte(master_0, 0x40, 0x1e);
266 pci_write_config_byte(master_0, 0x41, 0x14);
273 pci_write_config_byte(master_0, 0x42, 0x00);
274 pci_write_config_byte(master_0, 0x43, 0xc1);
304 .port_ops = &cs5530_port_ops
310 .port_ops = &cs5530_port_ops
320 if (cs5530_init_chip())
323 if (cs5530_is_palmax())
324 ppi[1] = &info_palmax_secondary;
327 return ata_pci_bmdma_init_one(pdev, ppi, &cs5530_sht,
NULL, 0);
331 static int cs5530_reinit_one(
struct pci_dev *pdev)
336 rc = ata_pci_device_do_resume(pdev);
341 if (cs5530_init_chip())
344 ata_host_resume(host);
355 static struct pci_driver cs5530_pci_driver = {
358 .probe = cs5530_init_one,
359 .remove = ata_pci_remove_one,
361 .suspend = ata_pci_device_suspend,
362 .resume = cs5530_reinit_one,