diff options
| author | Markus Niebel <[email protected]> | 2026-06-01 11:02:16 +0200 |
|---|---|---|
| committer | Jerome Forissier <[email protected]> | 2026-07-23 17:05:20 +0200 |
| commit | 614ebea14bfc4f015a739e0d7b047fe98b831d37 (patch) | |
| tree | 7e53c5d7929f35327e4fee14f0c48e8627fa8adb | |
| parent | de02bc0eccb76aec8272abed651c35ab120f4844 (diff) | |
net: phy: dp83867: enable extended read / write for driver
Add a wrapper to implement ext_read / write using phy_[read,write]_mmd.
Check if devad is the only supported extended MMD address on this PHY.
Signed-off-by: Markus Niebel <[email protected]>
Signed-off-by: Alexander Stein <[email protected]>
| -rw-r--r-- | drivers/net/phy/dp83867.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/net/phy/dp83867.c b/drivers/net/phy/dp83867.c index ebed61de133..34c871857e1 100644 --- a/drivers/net/phy/dp83867.c +++ b/drivers/net/phy/dp83867.c @@ -126,6 +126,22 @@ struct dp83867_private { bool sgmii_ref_clk_en; }; +static int dp83867_phy_extread(struct phy_device *phydev, + int addr, int devad, int reg) +{ + if (devad != DP83867_DEVADDR) + return -EINVAL; + return phy_read_mmd(phydev, devad, addr); +}; + +static int dp83867_phy_extwrite(struct phy_device *phydev, int addr, + int devad, int reg, u16 val) +{ + if (devad != DP83867_DEVADDR) + return -EINVAL; + return phy_write_mmd(phydev, devad, addr, (u32)val); +}; + static int dp83867_config_port_mirroring(struct phy_device *phydev) { struct dp83867_private *dp83867 = @@ -410,4 +426,6 @@ U_BOOT_PHY_DRIVER(dp83867) = { .config = &dp83867_config, .startup = &genphy_startup, .shutdown = &genphy_shutdown, + .readext = dp83867_phy_extread, + .writeext = dp83867_phy_extwrite, }; |
