Lines Matching +full:hdmi +full:- +full:in
1 // SPDX-License-Identifier: GPL-2.0-only
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()
66 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_hpd_enable() local
67 struct device *dev = &hdmi->pdev->dev; in msm_hdmi_hpd_enable()
72 if (hdmi->hpd_gpiod) in msm_hdmi_hpd_enable()
73 gpiod_set_value_cansleep(hdmi->hpd_gpiod, 1); in msm_hdmi_hpd_enable()
79 mutex_lock(&hdmi->state_mutex); in msm_hdmi_hpd_enable()
80 msm_hdmi_set_mode(hdmi, false); in msm_hdmi_hpd_enable()
81 msm_hdmi_phy_reset(hdmi); in msm_hdmi_hpd_enable()
82 msm_hdmi_set_mode(hdmi, true); in msm_hdmi_hpd_enable()
84 hdmi->hpd_enabled = true; in msm_hdmi_hpd_enable()
85 mutex_unlock(&hdmi->state_mutex); in msm_hdmi_hpd_enable()
87 hdmi_write(hdmi, REG_HDMI_USEC_REFTIMER, 0x0001001b); in msm_hdmi_hpd_enable()
90 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, in msm_hdmi_hpd_enable()
95 spin_lock_irqsave(&hdmi->reg_lock, flags); in msm_hdmi_hpd_enable()
96 hpd_ctrl = hdmi_read(hdmi, REG_HDMI_HPD_CTRL); in msm_hdmi_hpd_enable()
100 hdmi_write(hdmi, REG_HDMI_HPD_CTRL, in msm_hdmi_hpd_enable()
102 hdmi_write(hdmi, REG_HDMI_HPD_CTRL, in msm_hdmi_hpd_enable()
104 spin_unlock_irqrestore(&hdmi->reg_lock, flags); in msm_hdmi_hpd_enable()
110 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_hpd_disable() local
111 struct device *dev = &hdmi->pdev->dev; in msm_hdmi_hpd_disable()
114 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, 0); in msm_hdmi_hpd_disable()
116 mutex_lock(&hdmi->state_mutex); in msm_hdmi_hpd_disable()
117 hdmi->hpd_enabled = false; in msm_hdmi_hpd_disable()
118 msm_hdmi_set_mode(hdmi, hdmi->power_on); in msm_hdmi_hpd_disable()
119 mutex_unlock(&hdmi->state_mutex); in msm_hdmi_hpd_disable()
127 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_hpd_irq() local
131 hpd_int_status = hdmi_read(hdmi, REG_HDMI_HPD_INT_STATUS); in msm_hdmi_hpd_irq()
132 hpd_int_ctrl = hdmi_read(hdmi, REG_HDMI_HPD_INT_CTRL); in msm_hdmi_hpd_irq()
139 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, in msm_hdmi_hpd_irq()
148 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, hpd_int_ctrl); in msm_hdmi_hpd_irq()
150 queue_work(hdmi->workq, &hdmi_bridge->hpd_work); in msm_hdmi_hpd_irq()
154 static enum drm_connector_status detect_reg(struct hdmi *hdmi) in detect_reg() argument
159 ret = pm_runtime_resume_and_get(&hdmi->pdev->dev); in detect_reg()
163 hpd_int_status = hdmi_read(hdmi, REG_HDMI_HPD_INT_STATUS); in detect_reg()
166 pm_runtime_put(&hdmi->pdev->dev); in detect_reg()
173 static enum drm_connector_status detect_gpio(struct hdmi *hdmi) in detect_gpio() argument
175 return gpiod_get_value(hdmi->hpd_gpiod) ? in detect_gpio()
184 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_detect() local
190 * provided by REG_HDMI_HPD_INT_STATUS in this case. in msm_hdmi_bridge_detect()
192 if (!hdmi->hpd_gpiod) in msm_hdmi_bridge_detect()
193 return detect_reg(hdmi); in msm_hdmi_bridge_detect()
196 stat_gpio = detect_gpio(hdmi); in msm_hdmi_bridge_detect()
197 stat_reg = detect_reg(hdmi); in msm_hdmi_bridge_detect()
203 } while (--retry); in msm_hdmi_bridge_detect()
206 * so trust that one the most if we didn't manage to get hdmi and in msm_hdmi_bridge_detect()