public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Nuno Sá" <noname.nuno@gmail.com>
To: Andrew Lunn <andrew@lunn.ch>,
	Osose Itua <osose.itua@savoirfairelinux.com>
Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org,
	 linux-kernel@vger.kernel.org, michael.hennerich@analog.com,
	 jerome.oufella@savoirfairelinux.com
Subject: Re: [PATCH v2 1/2] net: phy: adin: enable configuration of the LP Termination Register
Date: Wed, 07 Jan 2026 10:18:35 +0000	[thread overview]
Message-ID: <019bcd38dadb138fda4cf8b113c13b77a4581168.camel@gmail.com> (raw)
In-Reply-To: <a587cedd-9450-4c58-bc39-ecbdd525ef65@lunn.ch>

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á

  reply	other threads:[~2026-01-07 10:17 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-12-22 22:21 [PATCH v2 0/2] net: phy: adin: enable configuration of the LP Termination Register Osose Itua
2025-12-22 22:21 ` [PATCH v2 1/2] " Osose Itua
2025-12-23  2:57   ` Subbaraya Sundeep
2025-12-23  7:36   ` Vadim Fedorenko
2025-12-23  9:36   ` Andrew Lunn
2026-01-07 10:18     ` Nuno Sá [this message]
2025-12-23 13:22   ` kernel test robot
2025-12-23 13:33   ` kernel test robot
2025-12-22 22:21 ` [PATCH v2 2/2] dt-bindings: net: adi,adin: document LP Termination property Osose Itua
2025-12-23  9:33   ` Andrew Lunn
2025-12-27 12:29   ` Krzysztof Kozlowski
2026-01-07 10:25     ` Nuno Sá

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=019bcd38dadb138fda4cf8b113c13b77a4581168.camel@gmail.com \
    --to=noname.nuno@gmail.com \
    --cc=andrew@lunn.ch \
    --cc=devicetree@vger.kernel.org \
    --cc=jerome.oufella@savoirfairelinux.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.hennerich@analog.com \
    --cc=netdev@vger.kernel.org \
    --cc=osose.itua@savoirfairelinux.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox