diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe.c b/drivers/amlogic/media/vin/tvin/tvafe/tvafe.c index de260d26af3f..3ba85d6bc0d1 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe.c +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe.c @@ -347,6 +347,15 @@ void tvafe_dec_start(struct tvin_frontend_s *fe, enum tvin_sig_fmt_e fmt) ((port == TVIN_PORT_CVBS1) || (port == TVIN_PORT_CVBS2))) W_APB_REG(CVD2_H_LOOP_MAXSTATE, 0x9); +#ifdef CONFIG_AMLOGIC_MEDIA_TVIN_AVDETECT + if (tvafe_cpu_type() == CPU_TYPE_TXLX) { + if (port == TVIN_PORT_CVBS1) + tvafe_avin_detect_ch1_anlog_enable(0); + else if (port == TVIN_PORT_CVBS2) + tvafe_avin_detect_ch2_anlog_enable(0); + } +#endif + tvafe->parm.info.fmt = fmt; tvafe->parm.info.status = TVIN_SIG_STATUS_STABLE; @@ -404,6 +413,15 @@ void tvafe_dec_stop(struct tvin_frontend_s *fe, enum tvin_port_e port) #endif tvafe_cvd2_set_default_de(&tvafe->cvd2); } +#ifdef CONFIG_AMLOGIC_MEDIA_TVIN_AVDETECT + if (tvafe_cpu_type() == CPU_TYPE_TXLX) { + if (port == TVIN_PORT_CVBS1) + tvafe_avin_detect_ch1_anlog_enable(1); + else if (port == TVIN_PORT_CVBS2) + tvafe_avin_detect_ch2_anlog_enable(1); + } +#endif + devp->flags &= (~TVAFE_FLAG_DEV_STARTED); tvafe_pr_info("%s stop port:0x%x ok.\n", __func__, port); diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_avin_detect.h b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_avin_detect.h index aa7d9618af08..51cc7b330e42 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_avin_detect.h +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_avin_detect.h @@ -110,6 +110,8 @@ void tvafe_cha1_SYNCTIP_close_config(void); void tvafe_cha2_SYNCTIP_close_config(void); void tvafe_cha1_detect_restart_config(void); void tvafe_cha2_detect_restart_config(void); +void tvafe_avin_detect_ch1_anlog_enable(bool enable); +void tvafe_avin_detect_ch2_anlog_enable(bool enable); /*opened port,1:av1, 2:av2, 0:none av*/ extern unsigned int avport_opened;