Skip to content

Commit

Permalink
GITHUB: net: designware: Add phy supply support
Browse files Browse the repository at this point in the history
Some board need a regulator for gmac phy, so add this code to handle it.
Series-cc: eddie.cai.linux@gmail.com, kever.yang@rock-chips.com, sjoerd.simons@collabora.co.uk

Series-version: 2

Change-Id: Icf787e48d3519c0f7b03d772c776e118bc2c256f
Signed-off-by: Jacob Chen <jacob2.chen@rock-chips.com>
  • Loading branch information
wzyy2 committed Apr 17, 2017
1 parent dd73a15 commit 15b7a3d
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions drivers/net/designware.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <linux/compiler.h>
#include <linux/err.h>
#include <asm/io.h>
#include <power/regulator.h>
#include "designware.h"

DECLARE_GLOBAL_DATA_PTR;
Expand Down Expand Up @@ -661,6 +662,22 @@ int designware_eth_probe(struct udevice *dev)
ulong ioaddr;
int ret;

#if defined(CONFIG_DM_REGULATOR)
struct udevice *phy_supply;

ret = device_get_supply_regulator(dev, "phy-supply",
&phy_supply);
if (ret) {
debug("%s: No phy supply\n", dev->name);
} else {
ret = regulator_set_enable(phy_supply, true);
if (ret) {
puts("Error enabling phy supply\n");
return ret;
}
}
#endif

#ifdef CONFIG_DM_PCI
/*
* If we are on PCI bus, either directly attached to a PCI root port,
Expand Down

0 comments on commit 15b7a3d

Please sign in to comment.