Lines Matching refs:priv
348 cec_write(struct tda998x_priv *priv, uint16_t addr, uint8_t val) in cec_write() argument
350 struct i2c_client *client = priv->cec; in cec_write()
360 cec_read(struct tda998x_priv *priv, uint8_t addr) in cec_read() argument
362 struct i2c_client *client = priv->cec; in cec_read()
382 set_page(struct tda998x_priv *priv, uint16_t reg) in set_page() argument
384 if (REG2PAGE(reg) != priv->current_page) { in set_page()
385 struct i2c_client *client = priv->hdmi; in set_page()
396 priv->current_page = REG2PAGE(reg); in set_page()
402 reg_read_range(struct tda998x_priv *priv, uint16_t reg, char *buf, int cnt) in reg_read_range() argument
404 struct i2c_client *client = priv->hdmi; in reg_read_range()
408 mutex_lock(&priv->mutex); in reg_read_range()
409 ret = set_page(priv, reg); in reg_read_range()
426 mutex_unlock(&priv->mutex); in reg_read_range()
431 reg_write_range(struct tda998x_priv *priv, uint16_t reg, uint8_t *p, int cnt) in reg_write_range() argument
433 struct i2c_client *client = priv->hdmi; in reg_write_range()
440 mutex_lock(&priv->mutex); in reg_write_range()
441 ret = set_page(priv, reg); in reg_write_range()
449 mutex_unlock(&priv->mutex); in reg_write_range()
453 reg_read(struct tda998x_priv *priv, uint16_t reg) in reg_read() argument
458 ret = reg_read_range(priv, reg, &val, sizeof(val)); in reg_read()
465 reg_write(struct tda998x_priv *priv, uint16_t reg, uint8_t val) in reg_write() argument
467 struct i2c_client *client = priv->hdmi; in reg_write()
471 mutex_lock(&priv->mutex); in reg_write()
472 ret = set_page(priv, reg); in reg_write()
480 mutex_unlock(&priv->mutex); in reg_write()
484 reg_write16(struct tda998x_priv *priv, uint16_t reg, uint16_t val) in reg_write16() argument
486 struct i2c_client *client = priv->hdmi; in reg_write16()
490 mutex_lock(&priv->mutex); in reg_write16()
491 ret = set_page(priv, reg); in reg_write16()
499 mutex_unlock(&priv->mutex); in reg_write16()
503 reg_set(struct tda998x_priv *priv, uint16_t reg, uint8_t val) in reg_set() argument
507 old_val = reg_read(priv, reg); in reg_set()
509 reg_write(priv, reg, old_val | val); in reg_set()
513 reg_clear(struct tda998x_priv *priv, uint16_t reg, uint8_t val) in reg_clear() argument
517 old_val = reg_read(priv, reg); in reg_clear()
519 reg_write(priv, reg, old_val & ~val); in reg_clear()
523 tda998x_reset(struct tda998x_priv *priv) in tda998x_reset() argument
526 reg_write(priv, REG_SOFTRESET, SOFTRESET_AUDIO | SOFTRESET_I2C_MASTER); in tda998x_reset()
528 reg_write(priv, REG_SOFTRESET, 0); in tda998x_reset()
532 reg_set(priv, REG_MAIN_CNTRL0, MAIN_CNTRL0_SR); in tda998x_reset()
533 reg_clear(priv, REG_MAIN_CNTRL0, MAIN_CNTRL0_SR); in tda998x_reset()
536 reg_write(priv, REG_PLL_SERIAL_1, 0x00); in tda998x_reset()
537 reg_write(priv, REG_PLL_SERIAL_2, PLL_SERIAL_2_SRL_NOSC(1)); in tda998x_reset()
538 reg_write(priv, REG_PLL_SERIAL_3, 0x00); in tda998x_reset()
539 reg_write(priv, REG_SERIALIZER, 0x00); in tda998x_reset()
540 reg_write(priv, REG_BUFFER_OUT, 0x00); in tda998x_reset()
541 reg_write(priv, REG_PLL_SCG1, 0x00); in tda998x_reset()
542 reg_write(priv, REG_AUDIO_DIV, AUDIO_DIV_SERCLK_8); in tda998x_reset()
543 reg_write(priv, REG_SEL_CLK, SEL_CLK_SEL_CLK1 | SEL_CLK_ENA_SC_CLK); in tda998x_reset()
544 reg_write(priv, REG_PLL_SCGN1, 0xfa); in tda998x_reset()
545 reg_write(priv, REG_PLL_SCGN2, 0x00); in tda998x_reset()
546 reg_write(priv, REG_PLL_SCGR1, 0x5b); in tda998x_reset()
547 reg_write(priv, REG_PLL_SCGR2, 0x00); in tda998x_reset()
548 reg_write(priv, REG_PLL_SCG2, 0x10); in tda998x_reset()
551 reg_write(priv, REG_MUX_VP_VIP_OUT, 0x24); in tda998x_reset()
558 struct tda998x_priv *priv = in tda998x_hpd() local
561 if (priv->encoder && priv->encoder->dev) in tda998x_hpd()
562 drm_kms_helper_hotplug_event(priv->encoder->dev); in tda998x_hpd()
570 struct tda998x_priv *priv = data; in tda998x_irq_thread() local
573 if (!priv) in tda998x_irq_thread()
575 sta = cec_read(priv, REG_CEC_INTSTATUS); in tda998x_irq_thread()
576 cec = cec_read(priv, REG_CEC_RXSHPDINT); in tda998x_irq_thread()
577 lvl = cec_read(priv, REG_CEC_RXSHPDLEV); in tda998x_irq_thread()
578 flag0 = reg_read(priv, REG_INT_FLAGS_0); in tda998x_irq_thread()
579 flag1 = reg_read(priv, REG_INT_FLAGS_1); in tda998x_irq_thread()
580 flag2 = reg_read(priv, REG_INT_FLAGS_2); in tda998x_irq_thread()
584 if ((flag2 & INT_FLAGS_2_EDID_BLK_RD) && priv->wq_edid_wait) { in tda998x_irq_thread()
585 priv->wq_edid_wait = 0; in tda998x_irq_thread()
586 wake_up(&priv->wq_edid); in tda998x_irq_thread()
588 schedule_delayed_work(&priv->dwork, HZ/10); in tda998x_irq_thread()
606 tda998x_write_if(struct tda998x_priv *priv, uint8_t bit, uint16_t addr, in tda998x_write_if() argument
611 reg_clear(priv, REG_DIP_IF_FLAGS, bit); in tda998x_write_if()
612 reg_write_range(priv, addr, buf, size); in tda998x_write_if()
613 reg_set(priv, REG_DIP_IF_FLAGS, bit); in tda998x_write_if()
617 tda998x_write_aif(struct tda998x_priv *priv, struct tda998x_encoder_params *p) in tda998x_write_aif() argument
630 tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, buf, in tda998x_write_aif()
635 tda998x_write_avi(struct tda998x_priv *priv, struct drm_display_mode *mode) in tda998x_write_avi() argument
648 tda998x_write_if(priv, DIP_IF_FLAGS_IF2, REG_IF2_HB0, buf, in tda998x_write_avi()
652 static void tda998x_audio_mute(struct tda998x_priv *priv, bool on) in tda998x_audio_mute() argument
655 reg_set(priv, REG_SOFTRESET, SOFTRESET_AUDIO); in tda998x_audio_mute()
656 reg_clear(priv, REG_SOFTRESET, SOFTRESET_AUDIO); in tda998x_audio_mute()
657 reg_set(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_FIFO); in tda998x_audio_mute()
659 reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_FIFO); in tda998x_audio_mute()
664 tda998x_configure_audio(struct tda998x_priv *priv, in tda998x_configure_audio() argument
671 reg_write(priv, REG_ENA_AP, p->audio_cfg); in tda998x_configure_audio()
672 reg_write(priv, REG_ENA_ACLK, p->audio_clk_cfg); in tda998x_configure_audio()
677 reg_write(priv, REG_MUX_AP, MUX_AP_SELECT_SPDIF); in tda998x_configure_audio()
684 reg_write(priv, REG_MUX_AP, MUX_AP_SELECT_I2S); in tda998x_configure_audio()
695 reg_write(priv, REG_AIP_CLKSEL, clksel_aip); in tda998x_configure_audio()
696 reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_LAYOUT | in tda998x_configure_audio()
698 reg_write(priv, REG_CTS_N, cts_n); in tda998x_configure_audio()
715 reg_write(priv, REG_AUDIO_DIV, adiv); in tda998x_configure_audio()
730 reg_write_range(priv, REG_ACR_CTS_0, buf, 6); in tda998x_configure_audio()
733 reg_write(priv, REG_AIP_CLKSEL, clksel_aip | clksel_fs); in tda998x_configure_audio()
736 reg_set(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_CTS); in tda998x_configure_audio()
737 reg_clear(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_CTS); in tda998x_configure_audio()
745 reg_write_range(priv, REG_CH_STAT_B(0), buf, 4); in tda998x_configure_audio()
747 tda998x_audio_mute(priv, true); in tda998x_configure_audio()
749 tda998x_audio_mute(priv, false); in tda998x_configure_audio()
752 tda998x_write_aif(priv, p); in tda998x_configure_audio()
757 static void tda998x_encoder_set_config(struct tda998x_priv *priv, in tda998x_encoder_set_config() argument
760 priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(p->swap_a) | in tda998x_encoder_set_config()
764 priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(p->swap_c) | in tda998x_encoder_set_config()
768 priv->vip_cntrl_2 = VIP_CNTRL_2_SWAP_E(p->swap_e) | in tda998x_encoder_set_config()
773 priv->params = *p; in tda998x_encoder_set_config()
776 static void tda998x_encoder_dpms(struct tda998x_priv *priv, int mode) in tda998x_encoder_dpms() argument
782 if (mode == priv->dpms) in tda998x_encoder_dpms()
788 reg_write(priv, REG_ENA_VP_0, 0xff); in tda998x_encoder_dpms()
789 reg_write(priv, REG_ENA_VP_1, 0xff); in tda998x_encoder_dpms()
790 reg_write(priv, REG_ENA_VP_2, 0xff); in tda998x_encoder_dpms()
792 reg_write(priv, REG_VIP_CNTRL_0, priv->vip_cntrl_0); in tda998x_encoder_dpms()
793 reg_write(priv, REG_VIP_CNTRL_1, priv->vip_cntrl_1); in tda998x_encoder_dpms()
794 reg_write(priv, REG_VIP_CNTRL_2, priv->vip_cntrl_2); in tda998x_encoder_dpms()
798 reg_write(priv, REG_ENA_VP_0, 0x00); in tda998x_encoder_dpms()
799 reg_write(priv, REG_ENA_VP_1, 0x00); in tda998x_encoder_dpms()
800 reg_write(priv, REG_ENA_VP_2, 0x00); in tda998x_encoder_dpms()
804 priv->dpms = mode; in tda998x_encoder_dpms()
827 static int tda998x_encoder_mode_valid(struct tda998x_priv *priv, in tda998x_encoder_mode_valid() argument
840 tda998x_encoder_mode_set(struct tda998x_priv *priv, in tda998x_encoder_mode_set() argument
922 reg_set(priv, REG_AIP_CNTRL_0, AIP_CNTRL_0_RST_FIFO); in tda998x_encoder_mode_set()
925 reg_write(priv, REG_TBG_CNTRL_1, TBG_CNTRL_1_DWIN_DIS); in tda998x_encoder_mode_set()
926 reg_clear(priv, REG_TX33, TX33_HDMI); in tda998x_encoder_mode_set()
927 reg_write(priv, REG_ENC_CNTRL, ENC_CNTRL_CTL_CODE(0)); in tda998x_encoder_mode_set()
930 reg_write(priv, REG_HVF_CNTRL_0, HVF_CNTRL_0_PREFIL(0) | in tda998x_encoder_mode_set()
932 reg_write(priv, REG_VIP_CNTRL_5, VIP_CNTRL_5_SP_CNT(0)); in tda998x_encoder_mode_set()
933 reg_write(priv, REG_VIP_CNTRL_4, VIP_CNTRL_4_BLANKIT(0) | in tda998x_encoder_mode_set()
936 reg_clear(priv, REG_PLL_SERIAL_1, PLL_SERIAL_1_SRL_MAN_IZ); in tda998x_encoder_mode_set()
937 reg_clear(priv, REG_PLL_SERIAL_3, PLL_SERIAL_3_SRL_CCIR | in tda998x_encoder_mode_set()
939 reg_write(priv, REG_SERIALIZER, 0); in tda998x_encoder_mode_set()
940 reg_write(priv, REG_HVF_CNTRL_1, HVF_CNTRL_1_VQR(0)); in tda998x_encoder_mode_set()
944 reg_write(priv, REG_RPT_CNTRL, 0); in tda998x_encoder_mode_set()
945 reg_write(priv, REG_SEL_CLK, SEL_CLK_SEL_VRF_CLK(0) | in tda998x_encoder_mode_set()
948 reg_write(priv, REG_PLL_SERIAL_2, PLL_SERIAL_2_SRL_NOSC(div) | in tda998x_encoder_mode_set()
952 reg_write(priv, REG_MAT_CONTRL, MAT_CONTRL_MAT_BP | in tda998x_encoder_mode_set()
956 reg_write(priv, REG_ANA_GENERAL, 0x09); in tda998x_encoder_mode_set()
971 reg_write(priv, REG_VIP_CNTRL_3, reg); in tda998x_encoder_mode_set()
973 reg_write(priv, REG_VIDFORMAT, 0x00); in tda998x_encoder_mode_set()
974 reg_write16(priv, REG_REFPIX_MSB, ref_pix); in tda998x_encoder_mode_set()
975 reg_write16(priv, REG_REFLINE_MSB, ref_line); in tda998x_encoder_mode_set()
976 reg_write16(priv, REG_NPIX_MSB, n_pix); in tda998x_encoder_mode_set()
977 reg_write16(priv, REG_NLINE_MSB, n_line); in tda998x_encoder_mode_set()
978 reg_write16(priv, REG_VS_LINE_STRT_1_MSB, vs1_line_s); in tda998x_encoder_mode_set()
979 reg_write16(priv, REG_VS_PIX_STRT_1_MSB, vs1_pix_s); in tda998x_encoder_mode_set()
980 reg_write16(priv, REG_VS_LINE_END_1_MSB, vs1_line_e); in tda998x_encoder_mode_set()
981 reg_write16(priv, REG_VS_PIX_END_1_MSB, vs1_pix_e); in tda998x_encoder_mode_set()
982 reg_write16(priv, REG_VS_LINE_STRT_2_MSB, vs2_line_s); in tda998x_encoder_mode_set()
983 reg_write16(priv, REG_VS_PIX_STRT_2_MSB, vs2_pix_s); in tda998x_encoder_mode_set()
984 reg_write16(priv, REG_VS_LINE_END_2_MSB, vs2_line_e); in tda998x_encoder_mode_set()
985 reg_write16(priv, REG_VS_PIX_END_2_MSB, vs2_pix_e); in tda998x_encoder_mode_set()
986 reg_write16(priv, REG_HS_PIX_START_MSB, hs_pix_s); in tda998x_encoder_mode_set()
987 reg_write16(priv, REG_HS_PIX_STOP_MSB, hs_pix_e); in tda998x_encoder_mode_set()
988 reg_write16(priv, REG_VWIN_START_1_MSB, vwin1_line_s); in tda998x_encoder_mode_set()
989 reg_write16(priv, REG_VWIN_END_1_MSB, vwin1_line_e); in tda998x_encoder_mode_set()
990 reg_write16(priv, REG_VWIN_START_2_MSB, vwin2_line_s); in tda998x_encoder_mode_set()
991 reg_write16(priv, REG_VWIN_END_2_MSB, vwin2_line_e); in tda998x_encoder_mode_set()
992 reg_write16(priv, REG_DE_START_MSB, de_pix_s); in tda998x_encoder_mode_set()
993 reg_write16(priv, REG_DE_STOP_MSB, de_pix_e); in tda998x_encoder_mode_set()
995 if (priv->rev == TDA19988) { in tda998x_encoder_mode_set()
997 reg_write(priv, REG_ENABLE_SPACE, 0x00); in tda998x_encoder_mode_set()
1009 reg_write(priv, REG_TBG_CNTRL_1, reg); in tda998x_encoder_mode_set()
1012 reg_write(priv, REG_TBG_CNTRL_0, 0); in tda998x_encoder_mode_set()
1015 if (priv->is_hdmi_sink) { in tda998x_encoder_mode_set()
1018 reg_write(priv, REG_TBG_CNTRL_1, reg); in tda998x_encoder_mode_set()
1019 reg_write(priv, REG_ENC_CNTRL, ENC_CNTRL_CTL_CODE(1)); in tda998x_encoder_mode_set()
1020 reg_set(priv, REG_TX33, TX33_HDMI); in tda998x_encoder_mode_set()
1022 tda998x_write_avi(priv, adjusted_mode); in tda998x_encoder_mode_set()
1024 if (priv->params.audio_cfg) in tda998x_encoder_mode_set()
1025 tda998x_configure_audio(priv, adjusted_mode, in tda998x_encoder_mode_set()
1026 &priv->params); in tda998x_encoder_mode_set()
1031 tda998x_encoder_detect(struct tda998x_priv *priv) in tda998x_encoder_detect() argument
1033 uint8_t val = cec_read(priv, REG_CEC_RXSHPDLEV); in tda998x_encoder_detect()
1041 struct tda998x_priv *priv = data; in read_edid_block() local
1048 reg_write(priv, REG_DDC_ADDR, 0xa0); in read_edid_block()
1049 reg_write(priv, REG_DDC_OFFS, offset); in read_edid_block()
1050 reg_write(priv, REG_DDC_SEGM_ADDR, 0x60); in read_edid_block()
1051 reg_write(priv, REG_DDC_SEGM, segptr); in read_edid_block()
1054 priv->wq_edid_wait = 1; in read_edid_block()
1055 reg_write(priv, REG_EDID_CTRL, 0x1); in read_edid_block()
1058 reg_write(priv, REG_EDID_CTRL, 0x0); in read_edid_block()
1061 if (priv->hdmi->irq) { in read_edid_block()
1062 i = wait_event_timeout(priv->wq_edid, in read_edid_block()
1063 !priv->wq_edid_wait, in read_edid_block()
1066 dev_err(&priv->hdmi->dev, "read edid wait err %d\n", i); in read_edid_block()
1072 ret = reg_read(priv, REG_INT_FLAGS_2); in read_edid_block()
1081 dev_err(&priv->hdmi->dev, "read edid timeout\n"); in read_edid_block()
1085 ret = reg_read_range(priv, REG_EDID_DATA_0, buf, length); in read_edid_block()
1087 dev_err(&priv->hdmi->dev, "failed to read edid block %d: %d\n", in read_edid_block()
1096 tda998x_encoder_get_modes(struct tda998x_priv *priv, in tda998x_encoder_get_modes() argument
1102 if (priv->rev == TDA19988) in tda998x_encoder_get_modes()
1103 reg_clear(priv, REG_TX4, TX4_PD_RAM); in tda998x_encoder_get_modes()
1105 edid = drm_do_get_edid(connector, read_edid_block, priv); in tda998x_encoder_get_modes()
1107 if (priv->rev == TDA19988) in tda998x_encoder_get_modes()
1108 reg_set(priv, REG_TX4, TX4_PD_RAM); in tda998x_encoder_get_modes()
1111 dev_warn(&priv->hdmi->dev, "failed to read EDID\n"); in tda998x_encoder_get_modes()
1117 priv->is_hdmi_sink = drm_detect_hdmi_monitor(edid); in tda998x_encoder_get_modes()
1123 static void tda998x_encoder_set_polling(struct tda998x_priv *priv, in tda998x_encoder_set_polling() argument
1126 if (priv->hdmi->irq) in tda998x_encoder_set_polling()
1143 static void tda998x_destroy(struct tda998x_priv *priv) in tda998x_destroy() argument
1146 cec_write(priv, REG_CEC_RXSHPDINTENA, 0); in tda998x_destroy()
1147 reg_clear(priv, REG_INT_FLAGS_2, INT_FLAGS_2_EDID_BLK_RD); in tda998x_destroy()
1148 if (priv->hdmi->irq) { in tda998x_destroy()
1149 free_irq(priv->hdmi->irq, priv); in tda998x_destroy()
1150 cancel_delayed_work_sync(&priv->dwork); in tda998x_destroy()
1153 i2c_unregister_device(priv->cec); in tda998x_destroy()
1166 struct tda998x_priv *priv = to_tda998x_priv(encoder); in tda998x_encoder_slave_destroy() local
1168 tda998x_destroy(priv); in tda998x_encoder_slave_destroy()
1170 kfree(priv); in tda998x_encoder_slave_destroy()
1230 static int tda998x_create(struct i2c_client *client, struct tda998x_priv *priv) in tda998x_create() argument
1237 priv->vip_cntrl_0 = VIP_CNTRL_0_SWAP_A(2) | VIP_CNTRL_0_SWAP_B(3); in tda998x_create()
1238 priv->vip_cntrl_1 = VIP_CNTRL_1_SWAP_C(0) | VIP_CNTRL_1_SWAP_D(1); in tda998x_create()
1239 priv->vip_cntrl_2 = VIP_CNTRL_2_SWAP_E(4) | VIP_CNTRL_2_SWAP_F(5); in tda998x_create()
1241 priv->current_page = 0xff; in tda998x_create()
1242 priv->hdmi = client; in tda998x_create()
1245 priv->cec = i2c_new_dummy(client->adapter, cec_addr); in tda998x_create()
1246 if (!priv->cec) in tda998x_create()
1249 priv->dpms = DRM_MODE_DPMS_OFF; in tda998x_create()
1251 mutex_init(&priv->mutex); /* protect the page access */ in tda998x_create()
1254 cec_write(priv, REG_CEC_ENAMODS, in tda998x_create()
1257 tda998x_reset(priv); in tda998x_create()
1260 rev_lo = reg_read(priv, REG_VERSION_LSB); in tda998x_create()
1261 rev_hi = reg_read(priv, REG_VERSION_MSB); in tda998x_create()
1267 priv->rev = rev_lo | rev_hi << 8; in tda998x_create()
1270 priv->rev &= ~0x30; /* not-hdcp and not-scalar bit */ in tda998x_create()
1272 switch (priv->rev) { in tda998x_create()
1287 priv->rev); in tda998x_create()
1292 reg_write(priv, REG_DDC_DISABLE, 0x00); in tda998x_create()
1295 reg_write(priv, REG_TX3, 39); in tda998x_create()
1298 if (priv->rev == TDA19989) in tda998x_create()
1299 reg_set(priv, REG_I2C_MASTER, I2C_MASTER_DIS_MM); in tda998x_create()
1301 cec_write(priv, REG_CEC_FRO_IM_CLK_CTRL, in tda998x_create()
1309 init_waitqueue_head(&priv->wq_edid); in tda998x_create()
1310 INIT_DELAYED_WORK(&priv->dwork, tda998x_hpd); in tda998x_create()
1313 reg_read(priv, REG_INT_FLAGS_0); in tda998x_create()
1314 reg_read(priv, REG_INT_FLAGS_1); in tda998x_create()
1315 reg_read(priv, REG_INT_FLAGS_2); in tda998x_create()
1322 "tda998x", priv); in tda998x_create()
1331 cec_write(priv, REG_CEC_RXSHPDINTENA, CEC_RXSHPDLEV_HPD); in tda998x_create()
1335 reg_set(priv, REG_INT_FLAGS_2, INT_FLAGS_2_EDID_BLK_RD); in tda998x_create()
1343 priv->vip_cntrl_0 = video >> 16; in tda998x_create()
1344 priv->vip_cntrl_1 = video >> 8; in tda998x_create()
1345 priv->vip_cntrl_2 = video; in tda998x_create()
1354 if (priv->cec) in tda998x_create()
1355 i2c_unregister_device(priv->cec); in tda998x_create()
1363 struct tda998x_priv *priv; in tda998x_encoder_init() local
1366 priv = kzalloc(sizeof(*priv), GFP_KERNEL); in tda998x_encoder_init()
1367 if (!priv) in tda998x_encoder_init()
1370 priv->encoder = &encoder_slave->base; in tda998x_encoder_init()
1372 ret = tda998x_create(client, priv); in tda998x_encoder_init()
1374 kfree(priv); in tda998x_encoder_init()
1378 encoder_slave->slave_priv = priv; in tda998x_encoder_init()
1398 struct tda998x_priv2 *priv = enc_to_tda998x_priv2(encoder); in tda998x_encoder2_dpms() local
1400 tda998x_encoder_dpms(&priv->base, mode); in tda998x_encoder2_dpms()
1417 struct tda998x_priv2 *priv = enc_to_tda998x_priv2(encoder); in tda998x_encoder2_mode_set() local
1419 tda998x_encoder_mode_set(&priv->base, mode, adjusted_mode); in tda998x_encoder2_mode_set()
1434 struct tda998x_priv2 *priv = enc_to_tda998x_priv2(encoder); in tda998x_encoder_destroy() local
1436 tda998x_destroy(&priv->base); in tda998x_encoder_destroy()
1446 struct tda998x_priv2 *priv = conn_to_tda998x_priv2(connector); in tda998x_connector_get_modes() local
1448 return tda998x_encoder_get_modes(&priv->base, connector); in tda998x_connector_get_modes()
1454 struct tda998x_priv2 *priv = conn_to_tda998x_priv2(connector); in tda998x_connector_mode_valid() local
1456 return tda998x_encoder_mode_valid(&priv->base, mode); in tda998x_connector_mode_valid()
1462 struct tda998x_priv2 *priv = conn_to_tda998x_priv2(connector); in tda998x_connector_best_encoder() local
1464 return &priv->encoder; in tda998x_connector_best_encoder()
1477 struct tda998x_priv2 *priv = conn_to_tda998x_priv2(connector); in tda998x_connector_detect() local
1479 return tda998x_encoder_detect(&priv->base); in tda998x_connector_detect()
1500 struct tda998x_priv2 *priv; in tda998x_bind() local
1504 priv = devm_kzalloc(dev, sizeof(*priv), GFP_KERNEL); in tda998x_bind()
1505 if (!priv) in tda998x_bind()
1508 dev_set_drvdata(dev, priv); in tda998x_bind()
1519 priv->base.encoder = &priv->encoder; in tda998x_bind()
1520 priv->connector.interlace_allowed = 1; in tda998x_bind()
1521 priv->encoder.possible_crtcs = crtcs; in tda998x_bind()
1523 ret = tda998x_create(client, &priv->base); in tda998x_bind()
1528 tda998x_encoder_set_config(&priv->base, params); in tda998x_bind()
1530 tda998x_encoder_set_polling(&priv->base, &priv->connector); in tda998x_bind()
1532 drm_encoder_helper_add(&priv->encoder, &tda998x_encoder_helper_funcs); in tda998x_bind()
1533 ret = drm_encoder_init(drm, &priv->encoder, &tda998x_encoder_funcs, in tda998x_bind()
1538 drm_connector_helper_add(&priv->connector, in tda998x_bind()
1540 ret = drm_connector_init(drm, &priv->connector, in tda998x_bind()
1546 ret = drm_connector_register(&priv->connector); in tda998x_bind()
1550 priv->connector.encoder = &priv->encoder; in tda998x_bind()
1551 drm_mode_connector_attach_encoder(&priv->connector, &priv->encoder); in tda998x_bind()
1556 drm_connector_cleanup(&priv->connector); in tda998x_bind()
1558 drm_encoder_cleanup(&priv->encoder); in tda998x_bind()
1560 tda998x_destroy(&priv->base); in tda998x_bind()
1567 struct tda998x_priv2 *priv = dev_get_drvdata(dev); in tda998x_unbind() local
1569 drm_connector_cleanup(&priv->connector); in tda998x_unbind()
1570 drm_encoder_cleanup(&priv->encoder); in tda998x_unbind()
1571 tda998x_destroy(&priv->base); in tda998x_unbind()