Skip to content

Commit 91893f4

Browse files
vineethchowdharyNipaLocal
authored andcommitted
net: phy: xilinx-gmii2rgmii: Adopt clock support
Add clock support to the gmii_to_rgmii IP. The input clock name "clkin" from device-tree will be registered. Signed-off-by: Vineeth Karumanchi <[email protected]> Signed-off-by: NipaLocal <nipa@local>
1 parent ce4a068 commit 91893f4

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/net/phy/xilinx_gmii2rgmii.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
#include <linux/mii.h>
1616
#include <linux/mdio.h>
1717
#include <linux/phy.h>
18+
#include <linux/clk.h>
1819
#include <linux/of_mdio.h>
1920

2021
#define XILINX_GMII2RGMII_REG 0x10
@@ -85,11 +86,17 @@ static int xgmiitorgmii_probe(struct mdio_device *mdiodev)
8586
struct device *dev = &mdiodev->dev;
8687
struct device_node *np = dev->of_node, *phy_node;
8788
struct gmii2rgmii *priv;
89+
struct clk *clkin;
8890

8991
priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL);
9092
if (!priv)
9193
return -ENOMEM;
9294

95+
clkin = devm_clk_get_optional_enabled(dev, "clkin");
96+
if (IS_ERR(clkin))
97+
return dev_err_probe(dev, PTR_ERR(clkin),
98+
"Failed to get and enable clock_in from Device Tree\n");
99+
93100
phy_node = of_parse_phandle(np, "phy-handle", 0);
94101
if (!phy_node) {
95102
dev_err(dev, "Couldn't parse phy-handle\n");

0 commit comments

Comments
 (0)