Skip to content

Commit f35189e

Browse files
tpamborMaureenHelm
authored andcommitted
drivers: eth: phy: adin2111: support C45 register access
Implement read_c45 and write_c45 functions to support clause 45 register access. This enhancement allows to access C45 registers even when the MDIO controller does not natively support clause 45. Signed-off-by: Tim Pambor <tim.pambor@codewrights.de>
1 parent c9f8e8c commit f35189e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

‎drivers/ethernet/phy/phy_adin2111.c‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ static int phy_adin2111_c45_setup_dev_reg(const struct device *dev, uint16_t dev
146146
return mdio_write(cfg->mdio, cfg->phy_addr, ADIN1100_MMD_ACCESS_CNTRL, devad | BIT(14));
147147
}
148148

149-
static int phy_adin2111_c45_read(const struct device *dev, uint16_t devad,
149+
static int phy_adin2111_c45_read(const struct device *dev, uint8_t devad,
150150
uint16_t reg, uint16_t *val)
151151
{
152152
const struct phy_adin2111_config *cfg = dev->config;
@@ -167,7 +167,7 @@ static int phy_adin2111_c45_read(const struct device *dev, uint16_t devad,
167167
return rval;
168168
}
169169

170-
static int phy_adin2111_c45_write(const struct device *dev, uint16_t devad,
170+
static int phy_adin2111_c45_write(const struct device *dev, uint8_t devad,
171171
uint16_t reg, uint16_t val)
172172
{
173173
const struct phy_adin2111_config *cfg = dev->config;
@@ -640,6 +640,8 @@ static DEVICE_API(ethphy, phy_adin2111_api) = {
640640
.link_cb_set = phy_adin2111_link_cb_set,
641641
.read = phy_adin2111_reg_read,
642642
.write = phy_adin2111_reg_write,
643+
.read_c45 = phy_adin2111_c45_read,
644+
.write_c45 = phy_adin2111_c45_write,
643645
};
644646

645647
#if DT_ANY_COMPAT_HAS_PROP_STATUS_OKAY(adi_adin1100_phy, reset_gpios)

0 commit comments

Comments
 (0)