Skip to content

Commit 15b7a3d

Browse files
committed
GITHUB: net: designware: Add phy supply support
Some board need a regulator for gmac phy, so add this code to handle it. Series-cc: [email protected], [email protected], [email protected] Series-version: 2 Change-Id: Icf787e48d3519c0f7b03d772c776e118bc2c256f Signed-off-by: Jacob Chen <[email protected]>
1 parent dd73a15 commit 15b7a3d

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

drivers/net/designware.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
#include <linux/compiler.h>
1919
#include <linux/err.h>
2020
#include <asm/io.h>
21+
#include <power/regulator.h>
2122
#include "designware.h"
2223

2324
DECLARE_GLOBAL_DATA_PTR;
@@ -661,6 +662,22 @@ int designware_eth_probe(struct udevice *dev)
661662
ulong ioaddr;
662663
int ret;
663664

665+
#if defined(CONFIG_DM_REGULATOR)
666+
struct udevice *phy_supply;
667+
668+
ret = device_get_supply_regulator(dev, "phy-supply",
669+
&phy_supply);
670+
if (ret) {
671+
debug("%s: No phy supply\n", dev->name);
672+
} else {
673+
ret = regulator_set_enable(phy_supply, true);
674+
if (ret) {
675+
puts("Error enabling phy supply\n");
676+
return ret;
677+
}
678+
}
679+
#endif
680+
664681
#ifdef CONFIG_DM_PCI
665682
/*
666683
* If we are on PCI bus, either directly attached to a PCI root port,

0 commit comments

Comments
 (0)