This patch adds the BCM5221 PHY support by reusing
brcm_fet_config_intr() and brcm_fet_handle_interrupt() and
implementing config_init()/suspend()/resume().
Sponsored by: Tekvox Inc.
Cc: Jim Reinhart <jimr@xxxxxxxxxx>
Cc: James Autry <jautry@xxxxxxxxxx>
Cc: Matthew Maron <matthewm@xxxxxxxxxx>
Signed-off-by: Giulio Benetti <giulio.benetti@xxxxxxxxxxxxxxxxxxxxxx>
---
drivers/net/phy/broadcom.c | 144 +++++++++++++++++++++++++++++++++++++
include/linux/brcmphy.h | 8 +++
2 files changed, 152 insertions(+)
diff --git a/drivers/net/phy/broadcom.c b/drivers/net/phy/broadcom.c
index 59cae0d808aa..99f6c0485f01 100644
--- a/drivers/net/phy/broadcom.c
+++ b/drivers/net/phy/broadcom.c
@@ -754,6 +754,84 @@ static int brcm_fet_config_init(struct phy_device *phydev)
return err;
}
+static int bcm5221_config_init(struct phy_device *phydev)
+{
+static int bcm5221_suspend(struct phy_device *phydev)
+{
+ int reg, err, err2, brcmtest;
+
+ /* Enable shadow register access */
+ brcmtest = phy_read(phydev, MII_BRCM_FET_BRCMTEST);
+ if (brcmtest < 0)
+ return brcmtest;
+
+ reg = brcmtest | MII_BRCM_FET_BT_SRE;
+
+ err = phy_write(phydev, MII_BRCM_FET_BRCMTEST, reg);
+ if (err < 0)
+ return err;
+
+ /* Force Low Power Mode with clock enabled */
+ err = phy_set_bits(phydev, MII_BRCM_FET_SHDW_AUXMODE4,
+ BCM5221_SHDW_AM4_EN_CLK_LPM |
+ BCM5221_SHDW_AM4_FORCE_LPM);
+
+ /* Disable shadow register access */
+ err2 = phy_write(phydev, MII_BRCM_FET_BRCMTEST, brcmtest);
+ if (!err)
+ err = err2;
+
+ return err;
+}
+
+static int bcm5221_resume(struct phy_device *phydev)
+{
Attachment:
smime.p7s
Description: S/MIME Cryptographic Signature