aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-mxs.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-mxs.c')
-rw-r--r--drivers/i2c/busses/i2c-mxs.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/i2c/busses/i2c-mxs.c b/drivers/i2c/busses/i2c-mxs.c
index 3d471d56bf15..76b8af44f634 100644
--- a/drivers/i2c/busses/i2c-mxs.c
+++ b/drivers/i2c/busses/i2c-mxs.c
@@ -227,6 +227,7 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg,
227 return -EINVAL; 227 return -EINVAL;
228 228
229 init_completion(&i2c->cmd_complete); 229 init_completion(&i2c->cmd_complete);
230 i2c->cmd_err = 0;
230 231
231 flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0; 232 flags = stop ? MXS_I2C_CTRL0_POST_SEND_STOP : 0;
232 233
@@ -252,6 +253,9 @@ static int mxs_i2c_xfer_msg(struct i2c_adapter *adap, struct i2c_msg *msg,
252 253
253 if (i2c->cmd_err == -ENXIO) 254 if (i2c->cmd_err == -ENXIO)
254 mxs_i2c_reset(i2c); 255 mxs_i2c_reset(i2c);
256 else
257 writel(MXS_I2C_QUEUECTRL_QUEUE_RUN,
258 i2c->regs + MXS_I2C_QUEUECTRL_CLR);
255 259
256 dev_dbg(i2c->dev, "Done with err=%d\n", i2c->cmd_err); 260 dev_dbg(i2c->dev, "Done with err=%d\n", i2c->cmd_err);
257 261
@@ -299,8 +303,6 @@ static irqreturn_t mxs_i2c_isr(int this_irq, void *dev_id)
299 MXS_I2C_CTRL1_SLAVE_STOP_IRQ | MXS_I2C_CTRL1_SLAVE_IRQ)) 303 MXS_I2C_CTRL1_SLAVE_STOP_IRQ | MXS_I2C_CTRL1_SLAVE_IRQ))
300 /* MXS_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ is only for slaves */ 304 /* MXS_I2C_CTRL1_OVERSIZE_XFER_TERM_IRQ is only for slaves */
301 i2c->cmd_err = -EIO; 305 i2c->cmd_err = -EIO;
302 else
303 i2c->cmd_err = 0;
304 306
305 is_last_cmd = (readl(i2c->regs + MXS_I2C_QUEUESTAT) & 307 is_last_cmd = (readl(i2c->regs + MXS_I2C_QUEUESTAT) &
306 MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK) == 0; 308 MXS_I2C_QUEUESTAT_WRITE_QUEUE_CNT_MASK) == 0;
@@ -384,8 +386,6 @@ static int __devexit mxs_i2c_remove(struct platform_device *pdev)
384 if (ret) 386 if (ret)
385 return -EBUSY; 387 return -EBUSY;
386 388
387 writel(MXS_I2C_QUEUECTRL_QUEUE_RUN,
388 i2c->regs + MXS_I2C_QUEUECTRL_CLR);
389 writel(MXS_I2C_CTRL0_SFTRST, i2c->regs + MXS_I2C_CTRL0_SET); 389 writel(MXS_I2C_CTRL0_SFTRST, i2c->regs + MXS_I2C_CTRL0_SET);
390 390
391 platform_set_drvdata(pdev, NULL); 391 platform_set_drvdata(pdev, NULL);