From patchwork Fri Jul 13 21:09:13 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 943819 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="Sdjk2/9p"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41S56R0Q6yz9s29 for ; Sat, 14 Jul 2018 07:09:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731956AbeGMV0E (ORCPT ); Fri, 13 Jul 2018 17:26:04 -0400 Received: from www.zeus03.de ([194.117.254.33]:48428 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731960AbeGMV0D (ORCPT ); Fri, 13 Jul 2018 17:26:03 -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=ULm2Bo/WMxPVBZgzWE5gkC4xnOYTVZj8SgrPVWn9sy0=; b=Sdjk2/9pzZ+3 hc7KGchkgL7ASY/+UidBjOZNqm843yGSUylsiuw83SBWP7+IPgBGPI28j/QF/zOK J8svp2CGnG/DIOJa7LYJsWRXb1kEVhUPEr3Uod/eIv/ThPuknRv6Wd6hGY5zDNlk RwFwGAKDH8VVSVBaU2uu2lN2TaqH31I= Received: (qmail 3404 invoked from network); 13 Jul 2018 23:09:42 +0200 Received: by mail.zeus03.de with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted, authenticated); 13 Jul 2018 23:09:42 +0200 X-UD-Smtp-Session: l3s3148p1@NHUL5udwduUgAwDPW8bBAAId4P/+oMhl From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , linux-kernel@vger.kernel.org Subject: [PATCH/RFT 1/6] i2c: designware: use open drain for recovery GPIO Date: Fri, 13 Jul 2018 23:09:13 +0200 Message-Id: <20180713210920.3648-2-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-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org I2C is open drain, so set up the GPIO accordingly. Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-designware-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index fc7c255c80af..a546db80f53e 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -665,7 +665,7 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev) struct gpio_desc *gpio; int r; - gpio = devm_gpiod_get(dev->dev, "scl", GPIOD_OUT_HIGH); + gpio = devm_gpiod_get(dev->dev, "scl", GPIOD_OUT_HIGH_OPEN_DRAIN); if (IS_ERR(gpio)) { r = PTR_ERR(gpio); if (r == -ENOENT || r == -ENOSYS) From patchwork Fri Jul 13 21:09: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: 943825 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="gyfvm8iA"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41S56v6mBTz9s2M for ; Sat, 14 Jul 2018 07:10:15 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732723AbeGMV0F (ORCPT ); Fri, 13 Jul 2018 17:26:05 -0400 Received: from www.zeus03.de ([194.117.254.33]:48448 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731963AbeGMV0F (ORCPT ); Fri, 13 Jul 2018 17:26:05 -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=p1ZF9VNFJLVbCq+MBmvJ6DQuyO6uD3S4rY0Ozqw9Md0=; b=gyfvm8iASmOd wwUCvCXnnff+xOJUvgfPPmXl/bEZbqtX8o23QXibU3mH6B1hlXM5VUqUZRW3NgvW x4pEShhs78MxNiJDx6ridf30yVNtg5TGraMf0kn6eIMoFCllTnYzz+fLseTGrv8M OXA0pFJfp5B0nA9dnhPn27T30qYuySE= Received: (qmail 3433 invoked from network); 13 Jul 2018 23:09:43 +0200 Received: by mail.zeus03.de with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted, authenticated); 13 Jul 2018 23:09:43 +0200 X-UD-Smtp-Session: l3s3148p1@atQU5udweOUgAwDPW8bBAAId4P/+oMhl From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , linux-kernel@vger.kernel.org Subject: [PATCH/RFT 2/6] i2c: imx: use open drain for recovery GPIO Date: Fri, 13 Jul 2018 23:09:14 +0200 Message-Id: <20180713210920.3648-3-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-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org I2C is open drain, so set up the GPIO accordingly. Signed-off-by: Wolfram Sang Reviewed-by: Lucas Stach --- drivers/i2c/busses/i2c-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 0207e194f84b..3e23ee26c55c 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1010,7 +1010,7 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx, i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl, "gpio"); rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN); - rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_OUT_HIGH); + rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_OUT_HIGH_OPEN_DRAIN); if (PTR_ERR(rinfo->sda_gpiod) == -EPROBE_DEFER || PTR_ERR(rinfo->scl_gpiod) == -EPROBE_DEFER) { From patchwork Fri Jul 13 21:09:15 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 943821 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="EKs4jTy4"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41S56R66T5z9s3q for ; Sat, 14 Jul 2018 07:09:51 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733081AbeGMV0G (ORCPT ); Fri, 13 Jul 2018 17:26:06 -0400 Received: from www.zeus03.de ([194.117.254.33]:48466 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732663AbeGMV0G (ORCPT ); Fri, 13 Jul 2018 17:26:06 -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=Pxg0D6gPydncZpakJGoJP7XH88zvwDWI6lnNmfm0LJk=; b=EKs4jTy4wN68 xjThzOQOWbmb8HAlK0sg787sTIFzoN9VNbHVKmjS5pqD3Z7h3pKG3fEuRnEnPEj1 MS8zgxinRkuVAbv/iqwsECl4p3VLEHpRnD89eKjBbTodYqs5Vt+JB8B8XR0VX6RQ Z3AlPOnQKcv3p9+uMhKMyyRSMF5yqBY= Received: (qmail 3472 invoked from network); 13 Jul 2018 23:09:44 +0200 Received: by mail.zeus03.de with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted, authenticated); 13 Jul 2018 23:09:44 +0200 X-UD-Smtp-Session: l3s3148p1@dNoe5udweuUgAwDPW8bBAAId4P/+oMhl From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , Jarkko Nikula , Andy Shevchenko , Mika Westerberg , linux-kernel@vger.kernel.org Subject: [PATCH/RFT 3/6] i2c: designware: set SDA as output for recovery Date: Fri, 13 Jul 2018 23:09:15 +0200 Message-Id: <20180713210920.3648-4-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-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org This allows for sending STOP when generating pulses which is much more robust because it will bring clients into a default state. Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-designware-master.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-designware-master.c b/drivers/i2c/busses/i2c-designware-master.c index a546db80f53e..25981efc844e 100644 --- a/drivers/i2c/busses/i2c-designware-master.c +++ b/drivers/i2c/busses/i2c-designware-master.c @@ -674,7 +674,7 @@ static int i2c_dw_init_recovery_info(struct dw_i2c_dev *dev) } rinfo->scl_gpiod = gpio; - gpio = devm_gpiod_get_optional(dev->dev, "sda", GPIOD_IN); + gpio = devm_gpiod_get_optional(dev->dev, "sda", GPIOD_OUT_HIGH_OPEN_DRAIN); if (IS_ERR(gpio)) return PTR_ERR(gpio); rinfo->sda_gpiod = gpio; From patchwork Fri Jul 13 21:09:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 943824 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="OzaSE55L"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41S56q2cXFz9ryt for ; Sat, 14 Jul 2018 07:10:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731878AbeGMV03 (ORCPT ); Fri, 13 Jul 2018 17:26:29 -0400 Received: from www.zeus03.de ([194.117.254.33]:48486 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732713AbeGMV0G (ORCPT ); Fri, 13 Jul 2018 17:26:06 -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=TyDHIV3F6W2grOqvBRQ47E4KYK9To9LnJv0HUB34Sbw=; b=OzaSE55Lv2UY eV1dDaD26J9BMTZsYt+zwqBBWchf42c6HEpKB/gbDrhM5XEhtczYcRkZbsEmx0bt IvBbh6yZnvYQ/pOee7Gxi83VelBM5Efq5seBlZToCNj3LFm2BcXa15v7T6QUkECW GYCCeqOQojWRIUAVBYuZ6WMPd+O2XIs= Received: (qmail 3509 invoked from network); 13 Jul 2018 23:09:44 +0200 Received: by mail.zeus03.de with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted, authenticated); 13 Jul 2018 23:09:44 +0200 X-UD-Smtp-Session: l3s3148p1@Otoo5udwfOUgAwDPW8bBAAId4P/+oMhl From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , Sekhar Nori , Kevin Hilman , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH/RFT 4/6] i2c: davinci: set SDA as output for recovery Date: Fri, 13 Jul 2018 23:09:16 +0200 Message-Id: <20180713210920.3648-5-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-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org This allows for sending STOP when generating pulses which is much more robust because it will bring clients into a default state. Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-davinci.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-davinci.c b/drivers/i2c/busses/i2c-davinci.c index d945a2654c2f..478acf0870aa 100644 --- a/drivers/i2c/busses/i2c-davinci.c +++ b/drivers/i2c/busses/i2c-davinci.c @@ -874,7 +874,8 @@ static int davinci_i2c_probe(struct platform_device *pdev) r = PTR_ERR(rinfo->scl_gpiod); goto err_unuse_clocks; } - rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN); + rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", + GPIOD_OUT_HIGH_OPEN_DRAIN); if (IS_ERR(rinfo->sda_gpiod)) { r = PTR_ERR(rinfo->sda_gpiod); goto err_unuse_clocks; From patchwork Fri Jul 13 21:09:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Wolfram Sang X-Patchwork-Id: 943823 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="E/PhizbG"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41S56j6vFqz9s2g for ; Sat, 14 Jul 2018 07:10:05 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731871AbeGMV0Y (ORCPT ); Fri, 13 Jul 2018 17:26:24 -0400 Received: from www.zeus03.de ([194.117.254.33]:48508 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731964AbeGMV0H (ORCPT ); Fri, 13 Jul 2018 17:26:07 -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=b6oGDBIBfv/l0HoECb650AG0im9yfc37flMn/wBVbNQ=; b=E/PhizbGDs2C nmJzLFHh6i3bLfBfp4JV+QsTa6UaIHznQLrQvmWj44hCkyZUwmb77InHDZtpaCNo iML/mnWzEYUU7jqN0MaqZ0GJ3Oo/K/n2Vc+riztk5EFYHWOS6eu3IfMmpWxUr56o /LYuBPNL3wxXVZhKsMVFGZDAhlugiP0= Received: (qmail 3547 invoked from network); 13 Jul 2018 23:09:45 +0200 Received: by mail.zeus03.de with ESMTPSA (ECDHE-RSA-AES256-GCM-SHA384 encrypted, authenticated); 13 Jul 2018 23:09:45 +0200 X-UD-Smtp-Session: l3s3148p1@C90y5udwfuUgAwDPW8bBAAId4P/+oMhl From: Wolfram Sang To: linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Wolfram Sang , linux-kernel@vger.kernel.org Subject: [PATCH/RFT 5/6] i2c: imx: set SDA as output for recovery Date: Fri, 13 Jul 2018 23:09:17 +0200 Message-Id: <20180713210920.3648-6-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-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@vger.kernel.org This allows for sending STOP when generating pulses which is much more robust because it will bring clients into a default state. Signed-off-by: Wolfram Sang --- drivers/i2c/busses/i2c-imx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-imx.c b/drivers/i2c/busses/i2c-imx.c index 3e23ee26c55c..a3881e270106 100644 --- a/drivers/i2c/busses/i2c-imx.c +++ b/drivers/i2c/busses/i2c-imx.c @@ -1009,7 +1009,7 @@ static int i2c_imx_init_recovery_info(struct imx_i2c_struct *i2c_imx, PINCTRL_STATE_DEFAULT); i2c_imx->pinctrl_pins_gpio = pinctrl_lookup_state(i2c_imx->pinctrl, "gpio"); - rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_IN); + rinfo->sda_gpiod = devm_gpiod_get(&pdev->dev, "sda", GPIOD_OUT_HIGH_OPEN_DRAIN); rinfo->scl_gpiod = devm_gpiod_get(&pdev->dev, "scl", GPIOD_OUT_HIGH_OPEN_DRAIN); if (PTR_ERR(rinfo->sda_gpiod) == -EPROBE_DEFER || 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: 943822 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-i2c-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=sang-engineering.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=sang-engineering.com header.i=@sang-engineering.com header.b="xnHEJ4kr"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 41S56Y1wXqz9s7h for ; Sat, 14 Jul 2018 07:09:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387745AbeGMV0L (ORCPT ); Fri, 13 Jul 2018 17:26:11 -0400 Received: from www.zeus03.de ([194.117.254.33]:48536 "EHLO mail.zeus03.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732589AbeGMV0I (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-i2c-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-i2c@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 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; }