netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Florian Fainelli <f.fainelli@gmail.com>
To: shh.xie@gmail.com
Cc: David Miller <davem@davemloft.net>,
	jg1.han@samsung.com, mugunthanvnm <mugunthanvnm@ti.com>,
	netdev <netdev@vger.kernel.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"emilian.medve" <Emilian.Medve@freescale.com>,
	madalin.bucur@freescale.com
Subject: Re: [PATCH 5/5][v2] phylib: Add of_phy_attach
Date: Wed, 27 Nov 2013 10:55:19 -0800	[thread overview]
Message-ID: <CAGVrzcZsev7N_YKEhK_2673sPVk5sd+PYL2H8BsRuAn-ETAKWQ@mail.gmail.com> (raw)
In-Reply-To: <1385459735-722-1-git-send-email-shh.xie@gmail.com>

2013/11/26  <shh.xie@gmail.com>:
> From: Andy Fleming <afleming@freescale.com>
>
> 10G PHYs don't currently support running the state machine, which
> is implicitly setup via of_phy_connect(). Therefore, it is necessary
> to implement an OF version of phy_attach(), which does everything
> except start the state machine.
>
> Signed-off-by: Andy Fleming <afleming@freescale.com>
> Signed-off-by: Shaohui Xie <Shaohui.Xie@freescale.com>

Acked-by: Florian Fainelli <f.fainelli@gmail.com>

> ---
> v2: no changes.
>
>  drivers/of/of_mdio.c    | 19 +++++++++++++++++++
>  include/linux/of_mdio.h |  9 +++++++++
>  2 files changed, 28 insertions(+)
>
> diff --git a/drivers/of/of_mdio.c b/drivers/of/of_mdio.c
> index d5a57a9..21076ac 100644
> --- a/drivers/of/of_mdio.c
> +++ b/drivers/of/of_mdio.c
> @@ -247,3 +247,22 @@ struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>         return IS_ERR(phy) ? NULL : phy;
>  }
>  EXPORT_SYMBOL(of_phy_connect_fixed_link);
> +
> +/**
> + * of_phy_attach - Attach to a PHY without starting the state machine
> + * @dev: pointer to net_device claiming the phy
> + * @phy_np: Node pointer for the PHY
> + * @flags: flags to pass to the PHY
> + * @iface: PHY data interface type
> + */
> +struct phy_device *of_phy_attach(struct net_device *dev,
> +               struct device_node *phy_np, u32 flags, phy_interface_t iface)
> +{
> +       struct phy_device *phy = of_phy_find_device(phy_np);
> +
> +       if (!phy)
> +               return NULL;
> +
> +       return phy_attach_direct(dev, phy, flags, iface) ? NULL : phy;
> +}
> +EXPORT_SYMBOL(of_phy_attach);
> diff --git a/include/linux/of_mdio.h b/include/linux/of_mdio.h
> index 8163107..108583a 100644
> --- a/include/linux/of_mdio.h
> +++ b/include/linux/of_mdio.h
> @@ -19,6 +19,9 @@ extern struct phy_device *of_phy_connect(struct net_device *dev,
>                                          struct device_node *phy_np,
>                                          void (*hndlr)(struct net_device *),
>                                          u32 flags, phy_interface_t iface);
> +struct phy_device *of_phy_attach(struct net_device *dev,
> +                                struct device_node *phy_np, u32 flags,
> +                                phy_interface_t iface);
>  extern struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>                                          void (*hndlr)(struct net_device *),
>                                          phy_interface_t iface);
> @@ -44,6 +47,12 @@ static inline struct phy_device *of_phy_connect(struct net_device *dev,
>         return NULL;
>  }
>
> +static inline struct phy_device *of_phy_attach(struct net_device *dev,
> +               struct device_node *phy_np, u32 flags, phy_interface_t iface)
> +{
> +       return NULL;
> +}
> +
>  static inline struct phy_device *of_phy_connect_fixed_link(struct net_device *dev,
>                                                            void (*hndlr)(struct net_device *),
>                                                            phy_interface_t iface)
> --
> 1.8.4.1
>
>



-- 
Florian

      reply	other threads:[~2013-11-27 18:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-11-26  9:55 [PATCH 5/5][v2] phylib: Add of_phy_attach shh.xie
2013-11-27 18:55 ` Florian Fainelli [this message]

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=CAGVrzcZsev7N_YKEhK_2673sPVk5sd+PYL2H8BsRuAn-ETAKWQ@mail.gmail.com \
    --to=f.fainelli@gmail.com \
    --cc=Emilian.Medve@freescale.com \
    --cc=davem@davemloft.net \
    --cc=jg1.han@samsung.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=madalin.bucur@freescale.com \
    --cc=mugunthanvnm@ti.com \
    --cc=netdev@vger.kernel.org \
    --cc=shh.xie@gmail.com \
    /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).