/* pacpi_set_dmamode - set initial DMA mode data @ap: ATA interface @adev: ATA device  */
static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
/* pacpi_set_dmamode - set initial DMA mode data @ap: ATA interface @adev: ATA device  */
static void pacpi_set_dmamode(struct ata_port *ap, struct ata_device *adev)
{
	int unit = adev->devno;
	struct pata_acpi *acpi = ap->private_data;
	const struct ata_timing *t;
	if (!(acpi->gtm.flags & 0x10))
		unit = 0;
	t = ata_timing_find_mode(adev->dma_mode);
	if (adev->dma_mode >= XFER_UDMA_0) {
		acpi->gtm.drive[unit].dma = t->udma;
		acpi->gtm.flags |= (1 << (2 * unit));
	} else {
		acpi->gtm.drive[unit].dma = t->cycle;
		acpi->gtm.flags &= ~(1 << (2 * unit));
	}
	ata_acpi_stm(ap, &acpi->gtm);
	ata_acpi_gtm(ap, &acpi->gtm);
}