Thread (6 messages) flat view 6 messages, 3 authors, 2022-02-09

Re: [v5] dsa: mv88e6xxx: make serdes SGMII/Fiber tx amplitude configurable

From: Marek Behún <kabel@kernel.org>
Date: 2022-02-09 12:36:43

On Wed,  9 Feb 2022 10:54:27 +0100
Holger Brunck [off-list ref] wrote:
quoted hunk ↗ jump to hunk
@@ -3178,6 +3181,25 @@ static int mv88e6xxx_setup_port(struct mv88e6xxx_chip *chip, int port)
 			return err;
 	}
 
+	if (chip->info->ops->serdes_set_tx_p2p_amplitude) {
+		dp = dsa_to_port(ds, port);
+		if (dp)
+			phy_handle = of_parse_phandle(dp->dn, "phy-handle", 0);
+
+		if (phy_handle && !of_property_read_u32(phy_handle,
+							"tx-p2p-microvolt",
+							&tx_amp)) {
+			err = mv88e6352_serdes_set_tx_p2p_amplitude(chip, port,
+								    tx_amp);
You should use
  err = chip->info->ops->serdes_set_tx_p2p_amplitude(...);
instead of
  err = mv88e6352_serdes_set_tx_p2p_amplitude(...);
since you are adding this operation to the operations structure and
since mv88e6xxx_setup_port() is a generic method.

Sorry, I overlooked this in v4 :-(

Marek
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help