Commit 06acc17a authored by Dan Murphy's avatar Dan Murphy Committed by David S. Miller

net: phy: Add DP83825I to the DP83822 driver

Add the DP83825I ethernet PHY to the DP83822 driver.
These devices share the same WoL register bits and addresses.

The phy_driver init was made into a macro as there may be future
devices appended to this driver that will share the register space.

http://www.ti.com/lit/gpn/dp83825iReviewed-by: default avatarFlorian Fainelli <f.fainelli@gmail.com>
Signed-off-by: default avatarDan Murphy <dmurphy@ti.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent e0831ef7
...@@ -15,6 +15,8 @@ ...@@ -15,6 +15,8 @@
#include <linux/netdevice.h> #include <linux/netdevice.h>
#define DP83822_PHY_ID 0x2000a240 #define DP83822_PHY_ID 0x2000a240
#define DP83825I_PHY_ID 0x2000a150
#define DP83822_DEVADDR 0x1f #define DP83822_DEVADDR 0x1f
#define MII_DP83822_PHYSCR 0x11 #define MII_DP83822_PHYSCR 0x11
...@@ -304,26 +306,30 @@ static int dp83822_resume(struct phy_device *phydev) ...@@ -304,26 +306,30 @@ static int dp83822_resume(struct phy_device *phydev)
return 0; return 0;
} }
#define DP83822_PHY_DRIVER(_id, _name) \
{ \
PHY_ID_MATCH_MODEL(_id), \
.name = (_name), \
.features = PHY_BASIC_FEATURES, \
.soft_reset = dp83822_phy_reset, \
.config_init = dp83822_config_init, \
.get_wol = dp83822_get_wol, \
.set_wol = dp83822_set_wol, \
.ack_interrupt = dp83822_ack_interrupt, \
.config_intr = dp83822_config_intr, \
.suspend = dp83822_suspend, \
.resume = dp83822_resume, \
}
static struct phy_driver dp83822_driver[] = { static struct phy_driver dp83822_driver[] = {
{ DP83822_PHY_DRIVER(DP83822_PHY_ID, "TI DP83822"),
.phy_id = DP83822_PHY_ID, DP83822_PHY_DRIVER(DP83825I_PHY_ID, "TI DP83825I"),
.phy_id_mask = 0xfffffff0,
.name = "TI DP83822",
.features = PHY_BASIC_FEATURES,
.config_init = dp83822_config_init,
.soft_reset = dp83822_phy_reset,
.get_wol = dp83822_get_wol,
.set_wol = dp83822_set_wol,
.ack_interrupt = dp83822_ack_interrupt,
.config_intr = dp83822_config_intr,
.suspend = dp83822_suspend,
.resume = dp83822_resume,
},
}; };
module_phy_driver(dp83822_driver); module_phy_driver(dp83822_driver);
static struct mdio_device_id __maybe_unused dp83822_tbl[] = { static struct mdio_device_id __maybe_unused dp83822_tbl[] = {
{ DP83822_PHY_ID, 0xfffffff0 }, { DP83822_PHY_ID, 0xfffffff0 },
{ DP83825I_PHY_ID, 0xfffffff0 },
{ }, { },
}; };
MODULE_DEVICE_TABLE(mdio, dp83822_tbl); MODULE_DEVICE_TABLE(mdio, dp83822_tbl);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment