From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Paolo Sabatino Date: Sun, 30 Jun 2024 17:36:02 +0200 Subject: add dw_hdmi_disable() function to DW-HDMI driver --- drivers/video/dw_hdmi.c | 17 ++++++++++ include/dw_hdmi.h | 1 + 2 files changed, 18 insertions(+) diff --git a/drivers/video/dw_hdmi.c b/drivers/video/dw_hdmi.c index 111111111111..222222222222 100644 --- a/drivers/video/dw_hdmi.c +++ b/drivers/video/dw_hdmi.c @@ -1025,6 +1025,23 @@ int dw_hdmi_enable(struct dw_hdmi *hdmi, const struct display_timing *edid) return 0; } +int dw_hdmi_disable(struct dw_hdmi *hdmi) +{ + uint clkdis; + + /* disable pixel clock and tmds data path */ + clkdis = 0x7f; + hdmi_write(hdmi, clkdis, HDMI_MC_CLKDIS); + + /* disable phy */ + hdmi_phy_sel_interface_control(hdmi, 0); + hdmi_phy_enable_tmds(hdmi, 0); + hdmi_phy_enable_power(hdmi, 0); + + return 0; + +} + static const struct dw_hdmi_phy_ops dw_hdmi_synopsys_phy_ops = { .phy_set = dw_hdmi_phy_cfg, }; diff --git a/include/dw_hdmi.h b/include/dw_hdmi.h index 111111111111..222222222222 100644 --- a/include/dw_hdmi.h +++ b/include/dw_hdmi.h @@ -562,6 +562,7 @@ int dw_hdmi_phy_wait_for_hpd(struct dw_hdmi *hdmi); void dw_hdmi_phy_init(struct dw_hdmi *hdmi); int dw_hdmi_enable(struct dw_hdmi *hdmi, const struct display_timing *edid); +int dw_hdmi_disable(struct dw_hdmi *hdmi); int dw_hdmi_read_edid(struct dw_hdmi *hdmi, u8 *buf, int buf_size); void dw_hdmi_init(struct dw_hdmi *hdmi); int dw_hdmi_detect_hpd(struct dw_hdmi *hdmi); -- Armbian