mirror of
https://github.com/torvalds/linux.git
synced 2024-11-24 21:21:41 +00:00
Merge branch 'net-phy-micrel-additional-clock-handling'
Heiko Stuebner says: ==================== net: phy: micrel: additional clock handling Some Micrel phys define a specific rmii-ref clock (added in 2014) while the generic phy binding specifies an unnamed clock for ethernet phys. This allows Micrel phys to use both, so as to keep the phys not using the named rmii-ref clock to conform to the generic binding while allowing them to enable a supplying clock, when the phy is not supplied by a dedicated oscillator. ==================== Link: https://lore.kernel.org/r/20231201150131.326766-1-heiko@sntech.de Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
commit
e4b5e96d9c
@ -2001,7 +2001,7 @@ static int kszphy_probe(struct phy_device *phydev)
|
||||
|
||||
kszphy_parse_led_mode(phydev);
|
||||
|
||||
clk = devm_clk_get(&phydev->mdio.dev, "rmii-ref");
|
||||
clk = devm_clk_get_optional_enabled(&phydev->mdio.dev, "rmii-ref");
|
||||
/* NOTE: clk may be NULL if building without CONFIG_HAVE_CLK */
|
||||
if (!IS_ERR_OR_NULL(clk)) {
|
||||
unsigned long rate = clk_get_rate(clk);
|
||||
@ -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))
|
||||
|
Loading…
Reference in New Issue
Block a user