]> git.ipfire.org Git - thirdparty/linux.git/commit
phy: lynx-28g: don't concatenate lynx_28g_lane_rmw() argument "reg" with "val" and...
authorVladimir Oltean <vladimir.oltean@nxp.com>
Tue, 25 Nov 2025 11:48:38 +0000 (13:48 +0200)
committerVinod Koul <vkoul@kernel.org>
Tue, 23 Dec 2025 17:41:06 +0000 (23:11 +0530)
commit6e3d3e8783ae41a7a678093591a2d93044b94ac0
tree273ec72cc82e50f9a3127a86ae529e11f512ec65
parent13a5f7e3fd6dbc49adb950592ba7d76f1211105d
phy: lynx-28g: don't concatenate lynx_28g_lane_rmw() argument "reg" with "val" and "mask"

The last step in having lynx_28g_lane_rmw() arguments that fully point
to their definitions is the removal of the current concatenation logic,
by which e.g. "LNaTGCR0, N_RATE_QUARTER, N_RATE_MSK" is expanded to
"LNaTGCR0, LNaTGCR0_N_RATE_QUARTER, LNaTGCR0_N_RATE_MSK".

There are pros and cons to the above. An advantage is the impossibility
to mix up fields of one register with fields of another. For example
both LNaTGCR0 and LNaRGCR0 contain an N_RATE_QUARTER field (one for the
lane RX direction, one for the lane TX).

But the two notable disadvantages are:

1. the impossibility to write expressions such as logical OR between
   multiple fields. Practically, this forces us to perform more accesses
   to hardware registers than would otherwise be needed. See the LNaGCR0
   access for example.

2. the necessity to invent fields that don't exist, like SGMIIaCR1_SGPCS_DIS,
   in order to clear SGMIIaCR1_SGPCS_EN (the real field name). This is
   confusing, because sometimes, fields that end with _DIS really exist,
   and it's best to not invent new field names.

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20251125114847.804961-7-vladimir.oltean@nxp.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/freescale/phy-fsl-lynx-28g.c