From: Alexandre Courbot <gnurou@gmail.com>
To: Robert Jarzmik <robert.jarzmik@free.fr>
Cc: Linus Walleij <linus.walleij@linaro.org>,
Felipe Balbi <balbi@ti.com>,
"linux-usb@vger.kernel.org" <linux-usb@vger.kernel.org>,
"linux-gpio@vger.kernel.org" <linux-gpio@vger.kernel.org>
Subject: Re: [PATCH v1] usb: phy: generic: migrate to gpio_desc
Date: Mon, 1 Dec 2014 13:01:32 +0900 [thread overview]
Message-ID: <CAAVeFuKHFTuMYS4G468YoCZ-JgaT3zV8ObZ6AHcg06H0yVBgig@mail.gmail.com> (raw)
In-Reply-To: <87bnno1lbj.fsf@free.fr>
On Mon, Dec 1, 2014 at 5:32 AM, Robert Jarzmik <robert.jarzmik@free.fr> wrote:
> Linus Walleij <linus.walleij@linaro.org> writes:
>
>> This definately make things better so:
>> Acked-by: Linus Walleij <linus.walleij@linaro.org>
> Thanks.
>
>> One comment though:
>>
>>>> if (dev->of_node) {
>> (...)
>>>> + nop->gpiod_reset = devm_gpiod_get(dev, "reset-gpios");
>>>> + err = PTR_ERR(nop->gpiod_reset);
>>>> } else if (pdata) {
>> (...)
>>>> + err = devm_gpio_request_one(dev, pdata->gpio_reset, 0,
>>>> + dev_name(dev));
>>>> + if (!err)
>>>> + nop->gpiod_reset = gpio_to_desc(pdata->gpio_reset);
>>>> + }
>
>> So a next step would be to add support for getting the
>> devm_gpiod_get(dev, "reset-gpios"); outside of the if (dev->of_node)
>> clause, and possibly convert the board files for affected
>> platforms to use descriptors, if they will not be replaced by
>> device tree only.
>
> OK, if we were to do this, is there a way to build a static platform data with a
> gpio descriptor ?
> Ie. can I write something like :
> struct generic_phy_pdata {
> struct gpio_desc *reset_gpio;
> };
>
> And in machine code :
> static struct generic_phy_pdata usb_phy __initdata {
> .reset_gpio = XXX(19),
> };
>
> What should "XXX" be like to describe reset_gpio as a ACTIVE_HIGH gpio number 19
> ?
I think what you want to do is explained in the "Platform Data"
section of Documentation/gpio/board.txt
next prev parent reply other threads:[~2014-12-01 4:01 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1415535787-21868-1-git-send-email-robert.jarzmik@free.fr>
[not found] ` <20141121154358.GF7508@saruman>
2014-11-28 10:37 ` [PATCH v1] usb: phy: generic: migrate to gpio_desc Linus Walleij
[not found] ` <CACRpkdZtwYb77ytGiadFnZAUOkr8y_HPQoM3vmXBc+N6dszAJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-30 20:32 ` Robert Jarzmik
2014-12-01 4:01 ` Alexandre Courbot [this message]
2014-12-03 22:54 ` Robert Jarzmik
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=CAAVeFuKHFTuMYS4G468YoCZ-JgaT3zV8ObZ6AHcg06H0yVBgig@mail.gmail.com \
--to=gnurou@gmail.com \
--cc=balbi@ti.com \
--cc=linus.walleij@linaro.org \
--cc=linux-gpio@vger.kernel.org \
--cc=linux-usb@vger.kernel.org \
--cc=robert.jarzmik@free.fr \
/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).