]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net: phy: adin: enable configuration of the LP Termination Register
authorOsose Itua <osose.itua@savoirfairelinux.com>
Wed, 7 Jan 2026 22:16:53 +0000 (17:16 -0500)
committerJakub Kicinski <kuba@kernel.org>
Fri, 16 Jan 2026 03:36:04 +0000 (19:36 -0800)
The ADIN1200/ADIN1300 provide a control bit that selects between normal
receive termination and the lowest common mode impedance for 100BASE-TX
operation. This behavior is controlled through the Low Power Termination
register (B_100_ZPTM_EN_DIMRX).

Bit 0 of this register enables normal termination when set (this is the
default), and selects the lowest common mode impedance when cleared.

Signed-off-by: Osose Itua <osose.itua@savoirfairelinux.com>
Acked-by: Nuno Sá <nuno.sa@analog.com>
Link: https://patch.msgid.link/20260107221913.1334157-3-osose.itua@savoirfairelinux.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/phy/adin.c

index 7fa713ca8d45252ba1e300eb89e75a1d06b1473f..3a934051b574239844001baf585fd93c3764931d 100644 (file)
@@ -89,6 +89,9 @@
 #define ADIN1300_CLOCK_STOP_REG                        0x9400
 #define ADIN1300_LPI_WAKE_ERR_CNT_REG          0xa000
 
+#define ADIN1300_B_100_ZPTM_DIMRX              0xB685
+#define ADIN1300_B_100_ZPTM_EN_DIMRX           BIT(0)
+
 #define ADIN1300_CDIAG_RUN                     0xba1b
 #define   ADIN1300_CDIAG_RUN_EN                        BIT(0)
 
@@ -522,6 +525,19 @@ static int adin_config_clk_out(struct phy_device *phydev)
                              ADIN1300_GE_CLK_CFG_MASK, sel);
 }
 
+static int adin_config_zptm100(struct phy_device *phydev)
+{
+       struct device *dev = &phydev->mdio.dev;
+
+       if (!(device_property_read_bool(dev, "adi,low-cmode-impedance")))
+               return 0;
+
+       /* clear bit 0 to configure for lowest common-mode impedance */
+       return phy_clear_bits_mmd(phydev, MDIO_MMD_VEND1,
+                                         ADIN1300_B_100_ZPTM_DIMRX,
+                                         ADIN1300_B_100_ZPTM_EN_DIMRX);
+}
+
 static int adin_config_init(struct phy_device *phydev)
 {
        int rc;
@@ -548,6 +564,10 @@ static int adin_config_init(struct phy_device *phydev)
        if (rc < 0)
                return rc;
 
+       rc = adin_config_zptm100(phydev);
+       if (rc < 0)
+               return rc;
+
        phydev_dbg(phydev, "PHY is using mode '%s'\n",
                   phy_modes(phydev->interface));