]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/sti: hdmi: Use the common TMDS char rate constants
authorJavier Martinez Canillas <javierm@redhat.com>
Wed, 20 May 2026 14:43:41 +0000 (16:43 +0200)
committerJavier Martinez Canillas <javierm@redhat.com>
Thu, 21 May 2026 09:45:52 +0000 (11:45 +0200)
Replace the 340000000 and 165000000 magic numbers with the shared
constants defined in the <linux/hdmi.h> header.

Suggested-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20260520144424.1633354-6-javierm@redhat.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
drivers/gpu/drm/sti/sti_hdmi_tx3g4c28phy.c

index d25ecd4f4b67364bfca8e3e7c1b24f9d8c4dccc1..4fe0c54a096f18c15c06927c7737e8d0d64ce8bf 100644 (file)
@@ -4,6 +4,8 @@
  * Author: Vincent Abriou <vincent.abriou@st.com> for STMicroelectronics.
  */
 
+#include <linux/hdmi.h>
+
 #include <drm/drm_print.h>
 
 #include "sti_hdmi_tx3g4c28phy.h"
@@ -102,7 +104,7 @@ static bool sti_hdmi_tx3g4c28phy_start(struct sti_hdmi *hdmi)
        tmdsck = ckpxpll;
        pllctrl |= 40 << PLL_CFG_NDIV_SHIFT;
 
-       if (tmdsck > 340000000) {
+       if (tmdsck > HDMI_1_3_TMDS_CHAR_RATE_MAX_HZ) {
                DRM_ERROR("output TMDS clock (%d) out of range\n", tmdsck);
                goto err;
        }
@@ -135,7 +137,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 > HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ)
                val |= HDMI_SRZ_CFG_EN_SRC_TERMINATION;
 
        /*