All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Simon Horman <horms+renesas@verge.net.au>
Cc: netdev@vger.kernel.org, linux-sh@vger.kernel.org,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: [PATCH net-next v3 1/3] sh_eth: add support for gpio reset
Date: Mon, 01 Jul 2013 14:24:34 +0000	[thread overview]
Message-ID: <51D19122.6030409@cogentembedded.com> (raw)
In-Reply-To: <1372652695-16606-2-git-send-email-horms+renesas@verge.net.au>

Hello.

On 01-07-2013 8:24, Simon Horman wrote:

> Allow reset using a GPIO. In order to use this set the following
> in the device's platform data:

> 	needs_gpio_reset = 1
> 	reset_gpio = GPIO pin to use

> This patch is motivated by the lager board which uses the r8a7790 SoC
> which has a GPIO pin to reset its sh_eth device.

> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

> --

> v2
> * First post
> ---
>   drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
>   include/linux/sh_eth.h                | 3 +++
>   2 files changed, 7 insertions(+)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 7732f11..0253f61 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
> @@ -2652,6 +2653,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
>   		ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
>   	}
>
> +	if (pd->needs_gpio_reset)
> +		gpio_request_one(pd->reset_gpio, GPIOF_OUT_INIT_HIGH, NULL);

    Is reset signal active low or active high? Are you asserting or 
releasing it?

> diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
> index fc30571..b3f1550 100644
> --- a/include/linux/sh_eth.h
> +++ b/include/linux/sh_eth.h
> @@ -22,6 +22,9 @@ struct sh_eth_plat_data {
>   	unsigned no_ether_link:1;
>   	unsigned ether_link_active_low:1;
>   	unsigned needs_init:1;
> +	unsigned needs_gpio_reset:1;
> +
> +	unsigned reset_gpio;	/* Used if needs_gpio_reset is true */

    s/true/1/.

WBR, Sergei


WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sergei.shtylyov@cogentembedded.com>
To: Simon Horman <horms+renesas@verge.net.au>
Cc: netdev@vger.kernel.org, linux-sh@vger.kernel.org,
	Magnus Damm <magnus.damm@gmail.com>
Subject: Re: [PATCH net-next v3 1/3] sh_eth: add support for gpio reset
Date: Mon, 01 Jul 2013 18:24:34 +0400	[thread overview]
Message-ID: <51D19122.6030409@cogentembedded.com> (raw)
In-Reply-To: <1372652695-16606-2-git-send-email-horms+renesas@verge.net.au>

Hello.

On 01-07-2013 8:24, Simon Horman wrote:

> Allow reset using a GPIO. In order to use this set the following
> in the device's platform data:

> 	needs_gpio_reset = 1
> 	reset_gpio = GPIO pin to use

> This patch is motivated by the lager board which uses the r8a7790 SoC
> which has a GPIO pin to reset its sh_eth device.

> Signed-off-by: Simon Horman <horms+renesas@verge.net.au>

> --

> v2
> * First post
> ---
>   drivers/net/ethernet/renesas/sh_eth.c | 4 ++++
>   include/linux/sh_eth.h                | 3 +++
>   2 files changed, 7 insertions(+)

> diff --git a/drivers/net/ethernet/renesas/sh_eth.c b/drivers/net/ethernet/renesas/sh_eth.c
> index 7732f11..0253f61 100644
> --- a/drivers/net/ethernet/renesas/sh_eth.c
> +++ b/drivers/net/ethernet/renesas/sh_eth.c
[...]
> @@ -2652,6 +2653,9 @@ static int sh_eth_drv_probe(struct platform_device *pdev)
>   		ndev->features = NETIF_F_HW_VLAN_CTAG_FILTER;
>   	}
>
> +	if (pd->needs_gpio_reset)
> +		gpio_request_one(pd->reset_gpio, GPIOF_OUT_INIT_HIGH, NULL);

    Is reset signal active low or active high? Are you asserting or 
releasing it?

> diff --git a/include/linux/sh_eth.h b/include/linux/sh_eth.h
> index fc30571..b3f1550 100644
> --- a/include/linux/sh_eth.h
> +++ b/include/linux/sh_eth.h
> @@ -22,6 +22,9 @@ struct sh_eth_plat_data {
>   	unsigned no_ether_link:1;
>   	unsigned ether_link_active_low:1;
>   	unsigned needs_init:1;
> +	unsigned needs_gpio_reset:1;
> +
> +	unsigned reset_gpio;	/* Used if needs_gpio_reset is true */

    s/true/1/.

WBR, Sergei


  reply	other threads:[~2013-07-01 14:24 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-07-01  4:24 [PATCH net-next v3 0/3] sh_eth: Add support for r8a7790 SoC Simon Horman
2013-07-01  4:24 ` Simon Horman
2013-07-01  4:24 ` [PATCH net-next v3 1/3] sh_eth: add support for gpio reset Simon Horman
2013-07-01  4:24   ` Simon Horman
2013-07-01 14:24   ` Sergei Shtylyov [this message]
2013-07-01 14:24     ` Sergei Shtylyov
2013-07-02  5:25     ` Simon Horman
2013-07-02  5:25       ` Simon Horman
2013-07-04 15:20       ` Laurent Pinchart
2013-07-04 15:20         ` Laurent Pinchart
2013-07-01  4:24 ` [PATCH net-next v3 2/3] sh_eth: add support RMIIMODE register Simon Horman
2013-07-01  4:24   ` Simon Horman
2013-07-01 14:26   ` Sergei Shtylyov
2013-07-01 14:26     ` Sergei Shtylyov
2013-07-01 14:27   ` Sergei Shtylyov
2013-07-01 14:27     ` Sergei Shtylyov
2013-07-01  4:24 ` [PATCH net-next v3 3/3] sh_eth: Add support for r8a7790 SoC Simon Horman
2013-07-01  4:24   ` Simon Horman
2013-07-01 14:30   ` Sergei Shtylyov
2013-07-01 14:30     ` Sergei Shtylyov
2013-07-02  1:24     ` Simon Horman
2013-07-02  1:24       ` 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=51D19122.6030409@cogentembedded.com \
    --to=sergei.shtylyov@cogentembedded.com \
    --cc=horms+renesas@verge.net.au \
    --cc=linux-sh@vger.kernel.org \
    --cc=magnus.damm@gmail.com \
    --cc=netdev@vger.kernel.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.