linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alvaro Gamez Machado <alvaro.gamez@hazent.com>
To: Florian Fainelli <f.fainelli@gmail.com>
Cc: "Anirudha Sarangi" <anirudh@xilinx.com>,
	"John Linn" <John.Linn@xilinx.com>,
	"Michal Simek" <michal.simek@xilinx.com>,
	"Sören Brinkmann" <soren.brinkmann@xilinx.com>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case
Date: Sun, 2 Jul 2017 12:19:14 +0200	[thread overview]
Message-ID: <20170702101914.5nk27r2h754qzthe@collins.gmr.ssr.upm.es> (raw)
In-Reply-To: <425aed84-a1b6-b8da-5989-3bef5a03ead4@gmail.com>

On Fri, Jun 30, 2017 at 10:30:38AM -0700, Florian Fainelli wrote:
> On 06/30/2017 02:25 AM, Alvaro Gamez Machado wrote:
> >  	if (lp->phy_node) {
> > -		if (lp->phy_type == XAE_PHY_TYPE_GMII) {
> > +		if (lp->phy_type == XAE_PHY_TYPE_MII) {
> > +			phydev = of_phy_connect(lp->ndev, lp->phy_node,
> > +						axienet_adjust_link, 0,
> > +						PHY_INTERFACE_MODE_MII);
> > +		} else if (lp->phy_type == XAE_PHY_TYPE_GMII) {
> >  			phydev = of_phy_connect(lp->ndev, lp->phy_node,
> >  						axienet_adjust_link, 0,
> >  						PHY_INTERFACE_MODE_GMII);
> 
> Seems like this could be simplified even further if the values of
> lp->phy_type directly mapped to those of phy_interface_t.

Sadly, that's not the case. PHY_INTERFACE_MODE_* belong to a enum of twenty
different values, of which only _MII and _GMII overlap with XAW_PHY_*
values, but XAE_PHY_TYPE_RGMII_2_0 doesn't match
PHY_INTERFACE_MODE_RGMII_ID.

Regards
-- 
Alvaro G. M.

  reply	other threads:[~2017-07-02 10:27 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-30  9:25 [PATCH] net: axienet: add of_phy_connect call for XAE_PHY_TYPE_MII case Alvaro Gamez Machado
2017-06-30 17:30 ` Florian Fainelli
2017-07-02 10:19   ` Alvaro Gamez Machado [this message]
2017-07-04 16:24     ` Florian Fainelli
2017-07-05 10:13       ` Alvaro Gamez Machado
2017-07-05 14:34         ` Andrew Lunn
2017-07-05 14:43           ` Alvaro Gamez Machado
2017-07-05 15:20             ` Andrew Lunn

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=20170702101914.5nk27r2h754qzthe@collins.gmr.ssr.upm.es \
    --to=alvaro.gamez@hazent.com \
    --cc=John.Linn@xilinx.com \
    --cc=anirudh@xilinx.com \
    --cc=f.fainelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michal.simek@xilinx.com \
    --cc=netdev@vger.kernel.org \
    --cc=soren.brinkmann@xilinx.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).