broadcom: Add 5241 support
authorDmitry Baryshkov <dbaryshkov@gmail.com>
Wed, 16 Jun 2010 23:02:24 +0000 (23:02 +0000)
committerDavid S. Miller <davem@davemloft.net>
Fri, 25 Jun 2010 04:30:09 +0000 (21:30 -0700)
This patch adds the 5241 PHY ID to the broadcom module.

Signed-off-by: Dmitry Eremin-Solenikov <dbaryshkov@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/phy/broadcom.c
include/linux/brcmphy.h

index b743d37532ff2e9b63a6fb1af6b40cf6bb8bceb7..4accd83d3dfe8152067408e4fc5dc7b454c4d95e 100644 (file)
@@ -834,6 +834,21 @@ static struct phy_driver bcmac131_driver = {
        .driver         = { .owner = THIS_MODULE },
 };
 
+static struct phy_driver bcm5241_driver = {
+       .phy_id         = PHY_ID_BCM5241,
+       .phy_id_mask    = 0xfffffff0,
+       .name           = "Broadcom BCM5241",
+       .features       = PHY_BASIC_FEATURES |
+                         SUPPORTED_Pause | SUPPORTED_Asym_Pause,
+       .flags          = PHY_HAS_MAGICANEG | PHY_HAS_INTERRUPT,
+       .config_init    = brcm_fet_config_init,
+       .config_aneg    = genphy_config_aneg,
+       .read_status    = genphy_read_status,
+       .ack_interrupt  = brcm_fet_ack_interrupt,
+       .config_intr    = brcm_fet_config_intr,
+       .driver         = { .owner = THIS_MODULE },
+};
+
 static int __init broadcom_init(void)
 {
        int ret;
@@ -868,8 +883,13 @@ static int __init broadcom_init(void)
        ret = phy_driver_register(&bcmac131_driver);
        if (ret)
                goto out_ac131;
+       ret = phy_driver_register(&bcm5241_driver);
+       if (ret)
+               goto out_5241;
        return ret;
 
+out_5241:
+       phy_driver_unregister(&bcmac131_driver);
 out_ac131:
        phy_driver_unregister(&bcm57780_driver);
 out_57780:
@@ -894,6 +914,7 @@ out_5411:
 
 static void __exit broadcom_exit(void)
 {
+       phy_driver_unregister(&bcm5241_driver);
        phy_driver_unregister(&bcmac131_driver);
        phy_driver_unregister(&bcm57780_driver);
        phy_driver_unregister(&bcm50610m_driver);
@@ -920,6 +941,7 @@ static struct mdio_device_id broadcom_tbl[] = {
        { PHY_ID_BCM50610M, 0xfffffff0 },
        { PHY_ID_BCM57780, 0xfffffff0 },
        { PHY_ID_BCMAC131, 0xfffffff0 },
+       { PHY_ID_BCM5241, 0xfffffff0 },
        { }
 };
 
index c14c3a1b64d2c1992e4e08abcc9e2a70ca755005..b840a496028259076caff141de3a6a92ed177a3a 100644 (file)
@@ -1,5 +1,6 @@
 #define PHY_ID_BCM50610                        0x0143bd60
 #define PHY_ID_BCM50610M               0x0143bd70
+#define PHY_ID_BCM5241                 0x0143bc30
 #define PHY_ID_BCMAC131                        0x0143bc70
 #define PHY_ID_BCM5481                 0x0143bca0
 #define PHY_ID_BCM5482                 0x0143bcb0