/* this is the low level routine to reset the device on the One Wire interface on the hardware  */
static u8 mxc_w1_ds2_reset_bus(void *data)
/* this is the low level routine to reset the device on the One Wire interface on the hardware  */
static u8 mxc_w1_ds2_reset_bus(void *data)
{
	u8 reg_val;
	unsigned int timeout_cnt = 0;
	struct mxc_w1_device *dev = data;
	__raw_writeb(0x80, (dev->regs + MXC_W1_CONTROL));
	while (1) {
		reg_val = __raw_readb(dev->regs + MXC_W1_CONTROL);
		if (((reg_val >> 7) & 0x1) == 0 ||
		    timeout_cnt > MXC_W1_RESET_TIMEOUT)
			break;
		else
			timeout_cnt++;
		udelay(100);
	}
	return (reg_val >> 7) & 0x1;
}