[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190914152931.GK27922@lunn.ch>
Date: Sat, 14 Sep 2019 17:29:31 +0200
From: Andrew Lunn <andrew@...n.ch>
To: Alexandru Ardelean <alexandru.ardelean@...log.com>
Cc: netdev@...r.kernel.org, devicetree@...r.kernel.org,
linux-kernel@...r.kernel.org, davem@...emloft.net,
robh+dt@...nel.org, mark.rutland@....com, f.fainelli@...il.com,
hkallweit1@...il.com, mkubecek@...e.cz
Subject: Re: [PATCH v4 2/2] net: phy: adin: implement Energy Detect Powerdown
mode via phy-tunable
On Thu, Sep 12, 2019 at 07:28:12PM +0300, Alexandru Ardelean wrote:
> +static int adin_set_edpd(struct phy_device *phydev, u16 tx_interval)
> +{
> + u16 val;
> +
> + if (tx_interval == ETHTOOL_PHY_EDPD_DISABLE)
> + return phy_clear_bits(phydev, ADIN1300_PHY_CTRL_STATUS2,
> + (ADIN1300_NRG_PD_EN | ADIN1300_NRG_PD_TX_EN));
> +
> + val = ADIN1300_NRG_PD_EN;
> +
> + switch (tx_interval) {
> + case 1000: /* 1 second */
> + /* fallthrough */
> + case ETHTOOL_PHY_EDPD_DFLT_TX_MSECS:
> + val |= ADIN1300_NRG_PD_TX_EN;
> + /* fallthrough */
> + case ETHTOOL_PHY_EDPD_NO_TX:
> + break;
> + default:
> + return -EINVAL;
> + }
> +
> + return phy_modify(phydev, ADIN1300_PHY_CTRL_STATUS2,
> + (ADIN1300_NRG_PD_EN | ADIN1300_NRG_PD_TX_EN),
> + val);
> +}
> +
>
> + rc = adin_set_edpd(phydev, 1);
> + if (rc < 0)
> + return rc;
Hi Alexandru
Shouldn't this be adin_set_edpd(phydev, 1000);
Andrew
Powered by blists - more mailing lists