]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/ata/sata_via.c
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jmorris...
[linux-2.6-omap-h63xx.git] / drivers / ata / sata_via.c
index 86b7bfc173244a203bf11977eba1fbe268db7799..cc6ee0890f56c1ddcb24581bbad7bbc27ae2640e 100644 (file)
@@ -46,7 +46,7 @@
 #include <linux/libata.h>
 
 #define DRV_NAME       "sata_via"
-#define DRV_VERSION    "2.2"
+#define DRV_VERSION    "2.3"
 
 enum board_ids_enum {
        vt6420,
@@ -57,7 +57,6 @@ enum {
        SATA_CHAN_ENAB          = 0x40, /* SATA channel enable */
        SATA_INT_GATE           = 0x41, /* SATA interrupt gating */
        SATA_NATIVE_MODE        = 0x42, /* Native mode enable */
-       SATA_PATA_SHARING       = 0x49, /* PATA/SATA sharing func ctrl */
        PATA_UDMA_TIMING        = 0xB3, /* PATA timing for DMA/ cable detect */
        PATA_PIO_TIMING         = 0xAB, /* PATA timing register */
 
@@ -68,7 +67,6 @@ enum {
        NATIVE_MODE_ALL         = (1 << 7) | (1 << 6) | (1 << 5) | (1 << 4),
 
        SATA_EXT_PHY            = (1 << 6), /* 0==use PATA, 1==ext phy */
-       SATA_2DEV               = (1 << 5), /* SATA is master/slave */
 };
 
 static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent);
@@ -122,8 +120,6 @@ static struct scsi_host_template svia_sht = {
 };
 
 static const struct ata_port_operations vt6420_sata_ops = {
-       .port_disable           = ata_port_disable,
-
        .tf_load                = ata_tf_load,
        .tf_read                = ata_tf_read,
        .check_status           = ata_check_status,
@@ -146,14 +142,11 @@ static const struct ata_port_operations vt6420_sata_ops = {
 
        .irq_clear              = ata_bmdma_irq_clear,
        .irq_on                 = ata_irq_on,
-       .irq_ack                = ata_irq_ack,
 
        .port_start             = ata_port_start,
 };
 
 static const struct ata_port_operations vt6421_pata_ops = {
-       .port_disable           = ata_port_disable,
-
        .set_piomode            = vt6421_set_pio_mode,
        .set_dmamode            = vt6421_set_dma_mode,
 
@@ -180,14 +173,11 @@ static const struct ata_port_operations vt6421_pata_ops = {
 
        .irq_clear              = ata_bmdma_irq_clear,
        .irq_on                 = ata_irq_on,
-       .irq_ack                = ata_irq_ack,
 
        .port_start             = ata_port_start,
 };
 
 static const struct ata_port_operations vt6421_sata_ops = {
-       .port_disable           = ata_port_disable,
-
        .tf_load                = ata_tf_load,
        .tf_read                = ata_tf_read,
        .check_status           = ata_check_status,
@@ -211,7 +201,6 @@ static const struct ata_port_operations vt6421_sata_ops = {
 
        .irq_clear              = ata_bmdma_irq_clear,
        .irq_on                 = ata_irq_on,
-       .irq_ack                = ata_irq_ack,
 
        .scr_read               = svia_scr_read,
        .scr_write              = svia_scr_write,
@@ -276,7 +265,7 @@ static void svia_noop_freeze(struct ata_port *ap)
 
 /**
  *     vt6420_prereset - prereset for vt6420
- *     @ap: target ATA port
+ *     @link: target ATA link
  *     @deadline: deadline jiffies for the operation
  *
  *     SCR registers on vt6420 are pieces of shit and may hang the
@@ -294,9 +283,10 @@ static void svia_noop_freeze(struct ata_port *ap)
  *     RETURNS:
  *     0 on success, -errno otherwise.
  */
-static int vt6420_prereset(struct ata_port *ap, unsigned long deadline)
+static int vt6420_prereset(struct ata_link *link, unsigned long deadline)
 {
-       struct ata_eh_context *ehc = &ap->eh_context;
+       struct ata_port *ap = link->ap;
+       struct ata_eh_context *ehc = &ap->link.eh_context;
        unsigned long timeout = jiffies + (HZ * 5);
        u32 sstatus, scontrol;
        int online;
@@ -371,7 +361,7 @@ static void vt6421_set_dma_mode(struct ata_port *ap, struct ata_device *adev)
 {
        struct pci_dev *pdev = to_pci_dev(ap->host->dev);
        static const u8 udma_bits[] = { 0xEE, 0xE8, 0xE6, 0xE4, 0xE2, 0xE1, 0xE0, 0xE0 };
-       pci_write_config_byte(pdev, PATA_UDMA_TIMING, udma_bits[adev->pio_mode - XFER_UDMA_0]);
+       pci_write_config_byte(pdev, PATA_UDMA_TIMING, udma_bits[adev->dma_mode - XFER_UDMA_0]);
 }
 
 static const unsigned int svia_bar_sizes[] = {
@@ -407,6 +397,9 @@ static void vt6421_init_addrs(struct ata_port *ap)
        ioaddr->scr_addr = vt6421_scr_addr(iomap[5], ap->port_no);
 
        ata_std_ports(ioaddr);
+
+       ata_port_pbar_desc(ap, ap->port_no, -1, "port");
+       ata_port_pbar_desc(ap, 4, ap->port_no * 8, "bmdma");
 }
 
 static int vt6420_prepare_host(struct pci_dev *pdev, struct ata_host **r_host)
@@ -512,8 +505,7 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        int rc;
        struct ata_host *host;
        int board_id = (int) ent->driver_data;
-       const int *bar_sizes;
-       u8 tmp8;
+       const unsigned *bar_sizes;
 
        if (!printed_version++)
                dev_printk(KERN_DEBUG, &pdev->dev, "version " DRV_VERSION "\n");
@@ -522,19 +514,10 @@ static int svia_init_one (struct pci_dev *pdev, const struct pci_device_id *ent)
        if (rc)
                return rc;
 
-       if (board_id == vt6420) {
-               pci_read_config_byte(pdev, SATA_PATA_SHARING, &tmp8);
-               if (tmp8 & SATA_2DEV) {
-                       dev_printk(KERN_ERR, &pdev->dev,
-                                  "SATA master/slave not supported (0x%x)\n",
-                                  (int) tmp8);
-                       return -EIO;
-               }
-
+       if (board_id == vt6420)
                bar_sizes = &svia_bar_sizes[0];
-       } else {
+       else
                bar_sizes = &vt6421_bar_sizes[0];
-       }
 
        for (i = 0; i < ARRAY_SIZE(svia_bar_sizes); i++)
                if ((pci_resource_start(pdev, i) == 0) ||