Lines Matching full:hdmi
62 static inline u8 hdmi_readb(struct rk3066_hdmi *hdmi, u16 offset) in hdmi_readb() argument
64 return readl_relaxed(hdmi->regs + offset); in hdmi_readb()
67 static inline void hdmi_writeb(struct rk3066_hdmi *hdmi, u16 offset, u32 val) in hdmi_writeb() argument
69 writel_relaxed(val, hdmi->regs + offset); in hdmi_writeb()
72 static inline void hdmi_modb(struct rk3066_hdmi *hdmi, u16 offset, in hdmi_modb() argument
75 u8 temp = hdmi_readb(hdmi, offset) & ~msk; in hdmi_modb()
78 hdmi_writeb(hdmi, offset, temp); in hdmi_modb()
81 static void rk3066_hdmi_i2c_init(struct rk3066_hdmi *hdmi) in rk3066_hdmi_i2c_init() argument
85 ddc_bus_freq = (hdmi->tmdsclk >> 2) / HDMI_SCL_RATE; in rk3066_hdmi_i2c_init()
87 hdmi_writeb(hdmi, HDMI_DDC_BUS_FREQ_L, ddc_bus_freq & 0xFF); in rk3066_hdmi_i2c_init()
88 hdmi_writeb(hdmi, HDMI_DDC_BUS_FREQ_H, (ddc_bus_freq >> 8) & 0xFF); in rk3066_hdmi_i2c_init()
91 hdmi_modb(hdmi, HDMI_INTR_MASK1, HDMI_INTR_EDID_MASK, 0); in rk3066_hdmi_i2c_init()
92 hdmi_writeb(hdmi, HDMI_INTR_STATUS1, HDMI_INTR_EDID_MASK); in rk3066_hdmi_i2c_init()
95 static inline u8 rk3066_hdmi_get_power_mode(struct rk3066_hdmi *hdmi) in rk3066_hdmi_get_power_mode() argument
97 return hdmi_readb(hdmi, HDMI_SYS_CTRL) & HDMI_SYS_POWER_MODE_MASK; in rk3066_hdmi_get_power_mode()
100 static void rk3066_hdmi_set_power_mode(struct rk3066_hdmi *hdmi, int mode) in rk3066_hdmi_set_power_mode() argument
105 current_mode = rk3066_hdmi_get_power_mode(hdmi); in rk3066_hdmi_set_power_mode()
107 DRM_DEV_DEBUG(hdmi->dev, "mode :%d\n", mode); in rk3066_hdmi_set_power_mode()
108 DRM_DEV_DEBUG(hdmi->dev, "current_mode :%d\n", current_mode); in rk3066_hdmi_set_power_mode()
123 DRM_DEV_DEBUG(hdmi->dev, "%d: next_mode :%d\n", i, next_mode); in rk3066_hdmi_set_power_mode()
126 hdmi_modb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_set_power_mode()
129 hdmi_writeb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_set_power_mode()
133 hdmi_writeb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_set_power_mode()
137 hdmi_writeb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_set_power_mode()
151 hdmi->tmdsclk = DEFAULT_PLLA_RATE; in rk3066_hdmi_set_power_mode()
155 rk3066_hdmi_upload_frame(struct rk3066_hdmi *hdmi, int setup_rc, in rk3066_hdmi_upload_frame() argument
160 hdmi_modb(hdmi, HDMI_CP_AUTO_SEND_CTRL, mask, disable); in rk3066_hdmi_upload_frame()
162 hdmi_writeb(hdmi, HDMI_CP_BUF_INDEX, frame_index); in rk3066_hdmi_upload_frame()
174 hdmi_writeb(hdmi, HDMI_CP_BUF_ACC_HB0 + i * 4, in rk3066_hdmi_upload_frame()
178 hdmi_modb(hdmi, HDMI_CP_AUTO_SEND_CTRL, mask, enable); in rk3066_hdmi_upload_frame()
184 static int rk3066_hdmi_config_avi(struct rk3066_hdmi *hdmi, in rk3066_hdmi_config_avi() argument
191 &hdmi->connector, mode); in rk3066_hdmi_config_avi()
193 if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) in rk3066_hdmi_config_avi()
195 else if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV422) in rk3066_hdmi_config_avi()
200 frame.avi.colorimetry = hdmi->hdmi_data.colorimetry; in rk3066_hdmi_config_avi()
203 return rk3066_hdmi_upload_frame(hdmi, rc, &frame, in rk3066_hdmi_config_avi()
207 static int rk3066_hdmi_config_video_timing(struct rk3066_hdmi *hdmi, in rk3066_hdmi_config_video_timing() argument
221 if (hdmi->hdmi_data.vic == 2 || hdmi->hdmi_data.vic == 3) in rk3066_hdmi_config_video_timing()
227 hdmi_writeb(hdmi, HDMI_EXT_VIDEO_PARA, value); in rk3066_hdmi_config_video_timing()
231 hdmi_writeb(hdmi, HDMI_EXT_HTOTAL_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
232 hdmi_writeb(hdmi, HDMI_EXT_HTOTAL_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
235 hdmi_writeb(hdmi, HDMI_EXT_HBLANK_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
236 hdmi_writeb(hdmi, HDMI_EXT_HBLANK_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
239 hdmi_writeb(hdmi, HDMI_EXT_HDELAY_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
240 hdmi_writeb(hdmi, HDMI_EXT_HDELAY_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
243 hdmi_writeb(hdmi, HDMI_EXT_HDURATION_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
244 hdmi_writeb(hdmi, HDMI_EXT_HDURATION_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
247 hdmi_writeb(hdmi, HDMI_EXT_VTOTAL_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
248 hdmi_writeb(hdmi, HDMI_EXT_VTOTAL_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
251 hdmi_writeb(hdmi, HDMI_EXT_VBLANK_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
254 hdmi_writeb(hdmi, HDMI_EXT_VDELAY, value & 0xFF); in rk3066_hdmi_config_video_timing()
257 hdmi_writeb(hdmi, HDMI_EXT_VDURATION, value & 0xFF); in rk3066_hdmi_config_video_timing()
263 rk3066_hdmi_phy_write(struct rk3066_hdmi *hdmi, u16 offset, u8 value) in rk3066_hdmi_phy_write() argument
265 hdmi_writeb(hdmi, offset, value); in rk3066_hdmi_phy_write()
266 hdmi_modb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_phy_write()
269 hdmi_modb(hdmi, HDMI_SYS_CTRL, HDMI_SYS_PLL_RESET_MASK, 0); in rk3066_hdmi_phy_write()
273 static void rk3066_hdmi_config_phy(struct rk3066_hdmi *hdmi) in rk3066_hdmi_config_phy() argument
276 hdmi_writeb(hdmi, HDMI_DEEP_COLOR_MODE, 0x22); in rk3066_hdmi_config_phy()
279 * The semi-public documentation does not describe the hdmi registers in rk3066_hdmi_config_phy()
283 if (hdmi->tmdsclk > 100000000) { in rk3066_hdmi_config_phy()
284 rk3066_hdmi_phy_write(hdmi, 0x158, 0x0E); in rk3066_hdmi_config_phy()
285 rk3066_hdmi_phy_write(hdmi, 0x15c, 0x00); in rk3066_hdmi_config_phy()
286 rk3066_hdmi_phy_write(hdmi, 0x160, 0x60); in rk3066_hdmi_config_phy()
287 rk3066_hdmi_phy_write(hdmi, 0x164, 0x00); in rk3066_hdmi_config_phy()
288 rk3066_hdmi_phy_write(hdmi, 0x168, 0xDA); in rk3066_hdmi_config_phy()
289 rk3066_hdmi_phy_write(hdmi, 0x16c, 0xA1); in rk3066_hdmi_config_phy()
290 rk3066_hdmi_phy_write(hdmi, 0x170, 0x0e); in rk3066_hdmi_config_phy()
291 rk3066_hdmi_phy_write(hdmi, 0x174, 0x22); in rk3066_hdmi_config_phy()
292 rk3066_hdmi_phy_write(hdmi, 0x178, 0x00); in rk3066_hdmi_config_phy()
293 } else if (hdmi->tmdsclk > 50000000) { in rk3066_hdmi_config_phy()
294 rk3066_hdmi_phy_write(hdmi, 0x158, 0x06); in rk3066_hdmi_config_phy()
295 rk3066_hdmi_phy_write(hdmi, 0x15c, 0x00); in rk3066_hdmi_config_phy()
296 rk3066_hdmi_phy_write(hdmi, 0x160, 0x60); in rk3066_hdmi_config_phy()
297 rk3066_hdmi_phy_write(hdmi, 0x164, 0x00); in rk3066_hdmi_config_phy()
298 rk3066_hdmi_phy_write(hdmi, 0x168, 0xCA); in rk3066_hdmi_config_phy()
299 rk3066_hdmi_phy_write(hdmi, 0x16c, 0xA3); in rk3066_hdmi_config_phy()
300 rk3066_hdmi_phy_write(hdmi, 0x170, 0x0e); in rk3066_hdmi_config_phy()
301 rk3066_hdmi_phy_write(hdmi, 0x174, 0x20); in rk3066_hdmi_config_phy()
302 rk3066_hdmi_phy_write(hdmi, 0x178, 0x00); in rk3066_hdmi_config_phy()
304 rk3066_hdmi_phy_write(hdmi, 0x158, 0x02); in rk3066_hdmi_config_phy()
305 rk3066_hdmi_phy_write(hdmi, 0x15c, 0x00); in rk3066_hdmi_config_phy()
306 rk3066_hdmi_phy_write(hdmi, 0x160, 0x60); in rk3066_hdmi_config_phy()
307 rk3066_hdmi_phy_write(hdmi, 0x164, 0x00); in rk3066_hdmi_config_phy()
308 rk3066_hdmi_phy_write(hdmi, 0x168, 0xC2); in rk3066_hdmi_config_phy()
309 rk3066_hdmi_phy_write(hdmi, 0x16c, 0xA2); in rk3066_hdmi_config_phy()
310 rk3066_hdmi_phy_write(hdmi, 0x170, 0x0e); in rk3066_hdmi_config_phy()
311 rk3066_hdmi_phy_write(hdmi, 0x174, 0x20); in rk3066_hdmi_config_phy()
312 rk3066_hdmi_phy_write(hdmi, 0x178, 0x00); in rk3066_hdmi_config_phy()
316 static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi, in rk3066_hdmi_setup() argument
319 hdmi->hdmi_data.vic = drm_match_cea_mode(mode); in rk3066_hdmi_setup()
320 hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; in rk3066_hdmi_setup()
322 if (hdmi->hdmi_data.vic == 6 || hdmi->hdmi_data.vic == 7 || in rk3066_hdmi_setup()
323 hdmi->hdmi_data.vic == 21 || hdmi->hdmi_data.vic == 22 || in rk3066_hdmi_setup()
324 hdmi->hdmi_data.vic == 2 || hdmi->hdmi_data.vic == 3 || in rk3066_hdmi_setup()
325 hdmi->hdmi_data.vic == 17 || hdmi->hdmi_data.vic == 18) in rk3066_hdmi_setup()
326 hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; in rk3066_hdmi_setup()
328 hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; in rk3066_hdmi_setup()
330 hdmi->tmdsclk = mode->clock * 1000; in rk3066_hdmi_setup()
333 hdmi_modb(hdmi, HDMI_VIDEO_CTRL2, HDMI_VIDEO_AUDIO_DISABLE_MASK, in rk3066_hdmi_setup()
337 if (rk3066_hdmi_get_power_mode(hdmi) != HDMI_SYS_POWER_MODE_B) in rk3066_hdmi_setup()
338 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_B); in rk3066_hdmi_setup()
341 hdmi_modb(hdmi, HDMI_AV_CTRL1, in rk3066_hdmi_setup()
343 hdmi_writeb(hdmi, HDMI_VIDEO_CTRL1, in rk3066_hdmi_setup()
347 hdmi_writeb(hdmi, HDMI_DEEP_COLOR_MODE, 0x20); in rk3066_hdmi_setup()
349 rk3066_hdmi_config_video_timing(hdmi, mode); in rk3066_hdmi_setup()
351 if (hdmi->hdmi_data.sink_is_hdmi) { in rk3066_hdmi_setup()
352 hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK, in rk3066_hdmi_setup()
354 rk3066_hdmi_config_avi(hdmi, mode); in rk3066_hdmi_setup()
356 hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK, 0); in rk3066_hdmi_setup()
359 rk3066_hdmi_config_phy(hdmi); in rk3066_hdmi_setup()
361 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_E); in rk3066_hdmi_setup()
369 rk3066_hdmi_i2c_init(hdmi); in rk3066_hdmi_setup()
372 hdmi_modb(hdmi, HDMI_VIDEO_CTRL2, in rk3066_hdmi_setup()
382 struct rk3066_hdmi *hdmi = to_rk3066_hdmi(encoder); in rk3066_hdmi_encoder_mode_set() local
385 memcpy(&hdmi->previous_mode, adj_mode, sizeof(hdmi->previous_mode)); in rk3066_hdmi_encoder_mode_set()
390 struct rk3066_hdmi *hdmi = to_rk3066_hdmi(encoder); in rk3066_hdmi_encoder_enable() local
393 mux = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder); in rk3066_hdmi_encoder_enable()
399 regmap_write(hdmi->grf_regmap, GRF_SOC_CON0, val); in rk3066_hdmi_encoder_enable()
401 DRM_DEV_DEBUG(hdmi->dev, "hdmi encoder enable select: vop%s\n", in rk3066_hdmi_encoder_enable()
404 rk3066_hdmi_setup(hdmi, &hdmi->previous_mode); in rk3066_hdmi_encoder_enable()
409 struct rk3066_hdmi *hdmi = to_rk3066_hdmi(encoder); in rk3066_hdmi_encoder_disable() local
411 DRM_DEV_DEBUG(hdmi->dev, "hdmi encoder disable\n"); in rk3066_hdmi_encoder_disable()
413 if (rk3066_hdmi_get_power_mode(hdmi) == HDMI_SYS_POWER_MODE_E) { in rk3066_hdmi_encoder_disable()
414 hdmi_writeb(hdmi, HDMI_VIDEO_CTRL2, in rk3066_hdmi_encoder_disable()
416 hdmi_modb(hdmi, HDMI_VIDEO_CTRL2, in rk3066_hdmi_encoder_disable()
421 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_A); in rk3066_hdmi_encoder_disable()
461 struct rk3066_hdmi *hdmi = to_rk3066_hdmi(connector); in rk3066_hdmi_connector_detect() local
463 return (hdmi_readb(hdmi, HDMI_HPG_MENS_STA) & HDMI_HPG_IN_STATUS_HIGH) ? in rk3066_hdmi_connector_detect()
469 struct rk3066_hdmi *hdmi = to_rk3066_hdmi(connector); in rk3066_hdmi_connector_get_modes() local
473 if (!hdmi->ddc) in rk3066_hdmi_connector_get_modes()
476 edid = drm_get_edid(connector, hdmi->ddc); in rk3066_hdmi_connector_get_modes()
478 hdmi->hdmi_data.sink_is_hdmi = drm_detect_hdmi_monitor(edid); in rk3066_hdmi_connector_get_modes()
502 struct rk3066_hdmi *hdmi = to_rk3066_hdmi(connector); in rk3066_hdmi_connector_best_encoder() local
504 return &hdmi->encoder; in rk3066_hdmi_connector_best_encoder()
542 rk3066_hdmi_register(struct drm_device *drm, struct rk3066_hdmi *hdmi) in rk3066_hdmi_register() argument
544 struct drm_encoder *encoder = &hdmi->encoder; in rk3066_hdmi_register()
545 struct device *dev = hdmi->dev; in rk3066_hdmi_register()
563 hdmi->connector.polled = DRM_CONNECTOR_POLL_HPD; in rk3066_hdmi_register()
565 drm_connector_helper_add(&hdmi->connector, in rk3066_hdmi_register()
567 drm_connector_init(drm, &hdmi->connector, in rk3066_hdmi_register()
571 drm_connector_attach_encoder(&hdmi->connector, encoder); in rk3066_hdmi_register()
578 struct rk3066_hdmi *hdmi = dev_id; in rk3066_hdmi_hardirq() local
582 if (rk3066_hdmi_get_power_mode(hdmi) == HDMI_SYS_POWER_MODE_A) in rk3066_hdmi_hardirq()
583 hdmi_writeb(hdmi, HDMI_SYS_CTRL, HDMI_SYS_POWER_MODE_B); in rk3066_hdmi_hardirq()
585 interrupt = hdmi_readb(hdmi, HDMI_INTR_STATUS1); in rk3066_hdmi_hardirq()
587 hdmi_writeb(hdmi, HDMI_INTR_STATUS1, interrupt); in rk3066_hdmi_hardirq()
590 hdmi->i2c->stat = interrupt; in rk3066_hdmi_hardirq()
591 complete(&hdmi->i2c->cmpltn); in rk3066_hdmi_hardirq()
602 struct rk3066_hdmi *hdmi = dev_id; in rk3066_hdmi_irq() local
604 drm_helper_hpd_irq_event(hdmi->connector.dev); in rk3066_hdmi_irq()
609 static int rk3066_hdmi_i2c_read(struct rk3066_hdmi *hdmi, struct i2c_msg *msgs) in rk3066_hdmi_i2c_read() argument
615 ret = wait_for_completion_timeout(&hdmi->i2c->cmpltn, HZ / 10); in rk3066_hdmi_i2c_read()
616 if (!ret || hdmi->i2c->stat & HDMI_INTR_EDID_ERR) in rk3066_hdmi_i2c_read()
620 *buf++ = hdmi_readb(hdmi, HDMI_DDC_READ_FIFO_ADDR); in rk3066_hdmi_i2c_read()
625 static int rk3066_hdmi_i2c_write(struct rk3066_hdmi *hdmi, struct i2c_msg *msgs) in rk3066_hdmi_i2c_write() argument
636 reinit_completion(&hdmi->i2c->cmpltn); in rk3066_hdmi_i2c_write()
639 hdmi->i2c->segment_addr = msgs->buf[0]; in rk3066_hdmi_i2c_write()
641 hdmi->i2c->ddc_addr = msgs->buf[0]; in rk3066_hdmi_i2c_write()
644 hdmi_writeb(hdmi, HDMI_EDID_WORD_ADDR, hdmi->i2c->ddc_addr); in rk3066_hdmi_i2c_write()
647 hdmi_writeb(hdmi, HDMI_EDID_SEGMENT_POINTER, hdmi->i2c->segment_addr); in rk3066_hdmi_i2c_write()
655 struct rk3066_hdmi *hdmi = i2c_get_adapdata(adap); in rk3066_hdmi_i2c_xfer() local
656 struct rk3066_hdmi_i2c *i2c = hdmi->i2c; in rk3066_hdmi_i2c_xfer()
661 rk3066_hdmi_i2c_init(hdmi); in rk3066_hdmi_i2c_xfer()
663 /* Unmute HDMI EDID interrupt. */ in rk3066_hdmi_i2c_xfer()
664 hdmi_modb(hdmi, HDMI_INTR_MASK1, in rk3066_hdmi_i2c_xfer()
669 DRM_DEV_DEBUG(hdmi->dev, in rk3066_hdmi_i2c_xfer()
674 ret = rk3066_hdmi_i2c_read(hdmi, &msgs[i]); in rk3066_hdmi_i2c_xfer()
676 ret = rk3066_hdmi_i2c_write(hdmi, &msgs[i]); in rk3066_hdmi_i2c_xfer()
685 /* Mute HDMI EDID interrupt. */ in rk3066_hdmi_i2c_xfer()
686 hdmi_modb(hdmi, HDMI_INTR_MASK1, HDMI_INTR_EDID_MASK, 0); in rk3066_hdmi_i2c_xfer()
703 static struct i2c_adapter *rk3066_hdmi_i2c_adapter(struct rk3066_hdmi *hdmi) in rk3066_hdmi_i2c_adapter() argument
709 i2c = devm_kzalloc(hdmi->dev, sizeof(*i2c), GFP_KERNEL); in rk3066_hdmi_i2c_adapter()
719 adap->dev.parent = hdmi->dev; in rk3066_hdmi_i2c_adapter()
720 adap->dev.of_node = hdmi->dev->of_node; in rk3066_hdmi_i2c_adapter()
722 strlcpy(adap->name, "RK3066 HDMI", sizeof(adap->name)); in rk3066_hdmi_i2c_adapter()
723 i2c_set_adapdata(adap, hdmi); in rk3066_hdmi_i2c_adapter()
727 DRM_DEV_ERROR(hdmi->dev, "cannot add %s I2C adapter\n", in rk3066_hdmi_i2c_adapter()
729 devm_kfree(hdmi->dev, i2c); in rk3066_hdmi_i2c_adapter()
733 hdmi->i2c = i2c; in rk3066_hdmi_i2c_adapter()
735 DRM_DEV_DEBUG(hdmi->dev, "registered %s I2C bus driver\n", adap->name); in rk3066_hdmi_i2c_adapter()
745 struct rk3066_hdmi *hdmi; in rk3066_hdmi_bind() local
750 hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL); in rk3066_hdmi_bind()
751 if (!hdmi) in rk3066_hdmi_bind()
754 hdmi->dev = dev; in rk3066_hdmi_bind()
755 hdmi->drm_dev = drm; in rk3066_hdmi_bind()
761 hdmi->regs = devm_ioremap_resource(dev, iores); in rk3066_hdmi_bind()
762 if (IS_ERR(hdmi->regs)) in rk3066_hdmi_bind()
763 return PTR_ERR(hdmi->regs); in rk3066_hdmi_bind()
769 hdmi->hclk = devm_clk_get(dev, "hclk"); in rk3066_hdmi_bind()
770 if (IS_ERR(hdmi->hclk)) { in rk3066_hdmi_bind()
771 DRM_DEV_ERROR(dev, "unable to get HDMI hclk clock\n"); in rk3066_hdmi_bind()
772 return PTR_ERR(hdmi->hclk); in rk3066_hdmi_bind()
775 ret = clk_prepare_enable(hdmi->hclk); in rk3066_hdmi_bind()
777 DRM_DEV_ERROR(dev, "cannot enable HDMI hclk clock: %d\n", ret); in rk3066_hdmi_bind()
781 hdmi->grf_regmap = syscon_regmap_lookup_by_phandle(dev->of_node, in rk3066_hdmi_bind()
783 if (IS_ERR(hdmi->grf_regmap)) { in rk3066_hdmi_bind()
785 ret = PTR_ERR(hdmi->grf_regmap); in rk3066_hdmi_bind()
790 hdmi_writeb(hdmi, HDMI_INTERNAL_CLK_DIVIDER, 25); in rk3066_hdmi_bind()
792 hdmi->ddc = rk3066_hdmi_i2c_adapter(hdmi); in rk3066_hdmi_bind()
793 if (IS_ERR(hdmi->ddc)) { in rk3066_hdmi_bind()
794 ret = PTR_ERR(hdmi->ddc); in rk3066_hdmi_bind()
795 hdmi->ddc = NULL; in rk3066_hdmi_bind()
799 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_B); in rk3066_hdmi_bind()
801 hdmi_writeb(hdmi, HDMI_INTR_MASK1, HDMI_INTR_HOTPLUG); in rk3066_hdmi_bind()
802 hdmi_writeb(hdmi, HDMI_INTR_MASK2, 0); in rk3066_hdmi_bind()
803 hdmi_writeb(hdmi, HDMI_INTR_MASK3, 0); in rk3066_hdmi_bind()
804 hdmi_writeb(hdmi, HDMI_INTR_MASK4, 0); in rk3066_hdmi_bind()
805 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_A); in rk3066_hdmi_bind()
807 ret = rk3066_hdmi_register(drm, hdmi); in rk3066_hdmi_bind()
811 dev_set_drvdata(dev, hdmi); in rk3066_hdmi_bind()
815 dev_name(dev), hdmi); in rk3066_hdmi_bind()
817 DRM_DEV_ERROR(dev, "failed to request hdmi irq: %d\n", ret); in rk3066_hdmi_bind()
824 hdmi->connector.funcs->destroy(&hdmi->connector); in rk3066_hdmi_bind()
825 hdmi->encoder.funcs->destroy(&hdmi->encoder); in rk3066_hdmi_bind()
827 i2c_put_adapter(hdmi->ddc); in rk3066_hdmi_bind()
829 clk_disable_unprepare(hdmi->hclk); in rk3066_hdmi_bind()
837 struct rk3066_hdmi *hdmi = dev_get_drvdata(dev); in rk3066_hdmi_unbind() local
839 hdmi->connector.funcs->destroy(&hdmi->connector); in rk3066_hdmi_unbind()
840 hdmi->encoder.funcs->destroy(&hdmi->encoder); in rk3066_hdmi_unbind()
842 i2c_put_adapter(hdmi->ddc); in rk3066_hdmi_unbind()
843 clk_disable_unprepare(hdmi->hclk); in rk3066_hdmi_unbind()
864 { .compatible = "rockchip,rk3066-hdmi" },
873 .name = "rockchip-rk3066-hdmi",