From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH/RFC 2/3] ethernet: add a PHY reset GPIO DT binding to sh_eth
Date: Sat, 26 Jan 2013 01:04:13 +0000 [thread overview]
Message-ID: <3496361.USCGuib0gY@avalon> (raw)
In-Reply-To: <Pine.LNX.4.64.1301251127460.17518@axis700.grange>
Hi Guennadi,
On Friday 25 January 2013 11:34:55 Guennadi Liakhovetski wrote:
> On Fri, 25 Jan 2013, Laurent Pinchart wrote:
> > On Thursday 24 January 2013 17:07:32 Guennadi Liakhovetski wrote:
> > > If an ethernet PHY can be reset by a GPIO, it can be specified in DT.
> > > Add a binding and code to parse it, request the GPIO and take the PHY
> > > out of reset.
> > >
> > > Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
> > > Cc: devicetree-discuss@lists.ozlabs.org
> > > Cc: netdev@vger.kernel.org
> > > ---
> > >
> > > Documentation/devicetree/bindings/net/sh_ether.txt | 2 ++
> > > drivers/net/ethernet/renesas/sh_eth.c | 9 ++++++++-
> > > 2 files changed, 10 insertions(+), 1 deletions(-)
[snip]
> > > diff --git a/drivers/net/ethernet/renesas/sh_eth.c
> > > b/drivers/net/ethernet/renesas/sh_eth.c index 1f64848..06035a2 100644
> > > --- a/drivers/net/ethernet/renesas/sh_eth.c
> > > +++ b/drivers/net/ethernet/renesas/sh_eth.c
[snip]
> > > @@ -2420,6 +2423,10 @@ sh_eth_parse_dt(struct device *dev, struct
> > > net_device *ndev) else
> > >
> > > pdata->needs_init = 0;
> > >
> > > + gpio = of_get_named_gpio_flags(np, "phy-reset-gpios", 0, &flags);
> > > + if (gpio_is_valid(gpio) && !devm_gpio_request(dev, gpio, NULL))
> > > + gpio_direction_output(gpio, !!(flags & OF_GPIO_ACTIVE_LOW));
> >
> > You could use devm_gpio_request_one() here.
>
> Yes, but then the flag would look uglier, something like
>
> devm_gpio_request_one(dev, gpio, flags &
> OF_GPIO_ACTIVE_LOW ? GPIOF_OUT_INIT_HIGH :
> GPIOF_OUT_INIT_LOW);
>
> Does it really look like an improvement? :)
It's one less function call, so to me it does :-) Feel free to ignore that
though.
--
Regards,
Laurent Pinchart
next prev parent reply other threads:[~2013-01-26 1:04 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-01-24 16:07 [PATCH 0/3] ARM: shmobile: sh-eth pins in DT for armadillo800eva Guennadi Liakhovetski
2013-01-24 16:07 ` [PATCH 1/3] pinctrl: add ethernet pin groups to r8a7740 Guennadi Liakhovetski
2013-01-25 10:15 ` Laurent Pinchart
2013-01-24 16:07 ` [PATCH/RFC 2/3] ethernet: add a PHY reset GPIO DT binding to sh_eth Guennadi Liakhovetski
2013-01-25 10:21 ` Laurent Pinchart
2013-01-25 10:34 ` Guennadi Liakhovetski
2013-01-25 18:21 ` Jason Gunthorpe
2013-07-08 10:49 ` Guennadi Liakhovetski
2013-01-26 1:04 ` Laurent Pinchart [this message]
2013-01-24 16:07 ` [PATCH 3/3] ARM: shmobile: move pin configuration on armadillo800eva-reference to DT Guennadi Liakhovetski
2013-01-25 4:37 ` [PATCH 0/3] ARM: shmobile: sh-eth pins in DT for armadillo800eva Simon Horman
2013-01-25 8:09 ` Guennadi Liakhovetski
2013-01-25 9:05 ` Simon Horman
2013-01-25 9:57 ` Laurent Pinchart
2013-01-28 1:02 ` Simon Horman
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=3496361.USCGuib0gY@avalon \
--to=laurent.pinchart@ideasonboard.com \
--cc=linux-arm-kernel@lists.infradead.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 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).