aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-omap.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/i2c/busses/i2c-omap.c')
-rw-r--r--drivers/i2c/busses/i2c-omap.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 75bf3ad18099..0037e31076ba 100644
--- a/drivers/i2c/busses/i2c-omap.c
+++ b/drivers/i2c/busses/i2c-omap.c
@@ -247,7 +247,13 @@ static void omap_i2c_unidle(struct omap_i2c_dev *dev)
247 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, OMAP_I2C_CON_EN); 247 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG, OMAP_I2C_CON_EN);
248 } 248 }
249 dev->idle = 0; 249 dev->idle = 0;
250 omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate); 250
251 /*
252 * Don't write to this register if the IE state is 0 as it can
253 * cause deadlock.
254 */
255 if (dev->iestate)
256 omap_i2c_write_reg(dev, OMAP_I2C_IE_REG, dev->iestate);
251} 257}
252 258
253static void omap_i2c_idle(struct omap_i2c_dev *dev) 259static void omap_i2c_idle(struct omap_i2c_dev *dev)
@@ -280,6 +286,11 @@ static int omap_i2c_init(struct omap_i2c_dev *dev)
280 unsigned long internal_clk = 0; 286 unsigned long internal_clk = 0;
281 287
282 if (dev->rev >= OMAP_I2C_REV_2) { 288 if (dev->rev >= OMAP_I2C_REV_2) {
289 /* Disable I2C controller before soft reset */
290 omap_i2c_write_reg(dev, OMAP_I2C_CON_REG,
291 omap_i2c_read_reg(dev, OMAP_I2C_CON_REG) &
292 ~(OMAP_I2C_CON_EN));
293
283 omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, SYSC_SOFTRESET_MASK); 294 omap_i2c_write_reg(dev, OMAP_I2C_SYSC_REG, SYSC_SOFTRESET_MASK);
284 /* For some reason we need to set the EN bit before the 295 /* For some reason we need to set the EN bit before the
285 * reset done bit gets set. */ 296 * reset done bit gets set. */