/* The Opti uses magic 'trapdoor' register accesses to do configuration rather than using PCI space as other controllers do. The double inw on the error register activates configuration mode. We can then write the control register  */
static void opti_write_reg(struct ata_port *ap, u8 val, int reg)
/* The Opti uses magic 'trapdoor' register accesses to do configuration rather than using PCI space as other controllers do. The double inw on the error register activates configuration mode. We can then write the control register  */
static void opti_write_reg(struct ata_port *ap, u8 val, int reg)
{
	void __iomem *regio = ap->ioaddr.cmd_addr;
	ioread16(regio + 1);
	ioread16(regio + 1);
	iowrite8(3, regio + 2);
	iowrite8(val, regio + reg);
	iowrite8(0x83, regio + 2);
}