Lines Matching refs:hdmi
26 struct hdmi *hdmi; member
31 static void hdmi_phy_reset(struct hdmi *hdmi) in hdmi_phy_reset() argument
35 val = hdmi_read(hdmi, REG_HDMI_PHY_CTRL); in hdmi_phy_reset()
39 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in hdmi_phy_reset()
43 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in hdmi_phy_reset()
49 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in hdmi_phy_reset()
53 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in hdmi_phy_reset()
61 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in hdmi_phy_reset()
65 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in hdmi_phy_reset()
71 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in hdmi_phy_reset()
75 hdmi_write(hdmi, REG_HDMI_PHY_CTRL, in hdmi_phy_reset()
80 static int gpio_config(struct hdmi *hdmi, bool on) in gpio_config() argument
82 struct device *dev = &hdmi->pdev->dev; in gpio_config()
83 const struct hdmi_platform_config *config = hdmi->config; in gpio_config()
197 struct hdmi *hdmi = hdmi_connector->hdmi; in hpd_enable() local
198 const struct hdmi_platform_config *config = hdmi->config; in hpd_enable()
199 struct device *dev = &hdmi->pdev->dev; in hpd_enable()
205 ret = regulator_enable(hdmi->hpd_regs[i]); in hpd_enable()
219 ret = gpio_config(hdmi, true); in hpd_enable()
227 ret = clk_set_rate(hdmi->hpd_clks[i], in hpd_enable()
234 ret = clk_prepare_enable(hdmi->hpd_clks[i]); in hpd_enable()
242 hdmi_set_mode(hdmi, false); in hpd_enable()
243 hdmi_phy_reset(hdmi); in hpd_enable()
244 hdmi_set_mode(hdmi, true); in hpd_enable()
246 hdmi_write(hdmi, REG_HDMI_USEC_REFTIMER, 0x0001001b); in hpd_enable()
249 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, in hpd_enable()
254 spin_lock_irqsave(&hdmi->reg_lock, flags); in hpd_enable()
255 hpd_ctrl = hdmi_read(hdmi, REG_HDMI_HPD_CTRL); in hpd_enable()
259 hdmi_write(hdmi, REG_HDMI_HPD_CTRL, in hpd_enable()
261 hdmi_write(hdmi, REG_HDMI_HPD_CTRL, in hpd_enable()
263 spin_unlock_irqrestore(&hdmi->reg_lock, flags); in hpd_enable()
273 struct hdmi *hdmi = hdmi_connector->hdmi; in hdp_disable() local
274 const struct hdmi_platform_config *config = hdmi->config; in hdp_disable()
275 struct device *dev = &hdmi->pdev->dev; in hdp_disable()
279 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, 0); in hdp_disable()
281 hdmi_set_mode(hdmi, false); in hdp_disable()
284 clk_disable_unprepare(hdmi->hpd_clks[i]); in hdp_disable()
286 ret = gpio_config(hdmi, false); in hdp_disable()
295 ret = regulator_disable(hdmi->hpd_regs[i]); in hdp_disable()
314 struct hdmi *hdmi = hdmi_connector->hdmi; in hdmi_connector_irq() local
318 hpd_int_status = hdmi_read(hdmi, REG_HDMI_HPD_INT_STATUS); in hdmi_connector_irq()
319 hpd_int_ctrl = hdmi_read(hdmi, REG_HDMI_HPD_INT_CTRL); in hdmi_connector_irq()
326 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, in hdmi_connector_irq()
335 hdmi_write(hdmi, REG_HDMI_HPD_INT_CTRL, hpd_int_ctrl); in hdmi_connector_irq()
337 queue_work(hdmi->workq, &hdmi_connector->hpd_work); in hdmi_connector_irq()
341 static enum drm_connector_status detect_reg(struct hdmi *hdmi) in detect_reg() argument
343 uint32_t hpd_int_status = hdmi_read(hdmi, REG_HDMI_HPD_INT_STATUS); in detect_reg()
348 static enum drm_connector_status detect_gpio(struct hdmi *hdmi) in detect_gpio() argument
350 const struct hdmi_platform_config *config = hdmi->config; in detect_gpio()
360 struct hdmi *hdmi = hdmi_connector->hdmi; in hdmi_connector_detect() local
365 stat_gpio = detect_gpio(hdmi); in hdmi_connector_detect()
366 stat_reg = detect_reg(hdmi); in hdmi_connector_detect()
401 struct hdmi *hdmi = hdmi_connector->hdmi; in hdmi_connector_get_modes() local
406 hdmi_ctrl = hdmi_read(hdmi, REG_HDMI_CTRL); in hdmi_connector_get_modes()
407 hdmi_write(hdmi, REG_HDMI_CTRL, hdmi_ctrl | HDMI_CTRL_ENABLE); in hdmi_connector_get_modes()
409 edid = drm_get_edid(connector, hdmi->i2c); in hdmi_connector_get_modes()
411 hdmi_write(hdmi, REG_HDMI_CTRL, hdmi_ctrl); in hdmi_connector_get_modes()
413 hdmi->hdmi_mode = drm_detect_hdmi_monitor(edid); in hdmi_connector_get_modes()
428 struct hdmi *hdmi = hdmi_connector->hdmi; in hdmi_connector_mode_valid() local
429 const struct hdmi_platform_config *config = hdmi->config; in hdmi_connector_mode_valid()
436 requested, hdmi_connector->hdmi->encoder); in hdmi_connector_mode_valid()
443 actual = clk_round_rate(hdmi->pwr_clks[0], actual); in hdmi_connector_mode_valid()
457 return hdmi_connector->hdmi->encoder; in hdmi_connector_best_encoder()
477 struct drm_connector *hdmi_connector_init(struct hdmi *hdmi) in hdmi_connector_init() argument
489 hdmi_connector->hdmi = hdmi; in hdmi_connector_init()
494 drm_connector_init(hdmi->dev, connector, &hdmi_connector_funcs, in hdmi_connector_init()
508 dev_err(&hdmi->pdev->dev, "failed to enable HPD: %d\n", ret); in hdmi_connector_init()
512 drm_mode_connector_attach_encoder(connector, hdmi->encoder); in hdmi_connector_init()