From nobody Mon Feb 9 16:54:12 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1247D20E035; Fri, 7 Mar 2025 10:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741343406; cv=none; b=brVYj6bbZ0TXDSiD64IVdYZMLXqU7KEqVsRslcX/BNxhB/kuRd3MZUTeNExqn5B4C3aHIpVc1KxY1dqsw0kiF91SJOkszZzKyEc67AsBVMvzbyNq59/W1CZ5wYw0TT6gnGAqE5hq8CZFpzn8VlxLNQ8HaatNwvm8AmG1CiCpuMQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741343406; c=relaxed/simple; bh=u5PIwoXpE4i5c/yw91eUN1ZLY/9JIP8Pu8SR2ZLJDFc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GAPEOqHQfeLYHRnRSnagUBsBBrtrId+i6/8eiLorj6wctaCKIAvTpzWRMwdKZfnhkMnhb4AnHga1DUXL/Onw7nwqxFrYvWKAVl5WwDkNFX2G95x/7aDh8o8SjQoMaKVVdhqA+pKDcz1ZQvFYyA4YLAa5/1cQ7WBom5N5dMVleEc= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=S1BbLK1f; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="S1BbLK1f" Received: by smtp.kernel.org (Postfix) with ESMTPS id 96C5BC4CEE5; Fri, 7 Mar 2025 10:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741343405; bh=u5PIwoXpE4i5c/yw91eUN1ZLY/9JIP8Pu8SR2ZLJDFc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=S1BbLK1fK1YHOwwy904m8XHDqOH5joR/8QUmzsjejiCoZGNQuEYpp1aRoBedzrHNV t9iFE+fXdCG/KKlQclVZltdW8oQdq1ol3Sol89N6Gaxlrr/odmPVPTq/ofPbqeOR36 Z7jWMarayaCw1sNTnCzvE44Xp2k8YGx3UrwKTdpllahzYX5/A2PWuvxowh2fd6LwwN Gv0U5fTo+qPgTqRqFRD4UsqsebXmWLUulD4sSSJAPNnBeCNcrPIu8vs5X6cO9cHSUG q+Hu47ROvHroxTP+B/mM4u+imbWAdR6k9KkiP3hsTfsORAMct5jEul2zT6W91/P1Wc QgtZZANh5Xctg== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 828FDC282DE; Fri, 7 Mar 2025 10:30:05 +0000 (UTC) From: Dimitri Fedrau via B4 Relay Date: Fri, 07 Mar 2025 11:30:01 +0100 Subject: [PATCH net-next 1/3] dt-bindings: net: ethernet-phy: add property mac-series-termination-ohms Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250307-dp83822-mac-impedance-v1-1-bdd85a759b45@liebherr.com> References: <20250307-dp83822-mac-impedance-v1-0-bdd85a759b45@liebherr.com> In-Reply-To: <20250307-dp83822-mac-impedance-v1-0-bdd85a759b45@liebherr.com> To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dimitri Fedrau , Dimitri Fedrau X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741343404; l=1172; i=dimitri.fedrau@liebherr.com; s=20241202; h=from:subject:message-id; bh=ZGmwSQ66d6eh0REzIdZ/UIEpJ5tg0qml7Jgb30CA/sI=; b=saFDSQW7Jz8/Enl1FHon3rf594hns5gXEUgOWurxrpPav7KflToUD4W5QlRvITNlq/ZnSUojD +mRZ/XT/QMcAiir3nldKVFiiC1AKLJyVnxb8wl+3U6i439k7thfBH91 X-Developer-Key: i=dimitri.fedrau@liebherr.com; a=ed25519; pk=rT653x09JSQvotxIqQl4/XiI4AOiBZrdOGvxDUbb5m8= X-Endpoint-Received: by B4 Relay for dimitri.fedrau@liebherr.com/20241202 with auth_id=290 X-Original-From: Dimitri Fedrau Reply-To: dimitri.fedrau@liebherr.com From: Dimitri Fedrau Add property mac-series-termination-ohms in the device tree bindings for selecting the resistance value of the builtin series termination resistors of the PHY. Changing the resistance to an appropriate value can reduce signal reflections and therefore improve signal quality. Signed-off-by: Dimitri Fedrau --- Documentation/devicetree/bindings/net/ethernet-phy.yaml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Documentation/devicetree/bindings/net/ethernet-phy.yaml b/Docu= mentation/devicetree/bindings/net/ethernet-phy.yaml index 824bbe4333b7ed95cc39737d3c334a20aa890f01..4a710315a83ccf15bfc210ae432= ae988cf31e04c 100644 --- a/Documentation/devicetree/bindings/net/ethernet-phy.yaml +++ b/Documentation/devicetree/bindings/net/ethernet-phy.yaml @@ -238,6 +238,11 @@ properties: peak-to-peak specified in ANSI X3.263. When omitted, the PHYs default will be left as is. =20 + mac-series-termination-ohms: + description: + The resistance value of the series termination resistor. When omitte= d, the + PHYs default will be left as is. + leds: type: object =20 --=20 2.39.5 From nobody Mon Feb 9 16:54:12 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 124E020E700; Fri, 7 Mar 2025 10:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741343406; cv=none; b=UmIOB5TyxqkI00Zi1Z0N/AFN1veLiC4qO93pXG6ilqJGc0AaZ5NGbyIItV20pzusTgsWj6/LZSZYxnFdx1MVzLHc5zfN6Dt8zkG2s5R1gxdCZLI21T/fMFMeJUushq6wVBK46KcnH0uvtrsj5pmd9wJWnfTthrvrq+CcQPSoDBM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741343406; c=relaxed/simple; bh=doW7RKw6mRzT+GNEHSidBFZ+p8Q/c2b9a7TUtoCXOMc=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=F6k8GYiEUrpuh2SROnDuiazWXiiFUqF2jWBPKXCgXvT9NB87J6YxRPIbecVdTCSezHzwFFepuJRnWwn1VZuG9OW3uJbXEBtBs9jDN1IU/qyVcnoVru5zy7hiLQe2+dN2d/vfIZCN664qbKSGdUhH5nLVOyP9wZH3nlonzO4faxI= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=KTX+Aqew; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="KTX+Aqew" Received: by smtp.kernel.org (Postfix) with ESMTPS id A0384C4CEE7; Fri, 7 Mar 2025 10:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741343405; bh=doW7RKw6mRzT+GNEHSidBFZ+p8Q/c2b9a7TUtoCXOMc=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=KTX+AqewX3mbNRk22iYLOLrVUUXCttDMKR/okREJfVPcDahg7l+tGnpvClSw0S5KI cTQfbik4WlU41Uf05l4og0bHp6VHwtei5ULzO6aNKX1uPhA2qXEIjdLucerNPJy858 XVqVhdS/50JhMwtlkpkjJI4DqkPkmRAd+z/mG5kbYMe5ocy7oFmEek4FKcE28+TEtz T5W+VLsWUmJ98xmnQMYZwzzNy8+Khu9kag1tGt/to15Jb9ZO9ErqHl2U+C0fZygXRd ZTPC5a5bft5oD5OX4++vhtNgXxKiIPdZfANyjNZ68A3ax6vSWsKfx6MThed5d/N1+u jtZ/J01g91jSQ== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 95EDDC28B25; Fri, 7 Mar 2025 10:30:05 +0000 (UTC) From: Dimitri Fedrau via B4 Relay Date: Fri, 07 Mar 2025 11:30:02 +0100 Subject: [PATCH net-next 2/3] net: phy: Add helper for getting MAC series termination resistance Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250307-dp83822-mac-impedance-v1-2-bdd85a759b45@liebherr.com> References: <20250307-dp83822-mac-impedance-v1-0-bdd85a759b45@liebherr.com> In-Reply-To: <20250307-dp83822-mac-impedance-v1-0-bdd85a759b45@liebherr.com> To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dimitri Fedrau , Dimitri Fedrau X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741343404; l=2019; i=dimitri.fedrau@liebherr.com; s=20241202; h=from:subject:message-id; bh=WXDkCrvzATPSi65GNE8o3JjF1okiabDROoUJFOca/BU=; b=HsvITFP/0xYqQgKZ5aaR6H2UpueG8ibiadZdL3FDAk8+wWN5/uy2FE4Dx4vyvphHrYySYZWeO sEprLXq8I/gAy0Fm1Ol8lEjybCBk8GtLY/vikDlo0YyOKbWuZmg+beQ X-Developer-Key: i=dimitri.fedrau@liebherr.com; a=ed25519; pk=rT653x09JSQvotxIqQl4/XiI4AOiBZrdOGvxDUbb5m8= X-Endpoint-Received: by B4 Relay for dimitri.fedrau@liebherr.com/20241202 with auth_id=290 X-Original-From: Dimitri Fedrau Reply-To: dimitri.fedrau@liebherr.com From: Dimitri Fedrau Add helper which returns the MAC series termination resistance value. Modifying the resistance to an appropriate value can reduce signal reflections and therefore improve signal quality. Signed-off-by: Dimitri Fedrau --- drivers/net/phy/phy_device.c | 15 +++++++++++++++ include/linux/phy.h | 3 +++ 2 files changed, 18 insertions(+) diff --git a/drivers/net/phy/phy_device.c b/drivers/net/phy/phy_device.c index b2d32fbc8c8507f6280e4c3c671466f672c1cc8f..575583aa8b4d49bef796e96059e= 4f0dd56b351f9 100644 --- a/drivers/net/phy/phy_device.c +++ b/drivers/net/phy/phy_device.c @@ -2975,6 +2975,21 @@ int phy_get_tx_amplitude_gain(struct phy_device *phy= dev, struct device *dev, } EXPORT_SYMBOL_GPL(phy_get_tx_amplitude_gain); =20 +/** + * phy_get_mac_series_termination - stores MAC series termination in @val + * @phydev: phy_device struct + * @dev: pointer to the devices device struct + * @val: MAC series termination + * + * Returns: 0 on success, < 0 on failure + */ +int phy_get_mac_series_termination(struct phy_device *phydev, + struct device *dev, u32 *val) +{ + return phy_get_u32_property(dev, "mac-series-termination-ohms", val); +} +EXPORT_SYMBOL_GPL(phy_get_mac_series_termination); + static int phy_led_set_brightness(struct led_classdev *led_cdev, enum led_brightness value) { diff --git a/include/linux/phy.h b/include/linux/phy.h index c4a6385faf41c3156d1a9086eaf5c746640cddbe..633899c4250c91a366849ee0c11= d93feec48262f 100644 --- a/include/linux/phy.h +++ b/include/linux/phy.h @@ -2052,6 +2052,9 @@ int phy_get_tx_amplitude_gain(struct phy_device *phyd= ev, struct device *dev, enum ethtool_link_mode_bit_indices linkmode, u32 *val); =20 +int phy_get_mac_series_termination(struct phy_device *phydev, + struct device *dev, u32 *val); + void phy_resolve_pause(unsigned long *local_adv, unsigned long *partner_ad= v, bool *tx_pause, bool *rx_pause); =20 --=20 2.39.5 From nobody Mon Feb 9 16:54:12 2026 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1240C20E020; Fri, 7 Mar 2025 10:30:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741343406; cv=none; b=lgxDvE0D4aNO1JF+SxpfoPyCTqfAgapXt5hj/Eq2IUtBgHWSETSltl5+s2n97tGRZe3517c1pP1AXJg/J6p5wyZzKYxdztvR8EnVVKzU2Z3jw52z3uFxDMsYQW/gYrxoenFjHO9GKkFULtLpZsNKPe9Zyk/KTAxvP+Hue7kZTCc= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741343406; c=relaxed/simple; bh=UnVbaZ0z+i1Prd0RQ1QzaMpKe/HDNcGioNg7U9KGbjs=; h=From:Date:Subject:MIME-Version:Content-Type:Message-Id:References: In-Reply-To:To:Cc; b=GQKQZRcOjUhdcqSQvFdcseSbrFCUi/w+qtEPZmExxaWlhvO1AqzxZ/uPa7v2b/sFEYZFPDG6a2D975nKCw0xUMFJZ7b3dESpVgf+ZV7YthxESoY5lqi4EdiMK6KLTN4VfOz7kEPr4tDX9pVoqj8Ozh+hd4QkxMX8/YTLv9GR7NY= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=XpojHBoz; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="XpojHBoz" Received: by smtp.kernel.org (Postfix) with ESMTPS id B2031C4CEEB; Fri, 7 Mar 2025 10:30:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1741343405; bh=UnVbaZ0z+i1Prd0RQ1QzaMpKe/HDNcGioNg7U9KGbjs=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To:From; b=XpojHBoz0o0bWbWAaQz7JuCFx9m4i68OdPiB2SqakhKoBxOYbf525veXDofiz/ixY 0euQc5z5J8+KS9vUF+wFyA6iJ4Tg+gdKIqXn9CoCdUss4P0AWFXb52PAHc2PccxM/i 6wgYVPXOMY/448hbT/0wmAmr0MzQen5ZYJsAWmNx/Ezx5eeuwxlU3XRTOFx4qew1Rw /X65d5sGFmvv5o/DIS9Y6wgSJGoqngpscg9grRWJnO+nYG8QAayYBQX4G5Lq+hOgjz AO2GwiAzloyTSK9IwPeYhzwPJ+FD2rn1q1uggyzwGLHZaGJyNFOpn2yx5FiB5du+tm iaxMcHEdKURGA== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id A56B5C19F32; Fri, 7 Mar 2025 10:30:05 +0000 (UTC) From: Dimitri Fedrau via B4 Relay Date: Fri, 07 Mar 2025 11:30:03 +0100 Subject: [PATCH net-next 3/3] net: phy: dp83822: Add support for changing the MAC series termination Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20250307-dp83822-mac-impedance-v1-3-bdd85a759b45@liebherr.com> References: <20250307-dp83822-mac-impedance-v1-0-bdd85a759b45@liebherr.com> In-Reply-To: <20250307-dp83822-mac-impedance-v1-0-bdd85a759b45@liebherr.com> To: Andrew Lunn , Heiner Kallweit , Russell King , "David S. Miller" , Eric Dumazet , Jakub Kicinski , Paolo Abeni , Rob Herring , Krzysztof Kozlowski , Conor Dooley , Florian Fainelli Cc: netdev@vger.kernel.org, devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, Dimitri Fedrau , Dimitri Fedrau X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1741343404; l=3131; i=dimitri.fedrau@liebherr.com; s=20241202; h=from:subject:message-id; bh=HGx3jZ3iRbaor8YQ4l/v589zbjDXDV4BuTqPK5lXQCQ=; b=6xTTwI4vff9S3WRwowD+chdnuG01Uw6ZeqVP8ZOee20QLpuRK7P8h1jklsmWGlm5Kl1GKGjkZ v1SNGmwcxQqCDVBOUb/DCtQ2SjlZx+kZ+aWVKyuZf/u5H7mi875X5AB X-Developer-Key: i=dimitri.fedrau@liebherr.com; a=ed25519; pk=rT653x09JSQvotxIqQl4/XiI4AOiBZrdOGvxDUbb5m8= X-Endpoint-Received: by B4 Relay for dimitri.fedrau@liebherr.com/20241202 with auth_id=290 X-Original-From: Dimitri Fedrau Reply-To: dimitri.fedrau@liebherr.com From: Dimitri Fedrau The dp83822 provides the possibility to set the resistance value of the the MAC series termination. Modifying the resistance to an appropriate value can reduce signal reflections and therefore improve signal quality. Signed-off-by: Dimitri Fedrau --- drivers/net/phy/dp83822.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/drivers/net/phy/dp83822.c b/drivers/net/phy/dp83822.c index 3662f3905d5ade8ad933608fcaeabb714a588418..bd8082cdc00e4abe165ee7c515b= 252eb32149d45 100644 --- a/drivers/net/phy/dp83822.c +++ b/drivers/net/phy/dp83822.c @@ -33,6 +33,7 @@ #define MII_DP83822_MLEDCR 0x25 #define MII_DP83822_LDCTRL 0x403 #define MII_DP83822_LEDCFG1 0x460 +#define MII_DP83822_IOCTRL 0x461 #define MII_DP83822_IOCTRL1 0x462 #define MII_DP83822_IOCTRL2 0x463 #define MII_DP83822_GENCFG 0x465 @@ -118,6 +119,9 @@ #define DP83822_LEDCFG1_LED1_CTRL GENMASK(11, 8) #define DP83822_LEDCFG1_LED3_CTRL GENMASK(7, 4) =20 +/* IOCTRL bits */ +#define DP83822_IOCTRL_MAC_IMPEDANCE_CTRL GENMASK(4, 1) + /* IOCTRL1 bits */ #define DP83822_IOCTRL1_GPIO3_CTRL GENMASK(10, 8) #define DP83822_IOCTRL1_GPIO3_CTRL_LED3 BIT(0) @@ -202,6 +206,8 @@ struct dp83822_private { u32 gpio2_clk_out; bool led_pin_enable[DP83822_MAX_LED_PINS]; int tx_amplitude_100base_tx_index; + bool mac_series_termination_modify; + int mac_series_termination_index; }; =20 static int dp83822_config_wol(struct phy_device *phydev, @@ -533,6 +539,12 @@ static int dp83822_config_init(struct phy_device *phyd= ev) FIELD_PREP(DP83822_100BASE_TX_LINE_DRIVER_SWING, dp83822->tx_amplitude_100base_tx_index)); =20 + if (dp83822->mac_series_termination_modify) + phy_modify_mmd(phydev, MDIO_MMD_VEND2, MII_DP83822_IOCTRL, + DP83822_IOCTRL_MAC_IMPEDANCE_CTRL, + FIELD_PREP(DP83822_IOCTRL_MAC_IMPEDANCE_CTRL, + dp83822->mac_series_termination_index)); + err =3D dp83822_config_init_leds(phydev); if (err) return err; @@ -736,6 +748,10 @@ static const u32 tx_amplitude_100base_tx_gain[] =3D { 93, 95, 97, 98, 100, 102, 103, 105, }; =20 +static const u32 mac_series_termination[] =3D { + 99, 91, 84, 78, 73, 69, 65, 61, 58, 55, 53, 50, 48, 46, 44, 43, +}; + static int dp83822_of_init_leds(struct phy_device *phydev) { struct device_node *node =3D phydev->mdio.dev.of_node; @@ -853,6 +869,26 @@ static int dp83822_of_init(struct phy_device *phydev) } } =20 + dp83822->mac_series_termination_index =3D -1; + ret =3D phy_get_mac_series_termination(phydev, dev, &val); + if (!ret) { + for (i =3D 0; i < ARRAY_SIZE(mac_series_termination); i++) { + if (mac_series_termination[i] =3D=3D val) { + dp83822->mac_series_termination_index =3D i; + break; + } + } + + if (dp83822->mac_series_termination_index < 0) { + phydev_err(phydev, + "Invalid value for mac-series-termination-ohms property (%u)\n", + val); + return -EINVAL; + } + + dp83822->mac_series_termination_modify =3D true; + } + return dp83822_of_init_leds(phydev); } =20 --=20 2.39.5