[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2304961.J6VD8c1oK4@avalon>
Date: Wed, 24 Jul 2013 00:10:54 +0200
From: Laurent Pinchart <laurent.pinchart@...asonboard.com>
To: Guennadi Liakhovetski <g.liakhovetski@....de>
Cc: linux-sh@...r.kernel.org, Magnus Damm <magnus.damm@...il.com>,
Simon Horman <horms@...ge.net.au>,
Steve Glendinning <steve.glendinning@...well.net>,
netdev@...r.kernel.org,
Guennadi Liakhovetski <g.liakhovetski+renesas@...il.com>,
devicetree@...r.kernel.org
Subject: Re: [PATCH 2/4] net: smsc911x: add a reset GPIO DT binding
Hi Guennadi,
Thanks for the patch.
On Tuesday 23 July 2013 18:12:02 Guennadi Liakhovetski wrote:
> Add a new DT property to specify a reset GPIO.
>
> Signed-off-by: Guennadi Liakhovetski <g.liakhovetski+renesas@...il.com>
> Cc: devicetree@...r.kernel.org
> ---
> Documentation/devicetree/bindings/net/smsc911x.txt | 1 +
> drivers/net/ethernet/smsc/smsc911x.c | 11 +++++++++++
> 2 files changed, 12 insertions(+), 0 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/net/smsc911x.txt
> b/Documentation/devicetree/bindings/net/smsc911x.txt index adb5b57..2bf32be
> 100644
> --- a/Documentation/devicetree/bindings/net/smsc911x.txt
> +++ b/Documentation/devicetree/bindings/net/smsc911x.txt
> @@ -23,6 +23,7 @@ Optional properties:
> external PHY
> - smsc,save-mac-address : Indicates that mac address needs to be saved
> before resetting the controller
> +- smsc,reset-gpios : a GPIO binding to take the controller out of reset
Albeit defined in the smsc911x bindings, this property doesn't seem very
device-specific. I wonder whether it would make sense to drop the "smsc,"
prefix.
> - local-mac-address : 6 bytes, mac address
>
> Examples:
> diff --git a/drivers/net/ethernet/smsc/smsc911x.c
> b/drivers/net/ethernet/smsc/smsc911x.c index ca01c03..db6255e 100644
> --- a/drivers/net/ethernet/smsc/smsc911x.c
> +++ b/drivers/net/ethernet/smsc/smsc911x.c
> @@ -2328,6 +2328,8 @@ static int smsc911x_probe_config_dt(struct
> smsc911x_platform_config *config, {
> const char *mac;
> u32 width = 0;
> + enum of_gpio_flags flags;
> + int gpio;
>
> if (!np)
> return -ENODEV;
> @@ -2361,6 +2363,15 @@ static int smsc911x_probe_config_dt(struct
> smsc911x_platform_config *config, if (of_get_property(np,
> "smsc,save-mac-address", NULL))
> config->flags |= SMSC911X_SAVE_MAC_ADDRESS;
>
> + gpio = of_get_named_gpio_flags(np, "smsc,reset-gpios", 0, &flags);
> + if (gpio == -EPROBE_DEFER)
> + return gpio;
> + if (gpio_is_valid(gpio)) {
> + config->reset_gpio = gpio;
> + config->reset_gpio_config = SMSC911X_RESET_GPIO_VALID |
> + (flags & OF_GPIO_ACTIVE_LOW ? GPIOF_INIT_LOW : GPIOF_INIT_HIGH);
> + }
> +
> return 0;
> }
> #else
--
Regards,
Laurent Pinchart
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists