Lines Matching full:hdmi
9 #include "hdmi.h"
13 struct hdmi *hdmi; member
25 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_power_on() local
26 const struct hdmi_platform_config *config = hdmi->config; in msm_hdmi_power_on()
29 pm_runtime_get_sync(&hdmi->pdev->dev); in msm_hdmi_power_on()
32 ret = regulator_enable(hdmi->pwr_regs[i]); in msm_hdmi_power_on()
40 DBG("pixclock: %lu", hdmi->pixclock); in msm_hdmi_power_on()
41 ret = clk_set_rate(hdmi->pwr_clks[0], hdmi->pixclock); in msm_hdmi_power_on()
49 ret = clk_prepare_enable(hdmi->pwr_clks[i]); in msm_hdmi_power_on()
61 struct hdmi *hdmi = hdmi_bridge->hdmi; in power_off() local
62 const struct hdmi_platform_config *config = hdmi->config; in power_off()
71 clk_disable_unprepare(hdmi->pwr_clks[i]); in power_off()
74 ret = regulator_disable(hdmi->pwr_regs[i]); in power_off()
81 pm_runtime_put_autosuspend(&hdmi->pdev->dev); in power_off()
86 static void msm_hdmi_config_avi_infoframe(struct hdmi *hdmi) in msm_hdmi_config_avi_infoframe() argument
88 struct drm_crtc *crtc = hdmi->encoder->crtc; in msm_hdmi_config_avi_infoframe()
96 hdmi->connector, mode); in msm_hdmi_config_avi_infoframe()
100 DRM_DEV_ERROR(&hdmi->pdev->dev, in msm_hdmi_config_avi_infoframe()
111 hdmi_write(hdmi, REG_HDMI_AVI_INFO(0), in msm_hdmi_config_avi_infoframe()
117 hdmi_write(hdmi, REG_HDMI_AVI_INFO(1), in msm_hdmi_config_avi_infoframe()
123 hdmi_write(hdmi, REG_HDMI_AVI_INFO(2), in msm_hdmi_config_avi_infoframe()
129 hdmi_write(hdmi, REG_HDMI_AVI_INFO(3), in msm_hdmi_config_avi_infoframe()
134 hdmi_write(hdmi, REG_HDMI_INFOFRAME_CTRL0, in msm_hdmi_config_avi_infoframe()
138 val = hdmi_read(hdmi, REG_HDMI_INFOFRAME_CTRL1); in msm_hdmi_config_avi_infoframe()
141 hdmi_write(hdmi, REG_HDMI_INFOFRAME_CTRL1, val); in msm_hdmi_config_avi_infoframe()
147 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_pre_enable() local
148 struct hdmi_phy *phy = hdmi->phy; in msm_hdmi_bridge_pre_enable()
152 if (!hdmi->power_on) { in msm_hdmi_bridge_pre_enable()
155 hdmi->power_on = true; in msm_hdmi_bridge_pre_enable()
156 if (hdmi->hdmi_mode) { in msm_hdmi_bridge_pre_enable()
157 msm_hdmi_config_avi_infoframe(hdmi); in msm_hdmi_bridge_pre_enable()
158 msm_hdmi_audio_update(hdmi); in msm_hdmi_bridge_pre_enable()
162 msm_hdmi_phy_powerup(phy, hdmi->pixclock); in msm_hdmi_bridge_pre_enable()
164 msm_hdmi_set_mode(hdmi, true); in msm_hdmi_bridge_pre_enable()
166 if (hdmi->hdcp_ctrl) in msm_hdmi_bridge_pre_enable()
167 msm_hdmi_hdcp_on(hdmi->hdcp_ctrl); in msm_hdmi_bridge_pre_enable()
181 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_post_disable() local
182 struct hdmi_phy *phy = hdmi->phy; in msm_hdmi_bridge_post_disable()
184 if (hdmi->hdcp_ctrl) in msm_hdmi_bridge_post_disable()
185 msm_hdmi_hdcp_off(hdmi->hdcp_ctrl); in msm_hdmi_bridge_post_disable()
188 msm_hdmi_set_mode(hdmi, false); in msm_hdmi_bridge_post_disable()
192 if (hdmi->power_on) { in msm_hdmi_bridge_post_disable()
194 hdmi->power_on = false; in msm_hdmi_bridge_post_disable()
195 if (hdmi->hdmi_mode) in msm_hdmi_bridge_post_disable()
196 msm_hdmi_audio_update(hdmi); in msm_hdmi_bridge_post_disable()
206 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_mode_set() local
212 hdmi->pixclock = mode->clock * 1000; in msm_hdmi_bridge_mode_set()
223 hdmi_write(hdmi, REG_HDMI_TOTAL, in msm_hdmi_bridge_mode_set()
227 hdmi_write(hdmi, REG_HDMI_ACTIVE_HSYNC, in msm_hdmi_bridge_mode_set()
230 hdmi_write(hdmi, REG_HDMI_ACTIVE_VSYNC, in msm_hdmi_bridge_mode_set()
235 hdmi_write(hdmi, REG_HDMI_VSYNC_TOTAL_F2, in msm_hdmi_bridge_mode_set()
237 hdmi_write(hdmi, REG_HDMI_VSYNC_ACTIVE_F2, in msm_hdmi_bridge_mode_set()
241 hdmi_write(hdmi, REG_HDMI_VSYNC_TOTAL_F2, in msm_hdmi_bridge_mode_set()
243 hdmi_write(hdmi, REG_HDMI_VSYNC_ACTIVE_F2, in msm_hdmi_bridge_mode_set()
256 hdmi_write(hdmi, REG_HDMI_FRAME_CTRL, frame_ctrl); in msm_hdmi_bridge_mode_set()
258 if (hdmi->hdmi_mode) in msm_hdmi_bridge_mode_set()
259 msm_hdmi_audio_update(hdmi); in msm_hdmi_bridge_mode_set()
272 struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) in msm_hdmi_bridge_init() argument
278 hdmi_bridge = devm_kzalloc(hdmi->dev->dev, in msm_hdmi_bridge_init()
285 hdmi_bridge->hdmi = hdmi; in msm_hdmi_bridge_init()
290 ret = drm_bridge_attach(hdmi->encoder, bridge, NULL, 0); in msm_hdmi_bridge_init()