Skip to content

Commit 99ac4cb

Browse files
Heiko Stuebnerkuba-moo
authored andcommitted
net: phy: micrel: allow usage of generic ethernet-phy clock
The generic ethernet-phy binding allows describing an external clock since commit 350b7a2 ("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 <[email protected]> Reviewed-by: Florian Fainelli <[email protected]> Reviewed-by: Andrew Lunn <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 9853294 commit 99ac4cb

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

drivers/net/phy/micrel.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2021,6 +2021,11 @@ static int kszphy_probe(struct phy_device *phydev)
20212021
rate);
20222022
return -EINVAL;
20232023
}
2024+
} else if (!clk) {
2025+
/* unnamed clock from the generic ethernet-phy binding */
2026+
clk = devm_clk_get_optional_enabled(&phydev->mdio.dev, NULL);
2027+
if (IS_ERR(clk))
2028+
return PTR_ERR(clk);
20242029
}
20252030

20262031
if (ksz8041_fiber_mode(phydev))

0 commit comments

Comments
 (0)