drm/mediatek: Disable tmds on mt2701
authorchunhui dai <chunhui.dai@mediatek.com>
Fri, 4 Sep 2020 10:59:59 +0000 (12:59 +0200)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Mon, 14 Sep 2020 15:05:23 +0000 (23:05 +0800)
Without that patch if you use specific resolutions like 1280x1024,
I can see distortion in the output. It seems as if the
frequency for updating the pixel of the image is out of sync.

For initialization tmds needs to be active, but can be disabled after init
to fix blurry display

Signed-off-by: chunhui dai <chunhui.dai@mediatek.com>
Signed-off-by: Frank Wunderlich <frank-w@public-files.de>
Tested-by: Frank Wunderlich <frank-w@public-files.de>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/phy/mediatek/phy-mtk-hdmi-mt2701.c
drivers/phy/mediatek/phy-mtk-hdmi.c
drivers/phy/mediatek/phy-mtk-hdmi.h

index a6cb1dea3d0ce6d951b0c340ba7ed341d67340c3..b74c65a1762c72d1a1f5f3f1b838c73f16210048 100644 (file)
@@ -238,6 +238,7 @@ static void mtk_hdmi_phy_disable_tmds(struct mtk_hdmi_phy *hdmi_phy)
 
 struct mtk_hdmi_phy_conf mtk_hdmi_phy_2701_conf = {
        .flags = CLK_SET_RATE_GATE,
+       .pll_default_off = true,
        .hdmi_phy_clk_ops = &mtk_hdmi_phy_pll_ops,
        .hdmi_phy_enable_tmds = mtk_hdmi_phy_enable_tmds,
        .hdmi_phy_disable_tmds = mtk_hdmi_phy_disable_tmds,
index 8fc83f01a72060ad01badf18ae14ae0006f69357..47c029d4b270bbc7b558517374aaffcf5df69feb 100644 (file)
@@ -184,6 +184,9 @@ static int mtk_hdmi_phy_probe(struct platform_device *pdev)
                return PTR_ERR(phy_provider);
        }
 
+       if (hdmi_phy->conf->pll_default_off)
+               hdmi_phy->conf->hdmi_phy_disable_tmds(hdmi_phy);
+
        return of_clk_add_provider(dev->of_node, of_clk_src_simple_get,
                                   hdmi_phy->pll);
 }
index b13e1d5f8e785b888be62d4b48525de9a246dc47..dcf9bb13699b3ba0df3e62d3b7eb1f5a69df979d 100644 (file)
@@ -21,6 +21,7 @@ struct mtk_hdmi_phy;
 
 struct mtk_hdmi_phy_conf {
        unsigned long flags;
+       bool pll_default_off;
        const struct clk_ops *hdmi_phy_clk_ops;
        void (*hdmi_phy_enable_tmds)(struct mtk_hdmi_phy *hdmi_phy);
        void (*hdmi_phy_disable_tmds)(struct mtk_hdmi_phy *hdmi_phy);