/* * We implement our own qc_issue() callback since we may need to set up * the timings differently for master and slave transfers: the CLK_MOD_REG * and MWDMA_TIMING_REG is shared between master and slave, so reprogramming * this may be necessary. */ static unsigned int ftide010_qc_issue(struct ata_queued_cmd *qc) { struct ata_port *ap = qc->ap; struct ata_device *adev = qc->dev; /* * If the device changed, i.e. slave->master, master->slave, * then set up the DMA mode again so we are sure the timings * are correct. */ if (adev != ap->private_data && ata_dma_enabled(adev)) ftide010_set_dmamode(ap, adev); return ata_bmdma_qc_issue(qc); }
static unsigned int pacpi_qc_issue(struct ata_queued_cmd *qc) { struct ata_port *ap = qc->ap; struct ata_device *adev = qc->dev; struct pata_acpi *acpi = ap->private_data; if (acpi->gtm.flags & 0x10) return ata_sff_qc_issue(qc); if (adev != acpi->last) { pacpi_set_piomode(ap, adev); if (ata_dma_enabled(adev)) pacpi_set_dmamode(ap, adev); acpi->last = adev; } return ata_sff_qc_issue(qc); }
static unsigned int sc1200_qc_issue(struct ata_queued_cmd *qc) { struct ata_port *ap = qc->ap; struct ata_device *adev = qc->dev; struct ata_device *prev = ap->private_data; /* See if the DMA settings could be wrong */ if (ata_dma_enabled(adev) && adev != prev && prev != NULL) { /* Maybe, but do the channels match MWDMA/UDMA ? */ if ((ata_using_udma(adev) && !ata_using_udma(prev)) || (ata_using_udma(prev) && !ata_using_udma(adev))) /* Switch the mode bits */ sc1200_set_dmamode(ap, adev); } return ata_bmdma_qc_issue(qc); }
static unsigned int cs5530_qc_issue(struct ata_queued_cmd *qc) { struct ata_port *ap = qc->ap; struct ata_device *adev = qc->dev; struct ata_device *prev = ap->private_data; if (ata_dma_enabled(adev) && adev != prev && prev != NULL) { if ((ata_using_udma(adev) && !ata_using_udma(prev)) || (ata_using_udma(prev) && !ata_using_udma(adev))) cs5530_set_dmamode(ap, adev); } return ata_bmdma_qc_issue(qc); }