/* Performs one input/output transaction between the exi host and the usbgecko.  */
static u32 ug_io_transaction(u32 in)
/* Performs one input/output transaction between the exi host and the usbgecko.  */
static u32 ug_io_transaction(u32 in)
{
	u32 __iomem *csr_reg = ug_io_base + EXI_CSR;
	u32 __iomem *data_reg = ug_io_base + EXI_DATA;
	u32 __iomem *cr_reg = ug_io_base + EXI_CR;
	u32 csr, data, cr;
	csr = EXI_CSR_CLK_32MHZ | EXI_CSR_CS_0;
	out_be32(csr_reg, csr);
	data = in;
	out_be32(data_reg, data);
	cr = EXI_CR_TLEN(2) | EXI_CR_READ_WRITE | EXI_CR_TSTART;
	out_be32(cr_reg, cr);
	while (in_be32(cr_reg) & EXI_CR_TSTART)
		barrier();
	out_be32(csr_reg, 0);
	data = in_be32(data_reg);
	return data;
}