From patchwork Mon Jul 27 11:55:58 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sifan Naeem X-Patchwork-Id: 500375 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id E0E5D140320 for ; Mon, 27 Jul 2015 21:53:47 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752113AbbG0Lxr (ORCPT ); Mon, 27 Jul 2015 07:53:47 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:3399 "EHLO mailapp01.imgtec.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752063AbbG0Lxq (ORCPT ); Mon, 27 Jul 2015 07:53:46 -0400 Received: from KLMAIL01.kl.imgtec.org (unknown [192.168.5.35]) by Websense Email Security Gateway with ESMTPS id A8C8DB4BCD808; Mon, 27 Jul 2015 12:53:42 +0100 (IST) Received: from hhmail02.hh.imgtec.org (10.100.10.20) by KLMAIL01.kl.imgtec.org (192.168.5.35) with Microsoft SMTP Server (TLS) id 14.3.195.1; Mon, 27 Jul 2015 12:53:45 +0100 Received: from iw-build-3.kl.imgtec.org (192.168.167.63) by hhmail02.hh.imgtec.org (10.100.10.20) with Microsoft SMTP Server (TLS) id 14.3.235.1; Mon, 27 Jul 2015 12:53:44 +0100 From: Sifan Naeem To: Wolfram Sang , James Hogan , CC: Sifan Naeem Subject: [PATCH 3/7] i2c: img-scb: mark transaction as complete when all data is read Date: Mon, 27 Jul 2015 12:55:58 +0100 Message-ID: <1437998162-32724-4-git-send-email-sifan.naeem@imgtec.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1437998162-32724-1-git-send-email-sifan.naeem@imgtec.com> References: <1437998162-32724-1-git-send-email-sifan.naeem@imgtec.com> MIME-Version: 1.0 X-Originating-IP: [192.168.167.63] Sender: linux-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org We can mark the transfer as complete without waiting for the stop bit. This is important when handling repeated start transfers as we have to start the next transfer without the stop bit being issued. Signed-off-by: Sifan Naeem --- drivers/i2c/busses/i2c-img-scb.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/drivers/i2c/busses/i2c-img-scb.c b/drivers/i2c/busses/i2c-img-scb.c index 24b09fe..e27c3e0 100644 --- a/drivers/i2c/busses/i2c-img-scb.c +++ b/drivers/i2c/busses/i2c-img-scb.c @@ -903,8 +903,11 @@ static unsigned int img_i2c_auto(struct img_i2c *i2c, if (i2c->msg.flags & I2C_M_RD) { if (int_status & INT_FIFO_FULL_FILLING) { img_i2c_read_fifo(i2c); - if (i2c->msg.len == 0) - return ISR_WAITSTOP; + if (i2c->msg.len == 0) { + if (i2c->last_msg) + return ISR_WAITSTOP; + return ISR_COMPLETE(0); + } } } else { if (int_status & INT_FIFO_EMPTY_EMPTYING) {