Lines Matching full:hdmi
12 #include "hdmi.h"
14 static void msm_hdmi_phy_reset(struct hdmi *hdmi) in msm_hdmi_phy_reset() argument
18 val = hdmi_read(hdmi, REG_HDMI_PHY_CTRL); in msm_hdmi_phy_reset()
22 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in msm_hdmi_phy_reset()
26 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in msm_hdmi_phy_reset()
32 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in msm_hdmi_phy_reset()
36 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in msm_hdmi_phy_reset()
44 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in msm_hdmi_phy_reset()
48 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in msm_hdmi_phy_reset()
54 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in msm_hdmi_phy_reset()
58 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in msm_hdmi_phy_reset()
63 static void enable_hpd_clocks(struct hdmi *hdmi, bool enable) in enable_hpd_clocks() argument
65 const struct hdmi_platform_config *config = hdmi->config; in enable_hpd_clocks()
66 struct device *dev = &hdmi->pdev->dev; in enable_hpd_clocks()
72 ret = clk_set_rate(hdmi->hpd_clks[i], in enable_hpd_clocks()
80 ret = clk_prepare_enable(hdmi->hpd_clks[i]); in enable_hpd_clocks()
89 clk_disable_unprepare(hdmi->hpd_clks[i]); in enable_hpd_clocks()
96 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_hpd_enable() local
97 const struct hdmi_platform_config *config = hdmi->config; in msm_hdmi_hpd_enable()
98 struct device *dev = &hdmi->pdev->dev; in msm_hdmi_hpd_enable()
103 ret = regulator_bulk_enable(config->hpd_reg_cnt, hdmi->hpd_regs); in msm_hdmi_hpd_enable()
115 if (hdmi->hpd_gpiod) in msm_hdmi_hpd_enable()
116 gpiod_set_value_cansleep(hdmi->hpd_gpiod, 1); in msm_hdmi_hpd_enable()
119 enable_hpd_clocks(hdmi, true); in msm_hdmi_hpd_enable()
121 msm_hdmi_set_mode(hdmi, false); in msm_hdmi_hpd_enable()
122 msm_hdmi_phy_reset(hdmi); in msm_hdmi_hpd_enable()
123 msm_hdmi_set_mode(hdmi, true); in msm_hdmi_hpd_enable()
125 hdmi_write(hdmi, REG_HDMI_USEC_REFTIMER, 0x0001001b); in msm_hdmi_hpd_enable()
128 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, in msm_hdmi_hpd_enable()
133 spin_lock_irqsave(&hdmi->reg_lock, flags); in msm_hdmi_hpd_enable()
134 hpd_ctrl = hdmi_read(hdmi, REG_HDMI_HPD_CTRL); in msm_hdmi_hpd_enable()
138 hdmi_write(hdmi, REG_HDMI_HPD_CTRL, in msm_hdmi_hpd_enable()
140 hdmi_write(hdmi, REG_HDMI_HPD_CTRL, in msm_hdmi_hpd_enable()
142 spin_unlock_irqrestore(&hdmi->reg_lock, flags); in msm_hdmi_hpd_enable()
152 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_hpd_disable() local
153 const struct hdmi_platform_config *config = hdmi->config; in msm_hdmi_hpd_disable()
154 struct device *dev = &hdmi->pdev->dev; in msm_hdmi_hpd_disable()
158 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, 0); in msm_hdmi_hpd_disable()
160 msm_hdmi_set_mode(hdmi, false); in msm_hdmi_hpd_disable()
162 enable_hpd_clocks(hdmi, false); in msm_hdmi_hpd_disable()
169 ret = regulator_bulk_disable(config->hpd_reg_cnt, hdmi->hpd_regs); in msm_hdmi_hpd_disable()
177 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_hpd_irq() local
181 hpd_int_status = hdmi_read(hdmi, REG_HDMI_HPD_INT_STATUS); in msm_hdmi_hpd_irq()
182 hpd_int_ctrl = hdmi_read(hdmi, REG_HDMI_HPD_INT_CTRL); in msm_hdmi_hpd_irq()
189 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, in msm_hdmi_hpd_irq()
198 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, hpd_int_ctrl); in msm_hdmi_hpd_irq()
200 queue_work(hdmi->workq, &hdmi_bridge->hpd_work); in msm_hdmi_hpd_irq()
204 static enum drm_connector_status detect_reg(struct hdmi *hdmi) in detect_reg() argument
208 pm_runtime_get_sync(&hdmi->pdev->dev); in detect_reg()
209 enable_hpd_clocks(hdmi, true); in detect_reg()
211 hpd_int_status = hdmi_read(hdmi, REG_HDMI_HPD_INT_STATUS); in detect_reg()
213 enable_hpd_clocks(hdmi, false); in detect_reg()
214 pm_runtime_put(&hdmi->pdev->dev); in detect_reg()
221 static enum drm_connector_status detect_gpio(struct hdmi *hdmi) in detect_gpio() argument
223 return gpiod_get_value(hdmi->hpd_gpiod) ? in detect_gpio()
232 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_detect() local
240 if (!hdmi->hpd_gpiod) in msm_hdmi_bridge_detect()
241 return detect_reg(hdmi); in msm_hdmi_bridge_detect()
244 stat_gpio = detect_gpio(hdmi); in msm_hdmi_bridge_detect()
245 stat_reg = detect_reg(hdmi); in msm_hdmi_bridge_detect()
254 * so trust that one the most if we didn't manage to get hdmi and in msm_hdmi_bridge_detect()