Lines Matching +full:hpd +full:- +full:gpio
1 // SPDX-License-Identifier: GPL-2.0-only
8 #include <linux/gpio/consumer.h>
66 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_hpd_enable()
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()
84 hdmi->hpd_enabled = true; in msm_hdmi_hpd_enable()
85 mutex_unlock(&hdmi->state_mutex); in msm_hdmi_hpd_enable()
89 /* enable HPD events: */ in msm_hdmi_hpd_enable()
95 spin_lock_irqsave(&hdmi->reg_lock, flags); in msm_hdmi_hpd_enable()
99 /* Toggle HPD circuit to trigger HPD sense */ 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()
111 struct device *dev = &hdmi->pdev->dev; in msm_hdmi_hpd_disable()
113 /* Disable HPD interrupt */ 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()
130 /* Process HPD: */ in msm_hdmi_hpd_irq()
138 /* ack & disable (temporarily) HPD events: */ in msm_hdmi_hpd_irq()
150 queue_work(hdmi->workq, &hdmi_bridge->hpd_work); in msm_hdmi_hpd_irq()
159 ret = pm_runtime_resume_and_get(&hdmi->pdev->dev); in detect_reg()
166 pm_runtime_put(&hdmi->pdev->dev); in detect_reg()
175 return gpiod_get_value(hdmi->hpd_gpiod) ? in detect_gpio()
184 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_detect()
189 * some platforms may not have hpd gpio. Rely only on the status in msm_hdmi_bridge_detect()
192 if (!hdmi->hpd_gpiod) in msm_hdmi_bridge_detect()
203 } while (--retry); in msm_hdmi_bridge_detect()
205 /* the status we get from reading gpio seems to be more reliable, in msm_hdmi_bridge_detect()
207 * gpio status to agree: in msm_hdmi_bridge_detect()
211 DBG("hpd gpio tells us: %d", stat_gpio); in msm_hdmi_bridge_detect()