Commit c91026a9 authored by Neil Armstrong's avatar Neil Armstrong Committed by Chun-Kuang Hu
Browse files

drm/mediatek: hdmi: Add optional limit on maximal HDMI mode clock



Some SoCs like the MT8167 have a hard limit on the maximal
supported HDMI TMDS clock, so add a configuration value to
filter out those modes.

Signed-off-by: default avatarFabien Parent <fparent@baylibre.com>
Signed-off-by: default avatarNeil Armstrong <narmstrong@baylibre.com>
Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
parent 41ca9caa
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -149,6 +149,7 @@ struct hdmi_audio_param {
struct mtk_hdmi_conf {
	bool tz_disabled;
	bool cea_modes_only;
	unsigned long max_mode_clock;
};

struct mtk_hdmi {
@@ -1226,6 +1227,10 @@ static int mtk_hdmi_bridge_mode_valid(struct drm_bridge *bridge,
	if (hdmi->conf->cea_modes_only && !drm_match_cea_mode(mode))
		return MODE_BAD;

	if (hdmi->conf->max_mode_clock &&
	    mode->clock > hdmi->conf->max_mode_clock)
		return MODE_CLOCK_HIGH;

	if (mode->clock < 27000)
		return MODE_CLOCK_LOW;
	if (mode->clock > 297000)