netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Lunn <andrew@lunn.ch>
To: Raju Lakkaraju <Raju.Lakkaraju@microsemi.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"f.fainelli@gmail.com" <f.fainelli@gmail.com>,
	Allan Nielsen <Allan.Nielsen@microsemi.com>
Subject: Re: [PATCH 2/4] net: phy: Add MAC-IF driver for Microsemi PHYs.
Date: Wed, 24 Aug 2016 15:06:44 +0200	[thread overview]
Message-ID: <20160824130644.GD13406@lunn.ch> (raw)
In-Reply-To: <646450A91FAED74E85C6E9C4D6E936A145336694@avsrvexchmbx1.microsemi.net>

> +static int vsc85xx_mac_if_set(struct phy_device *phydev,
> +                             phy_interface_t   *interface)
> +{
> +       int rc;
> +       u16 reg_val;
> +
> +       mutex_lock(&phydev->lock);
> +       reg_val = phy_read(phydev, MSCC_PHY_EXT_PHY_CNTL_1);
> +       switch (*interface) {
> +       case PHY_INTERFACE_MODE_RGMII:
> +               reg_val &= ~(MAC_IF_SELECTION_MASK);
> +               reg_val |= (MAC_IF_SELECTION_RGMII << MAC_IF_SELECTION_POS);
> +               break;
> +       case PHY_INTERFACE_MODE_RMII:
> +               reg_val &= ~(MAC_IF_SELECTION_MASK);
> +               reg_val |= (MAC_IF_SELECTION_RMII << MAC_IF_SELECTION_POS);
> +               break;
> +       case PHY_INTERFACE_MODE_MII:
> +       case PHY_INTERFACE_MODE_GMII:
> +       default:
> +               reg_val &= ~(MAC_IF_SELECTION_MASK);
> +               reg_val |= (MAC_IF_SELECTION_GMII << MAC_IF_SELECTION_POS);
> +               break;
> +       }
> +       rc = phy_write(phydev, MSCC_PHY_EXT_PHY_CNTL_1, reg_val);
> +       if (rc != 0)
> +               goto out_unlock;
> +
> +       rc = vsc85xx_soft_reset(phydev);
> +
> +out_unlock:
> +       mutex_unlock(&phydev->lock);
> +
> +       return rc;
> +}

Again, you need to justify why you are doing something completely
different to all other phy drivers. You cannot you do what
m88e1121_config_aneg(), mv88e111_config_init(), dp83867_config_init()
does?

	Andrew

  reply	other threads:[~2016-08-24 13:08 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-24 12:24 [PATCH 2/4] net: phy: Add MAC-IF driver for Microsemi PHYs Raju Lakkaraju
2016-08-24 13:06 ` Andrew Lunn [this message]
2016-09-08  9:09   ` Raju Lakkaraju

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=20160824130644.GD13406@lunn.ch \
    --to=andrew@lunn.ch \
    --cc=Allan.Nielsen@microsemi.com \
    --cc=Raju.Lakkaraju@microsemi.com \
    --cc=f.fainelli@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 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).