]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/sata_via.c
Merge branch 'master' of /pub/scm/linux/kernel/git/torvalds/linux-2.6
[linux-2.6-omap-h63xx.git] / drivers / ata / sata_via.c
index 1d855f55f5f710edd378110740b76042afe37005..c4124475f754f101fc427a63934901d59de9083b 100644 (file)
@@ -46,7 +46,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "sata_via"
-#define DRV_VERSION    "2.1"
+#define DRV_VERSION    "2.2"
 
 enum board_ids_enum {
        vt6420,
@@ -85,6 +85,9 @@ static const struct pci_device_id svia_pci_tbl[] = {
        { PCI_VDEVICE(VIA, 0x0591), vt6420 },
        { PCI_VDEVICE(VIA, 0x3149), vt6420 },
        { PCI_VDEVICE(VIA, 0x3249), vt6421 },
+       { PCI_VDEVICE(VIA, 0x5287), vt6420 },
+       { PCI_VDEVICE(VIA, 0x5372), vt6420 },
+       { PCI_VDEVICE(VIA, 0x7372), vt6420 },
 
        { }     /* terminate list */
 };
@@ -93,6 +96,10 @@ static struct pci_driver svia_pci_driver = {
        .name                   = DRV_NAME,
        .id_table               = svia_pci_tbl,
        .probe                  = svia_init_one,
+#ifdef CONFIG_PM
+       .suspend                = ata_pci_device_suspend,
+       .resume                 = ata_pci_device_resume,
+#endif
        .remove                 = ata_pci_remove_one,
 };
 
@@ -216,7 +223,7 @@ static const struct ata_port_info vt6420_port_info = {
        .flags          = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY,
        .pio_mask       = 0x1f,
        .mwdma_mask     = 0x07,
-       .udma_mask      = 0x7f,
+       .udma_mask      = ATA_UDMA6,
        .port_ops       = &vt6420_sata_ops,
 };
 
@@ -224,7 +231,7 @@ static struct ata_port_info vt6421_sport_info = {
        .flags          = ATA_FLAG_SATA | ATA_FLAG_NO_LEGACY,
        .pio_mask       = 0x1f,
        .mwdma_mask     = 0x07,
-       .udma_mask      = 0x7f,
+       .udma_mask      = ATA_UDMA6,
        .port_ops       = &vt6421_sata_ops,
 };
 
@@ -232,7 +239,7 @@ static struct ata_port_info vt6421_pport_info = {
        .flags          = ATA_FLAG_SLAVE_POSS | ATA_FLAG_NO_LEGACY,
        .pio_mask       = 0x1f,
        .mwdma_mask     = 0,
-       .udma_mask      = 0x7f,
+       .udma_mask      = ATA_UDMA6,
        .port_ops       = &vt6421_pata_ops,
 };
 
@@ -268,6 +275,7 @@ static void svia_noop_freeze(struct ata_port *ap)
 /**
  *     vt6420_prereset - prereset for vt6420
  *     @ap: target ATA port
+ *     @deadline: deadline jiffies for the operation
  *
  *     SCR registers on vt6420 are pieces of shit and may hang the
  *     whole machine completely if accessed with the wrong timing.
@@ -284,7 +292,7 @@ static void svia_noop_freeze(struct ata_port *ap)
  *     RETURNS:
  *     0 on success, -errno otherwise.
  */
-static int vt6420_prereset(struct ata_port *ap)
+static int vt6420_prereset(struct ata_port *ap, unsigned long deadline)
 {
        struct ata_eh_context *ehc = &ap->eh_context;
        unsigned long timeout = jiffies + (HZ * 5);
@@ -295,9 +303,7 @@ static int vt6420_prereset(struct ata_port *ap)
        if (!(ap->pflags & ATA_PFLAG_LOADING))
                goto skip_scr;
 
-       /* Resume phy.  This is the old resume sequence from
-        * __sata_phy_reset().
-        */
+       /* Resume phy.  This is the old SATA resume sequence */
        svia_scr_write(ap, SCR_CONTROL, 0x300);
        svia_scr_read(ap, SCR_CONTROL); /* flush */
 
@@ -329,7 +335,7 @@ static int vt6420_prereset(struct ata_port *ap)
 
  skip_scr:
        /* wait for !BSY */
-       ata_busy_sleep(ap, ATA_TMOUT_BOOT_QUICK, ATA_TMOUT_BOOT);
+       ata_wait_ready(ap, deadline);
 
        return 0;
 }
@@ -406,7 +412,7 @@ static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
        struct ata_host *host;
        int rc;
 
-       rc = ata_pci_prepare_native_host(pdev, ppi, 2, &host);
+       rc = ata_pci_prepare_sff_host(pdev, ppi, &host);
        if (rc)
                return rc;
        *r_host = host;
@@ -436,7 +442,7 @@ static int vt6421_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
                return -ENOMEM;
        }
 
-       rc = pcim_iomap_regions(pdev, 0x1f, DRV_NAME);
+       rc = pcim_iomap_regions(pdev, 0x3f, DRV_NAME);
        if (rc) {
                dev_printk(KERN_ERR, &pdev->dev, "failed to request/iomap "
                           "PCI BARs (errno=%d)\n", rc);