]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/pata_marvell.c
Pull bugzilla-7897 into release branch
[linux-2.6-omap-h63xx.git] / drivers / ata / pata_marvell.c
index 1ea64075c783169534eacbadd1bc70b30759f6e1..13a70ac6f1dc2f536b132229ac7706aa87e7d6e5 100644 (file)
@@ -20,7 +20,7 @@
 #include <linux/ata.h>
 
 #define DRV_NAME       "pata_marvell"
-#define DRV_VERSION    "0.0.5u"
+#define DRV_VERSION    "0.1.1"
 
 /**
  *     marvell_pre_reset       -       check for 40/80 pin
@@ -45,10 +45,10 @@ static int marvell_pre_reset(struct ata_port *ap)
        for(i = 0; i <= 0x0F; i++)
                printk("%02X:%02X ", i, readb(barp + i));
        printk("\n");
-       
+
        devices = readl(barp + 0x0C);
        pci_iounmap(pdev, barp);
-       
+
        if ((pdev->device == 0x6145) && (ap->port_no == 0) &&
            (!(devices & 0x10)))        /* PATA enable ? */
                return -ENOENT;
@@ -57,11 +57,11 @@ static int marvell_pre_reset(struct ata_port *ap)
        switch(ap->port_no)
        {
        case 0:
-               /* Might be backward, docs unclear */
-               if (inb(ap->ioaddr.bmdma_addr + 1) & 1)
-                       ap->cbl = ATA_CBL_PATA80;
-               else
+               if (ioread8(ap->ioaddr.bmdma_addr + 1) & 1)
                        ap->cbl = ATA_CBL_PATA40;
+               else
+                       ap->cbl = ATA_CBL_PATA80;
+               break;
 
        case 1: /* Legacy SATA port */
                ap->cbl = ATA_CBL_SATA;
@@ -94,15 +94,17 @@ static struct scsi_host_template marvell_sht = {
        .can_queue              = ATA_DEF_QUEUE,
        .this_id                = ATA_SHT_THIS_ID,
        .sg_tablesize           = LIBATA_MAX_PRD,
-       .max_sectors            = ATA_MAX_SECTORS,
        .cmd_per_lun            = ATA_SHT_CMD_PER_LUN,
        .emulated               = ATA_SHT_EMULATED,
        .use_clustering         = ATA_SHT_USE_CLUSTERING,
        .proc_name              = DRV_NAME,
        .dma_boundary           = ATA_DMA_BOUNDARY,
        .slave_configure        = ata_scsi_slave_config,
+       .slave_destroy          = ata_scsi_slave_destroy,
        /* Use standard CHS mapping rules */
        .bios_param             = ata_std_bios_param,
+       .resume                 = ata_scsi_device_resume,
+       .suspend                = ata_scsi_device_suspend,
 };
 
 static const struct ata_port_operations marvell_ops = {
@@ -127,16 +129,16 @@ static const struct ata_port_operations marvell_ops = {
        .bmdma_status           = ata_bmdma_status,
        .qc_prep                = ata_qc_prep,
        .qc_issue               = ata_qc_issue_prot,
-       .data_xfer              = ata_pio_data_xfer,
+       .data_xfer              = ata_data_xfer,
 
        /* Timeout handling */
        .irq_handler            = ata_interrupt,
        .irq_clear              = ata_bmdma_irq_clear,
+       .irq_on                 = ata_irq_on,
+       .irq_ack                = ata_irq_ack,
 
        /* Generic PATA PCI ATA helpers */
        .port_start             = ata_port_start,
-       .port_stop              = ata_port_stop,
-       .host_stop              = ata_host_stop,
 };
 
 
@@ -197,6 +199,8 @@ static struct pci_driver marvell_pci_driver = {
        .id_table               = marvell_pci_tbl,
        .probe                  = marvell_init_one,
        .remove                 = ata_pci_remove_one,
+       .suspend                = ata_pci_device_suspend,
+       .resume                 = ata_pci_device_resume,
 };
 
 static int __init marvell_init(void)