aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/i2c/busses/i2c-omap.c
diff options
context:
space:
mode:
authorCory Maccarrone <darkstar6262@gmail.com>2009-12-22 20:06:13 -0500
committerBen Dooks <ben-linux@fluff.org>2009-12-23 20:26:06 -0500
commit07ac31f6f4cd558e53f6705dbe3033a7f0237eb8 (patch)
tree745b42db8e2d97fb4e783a581ba846fd57432c81 /drivers/i2c/busses/i2c-omap.c
parentac07fb4dc1908d300f50fa711982c9d750eb59f7 (diff)
i2c-omap: Don't write IE state in unidle if 0
Commit ef871432... (i2c-omap: OMAP3: PM: (re)init for every transfer to support off-mode) introduced a change which make the dev->iestate contents be written to the OMAP_I2C_IE_REG every time omap_i2c_unidle is called. Previously, the state was only written if it wasn't equal to zero. In omap_i2c_probe, omap_i2c_unidle() is called prior to omap_i2c_init(), in which case dev->iestate has not yet been initialized and will be set to zero. Having this value written to the registers causes deadlock while booting. As such, this change restores the original functionality. Signed-off-by: Cory Maccarrone <darkstar6262@gmail.com> Signed-off-by: Ben Dooks <ben-linux@fluff.org>
Diffstat (limited to 'drivers/i2c/busses/i2c-omap.c')
-rw-r--r--drivers/i2c/busses/i2c-omap.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/i2c/busses/i2c-omap.c b/drivers/i2c/busses/i2c-omap.c
index 75bf3ad18099..a64a192c44a4 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)