Lines Matching full:hdmi

12 #include "hdmi.h"
18 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_power_on() local
19 const struct hdmi_platform_config *config = hdmi->config; in msm_hdmi_power_on()
22 pm_runtime_get_sync(&hdmi->pdev->dev); in msm_hdmi_power_on()
24 ret = regulator_bulk_enable(config->pwr_reg_cnt, hdmi->pwr_regs); in msm_hdmi_power_on()
29 DBG("pixclock: %lu", hdmi->pixclock); in msm_hdmi_power_on()
30 ret = clk_set_rate(hdmi->pwr_clks[0], hdmi->pixclock); in msm_hdmi_power_on()
38 ret = clk_prepare_enable(hdmi->pwr_clks[i]); in msm_hdmi_power_on()
50 struct hdmi *hdmi = hdmi_bridge->hdmi; in power_off() local
51 const struct hdmi_platform_config *config = hdmi->config; in power_off()
60 clk_disable_unprepare(hdmi->pwr_clks[i]); in power_off()
62 ret = regulator_bulk_disable(config->pwr_reg_cnt, hdmi->pwr_regs); in power_off()
66 pm_runtime_put(&hdmi->pdev->dev); in power_off()
71 static void msm_hdmi_config_avi_infoframe(struct hdmi *hdmi) in msm_hdmi_config_avi_infoframe() argument
73 struct drm_crtc *crtc = hdmi->encoder->crtc; in msm_hdmi_config_avi_infoframe()
81 hdmi->connector, mode); in msm_hdmi_config_avi_infoframe()
85 DRM_DEV_ERROR(&hdmi->pdev->dev, in msm_hdmi_config_avi_infoframe()
96 hdmi_write(hdmi, REG_HDMI_AVI_INFO(0), in msm_hdmi_config_avi_infoframe()
102 hdmi_write(hdmi, REG_HDMI_AVI_INFO(1), in msm_hdmi_config_avi_infoframe()
108 hdmi_write(hdmi, REG_HDMI_AVI_INFO(2), in msm_hdmi_config_avi_infoframe()
114 hdmi_write(hdmi, REG_HDMI_AVI_INFO(3), in msm_hdmi_config_avi_infoframe()
119 hdmi_write(hdmi, REG_HDMI_INFOFRAME_CTRL0, in msm_hdmi_config_avi_infoframe()
123 val = hdmi_read(hdmi, REG_HDMI_INFOFRAME_CTRL1); in msm_hdmi_config_avi_infoframe()
126 hdmi_write(hdmi, REG_HDMI_INFOFRAME_CTRL1, val); in msm_hdmi_config_avi_infoframe()
132 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_pre_enable() local
133 struct hdmi_phy *phy = hdmi->phy; in msm_hdmi_bridge_pre_enable()
137 if (!hdmi->power_on) { in msm_hdmi_bridge_pre_enable()
140 hdmi->power_on = true; in msm_hdmi_bridge_pre_enable()
141 if (hdmi->hdmi_mode) { in msm_hdmi_bridge_pre_enable()
142 msm_hdmi_config_avi_infoframe(hdmi); in msm_hdmi_bridge_pre_enable()
143 msm_hdmi_audio_update(hdmi); in msm_hdmi_bridge_pre_enable()
147 msm_hdmi_phy_powerup(phy, hdmi->pixclock); in msm_hdmi_bridge_pre_enable()
149 msm_hdmi_set_mode(hdmi, true); in msm_hdmi_bridge_pre_enable()
151 if (hdmi->hdcp_ctrl) in msm_hdmi_bridge_pre_enable()
152 msm_hdmi_hdcp_on(hdmi->hdcp_ctrl); in msm_hdmi_bridge_pre_enable()
158 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_post_disable() local
159 struct hdmi_phy *phy = hdmi->phy; in msm_hdmi_bridge_post_disable()
161 if (hdmi->hdcp_ctrl) in msm_hdmi_bridge_post_disable()
162 msm_hdmi_hdcp_off(hdmi->hdcp_ctrl); in msm_hdmi_bridge_post_disable()
165 msm_hdmi_set_mode(hdmi, false); in msm_hdmi_bridge_post_disable()
169 if (hdmi->power_on) { in msm_hdmi_bridge_post_disable()
171 hdmi->power_on = false; in msm_hdmi_bridge_post_disable()
172 if (hdmi->hdmi_mode) in msm_hdmi_bridge_post_disable()
173 msm_hdmi_audio_update(hdmi); in msm_hdmi_bridge_post_disable()
183 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_mode_set() local
189 hdmi->pixclock = mode->clock * 1000; in msm_hdmi_bridge_mode_set()
200 hdmi_write(hdmi, REG_HDMI_TOTAL, in msm_hdmi_bridge_mode_set()
204 hdmi_write(hdmi, REG_HDMI_ACTIVE_HSYNC, in msm_hdmi_bridge_mode_set()
207 hdmi_write(hdmi, REG_HDMI_ACTIVE_VSYNC, in msm_hdmi_bridge_mode_set()
212 hdmi_write(hdmi, REG_HDMI_VSYNC_TOTAL_F2, in msm_hdmi_bridge_mode_set()
214 hdmi_write(hdmi, REG_HDMI_VSYNC_ACTIVE_F2, in msm_hdmi_bridge_mode_set()
218 hdmi_write(hdmi, REG_HDMI_VSYNC_TOTAL_F2, in msm_hdmi_bridge_mode_set()
220 hdmi_write(hdmi, REG_HDMI_VSYNC_ACTIVE_F2, in msm_hdmi_bridge_mode_set()
233 hdmi_write(hdmi, REG_HDMI_FRAME_CTRL, frame_ctrl); in msm_hdmi_bridge_mode_set()
235 if (hdmi->hdmi_mode) in msm_hdmi_bridge_mode_set()
236 msm_hdmi_audio_update(hdmi); in msm_hdmi_bridge_mode_set()
243 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_edid_read() local
247 hdmi_ctrl = hdmi_read(hdmi, REG_HDMI_CTRL); in msm_hdmi_bridge_edid_read()
248 hdmi_write(hdmi, REG_HDMI_CTRL, hdmi_ctrl | HDMI_CTRL_ENABLE); in msm_hdmi_bridge_edid_read()
250 drm_edid = drm_edid_read_ddc(connector, hdmi->i2c); in msm_hdmi_bridge_edid_read()
252 hdmi_write(hdmi, REG_HDMI_CTRL, hdmi_ctrl); in msm_hdmi_bridge_edid_read()
262 hdmi->hdmi_mode = drm_detect_hdmi_monitor(edid); in msm_hdmi_bridge_edid_read()
273 struct hdmi *hdmi = hdmi_bridge->hdmi; in msm_hdmi_bridge_mode_valid() local
274 const struct hdmi_platform_config *config = hdmi->config; in msm_hdmi_bridge_mode_valid()
287 requested, hdmi_bridge->hdmi->encoder); in msm_hdmi_bridge_mode_valid()
289 actual = clk_round_rate(hdmi->pwr_clks[0], requested); in msm_hdmi_bridge_mode_valid()
321 int msm_hdmi_bridge_init(struct hdmi *hdmi) in msm_hdmi_bridge_init() argument
327 hdmi_bridge = devm_kzalloc(hdmi->dev->dev, in msm_hdmi_bridge_init()
332 hdmi_bridge->hdmi = hdmi; in msm_hdmi_bridge_init()
337 bridge->ddc = hdmi->i2c; in msm_hdmi_bridge_init()
343 ret = devm_drm_bridge_add(hdmi->dev->dev, bridge); in msm_hdmi_bridge_init()
347 ret = drm_bridge_attach(hdmi->encoder, bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); in msm_hdmi_bridge_init()
351 hdmi->bridge = bridge; in msm_hdmi_bridge_init()