[PATCH 5/8] drm/sti: hdmi: Use the common TMDS char rate constants
From: Javier Martinez Canillas
Date: Tue May 19 2026 - 10:59:57 EST
Replace the 340000000 and 165000000 magic numbers with the shared
constants defined in the <drm/display/drm_hdmi_helper.h> header.
Suggested-by: Maxime Ripard <mripard@xxxxxxxxxx>
Signed-off-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>
---
drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c b/drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c
index d25ecd4f4b67..1c5a54cb999a 100644
--- a/drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c
+++ b/drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c
@@ -4,6 +4,7 @@
* Author: Vincent Abriou <vincent.abriou@xxxxxx> for STMicroelectronics.
*/
+#include <drm/display/drm_hdmi_helper.h>
#include <drm/drm_print.h>
#include "sti_hdmi_tx3g4c28phy.h"
@@ -102,7 +103,7 @@ static bool sti_hdmi_tx3g4c28phy_start(struct sti_hdmi *hdmi)
tmdsck = ckpxpll;
pllctrl |= 40 << PLL_CFG_NDIV_SHIFT;
- if (tmdsck > 340000000) {
+ if (tmdsck > DRM_HDMI_TMDS_CHAR_RATE_MAX_1_3) {
DRM_ERROR("output TMDS clock (%d) out of range\n", tmdsck);
goto err;
}
@@ -135,7 +136,7 @@ static bool sti_hdmi_tx3g4c28phy_start(struct sti_hdmi *hdmi)
HDMI_SRZ_CFG_EN_BIASRES_DETECTION |
HDMI_SRZ_CFG_EN_SINK_TERM_DETECTION);
- if (tmdsck > 165000000)
+ if (tmdsck > DRM_HDMI_TMDS_CHAR_RATE_MAX_1_0)
val |= HDMI_SRZ_CFG_EN_SRC_TERMINATION;
/*
--
2.54.0