linux-gpio.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: GPIO consumer interface and DT
       [not found] <20180815221102.GA4375@arek-VirtualBox>
@ 2018-08-16  6:39 ` Linus Walleij
  2018-08-16 19:07   ` Arkadiusz Lis
  0 siblings, 1 reply; 3+ messages in thread
From: Linus Walleij @ 2018-08-16  6:39 UTC (permalink / raw)
  To: areklis909; +Cc: open list:GPIO SUBSYSTEM, Kernelnewbies

On Thu, Aug 16, 2018 at 12:11 AM Arkadiusz Lis <areklis909@gmail.com> wrote:

> What I learned
> from Documentation/driver-api/gpio/board.rst is this string should be
> equal to <function> prefix in <function>-gpios node in device tree.
> For example: in file drivers/i2c/busses/i2c-gpio.c author gets gpio
> descriptor with con_ids 'sda' and 'scl'. They are described in
> Documentation/devicetree/bindings/i2c/i2c-gpio.txt as required
> properties.

You got it right.

> In my case I didn't find bindings for emxx_udc driver and I don't know
> what string should I insert:
> gpiod = devm_gpiod_get(udc->dev, "DT_GPIOS_NAME", GPIOD_IN); //
> "DT_GPIOS_NAME" is a placeholder

This driver is not yet converted to use device tree so there is
no way you can know this property name before bindings are
established.

You or someone else first need to define device tree bindings
in Documention/devicetree/bindings/usb/* somwhere, then augment
the driver to use these bindings, including the right name for
the GPIO line, when using the devm_gpiod_get().

Pretty certainly the chosen GPIO name will be "vbus-gpios" in this
case so you will pass "vbus" as name. But that needs to first
be discussed by the DT bindings mailing list.

I wonder how you're testing this though.

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GPIO consumer interface and DT
  2018-08-16  6:39 ` GPIO consumer interface and DT Linus Walleij
@ 2018-08-16 19:07   ` Arkadiusz Lis
  2018-08-20  7:30     ` Linus Walleij
  0 siblings, 1 reply; 3+ messages in thread
From: Arkadiusz Lis @ 2018-08-16 19:07 UTC (permalink / raw)
  To: Linus Walleij, Kernelnewbies, linux-gpio

> You or someone else first need to define device tree bindings
> in Documention/devicetree/bindings/usb/* somwhere, then augment
> the driver to use these bindings, including the right name for
> the GPIO line, when using the devm_gpiod_get().

OK, I will try to start a discussion about this.

> I wonder how you're testing this though.

I don't have this equipment to be honest. 
Once work is done I count on kindness of interested people who actually
have it and are able to test the patch on the target.
Is there any other way?

Thanks,
Arek

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: GPIO consumer interface and DT
  2018-08-16 19:07   ` Arkadiusz Lis
@ 2018-08-20  7:30     ` Linus Walleij
  0 siblings, 0 replies; 3+ messages in thread
From: Linus Walleij @ 2018-08-20  7:30 UTC (permalink / raw)
  To: Arek Lis; +Cc: open list:GPIO SUBSYSTEM, Kernelnewbies

On Thu, Aug 16, 2018 at 9:08 PM Arkadiusz Lis <areklis909@gmail.com> wrote:
> [Me]
> > I wonder how you're testing this though.
>
> I don't have this equipment to be honest.
> Once work is done I count on kindness of interested people who actually
> have it and are able to test the patch on the target.
> Is there any other way?

The other way is to have the equipment.

But your efforts are appreciated either way, just needs proper testing
and that can be hard to get right remotely. (A lot of mailing back
and forth.)

Yours,
Linus Walleij

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-20  7:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20180815221102.GA4375@arek-VirtualBox>
2018-08-16  6:39 ` GPIO consumer interface and DT Linus Walleij
2018-08-16 19:07   ` Arkadiusz Lis
2018-08-20  7:30     ` Linus Walleij

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