phy: mediatek: tphy: Cleanup and document slew calibration
authorAngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Mon, 23 Jun 2025 12:03:15 +0000 (14:03 +0200)
committerVinod Koul <vkoul@kernel.org>
Thu, 26 Jun 2025 23:33:42 +0000 (16:33 -0700)
commitd6306fc5d77b7cbdf75a90159f58ebb84ae6f02a
treef7566f26f1ed078e86839515b38bffe12646b79d
parent9cc82c2498b4fac77fb2438080458e42c1d0d5cb
phy: mediatek: tphy: Cleanup and document slew calibration

While it's true that, generally, the T-PHY V3 does not support the
slew calibration process, some minor versions of it actually do,
moreover, some SoCs may not support this even though the version
of the PHY IP does.

The reference clock and rate coefficient parameters are used only
for slew calibration: move those to platform data, then document
and change the checks in hs_slew_rate_calibrate() to perform the
calibration only if:
 - EYE value was not supplied (pre-calculated calibration); and
 - Slew reference clock value is present (not zero); and
 - Slew coefficient is present (not zero).

Moreover, change the probe function to always check if both the
slew reference clock and coefficient properties are present and,
if not, assign the value from platform data (which, as reminder,
if not added means that it's zero!), instead of checking the PHY
IP version.

Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org>
Link: https://lore.kernel.org/r/20250623120315.109881-3-angelogioacchino.delregno@collabora.com
Signed-off-by: Vinod Koul <vkoul@kernel.org>
drivers/phy/mediatek/phy-mtk-tphy.c