From ad96f1fe44bab59f097391b820608974433a7e4c Mon Sep 17 00:00:00 2001 From: xuhuicong Date: Wed, 17 Jan 2018 10:01:18 +0800 Subject: [PATCH] drm: bridge: dw-hdmi: disable scamble when tmdsclk less than 340Mhz to Improve signal compatibility disable scamble when tmdsclk less than 340Mhz by default. and can enable it by define "scramble-low-rates;" in dts file. Change-Id: I0bd5d8e2ea4df065d84018615d4c39cac7ac441a Signed-off-by: xuhuicong --- .../bindings/display/rockchip/dw_hdmi-rockchip.txt | 1 + drivers/gpu/drm/bridge/synopsys/dw-hdmi.c | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt index cf7125ba695a..a125564580fa 100644 --- a/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt +++ b/Documentation/devicetree/bindings/display/rockchip/dw_hdmi-rockchip.txt @@ -44,6 +44,7 @@ Optional properties - unsupported-yuv-input: If yuv input is not supported, set this property. - unsupported-deep-color: If deep color mode is not supported, set this property. - hdcp1x-enable: enable hdcp1.x, enable if defined, disable if not defined +- scramble-low-rates: if defined enable scarmble when tmdsclk less than 340Mhz Example: diff --git a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c index 4f985ecda35c..14d7a92f3024 100644 --- a/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c +++ b/drivers/gpu/drm/bridge/synopsys/dw-hdmi.c @@ -267,6 +267,7 @@ struct dw_hdmi { unsigned int audio_cts; unsigned int audio_n; bool audio_enable; + bool scramble_low_rates; struct extcon_dev *extcon; @@ -2150,7 +2151,8 @@ static void hdmi_av_composer(struct dw_hdmi *hdmi, /* Scrambling Control */ if (dw_hdmi_support_scdc(hdmi)) { if (vmode->mtmdsclock > HDMI14_MAX_TMDSCLK || - hdmi_info->scdc.scrambling.low_rates) { + (hdmi_info->scdc.scrambling.low_rates && + hdmi->scramble_low_rates)) { /* * HDMI2.0 Specifies the following procedure: * After the Source Device has determined that @@ -3868,6 +3870,9 @@ __dw_hdmi_probe(struct platform_device *pdev, dw_hdmi_register_debugfs(dev, hdmi); + if (of_property_read_bool(np, "scramble-low-rates")) + hdmi->scramble_low_rates = true; + if (of_property_read_bool(np, "hdcp1x-enable")) hdcp1x_enable = 1; dw_hdmi_register_hdcp(dev, hdmi, val, hdcp1x_enable);