Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1802489imm; Sun, 15 Jul 2018 17:48:39 -0700 (PDT) X-Google-Smtp-Source: AAOMgpfhR3pmGNR+2olwZtlgS84f2LegOJxazpZTZMQFLKTXG75vSBqU8yP6XztL19dE/ObwhyHA X-Received: by 2002:a62:8b87:: with SMTP id e7-v6mr16031997pfl.133.1531702119636; Sun, 15 Jul 2018 17:48:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531702119; cv=none; d=google.com; s=arc-20160816; b=ZpfJ7RDnCv6Nv/c/tyWf/QWIWuRd2hZzwyoC/7c2UDK1z8g1QS7QtfatUw914sPLBt TT+4itPKHgC0rKaI+jdMRV/ROnlJHfPAOmk78a5vKutMAsFV6VrteKXosZ8/0XAweYsW VJkIWYfkpFFMS5LG1BR0kB5TSbCf/Oat2ItBZlr/t9P23Uz6jHfxFnLt5xMkhde6eBp1 TRsQeIMSe7WLdOHokJbMqtK/sxhv+mKsHE5BuuFy/BvrLZ62udf67ezj4V/jLis/oBDT VqEuf2sKb50viMbGXjDkpynPKs87Q1I17+gO7sUPqBxQBfSpk/7V0Env+epwO8TjJ5PA rGOA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=XIyIELJ1sOcFHM4QTuZZLkK0afpM8VYAxrxmUBoxLSI=; b=kUSzauT/x/2mSt8Hfcwq96Nz+FQCfkJGJTArh5XjrLAcE3ATFV3vU52vQBeTJVo7XI V04SC6wmB1s0yIVZJDfsXNUacb6fDPCfIVSGVC/jVllz3XIWdHDE87P63U/HBDKfRNpR 37CII35oQApAvATuvF3g6NuTI7gAplvJAj4PYkND8URQYdmmmG/RU16cjwSPWMdSv+9c jtvdy9+aWDPfxoYdYJ6EGsRaxfbHOHxLu6vLmWESXvjygJgXoOe+FPrT70cqCdM1X/5X ODIxx3tqPQOAWTO5Gz1SGT/YhlKyprzShoDpksZuwVIdxzaGM9MhHzr6V/1NUF8PxHBp Sepw== ARC-Authentication-Results: i=1; mx.google.com; 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 u134-v6si31386673pfc.244.2018.07.15.17.48.25; Sun, 15 Jul 2018 17:48:39 -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; 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 S1727354AbeGPBMh (ORCPT + 99 others); Sun, 15 Jul 2018 21:12:37 -0400 Received: from anchovy3.45ru.net.au ([203.30.46.155]:46946 "EHLO anchovy3.45ru.net.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727125AbeGPBMh (ORCPT ); Sun, 15 Jul 2018 21:12:37 -0400 Received: (qmail 25178 invoked by uid 5089); 16 Jul 2018 00:47:46 -0000 Received: by simscan 1.2.0 ppid: 25093, pid: 25094, t: 0.0544s scanners: regex: 1.2.0 attach: 1.2.0 clamav: 0.88.3/m:40/d:1950 Received: from unknown (HELO ?192.168.0.2?) (preid@electromag.com.au@58.7.184.227) by anchovy2.45ru.net.au with ESMTPA; 16 Jul 2018 00:47:45 -0000 Subject: Re: [PATCH/RFT 1/6] i2c: designware: use open drain for recovery GPIO To: Wolfram Sang , linux-i2c@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, kernel@pengutronix.de, Jarkko Nikula , Andy Shevchenko , Mika Westerberg , linux-kernel@vger.kernel.org References: <20180713210920.3648-1-wsa+renesas@sang-engineering.com> <20180713210920.3648-2-wsa+renesas@sang-engineering.com> From: Phil Reid Message-ID: Date: Mon, 16 Jul 2018 08:47:37 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <20180713210920.3648-2-wsa+renesas@sang-engineering.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-AU Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 14/07/2018 05:09, Wolfram Sang wrote: > 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) > G'day Wolfram, This was intentional. The gpio we use to drive the i2c line is implemented in an FPGA and signals a buffer attached to the GPIO to drive scl OPEN drain. The GPIO is output only. The gpio setup can still specify the the GPIO be allocated OPEN drain if someone wishes to use a "smarter" gpio. So while the scl is open drain, there may be hardware in between that isn't. What would the correct way be to deal with that now? -- Regards Phil