diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c index f926643d099c..c0156b8b694c 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_cvd.c @@ -153,12 +153,11 @@ module_param(config_force_fmt, uint, 0664); MODULE_PARM_DESC(config_force_fmt, "after try TRY_FORMAT_MAX times ,we will force one fmt"); -/*0:normal 1:force nonstandard configure*/ -/*2:force don't nonstandard configure*/ -static unsigned int force_nostd = 2; -module_param(force_nostd, uint, 0644); -MODULE_PARM_DESC(force_nostd, - "fixed nosig problem by removing the nostd config.\n"); +/*0:normal nonstandard configure every loop*/ +/*1:force nonstandard configure every loop*/ +/*2:nonstandard configure once*/ +/*3:force don't nonstandard configure*/ +unsigned int force_nostd = 2; /*0x001:enable cdto adj 0x010:enable 3d adj 0x100:enable pga;*/ /*0x1000:enable hs adj,which can instead cdto*/ @@ -587,7 +586,7 @@ static void tvafe_cvd2_non_std_config(struct tvafe_cvd2_s *cvd2) if (force_nostd == 3) return; if ((cvd2->info.non_std_config == cvd2->info.non_std_enable) && - (force_nostd&0x2)) + (force_nostd == 2)) return; cvd2->info.non_std_config = cvd2->info.non_std_enable; if (cvd2->info.non_std_config && (!(force_nostd&0x1))) { @@ -1236,6 +1235,14 @@ static void tvafe_cvd2_non_std_signal_det( cvd2->info.non_std_enable = 0; } } + + if (print_cnt == 0x28) { + if (cvd_nonstd_dbg_en) { + tvafe_pr_info("%s: nonstd_cnt=%d, nonstd_flag=%d, dgain=0x%x, non_std_enable=%d\n", + __func__, nonstd_cnt, nonstd_flag, dgain, + cvd2->info.non_std_enable); + } + } } /* diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_debug.c b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_debug.c index f6786fe1a83a..c2d581087ea8 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_debug.c +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_debug.c @@ -199,11 +199,10 @@ static ssize_t tvafe_store(struct device *dev, struct device_attribute *attr, const char *buff, size_t count) { unsigned char fmt_index = 0; - struct tvafe_dev_s *devp; unsigned long tmp = 0; char *buf_orig, *parm[47] = {NULL}; - long val; + unsigned int val; devp = dev_get_drvdata(dev); if (!buff) @@ -234,17 +233,15 @@ static ssize_t tvafe_store(struct device *dev, else tvafe_pr_info("%s:invaild command.", buff); } else if (!strncmp(buff, "disableapi", strlen("disableapi"))) { - if (kstrtoul(buff+strlen("disableapi")+1, 10, &tmp) == 0) - disableapi = tmp; + if (kstrtouint(buff+strlen("disableapi")+1, 10, &val) == 0) + disableapi = val; } else if (!strncmp(buff, "force_stable", strlen("force_stable"))) { - if (kstrtoul(buff+strlen("force_stable")+1, 10, &tmp) == 0) - force_stable = tmp; + if (kstrtouint(buff+strlen("force_stable")+1, 10, &val) == 0) + force_stable = val; } else if (!strncmp(buff, "tvafe_enable", strlen("tvafe_enable"))) { - if (kstrtoul(parm[1], 10, &val) < 0) { - kfree(buf_orig); - return -EINVAL; - } + if (kstrtouint(parm[1], 10, &val) < 0) + goto tvafe_store_err; if (val) { tvafe_enable_module(true); devp->flags &= (~TVAFE_POWERDOWN_IN_IDLE); @@ -300,10 +297,8 @@ static ssize_t tvafe_store(struct device *dev, /*patch for Very low probability hanging issue on atv close*/ /*only appeared in one project,this for reserved debug*/ /*default setting to disable the nonstandard signal detect*/ - if (kstrtoul(parm[1], 10, &val) < 0) { - kfree(buf_orig); - return -EINVAL; - } + if (kstrtouint(parm[1], 10, &val) < 0) + goto tvafe_store_err; if (val) { devp->tvafe.cvd2.nonstd_detect_dis = true; pr_info("[tvafe..]%s:disable nonstd detect\n", @@ -331,6 +326,10 @@ static ssize_t tvafe_store(struct device *dev, tvafe_pr_info("[%s]:invaild command.\n", __func__); kfree(buf_orig); return count; + +tvafe_store_err: + kfree(buf_orig); + return -EINVAL; } static ssize_t tvafe_show(struct device *dev,