From patchwork Thu Jun 14 01:27:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10463175 X-Patchwork-Delegate: geert@linux-m68k.org Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 56885600D0 for ; Thu, 14 Jun 2018 01:27:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 47DEA28C6C for ; Thu, 14 Jun 2018 01:27:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3CB3D28C70; Thu, 14 Jun 2018 01:27:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DE6DF28C6C for ; Thu, 14 Jun 2018 01:27:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S935736AbeFNB1p (ORCPT ); Wed, 13 Jun 2018 21:27:45 -0400 Received: from sauhun.de ([88.99.104.3]:48120 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S935530AbeFNB1p (ORCPT ); Wed, 13 Jun 2018 21:27:45 -0400 Received: from localhost (softbank126012118084.bbtec.net [126.12.118.84]) by pokefinder.org (Postfix) with ESMTPSA id B9178540104; Thu, 14 Jun 2018 03:27:41 +0200 (CEST) From: Wolfram Sang To: linux-i2c@vger.kernel.org, cerg2010cerg2010@mail.ru Cc: linux-renesas-soc@vger.kernel.org, drivers_video-dri@kernel-bugs.osdl.org, Wolfram Sang Subject: [RFT 2/2] i2c: algos: bit: make sure to send STOP Date: Thu, 14 Jun 2018 10:27:14 +0900 Message-Id: <20180614012714.5937-3-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180614012714.5937-1-wsa+renesas@sang-engineering.com> References: <20180614012714.5937-1-wsa+renesas@sang-engineering.com> Sender: linux-renesas-soc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP If SCL was low but SDA high, we would simply raise SCL but not send a STOP. To make sure we always send STOP initially, lower both lines first. Signed-off-by: Wolfram Sang --- drivers/i2c/algos/i2c-algo-bit.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/algos/i2c-algo-bit.c b/drivers/i2c/algos/i2c-algo-bit.c index c76cf51975d0..344649847885 100644 --- a/drivers/i2c/algos/i2c-algo-bit.c +++ b/drivers/i2c/algos/i2c-algo-bit.c @@ -650,6 +650,8 @@ static int __i2c_bit_add_bus(struct i2c_adapter *adap, adap->quirks = &i2c_bit_quirk_no_clk_stretch; /* Bring bus to a known state. Looks like STOP if bus is not free yet */ + scllo(bit_adap); + sdalo(bit_adap); sclhi(bit_adap); sdahi(bit_adap);