Lines Matching full:hdmi
12 #include "hdmi.h"
26 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_power_on() local
27 const struct hdmi_platform_config *config = hdmi->config; in msm_hdmi_power_on()
30 pm_runtime_get_sync(&hdmi->pdev->dev); in msm_hdmi_power_on()
32 ret = regulator_bulk_enable(config->pwr_reg_cnt, hdmi->pwr_regs); in msm_hdmi_power_on()
37 DBG("pixclock: %lu", hdmi->pixclock); in msm_hdmi_power_on()
38 ret = clk_set_rate(hdmi->pwr_clks[0], hdmi->pixclock); in msm_hdmi_power_on()
46 ret = clk_prepare_enable(hdmi->pwr_clks[i]); in msm_hdmi_power_on()
58 struct hdmi *hdmi = hdmi_bridge->hdmi; in power_off() local
59 const struct hdmi_platform_config *config = hdmi->config; in power_off()
68 clk_disable_unprepare(hdmi->pwr_clks[i]); in power_off()
70 ret = regulator_bulk_disable(config->pwr_reg_cnt, hdmi->pwr_regs); in power_off()
74 pm_runtime_put(&hdmi->pdev->dev); in power_off()
79 static void msm_hdmi_config_avi_infoframe(struct hdmi *hdmi) in msm_hdmi_config_avi_infoframe() argument
81 struct drm_crtc *crtc = hdmi->encoder->crtc; in msm_hdmi_config_avi_infoframe()
89 hdmi->connector, mode); in msm_hdmi_config_avi_infoframe()
93 DRM_DEV_ERROR(&hdmi->pdev->dev, in msm_hdmi_config_avi_infoframe()
104 hdmi_write(hdmi, REG_HDMI_AVI_INFO(0), in msm_hdmi_config_avi_infoframe()
110 hdmi_write(hdmi, REG_HDMI_AVI_INFO(1), in msm_hdmi_config_avi_infoframe()
116 hdmi_write(hdmi, REG_HDMI_AVI_INFO(2), in msm_hdmi_config_avi_infoframe()
122 hdmi_write(hdmi, REG_HDMI_AVI_INFO(3), in msm_hdmi_config_avi_infoframe()
127 hdmi_write(hdmi, REG_HDMI_INFOFRAME_CTRL0, in msm_hdmi_config_avi_infoframe()
131 val = hdmi_read(hdmi, REG_HDMI_INFOFRAME_CTRL1); in msm_hdmi_config_avi_infoframe()
134 hdmi_write(hdmi, REG_HDMI_INFOFRAME_CTRL1, val); in msm_hdmi_config_avi_infoframe()
140 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_pre_enable() local
141 struct hdmi_phy *phy = hdmi->phy; in msm_hdmi_bridge_pre_enable()
145 if (!hdmi->power_on) { in msm_hdmi_bridge_pre_enable()
148 hdmi->power_on = true; in msm_hdmi_bridge_pre_enable()
149 if (hdmi->hdmi_mode) { in msm_hdmi_bridge_pre_enable()
150 msm_hdmi_config_avi_infoframe(hdmi); in msm_hdmi_bridge_pre_enable()
151 msm_hdmi_audio_update(hdmi); in msm_hdmi_bridge_pre_enable()
155 msm_hdmi_phy_powerup(phy, hdmi->pixclock); in msm_hdmi_bridge_pre_enable()
157 msm_hdmi_set_mode(hdmi, true); in msm_hdmi_bridge_pre_enable()
159 if (hdmi->hdcp_ctrl) in msm_hdmi_bridge_pre_enable()
160 msm_hdmi_hdcp_on(hdmi->hdcp_ctrl); in msm_hdmi_bridge_pre_enable()
166 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_post_disable() local
167 struct hdmi_phy *phy = hdmi->phy; in msm_hdmi_bridge_post_disable()
169 if (hdmi->hdcp_ctrl) in msm_hdmi_bridge_post_disable()
170 msm_hdmi_hdcp_off(hdmi->hdcp_ctrl); in msm_hdmi_bridge_post_disable()
173 msm_hdmi_set_mode(hdmi, false); in msm_hdmi_bridge_post_disable()
177 if (hdmi->power_on) { in msm_hdmi_bridge_post_disable()
179 hdmi->power_on = false; in msm_hdmi_bridge_post_disable()
180 if (hdmi->hdmi_mode) in msm_hdmi_bridge_post_disable()
181 msm_hdmi_audio_update(hdmi); in msm_hdmi_bridge_post_disable()
191 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_mode_set() local
197 hdmi->pixclock = mode->clock * 1000; in msm_hdmi_bridge_mode_set()
208 hdmi_write(hdmi, REG_HDMI_TOTAL, in msm_hdmi_bridge_mode_set()
212 hdmi_write(hdmi, REG_HDMI_ACTIVE_HSYNC, in msm_hdmi_bridge_mode_set()
215 hdmi_write(hdmi, REG_HDMI_ACTIVE_VSYNC, in msm_hdmi_bridge_mode_set()
220 hdmi_write(hdmi, REG_HDMI_VSYNC_TOTAL_F2, in msm_hdmi_bridge_mode_set()
222 hdmi_write(hdmi, REG_HDMI_VSYNC_ACTIVE_F2, in msm_hdmi_bridge_mode_set()
226 hdmi_write(hdmi, REG_HDMI_VSYNC_TOTAL_F2, in msm_hdmi_bridge_mode_set()
228 hdmi_write(hdmi, REG_HDMI_VSYNC_ACTIVE_F2, in msm_hdmi_bridge_mode_set()
241 hdmi_write(hdmi, REG_HDMI_FRAME_CTRL, frame_ctrl); in msm_hdmi_bridge_mode_set()
243 if (hdmi->hdmi_mode) in msm_hdmi_bridge_mode_set()
244 msm_hdmi_audio_update(hdmi); in msm_hdmi_bridge_mode_set()
251 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_get_edid() local
255 hdmi_ctrl = hdmi_read(hdmi, REG_HDMI_CTRL); in msm_hdmi_bridge_get_edid()
256 hdmi_write(hdmi, REG_HDMI_CTRL, hdmi_ctrl | HDMI_CTRL_ENABLE); in msm_hdmi_bridge_get_edid()
258 edid = drm_get_edid(connector, hdmi->i2c); in msm_hdmi_bridge_get_edid()
260 hdmi_write(hdmi, REG_HDMI_CTRL, hdmi_ctrl); in msm_hdmi_bridge_get_edid()
262 hdmi->hdmi_mode = drm_detect_hdmi_monitor(edid); in msm_hdmi_bridge_get_edid()
272 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_mode_valid() local
273 const struct hdmi_platform_config *config = hdmi->config; in msm_hdmi_bridge_mode_valid()
286 requested, hdmi_bridge->hdmi->encoder); in msm_hdmi_bridge_mode_valid()
288 actual = clk_round_rate(hdmi->pwr_clks[0], requested); in msm_hdmi_bridge_mode_valid()
320 struct drm_bridge *msm_hdmi_bridge_init(struct hdmi *hdmi) in msm_hdmi_bridge_init() argument
326 hdmi_bridge = devm_kzalloc(hdmi->dev->dev, in msm_hdmi_bridge_init()
333 hdmi_bridge->hdmi = hdmi; in msm_hdmi_bridge_init()
338 bridge->ddc = hdmi->i2c; in msm_hdmi_bridge_init()
346 ret = drm_bridge_attach(hdmi->encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); in msm_hdmi_bridge_init()