Skip to content

Commit 9b54821

Browse files
Yendapally Reddy Dhananjaya Reddygregkh
authored andcommitted
net: phy: Initialize mdio clock at probe function
commit bb1a619735b4660f21bce3e728b937640024b4ad upstream. USB PHYs need the MDIO clock divisor enabled earlier to work. Initialize mdio clock divisor in probe function. The ext bus bit available in the same register will be used by mdio mux to enable external mdio. Signed-off-by: Yendapally Reddy Dhananjaya Reddy <yendapally.reddy@broadcom.com> Fixes: ddc24ae ("net: phy: Broadcom iProc MDIO bus driver") Reviewed-by: Florian Fainelli <f.fainelli@gmail.com> Signed-off-by: Jon Mason <jon.mason@broadcom.com> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Amit Pundir <amit.pundir@linaro.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 889caad commit 9b54821

1 file changed

Lines changed: 2 additions & 4 deletions

File tree

drivers/net/phy/mdio-bcm-iproc.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,6 @@ static int iproc_mdio_read(struct mii_bus *bus, int phy_id, int reg)
8181
if (rc)
8282
return rc;
8383

84-
iproc_mdio_config_clk(priv->base);
85-
8684
/* Prepare the read operation */
8785
cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
8886
(reg << MII_DATA_RA_SHIFT) |
@@ -112,8 +110,6 @@ static int iproc_mdio_write(struct mii_bus *bus, int phy_id,
112110
if (rc)
113111
return rc;
114112

115-
iproc_mdio_config_clk(priv->base);
116-
117113
/* Prepare the write operation */
118114
cmd = (MII_DATA_TA_VAL << MII_DATA_TA_SHIFT) |
119115
(reg << MII_DATA_RA_SHIFT) |
@@ -163,6 +159,8 @@ static int iproc_mdio_probe(struct platform_device *pdev)
163159
bus->read = iproc_mdio_read;
164160
bus->write = iproc_mdio_write;
165161

162+
iproc_mdio_config_clk(priv->base);
163+
166164
rc = of_mdiobus_register(bus, pdev->dev.of_node);
167165
if (rc) {
168166
dev_err(&pdev->dev, "MDIO bus registration failed\n");

0 commit comments

Comments
 (0)