I2C: OMAP3: PM: (re)init for every transfer to support off-mode
commit35eab3133ca9bdfbacd882a770bb3a24af577d69
authorRajendra Nayak <rnayak@ti.com>
Fri, 26 Sep 2008 12:18:07 +0000 (26 17:48 +0530)
committerKevin Hilman <khilman@deeprootsystems.com>
Fri, 23 Oct 2009 18:19:45 +0000 (23 11:19 -0700)
tree6c38fc02030fc516e51364dc20d270c4124496e8
parent047db7764424e94aafc75c8a30d002f0c5a68253
I2C: OMAP3: PM: (re)init for every transfer to support off-mode

Because of OMAP off-mode, powerdomain can go off when I2C is idle.
Save enough state, and do a re-init for each transfer.

Additional save/restore state added by Jagadeesh Bhaskar Pakaravoor
(SYSC_REG) and Aaro Koskinen (wakeup sources.)

Also, The OMAP3430 TRM states:

"During active mode (I2Ci.I2C_CON[15] I2C_EN bit is set to 1), make no
changes to the I2Ci.I2C_SCLL and I2Ci.I2C_SCLH registers.  Changes may
result in unpredictable behavior."

Hence, the I2C_EN bit should be clearer when modifying these
registers. Please note that clearing the entire I2C_CON register to
disable the I2C module is safe, because the I2C_CON register is
re-configured for each transfer.

Signed-off-by: Jouni Hogander <jouni.hogander@nokia.com>
Signed-off-by: Rajendra Nayak <rnayak@ti.com>
Cc: Jagadeesh Bhaskar Pakaravoor <j-pakaravoor@ti.com>
Cc: Aaro Koskinen <aaro.koskinen@nokia.com>
Cc: Jon Hunter <jon-hunter@ti.com>
Cc: Hu Tao <taohu@motorola.com>
Cc: Xiaolong Chen <A21785@motorola.com>
Signed-off-by: Kevin Hilman <khilman@deeprootsystems.com>
drivers/i2c/busses/i2c-omap.c