Skip to content

Commit 06acc17

Browse files
Dan Murphydavem330
authored andcommitted
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/dp83825i Reviewed-by: Florian Fainelli <[email protected]> Signed-off-by: Dan Murphy <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e0831ef commit 06acc17

File tree

1 file changed

+20
-14
lines changed

1 file changed

+20
-14
lines changed

drivers/net/phy/dp83822.c

Lines changed: 20 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,8 @@
1515
#include <linux/netdevice.h>
1616

1717
#define DP83822_PHY_ID 0x2000a240
18+
#define DP83825I_PHY_ID 0x2000a150
19+
1820
#define DP83822_DEVADDR 0x1f
1921

2022
#define MII_DP83822_PHYSCR 0x11
@@ -304,26 +306,30 @@ static int dp83822_resume(struct phy_device *phydev)
304306
return 0;
305307
}
306308

309+
#define DP83822_PHY_DRIVER(_id, _name) \
310+
{ \
311+
PHY_ID_MATCH_MODEL(_id), \
312+
.name = (_name), \
313+
.features = PHY_BASIC_FEATURES, \
314+
.soft_reset = dp83822_phy_reset, \
315+
.config_init = dp83822_config_init, \
316+
.get_wol = dp83822_get_wol, \
317+
.set_wol = dp83822_set_wol, \
318+
.ack_interrupt = dp83822_ack_interrupt, \
319+
.config_intr = dp83822_config_intr, \
320+
.suspend = dp83822_suspend, \
321+
.resume = dp83822_resume, \
322+
}
323+
307324
static struct phy_driver dp83822_driver[] = {
308-
{
309-
.phy_id = DP83822_PHY_ID,
310-
.phy_id_mask = 0xfffffff0,
311-
.name = "TI DP83822",
312-
.features = PHY_BASIC_FEATURES,
313-
.config_init = dp83822_config_init,
314-
.soft_reset = dp83822_phy_reset,
315-
.get_wol = dp83822_get_wol,
316-
.set_wol = dp83822_set_wol,
317-
.ack_interrupt = dp83822_ack_interrupt,
318-
.config_intr = dp83822_config_intr,
319-
.suspend = dp83822_suspend,
320-
.resume = dp83822_resume,
321-
},
325+
DP83822_PHY_DRIVER(DP83822_PHY_ID, "TI DP83822"),
326+
DP83822_PHY_DRIVER(DP83825I_PHY_ID, "TI DP83825I"),
322327
};
323328
module_phy_driver(dp83822_driver);
324329

325330
static struct mdio_device_id __maybe_unused dp83822_tbl[] = {
326331
{ DP83822_PHY_ID, 0xfffffff0 },
332+
{ DP83825I_PHY_ID, 0xfffffff0 },
327333
{ },
328334
};
329335
MODULE_DEVICE_TABLE(mdio, dp83822_tbl);

0 commit comments

Comments
 (0)