]> err.no Git - linux-2.6/blobdiff - drivers/ata/pata_pdc202xx_old.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/mchehab/v4l-dvb
[linux-2.6] / drivers / ata / pata_pdc202xx_old.c
index 65d951618c605d1c9e908a508c528014ac4b2b6c..6c9689b59b0627db0d96553ebc89602e2ce3bf84 100644 (file)
@@ -215,8 +215,8 @@ static void pdc2026x_bmdma_stop(struct ata_queued_cmd *qc)
        /* Flip back to 33Mhz for PIO */
        if (adev->dma_mode >= XFER_UDMA_2)
                iowrite8(ioread8(clock) & ~sel66, clock);
-
        ata_bmdma_stop(qc);
+       pdc202xx_set_piomode(ap, adev);
 }
 
 /**
@@ -233,6 +233,35 @@ static void pdc2026x_dev_config(struct ata_device *adev)
        adev->max_sectors = 256;
 }
 
+static int pdc2026x_port_start(struct ata_port *ap)
+{
+       void __iomem *bmdma = ap->ioaddr.bmdma_addr;
+       if (bmdma) {
+               /* Enable burst mode */
+               u8 burst = ioread8(bmdma + 0x1f);
+               iowrite8(burst | 0x01, bmdma + 0x1f);
+       }
+       return ata_sff_port_start(ap);
+}
+
+/**
+ *     pdc2026x_check_atapi_dma - Check whether ATAPI DMA can be supported for this command
+ *     @qc: Metadata associated with taskfile to check
+ *
+ *     Just say no - not supported on older Promise.
+ *
+ *     LOCKING:
+ *     None (inherited from caller).
+ *
+ *     RETURNS: 0 when ATAPI DMA can be used
+ *              1 otherwise
+ */
+
+static int pdc2026x_check_atapi_dma(struct ata_queued_cmd *qc)
+{
+       return 1;
+}
+
 static struct scsi_host_template pdc202xx_sht = {
        .module                 = THIS_MODULE,
        .name                   = DRV_NAME,
@@ -300,6 +329,7 @@ static struct ata_port_operations pdc2026x_port_ops = {
        .post_internal_cmd = ata_bmdma_post_internal_cmd,
        .cable_detect   = pdc2026x_cable_detect,
 
+       .check_atapi_dma= pdc2026x_check_atapi_dma,
        .bmdma_setup    = ata_bmdma_setup,
        .bmdma_start    = pdc2026x_bmdma_start,
        .bmdma_stop     = pdc2026x_bmdma_stop,
@@ -313,7 +343,7 @@ static struct ata_port_operations pdc2026x_port_ops = {
        .irq_clear      = ata_bmdma_irq_clear,
        .irq_on         = ata_irq_on,
 
-       .port_start     = ata_sff_port_start,
+       .port_start     = pdc2026x_port_start,
 };
 
 static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id)
@@ -351,9 +381,9 @@ static int pdc202xx_init_one(struct pci_dev *dev, const struct pci_device_id *id
                struct pci_dev *bridge = dev->bus->self;
                /* Don't grab anything behind a Promise I2O RAID */
                if (bridge && bridge->vendor == PCI_VENDOR_ID_INTEL) {
-                       ifbridge->device == PCI_DEVICE_ID_INTEL_I960)
+                       if (bridge->device == PCI_DEVICE_ID_INTEL_I960)
                                return -ENODEV;
-                       ifbridge->device == PCI_DEVICE_ID_INTEL_I960RM)
+                       if (bridge->device == PCI_DEVICE_ID_INTEL_I960RM)
                                return -ENODEV;
                }
        }