提交 f7714b4e 编写于 作者: A Abhishek Sahu 提交者: Wolfram Sang

i2c: qup: send NACK for last read sub transfers

According to I2c specification, “If a master-receiver sends a
repeated START condition, it sends a not-acknowledge (A) just
before the repeated START condition”. QUP v2 supports sending
of NACK without stop with QUP_TAG_V2_DATARD_NACK so added the
same.
Signed-off-by: NAbhishek Sahu <absahu@codeaurora.org>
Reviewed-by: NAustin Christ <austinwc@codeaurora.org>
Reviewed-by: NAndy Gross <andy.gross@linaro.org>
Signed-off-by: NWolfram Sang <wsa@the-dreams.de>
上级 6f2f0f64
...@@ -104,6 +104,7 @@ ...@@ -104,6 +104,7 @@
#define QUP_TAG_V2_DATAWR 0x82 #define QUP_TAG_V2_DATAWR 0x82
#define QUP_TAG_V2_DATAWR_STOP 0x83 #define QUP_TAG_V2_DATAWR_STOP 0x83
#define QUP_TAG_V2_DATARD 0x85 #define QUP_TAG_V2_DATARD 0x85
#define QUP_TAG_V2_DATARD_NACK 0x86
#define QUP_TAG_V2_DATARD_STOP 0x87 #define QUP_TAG_V2_DATARD_STOP 0x87
/* Status, Error flags */ /* Status, Error flags */
...@@ -606,7 +607,9 @@ static int qup_i2c_set_tags(u8 *tags, struct qup_i2c_dev *qup, ...@@ -606,7 +607,9 @@ static int qup_i2c_set_tags(u8 *tags, struct qup_i2c_dev *qup,
tags[len++] = QUP_TAG_V2_DATAWR_STOP; tags[len++] = QUP_TAG_V2_DATAWR_STOP;
} else { } else {
if (msg->flags & I2C_M_RD) if (msg->flags & I2C_M_RD)
tags[len++] = QUP_TAG_V2_DATARD; tags[len++] = qup->blk.pos == (qup->blk.count - 1) ?
QUP_TAG_V2_DATARD_NACK :
QUP_TAG_V2_DATARD;
else else
tags[len++] = QUP_TAG_V2_DATAWR; tags[len++] = QUP_TAG_V2_DATAWR;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册