add timeout for infinite loop in I2C driver