Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/mediatek: Move tz_disabled from mtk_hdmi_phy to mtk_hdmi driver

tz_disabled is used to control mtk_hdmi output signal, but this variable
is stored in mtk_hdmi_phy and mtk_hdmi_phy does not use it. So move
tz_disabled to mtk_hdmi where it's used.

Signed-off-by: CK Hu <ck.hu@mediatek.com>
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
Tested-by: Frank Wunderlich <frank-w@public-files.de>

authored by

CK Hu and committed by
Chun-Kuang Hu
96f51a4d 5aa8e764

+16 -5
+16 -3
drivers/gpu/drm/mediatek/mtk_hdmi.c
··· 145 145 struct hdmi_codec_params codec_params; 146 146 }; 147 147 148 + struct mtk_hdmi_conf { 149 + bool tz_disabled; 150 + }; 151 + 148 152 struct mtk_hdmi { 149 153 struct drm_bridge bridge; 150 154 struct drm_bridge *next_bridge; 151 155 struct drm_connector conn; 152 156 struct device *dev; 157 + const struct mtk_hdmi_conf *conf; 153 158 struct phy *phy; 154 159 struct device *cec_dev; 155 160 struct i2c_adapter *ddc_adpt; ··· 239 234 static void mtk_hdmi_hw_make_reg_writable(struct mtk_hdmi *hdmi, bool enable) 240 235 { 241 236 struct arm_smccc_res res; 242 - struct mtk_hdmi_phy *hdmi_phy = phy_get_drvdata(hdmi->phy); 243 237 244 238 /* 245 239 * MT8173 HDMI hardware has an output control bit to enable/disable HDMI ··· 246 242 * The ARM trusted firmware provides an API for the HDMI driver to set 247 243 * this control bit to enable HDMI output in supervisor mode. 248 244 */ 249 - if (hdmi_phy->conf && hdmi_phy->conf->tz_disabled) 245 + if (hdmi->conf && hdmi->conf->tz_disabled) 250 246 regmap_update_bits(hdmi->sys_regmap, 251 247 hdmi->sys_offset + HDMI_SYS_CFG20, 252 248 0x80008005, enable ? 0x80000005 : 0x8000); ··· 1727 1723 return -ENOMEM; 1728 1724 1729 1725 hdmi->dev = dev; 1726 + hdmi->conf = of_device_get_match_data(dev); 1730 1727 1731 1728 ret = mtk_hdmi_dt_parse_pdata(hdmi, pdev); 1732 1729 if (ret) ··· 1808 1803 static SIMPLE_DEV_PM_OPS(mtk_hdmi_pm_ops, 1809 1804 mtk_hdmi_suspend, mtk_hdmi_resume); 1810 1805 1806 + static const struct mtk_hdmi_conf mtk_hdmi_conf_mt2701 = { 1807 + .tz_disabled = true, 1808 + }; 1809 + 1811 1810 static const struct of_device_id mtk_drm_hdmi_of_ids[] = { 1812 - { .compatible = "mediatek,mt8173-hdmi", }, 1811 + { .compatible = "mediatek,mt2701-hdmi", 1812 + .data = &mtk_hdmi_conf_mt2701, 1813 + }, 1814 + { .compatible = "mediatek,mt8173-hdmi", 1815 + }, 1813 1816 {} 1814 1817 }; 1815 1818
-1
drivers/gpu/drm/mediatek/mtk_hdmi_phy.h
··· 20 20 struct mtk_hdmi_phy; 21 21 22 22 struct mtk_hdmi_phy_conf { 23 - bool tz_disabled; 24 23 unsigned long flags; 25 24 const struct clk_ops *hdmi_phy_clk_ops; 26 25 void (*hdmi_phy_enable_tmds)(struct mtk_hdmi_phy *hdmi_phy);
-1
drivers/gpu/drm/mediatek/mtk_mt2701_hdmi_phy.c
··· 237 237 } 238 238 239 239 struct mtk_hdmi_phy_conf mtk_hdmi_phy_2701_conf = { 240 - .tz_disabled = true, 241 240 .flags = CLK_SET_RATE_GATE, 242 241 .hdmi_phy_clk_ops = &mtk_hdmi_phy_pll_ops, 243 242 .hdmi_phy_enable_tmds = mtk_hdmi_phy_enable_tmds,