1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-17 10:26:15 +00:00

Enable PHY regulator when the optional "phy-supply" property is present.

Submitted by:	Emmanuel Vadot <manu@bidouilliste.com>
This commit is contained in:
Jared McNeill 2016-04-09 11:23:46 +00:00
parent f254aeda60
commit a09ecc1326
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=297739

View File

@ -42,6 +42,7 @@ __FBSDID("$FreeBSD$");
#include <arm/allwinner/allwinner_machdep.h>
#include <dev/extres/clk/clk.h>
#include <dev/extres/regulator/regulator.h>
#include "if_dwc_if.h"
@ -64,6 +65,7 @@ a20_if_dwc_init(device_t dev)
const char *tx_parent_name;
char *phy_type;
clk_t clk_tx, clk_tx_parent;
regulator_t reg;
phandle_t node;
int error;
@ -96,6 +98,15 @@ a20_if_dwc_init(device_t dev)
}
}
/* Enable PHY regulator if applicable */
if (regulator_get_by_ofw_property(dev, "phy-supply", &reg) == 0) {
error = regulator_enable(reg);
if (error != 0) {
device_printf(dev, "could not enable PHY regulator\n");
return (error);
}
}
return (0);
}