From: Nian Jing Date: Fri, 22 Jun 2018 12:13:56 +0000 (+0800) Subject: tvafe: atv default not support ntsc 50 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1f5488e2c660e7066334fd2948c3b925c49da69f;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git tvafe: atv default not support ntsc 50 PD#167487: atv default not support ntsc 50 Change-Id: I723f2cf1b26056a4adef39eb76a22596ac878e69 Signed-off-by: Nian Jing --- diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c index b87e45fca7b4..7fa710b812d0 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c @@ -115,6 +115,7 @@ static int auto_de_en = 1; static int lock_cnt; static unsigned int cvd_reg8a = 0xa; static int auto_vs_en = 1; +static bool ntsc50_en; module_param(auto_vs_en, int, 0664); MODULE_PARM_DESC(auto_vs_en, "auto_vs_en\n"); @@ -1635,11 +1636,13 @@ static void tvafe_cvd2_search_video_mode(struct tvafe_cvd2_s *cvd2, /* line625+brust358+pal*/ /*-> pal_cn */ cvd2->info.state = TVAFE_CVD2_STATE_FIND; - } else if (cvd2->hw.line625 && + } else if (((cvd2->vd_port == TVIN_PORT_CVBS1) || + (cvd2->vd_port == TVIN_PORT_CVBS2) || ntsc50_en) + && (cvd2->hw.line625 && cvd2->hw.fsc_358 && !cvd2->hw.pal && !cvd2->hw.fsc_443 && - !cvd2->hw.secam) + !cvd2->hw.secam)) tvafe_cvd2_try_format(cvd2, mem, TVIN_SIG_FMT_CVBS_NTSC_50); else { @@ -2589,6 +2592,12 @@ void tvafe_cvd2_set_reg8a(unsigned int v) cvd_reg8a = v; W_APB_REG(CVD2_CHROMA_LOOPFILTER_STATE, cvd_reg8a); } + +void tvafe_cvd2_rf_ntsc50_en(bool v) +{ + ntsc50_en = v; +} + void tvafe_snow_config(unsigned int onoff) { if (tvafe_snow_function_flag == 0 || diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.h b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.h index c69af513a9fc..0a851375ea83 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.h +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.h @@ -204,6 +204,7 @@ extern enum tvin_aspect_ratio_e tvafe_cvd2_get_wss(void); extern void tvafe_cvd2_get_signal_status(struct tvafe_cvd2_s *cvd2); extern void cvd_vbi_mem_set(unsigned int offset, unsigned int size); extern void cvd_vbi_config(void); +extern void tvafe_cvd2_rf_ntsc50_en(bool v); extern bool tvafe_snow_function_flag; diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_debug.c b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_debug.c index 0626b691074e..f4c07fee3609 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_debug.c +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_debug.c @@ -82,6 +82,8 @@ static void tvafe_state(struct tvafe_dev_s *devp) tvafe_pr_info("tvafe_cvd2_s->manual_fmt:0x%x\n", cvd2->manual_fmt); tvafe_pr_info("tvafe_cvd2_s->vd_port:0x%x\n", cvd2->vd_port); tvafe_pr_info("tvafe_cvd2_s->cvd2_init_en:%d\n", cvd2->cvd2_init_en); + tvafe_pr_info("tvafe_cvd2_s->nonstd_detect_dis:%d\n", + cvd2->nonstd_detect_dis); /* tvin_parm_s->tvin_info_s struct info */ tvafe_pr_info("\n!!tvin_parm_s->tvin_info_s struct info:\n"); tvafe_pr_info("tvin_info_s->trans_fmt:0x%x\n", tvin_info->trans_fmt); @@ -301,6 +303,20 @@ static ssize_t tvafe_store(struct device *dev, pr_info("[tvafe..]%s:enable nonstd detect\n", __func__); } + } else if (!strncmp(buff, "rf_ntsc50_en", strlen("rf_ntsc50_en"))) { + if (kstrtoul(parm[1], 10, &val) < 0) { + kfree(buf_orig); + return -EINVAL; + } + if (val) { + tvafe_cvd2_rf_ntsc50_en(true); + pr_info("[tvafe..]%s:tvafe_cvd2_rf_ntsc50_en\n", + __func__); + } else { + tvafe_cvd2_rf_ntsc50_en(false); + pr_info("[tvafe..]%s:tvafe_cvd2_rf_ntsc50_dis\n", + __func__); + } } else tvafe_pr_info("[%s]:invaild command.\n", __func__); kfree(buf_orig);