net: phy: micrel: allow usage of generic ethernet-phy

A patch from »net: phy: micrel: additional clock handling« in state Mainline for linux-kernel

From: Heiko Stuebner <heiko.stuebner@...> Date: Sat, 18 Nov 2023 23:28:25 +0100

Commit-Message

The generic ethernet-phy binding allows describing an external clock since commit 350b7a258f20 ("dt-bindings: net: phy: Document support for external PHY clk") for cases where the phy is not supplied by an oscillator but instead by a clock from the host system. And the old named "rmii-ref" clock from 2014 is only specified for phys of the KSZ8021, KSZ8031, KSZ8081, KSZ8091 types. So allow retrieving and enabling the optional generic clock on phys that do not provide a rmii-ref clock. Signed-off-by: Heiko Stuebner <heiko.stuebner@...>

Patch-Comment

drivers/net/phy/micrel.c | 5 +++++ 1 file changed, 5 insertions(+)

Statistics

  • 5 lines added
  • 0 lines removed

Changes

--------------------------- drivers/net/phy/micrel.c ---------------------------
index ec6a39dc9053..9490849437c0 100644
@@ -2021,6 +2021,11 @@ static int kszphy_probe(struct phy_device *phydev)
rate);
return -EINVAL;
}
+ } else if (!clk) {
+ /* unnamed clock from the generic ethernet-phy binding */
+ clk = devm_clk_get_optional_enabled(&phydev->mdio.dev, NULL);
+ if (IS_ERR(clk))
+ return PTR_ERR(clk);
}
if (ksz8041_fiber_mode(phydev))
 
 

Recent Patches

About Us

Sed lacus. Donec lectus. Nullam pretium nibh ut turpis. Nam bibendum. In nulla tortor, elementum vel, tempor at, varius non, purus. Mauris vitae nisl nec metus placerat consectetuer.

Read More...