From patchwork Fri Jul 13 21:09:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 10524173 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 B2516602B3 for ; Fri, 13 Jul 2018 21:09:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A299829E13 for ; Fri, 13 Jul 2018 21:09:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 96A5329E1F; Fri, 13 Jul 2018 21:09:52 +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.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI, T_DKIM_INVALID 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 4422A29E13 for ; Fri, 13 Jul 2018 21:09:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731622AbeGMV0K (ORCPT ); Fri, 13 Jul 2018 17:26:10 -0400 Received: from www.zeus03.de ([194.117.254.33]:48538 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732623AbeGMV0I (ORCPT ); Fri, 13 Jul 2018 17:26:08 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=sang-engineering.com; h= from:to:cc:subject:date:message-id:in-reply-to:references; s=k1; bh=fvo4uODzq779gZ7ZCxpFXKFmEiv8vkRlzDD0wa85F8U=; b=xnHEJ4krhasA /CIteL8yaQz6E5QMBOEevv96v4YO8WtyTaXllIP5tvFmjBuw6L4pAYC28U9Jp87M 0KUqvVisoMBlxJqBGj0YcfuXlLchtC4B0jUh5TMhuZ/ut8k/EYzZ20nyXlIuRhIz yaBqcQ5RU7aRK/vi8fR3x20IXFxPP8o= Received: (qmail 3567 invoked from network); 13 Jul 2018 23:09:46 +0200 Received: by mail.zeus03.de with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted, authenticated); 13 Jul 2018 23:09:46 +0200 X-UD-Smtp-Session: l3s3148p1@1H085udwgOUgAwDPW8bBAAId4P/+oMhl From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , Wolfram Sang , linux-kernel@vger.kernel.org Subject: [PATCH/RFT 6/6] i2c: recovery: remove bogus check if SDA GPIO is set to output Date: Fri, 13 Jul 2018 23:09:18 +0200 Message-Id: <20180713210920.3648-7-wsa+renesas@sang-engineering.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180713210920.3648-1-wsa+renesas@sang-engineering.com> References: <20180713210920.3648-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 This check did not work as intended. I2C is open drain, so this function will likely always have presented the GPIO as input because gpiod_get_direction doesn't know about open drain states. Remove this check for now. We can add it again once we know how to get more precise information about the GPIO. Signed-off-by: Wolfram Sang Reviewed-by: Ulrich Hecht --- drivers/i2c/i2c-core-base.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/i2c/i2c-core-base.c b/drivers/i2c/i2c-core-base.c index 301285c54603..7c5f012f561c 100644 --- a/drivers/i2c/i2c-core-base.c +++ b/drivers/i2c/i2c-core-base.c @@ -261,9 +261,7 @@ static void i2c_init_recovery(struct i2c_adapter *adap) bri->set_scl = set_scl_gpio_value; if (bri->sda_gpiod) { bri->get_sda = get_sda_gpio_value; - /* FIXME: add proper flag instead of '0' once available */ - if (gpiod_get_direction(bri->sda_gpiod) == 0) - bri->set_sda = set_sda_gpio_value; + bri->set_sda = set_sda_gpio_value; } return; }