Re: [PATCH/RFT 1/6] i2c: designware: use open drain for recovery GPIO

From: Wolfram Sang
Date: Tue Jul 17 2018 - 05:09:24 EST


Hi Phil,

> > - 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)
> >
>
> 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.

So, it is not possible to read SCL status then? Hmm, currently a working
get_scl is required...

> 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?

Well, I don't know much about this IP core and how/where it is used. I
just wonder what happens if another user comes along using an
open-drain GPIO. Is that possible?

I assume it is the same with SDA? Non open-drain? Output only?

Regards,

Wolfram

Attachment: signature.asc
Description: PGP signature