Message ID | 1517644697-30806-11-git-send-email-absahu@codeaurora.org (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Andy Gross |
Headers | show |
Hi Abhishek, On 2/3/2018 1:28 PM, Abhishek Sahu wrote: > 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: Abhishek Sahu <absahu@codeaurora.org> > --- > drivers/i2c/busses/i2c-qup.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c > index ba717bb..edea3b9 100644 > --- a/drivers/i2c/busses/i2c-qup.c > +++ b/drivers/i2c/busses/i2c-qup.c > @@ -113,6 +113,7 @@ > #define QUP_TAG_V2_DATAWR 0x82 > #define QUP_TAG_V2_DATAWR_STOP 0x83 > #define QUP_TAG_V2_DATARD 0x85 > +#define QUP_TAG_V2_DATARD_NACK 0x86 > #define QUP_TAG_V2_DATARD_STOP 0x87 > > /* Status, Error flags */ > @@ -609,7 +610,9 @@ static int qup_i2c_set_tags(u8 *tags, struct qup_i2c_dev *qup, > tags[len++] = QUP_TAG_V2_DATAWR_STOP; > } else { > 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 > tags[len++] = QUP_TAG_V2_DATAWR; good one. Thanks . Regards, Sricharan
Tested on Centriq 2400 Reviewed-by: Austin Christ <austinwc@codeaurora.org> On 2/3/2018 12:58 AM, Abhishek Sahu wrote: > 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: Abhishek Sahu <absahu@codeaurora.org> > --- > drivers/i2c/busses/i2c-qup.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c > index ba717bb..edea3b9 100644 > --- a/drivers/i2c/busses/i2c-qup.c > +++ b/drivers/i2c/busses/i2c-qup.c > @@ -113,6 +113,7 @@ > #define QUP_TAG_V2_DATAWR 0x82 > #define QUP_TAG_V2_DATAWR_STOP 0x83 > #define QUP_TAG_V2_DATARD 0x85 > +#define QUP_TAG_V2_DATARD_NACK 0x86 > #define QUP_TAG_V2_DATARD_STOP 0x87 > > /* Status, Error flags */ > @@ -609,7 +610,9 @@ static int qup_i2c_set_tags(u8 *tags, struct qup_i2c_dev *qup, > tags[len++] = QUP_TAG_V2_DATAWR_STOP; > } else { > 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 > tags[len++] = QUP_TAG_V2_DATAWR; > } >
On Sat, Feb 03, 2018 at 01:28:15PM +0530, Abhishek Sahu wrote: > 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: Abhishek Sahu <absahu@codeaurora.org> Reviewed-by: Andy Gross <andy.gross@linaro.org> -- To unsubscribe from this list: send the line "unsubscribe linux-arm-msm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/drivers/i2c/busses/i2c-qup.c b/drivers/i2c/busses/i2c-qup.c index ba717bb..edea3b9 100644 --- a/drivers/i2c/busses/i2c-qup.c +++ b/drivers/i2c/busses/i2c-qup.c @@ -113,6 +113,7 @@ #define QUP_TAG_V2_DATAWR 0x82 #define QUP_TAG_V2_DATAWR_STOP 0x83 #define QUP_TAG_V2_DATARD 0x85 +#define QUP_TAG_V2_DATARD_NACK 0x86 #define QUP_TAG_V2_DATARD_STOP 0x87 /* Status, Error flags */ @@ -609,7 +610,9 @@ static int qup_i2c_set_tags(u8 *tags, struct qup_i2c_dev *qup, tags[len++] = QUP_TAG_V2_DATAWR_STOP; } else { 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 tags[len++] = QUP_TAG_V2_DATAWR; }
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: Abhishek Sahu <absahu@codeaurora.org> --- drivers/i2c/busses/i2c-qup.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)