linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ulrich Hecht <ulrich.hecht@gmail.com>
To: Wolfram Sang <wsa+renesas@sang-engineering.com>
Cc: Linux I2C <linux-i2c@vger.kernel.org>,
	Linux-Renesas <linux-renesas-soc@vger.kernel.org>,
	kernel@pengutronix.de, Wolfram Sang <wsa@the-dreams.de>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH/RFT 6/6] i2c: recovery: remove bogus check if SDA GPIO is set to output
Date: Mon, 16 Jul 2018 11:29:29 +0200	[thread overview]
Message-ID: <CAO3366ySBBKpz1fpZ8orLTVF-tU+Gw3A7CiqaJWtmyGiU6kdYA@mail.gmail.com> (raw)
In-Reply-To: <20180713210920.3648-7-wsa+renesas@sang-engineering.com>

On Fri, Jul 13, 2018 at 11:09 PM, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> 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 <wsa+renesas@sang-engineering.com>
> ---
>  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
>

Reviewed-by: Ulrich Hecht <ulrich.hecht+renesas@gmail.com>

CU
Uli

      reply	other threads:[~2018-07-16  9:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-07-13 21:09 [PATCH/RFT 0/6] i2c: recovery: fix GPIO usage for recovery Wolfram Sang
2018-07-13 21:09 ` [PATCH/RFT 1/6] i2c: designware: use open drain for recovery GPIO Wolfram Sang
2018-07-16  0:47   ` Phil Reid
2018-07-17  9:09     ` Wolfram Sang
2018-07-17  9:27       ` Phil Reid
2018-07-24  7:26         ` Wolfram Sang
2018-07-25  3:26           ` Phil Reid
2018-07-13 21:09 ` [PATCH/RFT 2/6] i2c: imx: " Wolfram Sang
2018-07-23 12:47   ` Lucas Stach
2018-07-24  7:28     ` Wolfram Sang
2018-07-24 13:01   ` Wolfram Sang
2018-07-13 21:09 ` [PATCH/RFT 3/6] i2c: designware: set SDA as output for recovery Wolfram Sang
2018-07-13 21:09 ` [PATCH/RFT 4/6] i2c: davinci: " Wolfram Sang
2018-07-13 21:09 ` [PATCH/RFT 5/6] i2c: imx: " Wolfram Sang
2018-07-13 21:09 ` [PATCH/RFT 6/6] i2c: recovery: remove bogus check if SDA GPIO is set to output Wolfram Sang
2018-07-16  9:29   ` Ulrich Hecht [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAO3366ySBBKpz1fpZ8orLTVF-tU+Gw3A7CiqaJWtmyGiU6kdYA@mail.gmail.com \
    --to=ulrich.hecht@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    --cc=wsa@the-dreams.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).