pata_hpt{37x|3x2n}: SATA mode filtering
[linux-2.6.git] / drivers / ata / pata_octeon_cf.c
index 303ca7e..fa1b95a 100644 (file)
@@ -60,7 +60,7 @@ static unsigned int ns_to_tim_reg(unsigned int tim_mult, unsigned int nsecs)
         * Compute # of eclock periods to get desired duration in
         * nanoseconds.
         */
-       val = DIV_ROUND_UP(nsecs * (octeon_get_clock_rate() / 1000000),
+       val = DIV_ROUND_UP(nsecs * (octeon_get_io_clock_rate() / 1000000),
                          1000 * tim_mult);
 
        return val;
@@ -653,11 +653,6 @@ static irqreturn_t octeon_cf_interrupt(int irq, void *dev_instance)
 
                ap = host->ports[i];
                ocd = ap->dev->platform_data;
-
-               if (ap->flags & ATA_FLAG_DISABLED)
-                       continue;
-
-               ocd = ap->dev->platform_data;
                cf_port = ap->private_data;
                dma_int.u64 =
                        cvmx_read_csr(CVMX_MIO_BOOT_DMA_INTX(ocd->dma_engine));
@@ -666,8 +661,7 @@ static irqreturn_t octeon_cf_interrupt(int irq, void *dev_instance)
 
                qc = ata_qc_from_tag(ap, ap->link.active_tag);
 
-               if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)) &&
-                   (qc->flags & ATA_QCFLAG_ACTIVE)) {
+               if (qc && !(qc->tf.flags & ATA_TFLAG_POLLING)) {
                        if (dma_int.s.done && !dma_cfg.s.en) {
                                if (!sg_is_last(qc->cursg)) {
                                        qc->cursg = sg_next(qc->cursg);
@@ -737,8 +731,7 @@ static void octeon_cf_delayed_finish(struct work_struct *work)
                goto out;
        }
        qc = ata_qc_from_tag(ap, ap->link.active_tag);
-       if (qc && (!(qc->tf.flags & ATA_TFLAG_POLLING)) &&
-           (qc->flags & ATA_QCFLAG_ACTIVE))
+       if (qc && !(qc->tf.flags & ATA_TFLAG_POLLING))
                octeon_cf_dma_finished(ap, qc);
 out:
        spin_unlock_irqrestore(&host->lock, flags);
@@ -755,20 +748,6 @@ static void octeon_cf_dev_config(struct ata_device *dev)
 }
 
 /*
- * Trap if driver tries to do standard bmdma commands.  They are not
- * supported.
- */
-static void unreachable_qc(struct ata_queued_cmd *qc)
-{
-       BUG();
-}
-
-static u8 unreachable_port(struct ata_port *ap)
-{
-       BUG();
-}
-
-/*
  * We don't do ATAPI DMA so return 0.
  */
 static int octeon_cf_check_atapi_dma(struct ata_queued_cmd *qc)
@@ -809,10 +788,6 @@ static struct ata_port_operations octeon_cf_ops = {
        .sff_dev_select         = octeon_cf_dev_select,
        .sff_irq_on             = octeon_cf_irq_on,
        .sff_irq_clear          = octeon_cf_irq_clear,
-       .bmdma_setup            = unreachable_qc,
-       .bmdma_start            = unreachable_qc,
-       .bmdma_stop             = unreachable_qc,
-       .bmdma_status           = unreachable_port,
        .cable_detect           = ata_cable_40wire,
        .set_piomode            = octeon_cf_set_piomode,
        .set_dmamode            = octeon_cf_set_dmamode,