/* this is the low level routine to read/write a bit on the One Wire interface on the hardware. It does write 0 if parameter bit is set to 0, otherwise a write 1/read.  */
static u8 mxc_w1_touch_bit(struct mxc_w1_pdata *pdata, u8 bit)
/* this is the low level routine to read/write a bit on the One Wire interface on the hardware. It does write 0 if parameter bit is set to 0, otherwise a write 1/read.  */
static u8 mxc_w1_touch_bit(struct mxc_w1_pdata *pdata, u8 bit)
{
	u16 *ctrl_addr = &pdata->regs->control;
	u16 mask = MXC_W1_CONTROL_WR(bit);
	unsigned int timeout_cnt = 400; 
	writew(mask, ctrl_addr);
	while (timeout_cnt--) {
		if (!(readw(ctrl_addr) & mask))
			break;
		udelay(1);
	}
	return (readw(ctrl_addr) & MXC_W1_CONTROL_RDST) ? 1 : 0;
}