diff options
author | Robert Hancock <robert.hancock@calian.com> | 2021-03-26 01:04:38 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2021-03-26 23:17:17 +0100 |
commit | b11bfb9a19f9d790eea10cbd338b6b7f086c6dca (patch) | |
tree | cba9ceadaf439408c6d5e10fe8e4636ddb004d9e /drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | |
parent | dt-bindings: net: xilinx_axienet: Document additional clocks (diff) | |
download | linux-b11bfb9a19f9d790eea10cbd338b6b7f086c6dca.tar.xz linux-b11bfb9a19f9d790eea10cbd338b6b7f086c6dca.zip |
net: axienet: Enable more clocks
This driver was only enabling the first clock on the device, regardless
of its name. However, this controller logic can have multiple clocks
which should all be enabled. Add support for enabling additional clocks.
The clock names used are matching those used in the Xilinx version of this
driver as well as the Xilinx device tree generator, except for mgt_clk
which is not present there.
For backward compatibility, if no named clocks are present, the first
clock present is used for determining the MDIO bus clock divider.
Reviewed-by: Radhey Shyam Pandey <radhey.shyam.pandey@xilinx.com>
Signed-off-by: Robert Hancock <robert.hancock@calian.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c')
-rw-r--r-- | drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c index 9c014cee34b2..48f544f6c999 100644 --- a/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c +++ b/drivers/net/ethernet/xilinx/xilinx_axienet_mdio.c @@ -159,8 +159,8 @@ int axienet_mdio_enable(struct axienet_local *lp) lp->mii_clk_div = 0; - if (lp->clk) { - host_clock = clk_get_rate(lp->clk); + if (lp->axi_clk) { + host_clock = clk_get_rate(lp->axi_clk); } else { struct device_node *np1; |