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

The old comment referenced "HDMI <= 1.2" but 165 MHz is actually
the maximum TMDS character rate defined by the HDMI 1.0 spec.

Suggested-by: Maxime Ripard <mripard@kernel.org>
Reviewed-by: Chen-Yu Tsai <wens@kernel.org>
Reviewed-by: Maxime Ripard <mripard@kernel.org>
Link: https://patch.msgid.link/20260520144424.1633354-7-javierm@redhat.com
Signed-off-by: Javier Martinez Canillas <javierm@redhat.com>
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c

index 07e2afcb4f95cb3ccc2c7b564880a7774e78415e..74c7c3720ba82f883764d066901710f95a21b4ef 100644 (file)
@@ -189,8 +189,8 @@ sun4i_hdmi_connector_clock_valid(const struct drm_connector *connector,
        if (mode->flags & DRM_MODE_FLAG_DBLCLK)
                return MODE_BAD;
 
-       /* 165 MHz is the typical max pixelclock frequency for HDMI <= 1.2 */
-       if (clock > 165000000)
+       /* HDMI 1.0 max TMDS character rate */
+       if (clock > HDMI_1_0_TMDS_CHAR_RATE_MAX_HZ)
                return MODE_CLOCK_HIGH;
 
        rounded_rate = clk_round_rate(hdmi->tmds_clk, clock);