/* Turn the ATA device setup into PCI configuration bits for register 0x43 and return the two bits needed.  */
static u8 optidma_make_bits43(struct ata_device *adev)
/* Turn the ATA device setup into PCI configuration bits for register 0x43 and return the two bits needed.  */
static u8 optidma_make_bits43(struct ata_device *adev)
{
	static const u8 bits43[5] = {
		0, 0, 0, 1, 2
	};
	if (!ata_dev_enabled(adev))
		return 0;
	if (adev->dma_mode)
		return adev->dma_mode - XFER_MW_DMA_0;
	return bits43[adev->pio_mode - XFER_PIO_0];
}