struct i2c_msg *msgs, int stop)
{
unsigned long timeout;
- unsigned long trans_status;
unsigned long i2c_ctl;
unsigned long i2c_auto_conf;
unsigned long i2c_timeout;
(&i2c->msg_complete, EXYNOS5_I2C_TIMEOUT);
ret = 0;
- if (i2c->scl_clk_stretch) {
- unsigned long timeout = jiffies + msecs_to_jiffies(100);
-
- do {
- trans_status = readl(i2c->regs + HSI2C_TRANS_STATUS);
- if ((!(trans_status & HSI2C_MAST_ST_MASK)) ||
- ((stop == 0) && (trans_status & HSI2C_MASTER_BUSY))){
- timeout = 0;
- break;
- }
- } while(time_before(jiffies, timeout));
-
- if (timeout)
- dev_err(i2c->dev, "SDA check timeout!!! = 0x%8lx\n",trans_status);
- }
disable_irq(i2c->irq);
if (i2c->trans_done < 0) {
dev_err(i2c->dev, "ack was not received at write\n");
ret = i2c->trans_done;
exynos5_i2c_reset(i2c);
- } else {
- if (i2c->scl_clk_stretch) {
- unsigned long timeout = jiffies + msecs_to_jiffies(100);
-
- do {
- trans_status = readl(i2c->regs + HSI2C_TRANS_STATUS);
- if ((!(trans_status & HSI2C_MAST_ST_MASK)) ||
- ((stop == 0) && (trans_status & HSI2C_MASTER_BUSY))){
- timeout = 0;
- break;
- }
- } while(time_before(jiffies, timeout));
-
- if (timeout)
- dev_err(i2c->dev, "SDA check timeout!!! = 0x%8lx\n",trans_status);
- }
-
+ } else
ret = 0;
- }
}
}