All of lore.kernel.org
 help / color / mirror / Atom feed
From: Robert Jarzmik <robert.jarzmik-GANU6spQydw@public.gmane.org>
To: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org>
Cc: Felipe Balbi <balbi-l0cyMroinI0@public.gmane.org>,
	"linux-usb@vger.kernel.org"
	<linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Alexandre Courbot
	<gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>,
	"linux-gpio@vger.kernel.org"
	<linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>
Subject: Re: [PATCH v1] usb: phy: generic: migrate to gpio_desc
Date: Sun, 30 Nov 2014 21:32:16 +0100	[thread overview]
Message-ID: <87bnno1lbj.fsf@free.fr> (raw)
In-Reply-To: <CACRpkdZtwYb77ytGiadFnZAUOkr8y_HPQoM3vmXBc+N6dszAJw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> (Linus Walleij's message of "Fri, 28 Nov 2014 11:37:47 +0100")

Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org> writes:

> This definately make things better so:
> Acked-by: Linus Walleij <linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.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
?

Cheers.

-- 
Robert
--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2014-11-30 20:32 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 [this message]
2014-12-01  4:01         ` Alexandre Courbot
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=87bnno1lbj.fsf@free.fr \
    --to=robert.jarzmik-ganu6spqydw@public.gmane.org \
    --cc=balbi-l0cyMroinI0@public.gmane.org \
    --cc=gnurou-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linus.walleij-QSEj5FYQhm4dnm+yROfE0A@public.gmane.org \
    --cc=linux-gpio-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=linux-usb-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.