From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751959AbeB0WHe (ORCPT ); Tue, 27 Feb 2018 17:07:34 -0500 Received: from smtp.codeaurora.org ([198.145.29.96]:46978 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751641AbeB0WHb (ORCPT ); Tue, 27 Feb 2018 17:07:31 -0500 DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org D2BD060117 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=austinwc@codeaurora.org Subject: Re: [PATCH 10/12] i2c: qup: send NACK for last read sub transfers To: Abhishek Sahu , Andy Gross , Wolfram Sang Cc: David Brown , Sricharan R , linux-arm-msm@vger.kernel.org, linux-soc@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org References: <1517644697-30806-1-git-send-email-absahu@codeaurora.org> <1517644697-30806-11-git-send-email-absahu@codeaurora.org> From: "Christ, Austin" Message-ID: Date: Tue, 27 Feb 2018 15:07:29 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <1517644697-30806-11-git-send-email-absahu@codeaurora.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Tested on Centriq 2400 Reviewed-by: Austin Christ 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 > --- > 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; > } > -- Qualcomm Datacenter Technologies as an affiliate of Qualcomm Technologies, Inc. Qualcomm Technologies, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project.