tvafe: atv default not support ntsc 50
authorNian Jing <nian.jing@amlogic.com>
Fri, 22 Jun 2018 12:13:56 +0000 (20:13 +0800)
committerYixun Lan <yixun.lan@amlogic.com>
Mon, 2 Jul 2018 06:28:03 +0000 (23:28 -0700)
PD#167487: atv default not support ntsc 50

Change-Id: I723f2cf1b26056a4adef39eb76a22596ac878e69
Signed-off-by: Nian Jing <nian.jing@amlogic.com>
drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c
drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.h
drivers/amlogic/media/vin/tvin/tvafe/tvafe_debug.c

index b87e45fca7b45eedac77e16552815a78b22e0399..7fa710b812d06c047ea407f2db4e286634c69fb4 100644 (file)
@@ -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 ||
index c69af513a9fcd64439a214b66492bf2a5eaea5b8..0a851375ea83159cc2f9cfd7ae563e21cc727864 100644 (file)
@@ -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;
 
index 0626b691074e24e75f00c7832eb78d62f0e28112..f4c07fee3609d6e866a35a2c7dcdf70dca367aae 100644 (file)
@@ -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);