Lines Matching refs:priv

359 cec_write(struct tda998x_priv *priv, u16 addr, u8 val)  in cec_write()  argument
361 struct i2c_client *client = priv->cec; in cec_write()
371 cec_read(struct tda998x_priv *priv, u8 addr) in cec_read() argument
373 struct i2c_client *client = priv->cec; in cec_read()
393 set_page(struct tda998x_priv *priv, u16 reg) in set_page() argument
395 if (REG2PAGE(reg) != priv->current_page) { in set_page()
396 struct i2c_client *client = priv->hdmi; in set_page()
407 priv->current_page = REG2PAGE(reg); in set_page()
413 reg_read_range(struct tda998x_priv *priv, u16 reg, char *buf, int cnt) in reg_read_range() argument
415 struct i2c_client *client = priv->hdmi; in reg_read_range()
419 mutex_lock(&priv->mutex); in reg_read_range()
420 ret = set_page(priv, reg); in reg_read_range()
437 mutex_unlock(&priv->mutex); in reg_read_range()
442 reg_write_range(struct tda998x_priv *priv, u16 reg, u8 *p, int cnt) in reg_write_range() argument
444 struct i2c_client *client = priv->hdmi; in reg_write_range()
451 mutex_lock(&priv->mutex); in reg_write_range()
452 ret = set_page(priv, reg); in reg_write_range()
460 mutex_unlock(&priv->mutex); in reg_write_range()
464 reg_read(struct tda998x_priv *priv, u16 reg) in reg_read() argument
469 ret = reg_read_range(priv, reg, &val, sizeof(val)); in reg_read()
476 reg_write(struct tda998x_priv *priv, u16 reg, u8 val) in reg_write() argument
478 struct i2c_client *client = priv->hdmi; in reg_write()
482 mutex_lock(&priv->mutex); in reg_write()
483 ret = set_page(priv, reg); in reg_write()
491 mutex_unlock(&priv->mutex); in reg_write()
495 reg_write16(struct tda998x_priv *priv, u16 reg, u16 val) in reg_write16() argument
497 struct i2c_client *client = priv->hdmi; in reg_write16()
501 mutex_lock(&priv->mutex); in reg_write16()
502 ret = set_page(priv, reg); in reg_write16()
510 mutex_unlock(&priv->mutex); in reg_write16()
514 reg_set(struct tda998x_priv *priv, u16 reg, u8 val) in reg_set() argument
518 old_val = reg_read(priv, reg); in reg_set()
520 reg_write(priv, reg, old_val | val); in reg_set()
524 reg_clear(struct tda998x_priv *priv, u16 reg, u8 val) in reg_clear() argument
528 old_val = reg_read(priv, reg); in reg_clear()
530 reg_write(priv, reg, old_val & ~val); in reg_clear()
534 tda998x_reset(struct tda998x_priv *priv) in tda998x_reset() argument
537 reg_write(priv, REG_SOFTRESET, SOFTRESET_AUDIO | SOFTRESET_I2C_MASTER); in tda998x_reset()
539 reg_write(priv, REG_SOFTRESET, 0); in tda998x_reset()
543 reg_set(priv, REG_MAIN_CNTRL0, MAIN_CNTRL0_SR); in tda998x_reset()
544 reg_clear(priv, REG_MAIN_CNTRL0, MAIN_CNTRL0_SR); in tda998x_reset()
547 reg_write(priv, REG_PLL_SERIAL_1, 0x00); in tda998x_reset()
548 reg_write(priv, REG_PLL_SERIAL_2, PLL_SERIAL_2_SRL_NOSC(1)); in tda998x_reset()
549 reg_write(priv, REG_PLL_SERIAL_3, 0x00); in tda998x_reset()
550 reg_write(priv, REG_SERIALIZER, 0x00); in tda998x_reset()
551 reg_write(priv, REG_BUFFER_OUT, 0x00); in tda998x_reset()
552 reg_write(priv, REG_PLL_SCG1, 0x00); in tda998x_reset()
553 reg_write(priv, REG_AUDIO_DIV, AUDIO_DIV_SERCLK_8); in tda998x_reset()
554 reg_write(priv, REG_SEL_CLK, SEL_CLK_SEL_CLK1 | SEL_CLK_ENA_SC_CLK); in tda998x_reset()
555 reg_write(priv, REG_PLL_SCGN1, 0xfa); in tda998x_reset()
556 reg_write(priv, REG_PLL_SCGN2, 0x00); in tda998x_reset()
557 reg_write(priv, REG_PLL_SCGR1, 0x5b); in tda998x_reset()
558 reg_write(priv, REG_PLL_SCGR2, 0x00); in tda998x_reset()
559 reg_write(priv, REG_PLL_SCG2, 0x10); in tda998x_reset()
562 reg_write(priv, REG_MUX_VP_VIP_OUT, 0x24); in tda998x_reset()
578 struct tda998x_priv *priv = (struct tda998x_priv *)data; in tda998x_edid_delay_done() local
580 priv->edid_delay_active = false; in tda998x_edid_delay_done()
581 wake_up(&priv->edid_delay_waitq); in tda998x_edid_delay_done()
582 schedule_work(&priv->detect_work); in tda998x_edid_delay_done()
585 static void tda998x_edid_delay_start(struct tda998x_priv *priv) in tda998x_edid_delay_start() argument
587 priv->edid_delay_active = true; in tda998x_edid_delay_start()
588 mod_timer(&priv->edid_delay_timer, jiffies + HZ/10); in tda998x_edid_delay_start()
591 static int tda998x_edid_delay_wait(struct tda998x_priv *priv) in tda998x_edid_delay_wait() argument
593 return wait_event_killable(priv->edid_delay_waitq, !priv->edid_delay_active); in tda998x_edid_delay_wait()
603 struct tda998x_priv *priv = in tda998x_detect_work() local
605 struct drm_device *dev = priv->encoder.dev; in tda998x_detect_work()
616 struct tda998x_priv *priv = data; in tda998x_irq_thread() local
620 sta = cec_read(priv, REG_CEC_INTSTATUS); in tda998x_irq_thread()
621 cec = cec_read(priv, REG_CEC_RXSHPDINT); in tda998x_irq_thread()
622 lvl = cec_read(priv, REG_CEC_RXSHPDLEV); in tda998x_irq_thread()
623 flag0 = reg_read(priv, REG_INT_FLAGS_0); in tda998x_irq_thread()
624 flag1 = reg_read(priv, REG_INT_FLAGS_1); in tda998x_irq_thread()
625 flag2 = reg_read(priv, REG_INT_FLAGS_2); in tda998x_irq_thread()
632 tda998x_edid_delay_start(priv); in tda998x_irq_thread()
634 schedule_work(&priv->detect_work); in tda998x_irq_thread()
639 if ((flag2 & INT_FLAGS_2_EDID_BLK_RD) && priv->wq_edid_wait) { in tda998x_irq_thread()
640 priv->wq_edid_wait = 0; in tda998x_irq_thread()
641 wake_up(&priv->wq_edid); in tda998x_irq_thread()
649 tda998x_write_if(struct tda998x_priv *priv, u8 bit, u16 addr, in tda998x_write_if() argument
657 dev_err(&priv->hdmi->dev, in tda998x_write_if()
663 reg_clear(priv, REG_DIP_IF_FLAGS, bit); in tda998x_write_if()
664 reg_write_range(priv, addr, buf, len); in tda998x_write_if()
665 reg_set(priv, REG_DIP_IF_FLAGS, bit); in tda998x_write_if()
669 tda998x_write_aif(struct tda998x_priv *priv, struct tda998x_encoder_params *p) in tda998x_write_aif() argument
687 tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, &frame); in tda998x_write_aif()
691 tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) in tda998x_write_avi() argument
698 tda998x_write_if(priv, DIP_IF_FLAGS_IF2, REG_IF2_HB0, &frame); in tda998x_write_avi()
701 static void tda998x_audio_mute(struct tda998x_priv *priv, bool on) in tda998x_audio_mute() argument
704 reg_set(priv, REG_SOFTRESET, SOFTRESET_AUDIO); in tda998x_audio_mute()
705 reg_clear(priv, REG_SOFTRESET, SOFTRESET_AUDIO); in tda998x_audio_mute()
706 reg_set(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_FIFO); in tda998x_audio_mute()
708 reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_FIFO); in tda998x_audio_mute()
713 tda998x_configure_audio(struct tda998x_priv *priv, in tda998x_configure_audio() argument
720 reg_write(priv, REG_ENA_AP, p->audio_cfg); in tda998x_configure_audio()
721 reg_write(priv, REG_ENA_ACLK, p->audio_clk_cfg); in tda998x_configure_audio()
726 reg_write(priv, REG_MUX_AP, MUX_AP_SELECT_SPDIF); in tda998x_configure_audio()
733 reg_write(priv, REG_MUX_AP, MUX_AP_SELECT_I2S); in tda998x_configure_audio()
744 reg_write(priv, REG_AIP_CLKSEL, clksel_aip); in tda998x_configure_audio()
745 reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_LAYOUT | in tda998x_configure_audio()
747 reg_write(priv, REG_CTS_N, cts_n); in tda998x_configure_audio()
764 reg_write(priv, REG_AUDIO_DIV, adiv); in tda998x_configure_audio()
779 reg_write_range(priv, REG_ACR_CTS_0, buf, 6); in tda998x_configure_audio()
782 reg_write(priv, REG_AIP_CLKSEL, clksel_aip | clksel_fs); in tda998x_configure_audio()
785 reg_set(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_CTS); in tda998x_configure_audio()
786 reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_CTS); in tda998x_configure_audio()
794 reg_write_range(priv, REG_CH_STAT_B(0), buf, 4); in tda998x_configure_audio()
796 tda998x_audio_mute(priv, true); in tda998x_configure_audio()
798 tda998x_audio_mute(priv, false); in tda998x_configure_audio()
801 tda998x_write_aif(priv, p); in tda998x_configure_audio()
806 static void tda998x_encoder_set_config(struct tda998x_priv *priv, in tda998x_encoder_set_config() argument
809 priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(p->swap_a) | in tda998x_encoder_set_config()
813 priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(p->swap_c) | in tda998x_encoder_set_config()
817 priv->vip_cntrl_2 = VIP_CNTRL_2_SWAP_E(p->swap_e) | in tda998x_encoder_set_config()
822 priv->params = *p; in tda998x_encoder_set_config()
827 struct tda998x_priv *priv = enc_to_tda998x_priv(encoder); in tda998x_encoder_dpms() local
833 if (mode == priv->dpms) in tda998x_encoder_dpms()
839 reg_write(priv, REG_ENA_VP_0, 0xff); in tda998x_encoder_dpms()
840 reg_write(priv, REG_ENA_VP_1, 0xff); in tda998x_encoder_dpms()
841 reg_write(priv, REG_ENA_VP_2, 0xff); in tda998x_encoder_dpms()
843 reg_write(priv, REG_VIP_CNTRL_0, priv->vip_cntrl_0); in tda998x_encoder_dpms()
844 reg_write(priv, REG_VIP_CNTRL_1, priv->vip_cntrl_1); in tda998x_encoder_dpms()
845 reg_write(priv, REG_VIP_CNTRL_2, priv->vip_cntrl_2); in tda998x_encoder_dpms()
849 reg_write(priv, REG_ENA_VP_0, 0x00); in tda998x_encoder_dpms()
850 reg_write(priv, REG_ENA_VP_1, 0x00); in tda998x_encoder_dpms()
851 reg_write(priv, REG_ENA_VP_2, 0x00); in tda998x_encoder_dpms()
855 priv->dpms = mode; in tda998x_encoder_dpms()
895 struct tda998x_priv *priv = enc_to_tda998x_priv(encoder); in tda998x_encoder_mode_set() local
974 reg_set(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_FIFO); in tda998x_encoder_mode_set()
977 reg_write(priv, REG_TBG_CNTRL_1, TBG_CNTRL_1_DWIN_DIS); in tda998x_encoder_mode_set()
978 reg_clear(priv, REG_TX33, TX33_HDMI); in tda998x_encoder_mode_set()
979 reg_write(priv, REG_ENC_CNTRL, ENC_CNTRL_CTL_CODE(0)); in tda998x_encoder_mode_set()
982 reg_write(priv, REG_HVF_CNTRL_0, HVF_CNTRL_0_PREFIL(0) | in tda998x_encoder_mode_set()
984 reg_write(priv, REG_VIP_CNTRL_5, VIP_CNTRL_5_SP_CNT(0)); in tda998x_encoder_mode_set()
985 reg_write(priv, REG_VIP_CNTRL_4, VIP_CNTRL_4_BLANKIT(0) | in tda998x_encoder_mode_set()
988 reg_clear(priv, REG_PLL_SERIAL_1, PLL_SERIAL_1_SRL_MAN_IZ); in tda998x_encoder_mode_set()
989 reg_clear(priv, REG_PLL_SERIAL_3, PLL_SERIAL_3_SRL_CCIR | in tda998x_encoder_mode_set()
991 reg_write(priv, REG_SERIALIZER, 0); in tda998x_encoder_mode_set()
992 reg_write(priv, REG_HVF_CNTRL_1, HVF_CNTRL_1_VQR(0)); in tda998x_encoder_mode_set()
996 reg_write(priv, REG_RPT_CNTRL, 0); in tda998x_encoder_mode_set()
997 reg_write(priv, REG_SEL_CLK, SEL_CLK_SEL_VRF_CLK(0) | in tda998x_encoder_mode_set()
1000 reg_write(priv, REG_PLL_SERIAL_2, PLL_SERIAL_2_SRL_NOSC(div) | in tda998x_encoder_mode_set()
1004 reg_write(priv, REG_MAT_CONTRL, MAT_CONTRL_MAT_BP | in tda998x_encoder_mode_set()
1008 reg_write(priv, REG_ANA_GENERAL, 0x09); in tda998x_encoder_mode_set()
1023 reg_write(priv, REG_VIP_CNTRL_3, reg); in tda998x_encoder_mode_set()
1025 reg_write(priv, REG_VIDFORMAT, 0x00); in tda998x_encoder_mode_set()
1026 reg_write16(priv, REG_REFPIX_MSB, ref_pix); in tda998x_encoder_mode_set()
1027 reg_write16(priv, REG_REFLINE_MSB, ref_line); in tda998x_encoder_mode_set()
1028 reg_write16(priv, REG_NPIX_MSB, n_pix); in tda998x_encoder_mode_set()
1029 reg_write16(priv, REG_NLINE_MSB, n_line); in tda998x_encoder_mode_set()
1030 reg_write16(priv, REG_VS_LINE_STRT_1_MSB, vs1_line_s); in tda998x_encoder_mode_set()
1031 reg_write16(priv, REG_VS_PIX_STRT_1_MSB, vs1_pix_s); in tda998x_encoder_mode_set()
1032 reg_write16(priv, REG_VS_LINE_END_1_MSB, vs1_line_e); in tda998x_encoder_mode_set()
1033 reg_write16(priv, REG_VS_PIX_END_1_MSB, vs1_pix_e); in tda998x_encoder_mode_set()
1034 reg_write16(priv, REG_VS_LINE_STRT_2_MSB, vs2_line_s); in tda998x_encoder_mode_set()
1035 reg_write16(priv, REG_VS_PIX_STRT_2_MSB, vs2_pix_s); in tda998x_encoder_mode_set()
1036 reg_write16(priv, REG_VS_LINE_END_2_MSB, vs2_line_e); in tda998x_encoder_mode_set()
1037 reg_write16(priv, REG_VS_PIX_END_2_MSB, vs2_pix_e); in tda998x_encoder_mode_set()
1038 reg_write16(priv, REG_HS_PIX_START_MSB, hs_pix_s); in tda998x_encoder_mode_set()
1039 reg_write16(priv, REG_HS_PIX_STOP_MSB, hs_pix_e); in tda998x_encoder_mode_set()
1040 reg_write16(priv, REG_VWIN_START_1_MSB, vwin1_line_s); in tda998x_encoder_mode_set()
1041 reg_write16(priv, REG_VWIN_END_1_MSB, vwin1_line_e); in tda998x_encoder_mode_set()
1042 reg_write16(priv, REG_VWIN_START_2_MSB, vwin2_line_s); in tda998x_encoder_mode_set()
1043 reg_write16(priv, REG_VWIN_END_2_MSB, vwin2_line_e); in tda998x_encoder_mode_set()
1044 reg_write16(priv, REG_DE_START_MSB, de_pix_s); in tda998x_encoder_mode_set()
1045 reg_write16(priv, REG_DE_STOP_MSB, de_pix_e); in tda998x_encoder_mode_set()
1047 if (priv->rev == TDA19988) { in tda998x_encoder_mode_set()
1049 reg_write(priv, REG_ENABLE_SPACE, 0x00); in tda998x_encoder_mode_set()
1061 reg_write(priv, REG_TBG_CNTRL_1, reg); in tda998x_encoder_mode_set()
1064 reg_write(priv, REG_TBG_CNTRL_0, 0); in tda998x_encoder_mode_set()
1067 if (priv->is_hdmi_sink) { in tda998x_encoder_mode_set()
1070 reg_write(priv, REG_TBG_CNTRL_1, reg); in tda998x_encoder_mode_set()
1071 reg_write(priv, REG_ENC_CNTRL, ENC_CNTRL_CTL_CODE(1)); in tda998x_encoder_mode_set()
1072 reg_set(priv, REG_TX33, TX33_HDMI); in tda998x_encoder_mode_set()
1074 tda998x_write_avi(priv, adjusted_mode); in tda998x_encoder_mode_set()
1076 if (priv->params.audio_cfg) in tda998x_encoder_mode_set()
1077 tda998x_configure_audio(priv, adjusted_mode, in tda998x_encoder_mode_set()
1078 &priv->params); in tda998x_encoder_mode_set()
1085 struct tda998x_priv *priv = conn_to_tda998x_priv(connector); in tda998x_connector_detect() local
1086 u8 val = cec_read(priv, REG_CEC_RXSHPDLEV); in tda998x_connector_detect()
1094 struct tda998x_priv *priv = data; in read_edid_block() local
1101 reg_write(priv, REG_DDC_ADDR, 0xa0); in read_edid_block()
1102 reg_write(priv, REG_DDC_OFFS, offset); in read_edid_block()
1103 reg_write(priv, REG_DDC_SEGM_ADDR, 0x60); in read_edid_block()
1104 reg_write(priv, REG_DDC_SEGM, segptr); in read_edid_block()
1107 priv->wq_edid_wait = 1; in read_edid_block()
1108 reg_write(priv, REG_EDID_CTRL, 0x1); in read_edid_block()
1111 reg_write(priv, REG_EDID_CTRL, 0x0); in read_edid_block()
1114 if (priv->hdmi->irq) { in read_edid_block()
1115 i = wait_event_timeout(priv->wq_edid, in read_edid_block()
1116 !priv->wq_edid_wait, in read_edid_block()
1119 dev_err(&priv->hdmi->dev, "read edid wait err %d\n", i); in read_edid_block()
1125 ret = reg_read(priv, REG_INT_FLAGS_2); in read_edid_block()
1134 dev_err(&priv->hdmi->dev, "read edid timeout\n"); in read_edid_block()
1138 ret = reg_read_range(priv, REG_EDID_DATA_0, buf, length); in read_edid_block()
1140 dev_err(&priv->hdmi->dev, "failed to read edid block %d: %d\n", in read_edid_block()
1150 struct tda998x_priv *priv = conn_to_tda998x_priv(connector); in tda998x_connector_get_modes() local
1159 if (tda998x_edid_delay_wait(priv)) in tda998x_connector_get_modes()
1162 if (priv->rev == TDA19988) in tda998x_connector_get_modes()
1163 reg_clear(priv, REG_TX4, TX4_PD_RAM); in tda998x_connector_get_modes()
1165 edid = drm_do_get_edid(connector, read_edid_block, priv); in tda998x_connector_get_modes()
1167 if (priv->rev == TDA19988) in tda998x_connector_get_modes()
1168 reg_set(priv, REG_TX4, TX4_PD_RAM); in tda998x_connector_get_modes()
1171 dev_warn(&priv->hdmi->dev, "failed to read EDID\n"); in tda998x_connector_get_modes()
1177 priv->is_hdmi_sink = drm_detect_hdmi_monitor(edid); in tda998x_connector_get_modes()
1183 static void tda998x_encoder_set_polling(struct tda998x_priv *priv, in tda998x_encoder_set_polling() argument
1186 if (priv->hdmi->irq) in tda998x_encoder_set_polling()
1193 static void tda998x_destroy(struct tda998x_priv *priv) in tda998x_destroy() argument
1196 cec_write(priv, REG_CEC_RXSHPDINTENA, 0); in tda998x_destroy()
1197 reg_clear(priv, REG_INT_FLAGS_2, INT_FLAGS_2_EDID_BLK_RD); in tda998x_destroy()
1199 if (priv->hdmi->irq) in tda998x_destroy()
1200 free_irq(priv->hdmi->irq, priv); in tda998x_destroy()
1202 del_timer_sync(&priv->edid_delay_timer); in tda998x_destroy()
1203 cancel_work_sync(&priv->detect_work); in tda998x_destroy()
1205 i2c_unregister_device(priv->cec); in tda998x_destroy()
1210 static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv) in tda998x_create() argument
1217 priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(2) | VIP_CNTRL_0_SWAP_B(3); in tda998x_create()
1218 priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(0) | VIP_CNTRL_1_SWAP_D(1); in tda998x_create()
1219 priv->vip_cntrl_2 = VIP_CNTRL_2_SWAP_E(4) | VIP_CNTRL_2_SWAP_F(5); in tda998x_create()
1221 priv->current_page = 0xff; in tda998x_create()
1222 priv->hdmi = client; in tda998x_create()
1225 priv->cec = i2c_new_dummy(client->adapter, cec_addr); in tda998x_create()
1226 if (!priv->cec) in tda998x_create()
1229 priv->dpms = DRM_MODE_DPMS_OFF; in tda998x_create()
1231 mutex_init(&priv->mutex); /* protect the page access */ in tda998x_create()
1232 init_waitqueue_head(&priv->edid_delay_waitq); in tda998x_create()
1233 setup_timer(&priv->edid_delay_timer, tda998x_edid_delay_done, in tda998x_create()
1234 (unsigned long)priv); in tda998x_create()
1235 INIT_WORK(&priv->detect_work, tda998x_detect_work); in tda998x_create()
1238 cec_write(priv, REG_CEC_ENAMODS, in tda998x_create()
1241 tda998x_reset(priv); in tda998x_create()
1244 rev_lo = reg_read(priv, REG_VERSION_LSB); in tda998x_create()
1245 rev_hi = reg_read(priv, REG_VERSION_MSB); in tda998x_create()
1251 priv->rev = rev_lo | rev_hi << 8; in tda998x_create()
1254 priv->rev &= ~0x30; /* not-hdcp and not-scalar bit */ in tda998x_create()
1256 switch (priv->rev) { in tda998x_create()
1271 priv->rev); in tda998x_create()
1276 reg_write(priv, REG_DDC_DISABLE, 0x00); in tda998x_create()
1279 reg_write(priv, REG_TX3, 39); in tda998x_create()
1282 if (priv->rev == TDA19989) in tda998x_create()
1283 reg_set(priv, REG_I2C_MASTER, I2C_MASTER_DIS_MM); in tda998x_create()
1285 cec_write(priv, REG_CEC_FRO_IM_CLK_CTRL, in tda998x_create()
1293 init_waitqueue_head(&priv->wq_edid); in tda998x_create()
1296 reg_read(priv, REG_INT_FLAGS_0); in tda998x_create()
1297 reg_read(priv, REG_INT_FLAGS_1); in tda998x_create()
1298 reg_read(priv, REG_INT_FLAGS_2); in tda998x_create()
1305 "tda998x", priv); in tda998x_create()
1314 cec_write(priv, REG_CEC_RXSHPDINTENA, CEC_RXSHPDLEV_HPD); in tda998x_create()
1318 reg_set(priv, REG_INT_FLAGS_2, INT_FLAGS_2_EDID_BLK_RD); in tda998x_create()
1326 priv->vip_cntrl_0 = video >> 16; in tda998x_create()
1327 priv->vip_cntrl_1 = video >> 8; in tda998x_create()
1328 priv->vip_cntrl_2 = video; in tda998x_create()
1337 if (priv->cec) in tda998x_create()
1338 i2c_unregister_device(priv->cec); in tda998x_create()
1364 struct tda998x_priv *priv = enc_to_tda998x_priv(encoder); in tda998x_encoder_destroy() local
1366 tda998x_destroy(priv); in tda998x_encoder_destroy()
1377 struct tda998x_priv *priv = conn_to_tda998x_priv(connector); in tda998x_connector_best_encoder() local
1379 return &priv->encoder; in tda998x_connector_best_encoder()
1407 struct tda998x_priv *priv; in tda998x_bind() local
1411 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); in tda998x_bind()
1412 if (!priv) in tda998x_bind()
1415 dev_set_drvdata(dev, priv); in tda998x_bind()
1426 priv->connector.interlace_allowed = 1; in tda998x_bind()
1427 priv->encoder.possible_crtcs = crtcs; in tda998x_bind()
1429 ret = tda998x_create(client, priv); in tda998x_bind()
1434 tda998x_encoder_set_config(priv, params); in tda998x_bind()
1436 tda998x_encoder_set_polling(priv, &priv->connector); in tda998x_bind()
1438 drm_encoder_helper_add(&priv->encoder, &tda998x_encoder_helper_funcs); in tda998x_bind()
1439 ret = drm_encoder_init(drm, &priv->encoder, &tda998x_encoder_funcs, in tda998x_bind()
1444 drm_connector_helper_add(&priv->connector, in tda998x_bind()
1446 ret = drm_connector_init(drm, &priv->connector, in tda998x_bind()
1452 ret = drm_connector_register(&priv->connector); in tda998x_bind()
1456 priv->connector.encoder = &priv->encoder; in tda998x_bind()
1457 drm_mode_connector_attach_encoder(&priv->connector, &priv->encoder); in tda998x_bind()
1462 drm_connector_cleanup(&priv->connector); in tda998x_bind()
1464 drm_encoder_cleanup(&priv->encoder); in tda998x_bind()
1466 tda998x_destroy(priv); in tda998x_bind()
1473 struct tda998x_priv *priv = dev_get_drvdata(dev); in tda998x_unbind() local
1475 drm_connector_cleanup(&priv->connector); in tda998x_unbind()
1476 drm_encoder_cleanup(&priv->encoder); in tda998x_unbind()
1477 tda998x_destroy(priv); in tda998x_unbind()