From: Grygorii Strashko Date: Fri, 7 Jun 2013 18:46:07 +0000 (+0300) Subject: i2c: omap: query STP always when NACK is received X-Git-Tag: v3.12-rc1~140^2~21 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=cda2109a26eb6fa58acfeae878eed87492480eae;p=pandora-kernel.git i2c: omap: query STP always when NACK is received According to I2C specification the NACK should be handled as folowing: "When SDA remains HIGH during this ninth clock pulse, this is defined as the Not Acknowledge signal. The master can then gene rate either a STOP condition to abort the transfer, or a repeated START condition to start a new transfer." [http://www.nxp.com/documents/user_manual/UM10204.pdf] The same is recomened by TI I2C wiki: http://processors.wiki.ti.com/index.php/I2C_Tips Currently, the OMAP I2C driver interrupts I2C trunsfer in case of NACK, but It queries Stop condition OMAP_I2C_CON_REG.STP=1 only if NACK has been received during the last message transmitting/recieving. This may lead to stuck Bus in "Bus Busy" until I2C IP reset (idle/enable). Hence, fix it by querying Stop condition (STP) always when NACK is received. Signed-off-by: Grygorii Strashko Acked-by: Hein Tibosch Acked-by: Felipe Balbi Signed-off-by: Wolfram Sang --- Reading git-diff-tree failed