Re: [PATCH v2 1/2] net: phy: adin: enable configuration of the LP Termination Register

Nuno Sá
2026-01-07T10:17:55Z

On Tue, 2025-12-23 at 10:36 +0100, Andrew Lunn wrote:
> > +static int adin_config_zptm100(struct phy_device *phydev)
> > +{
> > + struct device *dev = &phydev->mdio.dev;
> > + int reg;
> > + int rc;
> > +
> > + if (!(device_property_read_bool(dev, "adi,low-cmode-impedance")))
> > + return 0;
> > +
> > + /* set to 0 to configure for lowest common-mode impedance */
> > + rc = phy_write_mmd(phydev, MDIO_MMD_VEND1, ADIN1300_B_100_ZPTM_DIMRX, 0x0);
> > + if (rc < 0)
> > + return rc;
> > +
> > + reg = phy_read_mmd(phydev, MDIO_MMD_VEND1, ADIN1300_B_100_ZPTM_DIMRX);
> > + if (reg < 0)
> > + return reg;
> > +
> > + if (!(reg & ADIN1300_B_100_ZPTM_EN_DIMRX)) {
> > + phydev_err(phydev, "Failed to set lowest common-mode impedance.\n");
> > + return -EINVAL;
> > + }
>
> Under what condition do you think this could happen? Do you think
> there are variants of the hardware which do not have this register?
>
> Andrew

I think he's just reading back the register to make sure the value was really updated...
If we were going to that for every write our lives would be miserable :).

I looked at both adin1200 and adin1300 and they support this in the same way so the above
should just be:

return phy_write_mmd()...

- Nuno Sá