Linux I2C development
 help / color / mirror / Atom feed
From: "Markus Stockhausen" <markus.stockhausen@gmx.de>
To: <andi.shyti@kernel.org>, <wsa+renesas@sang-engineering.com>
Cc: <linux-i2c@vger.kernel.org>, <linux-gpio@vger.kernel.org>,
	"'Linus Walleij'" <linusw@kernel.org>,
	"'Bartosz Golaszewski'" <brgl@kernel.org>
Subject: AW: [PATCH v3] i2c: i2c-gpio: Enhance driver for buses with shared SCL
Date: Tue, 16 Jun 2026 20:52:59 +0200	[thread overview]
Message-ID: <008e01dcfdc1$5a9a7660$0fcf6320$@gmx.de> (raw)
In-Reply-To: <CAD++jL=d9e5HiR=JtwNjiDy-ihq-kzPo+1JtxH4Mwm+LZ6CG5A@mail.gmail.com>

> Von: Linus Walleij <linusw@kernel.org> 
> Gesendet: Mittwoch, 27. Mai 2026 12:25
> An: Bartosz Golaszewski <brgl@kernel.org>
>  Betreff: Re: [PATCH v3] i2c: i2c-gpio: Enhance driver for buses with shared SCL
>
> On Thu, May 21, 2026 at 10:59 AM Bartosz Golaszewski <brgl@kernel.org> wrote:
>
> > >  /*
> > >   * Toggle SDA by changing the output value of the pin. This is only
> > >   * valid for pins configured as open drain (i.e. setting the value
> > > @@ -53,7 +72,7 @@ static void i2c_gpio_setscl_val(void *data, int state)
> > >  {
> > >         struct i2c_gpio_private_data *priv = data;
> > >
> > > -       gpiod_set_value_cansleep(priv->scl, state);
> > > +       gpiod_set_value_cansleep(priv->scl->gpio, state);
> >
> > That one bothers me a bit. We're driving a clock line but may end up
> > sleeping? That doesn't sound right. We typically do:
> >
> > setscl();
> > udelay();
> >
> > I know it's been like this before and maybe I'm not understanding the
> > whole picture so feel free to disregard the comment.
>
> I think there are people driving I2C on slow buses, i.e. a bit-banged
> GPIO I2C on a GPIO expander which is itself on I2C.
>
> I'm not saying such hardware design is a good idea, but I think
> I've seen it...
>
> The only way to make that work is to use gpiod_set_value_cansleep().

Gentle ping.

Thanks.

Markus


      reply	other threads:[~2026-06-16 18:53 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-20 17:31 [PATCH v3] i2c: i2c-gpio: Enhance driver for buses with shared SCL Markus Stockhausen
2026-05-20 18:44 ` Sander Vanheule
2026-05-21  8:59 ` Bartosz Golaszewski
2026-05-25 16:08   ` AW: " Markus Stockhausen
2026-05-27 10:24   ` Linus Walleij
2026-06-16 18:52     ` Markus Stockhausen [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='008e01dcfdc1$5a9a7660$0fcf6320$@gmx.de' \
    --to=markus.stockhausen@gmx.de \
    --cc=andi.shyti@kernel.org \
    --cc=brgl@kernel.org \
    --cc=linusw@kernel.org \
    --cc=linux-gpio@vger.kernel.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=wsa+renesas@sang-engineering.com \
    /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