Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1228969imm; Fri, 13 Jul 2018 14:10:45 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfCodosMv0n/kg0Yld00uzX3Znzc18Ss1ipsR06LUD1G+u/tgtB/JbSRM+wWVDpGMQxNnAN X-Received: by 2002:a63:710d:: with SMTP id m13-v6mr7515487pgc.66.1531516245188; Fri, 13 Jul 2018 14:10:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531516245; cv=none; d=google.com; s=arc-20160816; b=DZAgmS4sQFmYIZ7AVOg75lPVv3eJwmRNZzPNgyYIZpRLRZmT7Jz3w+Z0X47bVdrKYF SqyzMkYdRv9jlxR0dDZkSocokL2rWbntFubyVnBUuMx0NUPFJ192LKA5nN15pnSRsq8E xrplu5EPu9/2AALQ8q203teCssvMO/7pf519aQLU+SY3J9U9gzYyX9s5OlSGs0848QY9 V0BM5vJnQ3DzF9kpXTYVChNlKSGImaUo3X2C+FeTtArQ8IW2v29trlzR5jzR0D1xI4YH Rb41XH2UNhO6jreeURrXW42UTtw1Qm+uQrlNmf2RKOldljXJfhmJLtslUZMf4V27vpPk 3T7Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=nb6ZgNrqLyWOj3LWn44BPebtfpa8954hF1LzAqy3hiM=; b=Imf2qX0x4KxpfmNK7IkVuZDqRg8rqT1H3e4GnY1ryxoZ9pn+wbgU8wAKjfZEDipnvT n3wf7UVpyjO7R0jU/SUgodANxXj1Bd5zGaCD7E6z8Ok9V0KJbRTC4Ddm89an9vOtZ78A 7iE2E1JkdMSJN37eGXnjonx0JwPxxb/OCNjbh2KoQrZsvBRe533H0ZubzixbNa2VnuAs miA2aHnpECZxga3eM7e6csivtdR6IHi5Ji+Uo/rIfNZqVMbEyeKJuZLLKEpwI36jlPji pmqRpPDl0RIXGJpaZ2W6OFjtiVKMQohnuD4OmkQGnpPjquLhUs0rEmo4jJUTNCZzf5gf Ynjw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=xnHEJ4kr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d31-v6si24776977pld.23.2018.07.13.14.10.30; Fri, 13 Jul 2018 14:10:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail (test mode) header.i=@sang-engineering.com header.s=k1 header.b=xnHEJ4kr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387748AbeGMV0L (ORCPT + 99 others); Fri, 13 Jul 2018 17:26:11 -0400 Received: from www.zeus03.de ([194.117.254.33]:48540 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732663AbeGMV0I (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-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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; } -- 2.11.0