]> err.no Git - linux-2.6/blobdiff - drivers/ata/pata_cs5520.c
ahci: fix notification handling
[linux-2.6] / drivers / ata / pata_cs5520.c
index 79bef0d1fad337106eb77d419bf192090834fc80..ff1eb84c7d22ffa4103741541141272f1f4bd982 100644 (file)
@@ -41,7 +41,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "pata_cs5520"
-#define DRV_VERSION    "0.6.4"
+#define DRV_VERSION    "0.6.6"
 
 struct pio_clocks
 {
@@ -146,7 +146,7 @@ static struct scsi_host_template cs5520_sht = {
        .queuecommand           = ata_scsi_queuecmd,
        .can_queue              = ATA_DEF_QUEUE,
        .this_id                = ATA_SHT_THIS_ID,
-       .sg_tablesize           = LIBATA_MAX_PRD,
+       .sg_tablesize           = LIBATA_DUMB_MAX_PRD,
        .cmd_per_lun            = ATA_SHT_CMD_PER_LUN,
        .emulated               = ATA_SHT_EMULATED,
        .use_clustering         = ATA_SHT_USE_CLUSTERING,
@@ -155,14 +155,9 @@ static struct scsi_host_template cs5520_sht = {
        .slave_configure        = ata_scsi_slave_config,
        .slave_destroy          = ata_scsi_slave_destroy,
        .bios_param             = ata_std_bios_param,
-#ifdef CONFIG_PM
-       .resume                 = ata_scsi_device_resume,
-       .suspend                = ata_scsi_device_suspend,
-#endif
 };
 
 static struct ata_port_operations cs5520_port_ops = {
-       .port_disable           = ata_port_disable,
        .set_piomode            = cs5520_set_piomode,
        .set_dmamode            = cs5520_set_dmamode,
 
@@ -182,19 +177,20 @@ static struct ata_port_operations cs5520_port_ops = {
        .bmdma_start            = ata_bmdma_start,
        .bmdma_stop             = ata_bmdma_stop,
        .bmdma_status           = ata_bmdma_status,
-       .qc_prep                = ata_qc_prep,
+       .qc_prep                = ata_dumb_qc_prep,
        .qc_issue               = ata_qc_issue_prot,
        .data_xfer              = ata_data_xfer,
 
        .irq_clear              = ata_bmdma_irq_clear,
        .irq_on                 = ata_irq_on,
-       .irq_ack                = ata_irq_ack,
 
-       .port_start             = ata_port_start,
+       .port_start             = ata_sff_port_start,
 };
 
 static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_device_id *id)
 {
+       static const unsigned int cmd_port[] = { 0x1F0, 0x170 };
+       static const unsigned int ctl_port[] = { 0x3F6, 0x376 };
        struct ata_port_info pi = {
                .flags          = ATA_FLAG_SLAVE_POSS,
                .pio_mask       = 0x1f,
@@ -248,10 +244,10 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi
        }
 
        /* Map IO ports and initialize host accordingly */
-       iomap[0] = devm_ioport_map(&pdev->dev, 0x1F0, 8);
-       iomap[1] = devm_ioport_map(&pdev->dev, 0x3F6, 1);
-       iomap[2] = devm_ioport_map(&pdev->dev, 0x170, 8);
-       iomap[3] = devm_ioport_map(&pdev->dev, 0x376, 1);
+       iomap[0] = devm_ioport_map(&pdev->dev, cmd_port[0], 8);
+       iomap[1] = devm_ioport_map(&pdev->dev, ctl_port[0], 1);
+       iomap[2] = devm_ioport_map(&pdev->dev, cmd_port[1], 8);
+       iomap[3] = devm_ioport_map(&pdev->dev, ctl_port[1], 1);
        iomap[4] = pcim_iomap(pdev, 2, 0);
 
        if (!iomap[0] || !iomap[1] || !iomap[2] || !iomap[3] || !iomap[4])
@@ -264,6 +260,10 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi
        ioaddr->bmdma_addr = iomap[4];
        ata_std_ports(ioaddr);
 
+       ata_port_desc(host->ports[0],
+                     "cmd 0x%x ctl 0x%x", cmd_port[0], ctl_port[0]);
+       ata_port_pbar_desc(host->ports[0], 4, 0, "bmdma");
+
        ioaddr = &host->ports[1]->ioaddr;
        ioaddr->cmd_addr = iomap[2];
        ioaddr->ctl_addr = iomap[3];
@@ -271,6 +271,10 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi
        ioaddr->bmdma_addr = iomap[4] + 8;
        ata_std_ports(ioaddr);
 
+       ata_port_desc(host->ports[1],
+                     "cmd 0x%x ctl 0x%x", cmd_port[1], ctl_port[1]);
+       ata_port_pbar_desc(host->ports[1], 4, 8, "bmdma");
+
        /* activate the host */
        pci_set_master(pdev);
        rc = ata_host_start(host);
@@ -279,7 +283,7 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi
 
        for (i = 0; i < 2; i++) {
                static const int irq[] = { 14, 15 };
-               struct ata_port *ap = host->ports[0];
+               struct ata_port *ap = host->ports[i];
 
                if (ata_port_is_dummy(ap))
                        continue;
@@ -288,6 +292,8 @@ static int __devinit cs5520_init_one(struct pci_dev *pdev, const struct pci_devi
                                      ata_interrupt, 0, DRV_NAME, host);
                if (rc)
                        return rc;
+
+               ata_port_desc(ap, "irq %d", irq[i]);
        }
 
        return ata_host_register(host, &cs5520_sht);