summaryrefslogtreecommitdiff
path: root/drivers/phy
diff options
context:
space:
mode:
authorTom Rini <[email protected]>2020-10-24 10:49:28 -0400
committerTom Rini <[email protected]>2020-10-24 10:49:28 -0400
commitc99e87f82803500f9811b1e98926d9d25df35b38 (patch)
tree9ed4491e17a925e5d7a50ff21af8c33080f32ef1 /drivers/phy
parent001ab99325bf82cf3284771d1312585570569740 (diff)
parent16cc5ad0b439b1444af8134019d9d49d776fd67c (diff)
Merge branch '2020-10-23-misc-changes'
Highlights: - Fix a problem with the bootm overlap tests - Remove duplicated code in fatwrite - Cleanup our current "misc" command code and add a new one for misc class devices. - Various GPIO fixes
Diffstat (limited to 'drivers/phy')
-rw-r--r--drivers/phy/nop-phy.c35
1 files changed, 35 insertions, 0 deletions
diff --git a/drivers/phy/nop-phy.c b/drivers/phy/nop-phy.c
index a5eed20f3f9..ba71785fe42 100644
--- a/drivers/phy/nop-phy.c
+++ b/drivers/phy/nop-phy.c
@@ -4,17 +4,50 @@
* Written by Jean-Jacques Hiblot <[email protected]>
*/
+#include <clk.h>
#include <common.h>
#include <dm.h>
#include <dm/device.h>
+#include <dm/device_compat.h>
#include <generic-phy.h>
+struct nop_phy_priv {
+ struct clk_bulk bulk;
+};
+
+static int nop_phy_init(struct phy *phy)
+{
+ struct nop_phy_priv *priv = dev_get_priv(phy->dev);
+
+ if (CONFIG_IS_ENABLED(CLK))
+ return clk_enable_bulk(&priv->bulk);
+
+ return 0;
+}
+
+static int nop_phy_probe(struct udevice *dev)
+{
+ struct nop_phy_priv *priv = dev_get_priv(dev);
+ int ret;
+
+ if (CONFIG_IS_ENABLED(CLK)) {
+ ret = clk_get_bulk(dev, &priv->bulk);
+ if (ret < 0) {
+ dev_err(dev, "Failed to get clk: %d\n", ret);
+ return ret;
+ }
+ }
+
+ return 0;
+}
+
static const struct udevice_id nop_phy_ids[] = {
{ .compatible = "nop-phy" },
{ }
};
static struct phy_ops nop_phy_ops = {
+ .init = nop_phy_init,
};
U_BOOT_DRIVER(nop_phy) = {
@@ -22,4 +55,6 @@ U_BOOT_DRIVER(nop_phy) = {
.id = UCLASS_PHY,
.of_match = nop_phy_ids,
.ops = &nop_phy_ops,
+ .probe = nop_phy_probe,
+ .priv_auto_alloc_size = sizeof(struct nop_phy_priv),
};