ahci: add HFLAG_YES_FBS and apply it to 88SE9128
[linux-2.6.git] / drivers / ata / pata_serverworks.c
index 627abcf..86dd714 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * pata_serverworks.c  - Serverworks PATA for new ATA layer
  *                       (C) 2005 Red Hat Inc
- *                       Alan Cox <alan@redhat.com>
+ *                       (C) 2010 Bartlomiej Zolnierkiewicz
  *
  * based upon
  *
@@ -139,7 +139,6 @@ static struct sv_cable_table cable_detect[] = {
 /**
  *     serverworks_cable_detect        -       cable detection
  *     @ap: ATA port
- *     @deadline: deadline jiffies for the operation
  *
  *     Perform cable detection according to the device and subvendor
  *     identifications
@@ -199,7 +198,7 @@ static unsigned long serverworks_osb4_filter(struct ata_device *adev, unsigned l
 {
        if (adev->class == ATA_DEV_ATA)
                mask &= ~ATA_MASK_UDMA;
-       return ata_pci_default_filter(adev, mask);
+       return mask;
 }
 
 
@@ -219,7 +218,7 @@ static unsigned long serverworks_csb_filter(struct ata_device *adev, unsigned lo
 
        /* Disk, UDMA */
        if (adev->class != ATA_DEV_ATA)
-               return ata_pci_default_filter(adev, mask);
+               return mask;
 
        /* Actually do need to check */
        ata_id_c_string(adev->id, model_num, ATA_ID_PROD, sizeof(model_num));
@@ -228,7 +227,7 @@ static unsigned long serverworks_csb_filter(struct ata_device *adev, unsigned lo
                if (!strcmp(p, model_num))
                        mask &= ~(0xE0 << ATA_SHIFT_UDMA);
        }
-       return ata_pci_default_filter(adev, mask);
+       return mask;
 }
 
 /**
@@ -255,7 +254,7 @@ static void serverworks_set_piomode(struct ata_port *ap, struct ata_device *adev
        if (serverworks_is_csb(pdev)) {
                pci_read_config_word(pdev, 0x4A, &csb5_pio);
                csb5_pio &= ~(0x0F << devbits);
-               pci_write_config_byte(pdev, 0x4A, csb5_pio | (pio << devbits));
+               pci_write_config_word(pdev, 0x4A, csb5_pio | (pio << devbits));
        }
 }
 
@@ -329,7 +328,7 @@ static int serverworks_fixup_osb4(struct pci_dev *pdev)
                pci_dev_put(isa_dev);
                return 0;
        }
-       printk(KERN_WARNING "ata_serverworks: Unable to find bridge.\n");
+       printk(KERN_WARNING DRV_NAME ": Unable to find bridge.\n");
        return -ENODEV;
 }
 
@@ -399,31 +398,27 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
 {
        static const struct ata_port_info info[4] = {
                { /* OSB4 */
-                       .sht = &serverworks_sht,
                        .flags = ATA_FLAG_SLAVE_POSS,
-                       .pio_mask = 0x1f,
-                       .mwdma_mask = 0x07,
-                       .udma_mask = 0x07,
+                       .pio_mask = ATA_PIO4,
+                       .mwdma_mask = ATA_MWDMA2,
+                       .udma_mask = ATA_UDMA2,
                        .port_ops = &serverworks_osb4_port_ops
                }, { /* OSB4 no UDMA */
-                       .sht = &serverworks_sht,
                        .flags = ATA_FLAG_SLAVE_POSS,
-                       .pio_mask = 0x1f,
-                       .mwdma_mask = 0x07,
-                       .udma_mask = 0x00,
+                       .pio_mask = ATA_PIO4,
+                       .mwdma_mask = ATA_MWDMA2,
+                       /* No UDMA */
                        .port_ops = &serverworks_osb4_port_ops
                }, { /* CSB5 */
-                       .sht = &serverworks_sht,
                        .flags = ATA_FLAG_SLAVE_POSS,
-                       .pio_mask = 0x1f,
-                       .mwdma_mask = 0x07,
+                       .pio_mask = ATA_PIO4,
+                       .mwdma_mask = ATA_MWDMA2,
                        .udma_mask = ATA_UDMA4,
                        .port_ops = &serverworks_csb_port_ops
                }, { /* CSB5 - later revisions*/
-                       .sht = &serverworks_sht,
                        .flags = ATA_FLAG_SLAVE_POSS,
-                       .pio_mask = 0x1f,
-                       .mwdma_mask = 0x07,
+                       .pio_mask = ATA_PIO4,
+                       .mwdma_mask = ATA_MWDMA2,
                        .udma_mask = ATA_UDMA5,
                        .port_ops = &serverworks_csb_port_ops
                }
@@ -463,9 +458,9 @@ static int serverworks_init_one(struct pci_dev *pdev, const struct pci_device_id
                serverworks_fixup_ht1000(pdev);
 
        if (pdev->device == PCI_DEVICE_ID_SERVERWORKS_CSB5IDE)
-               ata_pci_clear_simplex(pdev);
+               ata_pci_bmdma_clear_simplex(pdev);
 
-       return ata_pci_init_one(pdev, ppi);
+       return ata_pci_bmdma_init_one(pdev, ppi, &serverworks_sht, NULL, 0);
 }
 
 #ifdef CONFIG_PM
@@ -486,7 +481,7 @@ static int serverworks_reinit_one(struct pci_dev *pdev)
                        serverworks_fixup_osb4(pdev);
                        break;
                case PCI_DEVICE_ID_SERVERWORKS_CSB5IDE:
-                       ata_pci_clear_simplex(pdev);
+                       ata_pci_bmdma_clear_simplex(pdev);
                        /* fall through */
                case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE:
                case PCI_DEVICE_ID_SERVERWORKS_CSB6IDE2: