From patchwork Tue Jan 9 13:58:57 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10152101 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 214E3602CA for ; Tue, 9 Jan 2018 13:59:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 13A5C289E3 for ; Tue, 9 Jan 2018 13:59:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 08BCC289FB; Tue, 9 Jan 2018 13:59:15 +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=-6.9 required=2.0 tests=BAYES_00,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 AA626289E3 for ; Tue, 9 Jan 2018 13:59:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752963AbeAIN7N (ORCPT ); Tue, 9 Jan 2018 08:59:13 -0500 Received: from sauhun.de ([88.99.104.3]:41837 "EHLO pokefinder.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758437AbeAIN7J (ORCPT ); Tue, 9 Jan 2018 08:59:09 -0500 Received: from localhost (p54B33354.dip0.t-ipconnect.de [84.179.51.84]) by pokefinder.org (Postfix) with ESMTPSA id 798042C5EC1; Tue, 9 Jan 2018 14:59:08 +0100 (CET) From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, Phil Reid , Wolfram Sang Subject: [PATCH v2 4/6] i2c: ensure SDA is released in recovery if SDA is controllable Date: Tue, 9 Jan 2018 14:58:57 +0100 Message-Id: <20180109135859.20771-5-wsa@the-dreams.de> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180109135859.20771-1-wsa@the-dreams.de> References: <20180109135859.20771-1-wsa@the-dreams.de> 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 From: Wolfram Sang If we have a function to control SDA, we should ensure that SDA is not held down by us. So, release the GPIO in this case. Tested-by: Phil Reid Signed-off-by: Wolfram Sang --- drivers/i2c/i2c-core-base.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index a8b3fbe16fa08c..54cef80990a11a 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -169,6 +169,8 @@ int i2c_generic_scl_recovery(struct i2c_adapter *adap) bri->prepare_recovery(adap); bri->set_scl(adap, val); + if (bri->set_sda) + bri->set_sda(adap, 1); ndelay(RECOVERY_NDELAY); /*