]> git.baikalelectronics.ru Git - kernel.git/commit
net: phy: adin: implement Energy Detect Powerdown mode via phy-tunable
authorAlexandru Ardelean <alexandru.ardelean@analog.com>
Mon, 16 Sep 2019 07:35:26 +0000 (10:35 +0300)
committerDavid S. Miller <davem@davemloft.net>
Mon, 16 Sep 2019 20:02:45 +0000 (22:02 +0200)
commit65d7be094f04fc8dc20e85dd8f10efcd70ccc525
tree5afa44df898abbb1fe15cd609ebb804dbe428cf6
parent9f2f13f4ffb13ee914105dfc9f860d68cae98108
net: phy: adin: implement Energy Detect Powerdown mode via phy-tunable

This driver becomes the first user of the kernel's `ETHTOOL_PHY_EDPD`
phy-tunable feature.
EDPD is also enabled by default on PHY config_init, but can be disabled via
the phy-tunable control.

When enabling EDPD, it's also a good idea (for the ADIN PHYs) to enable TX
periodic pulses, so that in case the other PHY is also on EDPD mode, there
is no lock-up situation where both sides are waiting for the other to
transmit.

Via the phy-tunable control, TX pulses can be disabled if specifying 0
`tx-interval` via ethtool.

The ADIN PHY supports only fixed 1 second intervals; they cannot be
configured. That is why the acceptable values are 1,
ETHTOOL_PHY_EDPD_DFLT_TX_MSECS and ETHTOOL_PHY_EDPD_NO_TX (which disables
TX pulses).

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Alexandru Ardelean <alexandru.ardelean@analog.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/adin.c