/* Write data to the device. The bit should be set after 3 subframe times (each frame is 64 clocks). We wait a maximum of 6 subframes. We really should try doing something more productive while we wait.  */
static void mcp_sa11x0_write(struct mcp *mcp, unsigned int reg, unsigned int val)
/* Write data to the device. The bit should be set after 3 subframe times (each frame is 64 clocks). We wait a maximum of 6 subframes. We really should try doing something more productive while we wait.  */
static void mcp_sa11x0_write(struct mcp *mcp, unsigned int reg, unsigned int val)
{
	int ret = -ETIME;
	int i;
	Ser4MCDR2 = reg << 17 | MCDR2_Wr | (val & 0xffff);
	for (i = 0; i < 2; i++) {
		udelay(mcp->rw_timeout);
		if (Ser4MCSR & MCSR_CWC) {
			ret = 0;
			break;
		}
	}
	if (ret < 0)
		printk(KERN_WARNING "mcp: write timed out\n");
}