Lines Matching refs:hdmi
73 static inline u8 hdmi_readb(struct rk3066_hdmi *hdmi, u16 offset) in hdmi_readb() argument
75 return readl_relaxed(hdmi->regs + offset); in hdmi_readb()
78 static inline void hdmi_writeb(struct rk3066_hdmi *hdmi, u16 offset, u32 val) in hdmi_writeb() argument
80 writel_relaxed(val, hdmi->regs + offset); in hdmi_writeb()
83 static inline void hdmi_modb(struct rk3066_hdmi *hdmi, u16 offset, in hdmi_modb() argument
86 u8 temp = hdmi_readb(hdmi, offset) & ~msk; in hdmi_modb()
89 hdmi_writeb(hdmi, offset, temp); in hdmi_modb()
92 static void rk3066_hdmi_i2c_init(struct rk3066_hdmi *hdmi) in rk3066_hdmi_i2c_init() argument
96 ddc_bus_freq = (hdmi->tmdsclk >> 2) / HDMI_SCL_RATE; in rk3066_hdmi_i2c_init()
98 hdmi_writeb(hdmi, HDMI_DDC_BUS_FREQ_L, ddc_bus_freq & 0xFF); in rk3066_hdmi_i2c_init()
99 hdmi_writeb(hdmi, HDMI_DDC_BUS_FREQ_H, (ddc_bus_freq >> 8) & 0xFF); in rk3066_hdmi_i2c_init()
102 hdmi_modb(hdmi, HDMI_INTR_MASK1, HDMI_INTR_EDID_MASK, 0); in rk3066_hdmi_i2c_init()
103 hdmi_writeb(hdmi, HDMI_INTR_STATUS1, HDMI_INTR_EDID_MASK); in rk3066_hdmi_i2c_init()
106 static inline u8 rk3066_hdmi_get_power_mode(struct rk3066_hdmi *hdmi) in rk3066_hdmi_get_power_mode() argument
108 return hdmi_readb(hdmi, HDMI_SYS_CTRL) & HDMI_SYS_POWER_MODE_MASK; in rk3066_hdmi_get_power_mode()
111 static void rk3066_hdmi_set_power_mode(struct rk3066_hdmi *hdmi, int mode) in rk3066_hdmi_set_power_mode() argument
116 current_mode = rk3066_hdmi_get_power_mode(hdmi); in rk3066_hdmi_set_power_mode()
118 DRM_DEV_DEBUG(hdmi->dev, "mode :%d\n", mode); in rk3066_hdmi_set_power_mode()
119 DRM_DEV_DEBUG(hdmi->dev, "current_mode :%d\n", current_mode); in rk3066_hdmi_set_power_mode()
134 DRM_DEV_DEBUG(hdmi->dev, "%d: next_mode :%d\n", i, next_mode); in rk3066_hdmi_set_power_mode()
137 hdmi_modb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_set_power_mode()
140 hdmi_writeb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_set_power_mode()
144 hdmi_writeb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_set_power_mode()
148 hdmi_writeb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_set_power_mode()
162 hdmi->tmdsclk = DEFAULT_PLLA_RATE; in rk3066_hdmi_set_power_mode()
166 rk3066_hdmi_upload_frame(struct rk3066_hdmi *hdmi, int setup_rc, in rk3066_hdmi_upload_frame() argument
171 hdmi_modb(hdmi, HDMI_CP_AUTO_SEND_CTRL, mask, disable); in rk3066_hdmi_upload_frame()
173 hdmi_writeb(hdmi, HDMI_CP_BUF_INDEX, frame_index); in rk3066_hdmi_upload_frame()
185 hdmi_writeb(hdmi, HDMI_CP_BUF_ACC_HB0 + i * 4, in rk3066_hdmi_upload_frame()
189 hdmi_modb(hdmi, HDMI_CP_AUTO_SEND_CTRL, mask, enable); in rk3066_hdmi_upload_frame()
195 static int rk3066_hdmi_config_avi(struct rk3066_hdmi *hdmi, in rk3066_hdmi_config_avi() argument
202 &hdmi->connector, mode); in rk3066_hdmi_config_avi()
204 if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV444) in rk3066_hdmi_config_avi()
206 else if (hdmi->hdmi_data.enc_out_format == HDMI_COLORSPACE_YUV422) in rk3066_hdmi_config_avi()
211 frame.avi.colorimetry = hdmi->hdmi_data.colorimetry; in rk3066_hdmi_config_avi()
214 return rk3066_hdmi_upload_frame(hdmi, rc, &frame, in rk3066_hdmi_config_avi()
218 static int rk3066_hdmi_config_video_timing(struct rk3066_hdmi *hdmi, in rk3066_hdmi_config_video_timing() argument
232 if (hdmi->hdmi_data.vic == 2 || hdmi->hdmi_data.vic == 3) in rk3066_hdmi_config_video_timing()
238 hdmi_writeb(hdmi, HDMI_EXT_VIDEO_PARA, value); in rk3066_hdmi_config_video_timing()
242 hdmi_writeb(hdmi, HDMI_EXT_HTOTAL_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
243 hdmi_writeb(hdmi, HDMI_EXT_HTOTAL_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
246 hdmi_writeb(hdmi, HDMI_EXT_HBLANK_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
247 hdmi_writeb(hdmi, HDMI_EXT_HBLANK_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
250 hdmi_writeb(hdmi, HDMI_EXT_HDELAY_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
251 hdmi_writeb(hdmi, HDMI_EXT_HDELAY_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
254 hdmi_writeb(hdmi, HDMI_EXT_HDURATION_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
255 hdmi_writeb(hdmi, HDMI_EXT_HDURATION_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
258 hdmi_writeb(hdmi, HDMI_EXT_VTOTAL_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
259 hdmi_writeb(hdmi, HDMI_EXT_VTOTAL_H, (value >> 8) & 0xFF); in rk3066_hdmi_config_video_timing()
262 hdmi_writeb(hdmi, HDMI_EXT_VBLANK_L, value & 0xFF); in rk3066_hdmi_config_video_timing()
265 hdmi_writeb(hdmi, HDMI_EXT_VDELAY, value & 0xFF); in rk3066_hdmi_config_video_timing()
268 hdmi_writeb(hdmi, HDMI_EXT_VDURATION, value & 0xFF); in rk3066_hdmi_config_video_timing()
274 rk3066_hdmi_phy_write(struct rk3066_hdmi *hdmi, u16 offset, u8 value) in rk3066_hdmi_phy_write() argument
276 hdmi_writeb(hdmi, offset, value); in rk3066_hdmi_phy_write()
277 hdmi_modb(hdmi, HDMI_SYS_CTRL, in rk3066_hdmi_phy_write()
280 hdmi_modb(hdmi, HDMI_SYS_CTRL, HDMI_SYS_PLL_RESET_MASK, 0); in rk3066_hdmi_phy_write()
284 static void rk3066_hdmi_config_phy(struct rk3066_hdmi *hdmi) in rk3066_hdmi_config_phy() argument
287 hdmi_writeb(hdmi, HDMI_DEEP_COLOR_MODE, 0x22); in rk3066_hdmi_config_phy()
294 if (hdmi->tmdsclk > 100000000) { in rk3066_hdmi_config_phy()
295 rk3066_hdmi_phy_write(hdmi, 0x158, 0x0E); in rk3066_hdmi_config_phy()
296 rk3066_hdmi_phy_write(hdmi, 0x15c, 0x00); in rk3066_hdmi_config_phy()
297 rk3066_hdmi_phy_write(hdmi, 0x160, 0x60); in rk3066_hdmi_config_phy()
298 rk3066_hdmi_phy_write(hdmi, 0x164, 0x00); in rk3066_hdmi_config_phy()
299 rk3066_hdmi_phy_write(hdmi, 0x168, 0xDA); in rk3066_hdmi_config_phy()
300 rk3066_hdmi_phy_write(hdmi, 0x16c, 0xA1); in rk3066_hdmi_config_phy()
301 rk3066_hdmi_phy_write(hdmi, 0x170, 0x0e); in rk3066_hdmi_config_phy()
302 rk3066_hdmi_phy_write(hdmi, 0x174, 0x22); in rk3066_hdmi_config_phy()
303 rk3066_hdmi_phy_write(hdmi, 0x178, 0x00); in rk3066_hdmi_config_phy()
304 } else if (hdmi->tmdsclk > 50000000) { in rk3066_hdmi_config_phy()
305 rk3066_hdmi_phy_write(hdmi, 0x158, 0x06); in rk3066_hdmi_config_phy()
306 rk3066_hdmi_phy_write(hdmi, 0x15c, 0x00); in rk3066_hdmi_config_phy()
307 rk3066_hdmi_phy_write(hdmi, 0x160, 0x60); in rk3066_hdmi_config_phy()
308 rk3066_hdmi_phy_write(hdmi, 0x164, 0x00); in rk3066_hdmi_config_phy()
309 rk3066_hdmi_phy_write(hdmi, 0x168, 0xCA); in rk3066_hdmi_config_phy()
310 rk3066_hdmi_phy_write(hdmi, 0x16c, 0xA3); in rk3066_hdmi_config_phy()
311 rk3066_hdmi_phy_write(hdmi, 0x170, 0x0e); in rk3066_hdmi_config_phy()
312 rk3066_hdmi_phy_write(hdmi, 0x174, 0x20); in rk3066_hdmi_config_phy()
313 rk3066_hdmi_phy_write(hdmi, 0x178, 0x00); in rk3066_hdmi_config_phy()
315 rk3066_hdmi_phy_write(hdmi, 0x158, 0x02); in rk3066_hdmi_config_phy()
316 rk3066_hdmi_phy_write(hdmi, 0x15c, 0x00); in rk3066_hdmi_config_phy()
317 rk3066_hdmi_phy_write(hdmi, 0x160, 0x60); in rk3066_hdmi_config_phy()
318 rk3066_hdmi_phy_write(hdmi, 0x164, 0x00); in rk3066_hdmi_config_phy()
319 rk3066_hdmi_phy_write(hdmi, 0x168, 0xC2); in rk3066_hdmi_config_phy()
320 rk3066_hdmi_phy_write(hdmi, 0x16c, 0xA2); in rk3066_hdmi_config_phy()
321 rk3066_hdmi_phy_write(hdmi, 0x170, 0x0e); in rk3066_hdmi_config_phy()
322 rk3066_hdmi_phy_write(hdmi, 0x174, 0x20); in rk3066_hdmi_config_phy()
323 rk3066_hdmi_phy_write(hdmi, 0x178, 0x00); in rk3066_hdmi_config_phy()
327 static int rk3066_hdmi_setup(struct rk3066_hdmi *hdmi, in rk3066_hdmi_setup() argument
330 struct drm_display_info *display = &hdmi->connector.display_info; in rk3066_hdmi_setup()
332 hdmi->hdmi_data.vic = drm_match_cea_mode(mode); in rk3066_hdmi_setup()
333 hdmi->hdmi_data.enc_out_format = HDMI_COLORSPACE_RGB; in rk3066_hdmi_setup()
335 if (hdmi->hdmi_data.vic == 6 || hdmi->hdmi_data.vic == 7 || in rk3066_hdmi_setup()
336 hdmi->hdmi_data.vic == 21 || hdmi->hdmi_data.vic == 22 || in rk3066_hdmi_setup()
337 hdmi->hdmi_data.vic == 2 || hdmi->hdmi_data.vic == 3 || in rk3066_hdmi_setup()
338 hdmi->hdmi_data.vic == 17 || hdmi->hdmi_data.vic == 18) in rk3066_hdmi_setup()
339 hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_601; in rk3066_hdmi_setup()
341 hdmi->hdmi_data.colorimetry = HDMI_COLORIMETRY_ITU_709; in rk3066_hdmi_setup()
343 hdmi->tmdsclk = mode->clock * 1000; in rk3066_hdmi_setup()
346 hdmi_modb(hdmi, HDMI_VIDEO_CTRL2, HDMI_VIDEO_AUDIO_DISABLE_MASK, in rk3066_hdmi_setup()
350 if (rk3066_hdmi_get_power_mode(hdmi) != HDMI_SYS_POWER_MODE_B) in rk3066_hdmi_setup()
351 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_B); in rk3066_hdmi_setup()
354 hdmi_modb(hdmi, HDMI_AV_CTRL1, in rk3066_hdmi_setup()
356 hdmi_writeb(hdmi, HDMI_VIDEO_CTRL1, in rk3066_hdmi_setup()
360 hdmi_writeb(hdmi, HDMI_DEEP_COLOR_MODE, 0x20); in rk3066_hdmi_setup()
362 rk3066_hdmi_config_video_timing(hdmi, mode); in rk3066_hdmi_setup()
365 hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK, in rk3066_hdmi_setup()
367 rk3066_hdmi_config_avi(hdmi, mode); in rk3066_hdmi_setup()
369 hdmi_modb(hdmi, HDMI_HDCP_CTRL, HDMI_VIDEO_MODE_MASK, 0); in rk3066_hdmi_setup()
372 rk3066_hdmi_config_phy(hdmi); in rk3066_hdmi_setup()
374 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_E); in rk3066_hdmi_setup()
382 rk3066_hdmi_i2c_init(hdmi); in rk3066_hdmi_setup()
385 hdmi_modb(hdmi, HDMI_VIDEO_CTRL2, in rk3066_hdmi_setup()
395 struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder); in rk3066_hdmi_encoder_mode_set() local
398 drm_mode_copy(&hdmi->previous_mode, adj_mode); in rk3066_hdmi_encoder_mode_set()
403 struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder); in rk3066_hdmi_encoder_enable() local
406 mux = drm_of_encoder_active_endpoint_id(hdmi->dev->of_node, encoder); in rk3066_hdmi_encoder_enable()
412 regmap_write(hdmi->grf_regmap, GRF_SOC_CON0, val); in rk3066_hdmi_encoder_enable()
414 DRM_DEV_DEBUG(hdmi->dev, "hdmi encoder enable select: vop%s\n", in rk3066_hdmi_encoder_enable()
417 rk3066_hdmi_setup(hdmi, &hdmi->previous_mode); in rk3066_hdmi_encoder_enable()
422 struct rk3066_hdmi *hdmi = encoder_to_rk3066_hdmi(encoder); in rk3066_hdmi_encoder_disable() local
424 DRM_DEV_DEBUG(hdmi->dev, "hdmi encoder disable\n"); in rk3066_hdmi_encoder_disable()
426 if (rk3066_hdmi_get_power_mode(hdmi) == HDMI_SYS_POWER_MODE_E) { in rk3066_hdmi_encoder_disable()
427 hdmi_writeb(hdmi, HDMI_VIDEO_CTRL2, in rk3066_hdmi_encoder_disable()
429 hdmi_modb(hdmi, HDMI_VIDEO_CTRL2, in rk3066_hdmi_encoder_disable()
434 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_A); in rk3066_hdmi_encoder_disable()
470 struct rk3066_hdmi *hdmi = connector_to_rk3066_hdmi(connector); in rk3066_hdmi_connector_detect() local
472 return (hdmi_readb(hdmi, HDMI_HPG_MENS_STA) & HDMI_HPG_IN_STATUS_HIGH) ? in rk3066_hdmi_connector_detect()
478 struct rk3066_hdmi *hdmi = connector_to_rk3066_hdmi(connector); in rk3066_hdmi_connector_get_modes() local
482 if (!hdmi->ddc) in rk3066_hdmi_connector_get_modes()
485 edid = drm_get_edid(connector, hdmi->ddc); in rk3066_hdmi_connector_get_modes()
510 struct rk3066_hdmi *hdmi = connector_to_rk3066_hdmi(connector); in rk3066_hdmi_connector_best_encoder() local
512 return &hdmi->encoder.encoder; in rk3066_hdmi_connector_best_encoder()
550 rk3066_hdmi_register(struct drm_device *drm, struct rk3066_hdmi *hdmi) in rk3066_hdmi_register() argument
552 struct drm_encoder *encoder = &hdmi->encoder.encoder; in rk3066_hdmi_register()
553 struct device *dev = hdmi->dev; in rk3066_hdmi_register()
570 hdmi->connector.polled = DRM_CONNECTOR_POLL_HPD; in rk3066_hdmi_register()
572 drm_connector_helper_add(&hdmi->connector, in rk3066_hdmi_register()
574 drm_connector_init_with_ddc(drm, &hdmi->connector, in rk3066_hdmi_register()
577 hdmi->ddc); in rk3066_hdmi_register()
579 drm_connector_attach_encoder(&hdmi->connector, encoder); in rk3066_hdmi_register()
586 struct rk3066_hdmi *hdmi = dev_id; in rk3066_hdmi_hardirq() local
590 if (rk3066_hdmi_get_power_mode(hdmi) == HDMI_SYS_POWER_MODE_A) in rk3066_hdmi_hardirq()
591 hdmi_writeb(hdmi, HDMI_SYS_CTRL, HDMI_SYS_POWER_MODE_B); in rk3066_hdmi_hardirq()
593 interrupt = hdmi_readb(hdmi, HDMI_INTR_STATUS1); in rk3066_hdmi_hardirq()
595 hdmi_writeb(hdmi, HDMI_INTR_STATUS1, interrupt); in rk3066_hdmi_hardirq()
598 hdmi->i2c->stat = interrupt; in rk3066_hdmi_hardirq()
599 complete(&hdmi->i2c->cmpltn); in rk3066_hdmi_hardirq()
610 struct rk3066_hdmi *hdmi = dev_id; in rk3066_hdmi_irq() local
612 drm_helper_hpd_irq_event(hdmi->connector.dev); in rk3066_hdmi_irq()
617 static int rk3066_hdmi_i2c_read(struct rk3066_hdmi *hdmi, struct i2c_msg *msgs) in rk3066_hdmi_i2c_read() argument
623 ret = wait_for_completion_timeout(&hdmi->i2c->cmpltn, HZ / 10); in rk3066_hdmi_i2c_read()
624 if (!ret || hdmi->i2c->stat & HDMI_INTR_EDID_ERR) in rk3066_hdmi_i2c_read()
628 *buf++ = hdmi_readb(hdmi, HDMI_DDC_READ_FIFO_ADDR); in rk3066_hdmi_i2c_read()
633 static int rk3066_hdmi_i2c_write(struct rk3066_hdmi *hdmi, struct i2c_msg *msgs) in rk3066_hdmi_i2c_write() argument
644 reinit_completion(&hdmi->i2c->cmpltn); in rk3066_hdmi_i2c_write()
647 hdmi->i2c->segment_addr = msgs->buf[0]; in rk3066_hdmi_i2c_write()
649 hdmi->i2c->ddc_addr = msgs->buf[0]; in rk3066_hdmi_i2c_write()
652 hdmi_writeb(hdmi, HDMI_EDID_FIFO_ADDR, 0x00); in rk3066_hdmi_i2c_write()
655 hdmi_writeb(hdmi, HDMI_EDID_WORD_ADDR, hdmi->i2c->ddc_addr); in rk3066_hdmi_i2c_write()
658 hdmi_writeb(hdmi, HDMI_EDID_SEGMENT_POINTER, hdmi->i2c->segment_addr); in rk3066_hdmi_i2c_write()
666 struct rk3066_hdmi *hdmi = i2c_get_adapdata(adap); in rk3066_hdmi_i2c_xfer() local
667 struct rk3066_hdmi_i2c *i2c = hdmi->i2c; in rk3066_hdmi_i2c_xfer()
672 rk3066_hdmi_i2c_init(hdmi); in rk3066_hdmi_i2c_xfer()
675 hdmi_modb(hdmi, HDMI_INTR_MASK1, in rk3066_hdmi_i2c_xfer()
680 DRM_DEV_DEBUG(hdmi->dev, in rk3066_hdmi_i2c_xfer()
685 ret = rk3066_hdmi_i2c_read(hdmi, &msgs[i]); in rk3066_hdmi_i2c_xfer()
687 ret = rk3066_hdmi_i2c_write(hdmi, &msgs[i]); in rk3066_hdmi_i2c_xfer()
697 hdmi_modb(hdmi, HDMI_INTR_MASK1, HDMI_INTR_EDID_MASK, 0); in rk3066_hdmi_i2c_xfer()
714 static struct i2c_adapter *rk3066_hdmi_i2c_adapter(struct rk3066_hdmi *hdmi) in rk3066_hdmi_i2c_adapter() argument
720 i2c = devm_kzalloc(hdmi->dev, sizeof(*i2c), GFP_KERNEL); in rk3066_hdmi_i2c_adapter()
730 adap->dev.parent = hdmi->dev; in rk3066_hdmi_i2c_adapter()
731 adap->dev.of_node = hdmi->dev->of_node; in rk3066_hdmi_i2c_adapter()
734 i2c_set_adapdata(adap, hdmi); in rk3066_hdmi_i2c_adapter()
738 DRM_DEV_ERROR(hdmi->dev, "cannot add %s I2C adapter\n", in rk3066_hdmi_i2c_adapter()
740 devm_kfree(hdmi->dev, i2c); in rk3066_hdmi_i2c_adapter()
744 hdmi->i2c = i2c; in rk3066_hdmi_i2c_adapter()
746 DRM_DEV_DEBUG(hdmi->dev, "registered %s I2C bus driver\n", adap->name); in rk3066_hdmi_i2c_adapter()
756 struct rk3066_hdmi *hdmi; in rk3066_hdmi_bind() local
760 hdmi = devm_kzalloc(dev, sizeof(*hdmi), GFP_KERNEL); in rk3066_hdmi_bind()
761 if (!hdmi) in rk3066_hdmi_bind()
764 hdmi->dev = dev; in rk3066_hdmi_bind()
765 hdmi->drm_dev = drm; in rk3066_hdmi_bind()
766 hdmi->regs = devm_platform_ioremap_resource(pdev, 0); in rk3066_hdmi_bind()
767 if (IS_ERR(hdmi->regs)) in rk3066_hdmi_bind()
768 return PTR_ERR(hdmi->regs); in rk3066_hdmi_bind()
774 hdmi->hclk = devm_clk_get(dev, "hclk"); in rk3066_hdmi_bind()
775 if (IS_ERR(hdmi->hclk)) { in rk3066_hdmi_bind()
777 return PTR_ERR(hdmi->hclk); in rk3066_hdmi_bind()
780 ret = clk_prepare_enable(hdmi->hclk); in rk3066_hdmi_bind()
786 hdmi->grf_regmap = syscon_regmap_lookup_by_phandle(dev->of_node, in rk3066_hdmi_bind()
788 if (IS_ERR(hdmi->grf_regmap)) { in rk3066_hdmi_bind()
790 ret = PTR_ERR(hdmi->grf_regmap); in rk3066_hdmi_bind()
795 hdmi_writeb(hdmi, HDMI_INTERNAL_CLK_DIVIDER, 25); in rk3066_hdmi_bind()
797 hdmi->ddc = rk3066_hdmi_i2c_adapter(hdmi); in rk3066_hdmi_bind()
798 if (IS_ERR(hdmi->ddc)) { in rk3066_hdmi_bind()
799 ret = PTR_ERR(hdmi->ddc); in rk3066_hdmi_bind()
800 hdmi->ddc = NULL; in rk3066_hdmi_bind()
804 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_B); in rk3066_hdmi_bind()
806 hdmi_writeb(hdmi, HDMI_INTR_MASK1, HDMI_INTR_HOTPLUG); in rk3066_hdmi_bind()
807 hdmi_writeb(hdmi, HDMI_INTR_MASK2, 0); in rk3066_hdmi_bind()
808 hdmi_writeb(hdmi, HDMI_INTR_MASK3, 0); in rk3066_hdmi_bind()
809 hdmi_writeb(hdmi, HDMI_INTR_MASK4, 0); in rk3066_hdmi_bind()
810 rk3066_hdmi_set_power_mode(hdmi, HDMI_SYS_POWER_MODE_A); in rk3066_hdmi_bind()
812 ret = rk3066_hdmi_register(drm, hdmi); in rk3066_hdmi_bind()
816 dev_set_drvdata(dev, hdmi); in rk3066_hdmi_bind()
820 dev_name(dev), hdmi); in rk3066_hdmi_bind()
829 hdmi->connector.funcs->destroy(&hdmi->connector); in rk3066_hdmi_bind()
830 hdmi->encoder.encoder.funcs->destroy(&hdmi->encoder.encoder); in rk3066_hdmi_bind()
832 i2c_put_adapter(hdmi->ddc); in rk3066_hdmi_bind()
834 clk_disable_unprepare(hdmi->hclk); in rk3066_hdmi_bind()
842 struct rk3066_hdmi *hdmi = dev_get_drvdata(dev); in rk3066_hdmi_unbind() local
844 hdmi->connector.funcs->destroy(&hdmi->connector); in rk3066_hdmi_unbind()
845 hdmi->encoder.encoder.funcs->destroy(&hdmi->encoder.encoder); in rk3066_hdmi_unbind()
847 i2c_put_adapter(hdmi->ddc); in rk3066_hdmi_unbind()
848 clk_disable_unprepare(hdmi->hclk); in rk3066_hdmi_unbind()