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*/
time_non_count = 200;
if (force_nostd == 3)
return;
+ if (cvd_nonstd_dbg_en) {
+ tvafe_pr_info("%s: force_nostd=%d, non_std_config=%d, non_std_enable=%d\n",
+ __func__, force_nostd,
+ cvd2->info.non_std_config,
+ cvd2->info.non_std_enable);
+ }
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))) {
if (cvd_nonstd_dbg_en) {
- tvafe_pr_info("%s: config non-std signal reg.\n",
- __func__);
- tvafe_pr_info("%s: noise_strenth=%d.\n",
- __func__, noise_strenth);
+ tvafe_pr_info("%s: config non-std signal reg, noise_strenth=%d\n",
+ __func__, noise_strenth);
}
#ifdef CONFIG_AM_SI2176
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);
+ }
+ }
}
/*
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)
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);
} else if (!strncmp(buff, "afe_ver", strlen("afe_ver"))) {
tvafe_pr_info("tvafe version : %s\n", TVAFE_VER);
} else if (!strncmp(buff, "snowcfg", strlen("snowcfg"))) {
- 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_set_snow_cfg(true);
tvafe_pr_info("[tvafe..]hadware snow cfg en\n");
tvafe_pr_info("[tvafe..]hadware snow cfg dis\n");
}
} else if (!strncmp(buff, "snowon", strlen("snowon"))) {
- 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_snow_config(1);
tvafe_snow_config_clamp(1);
tvafe_pr_info("%s:tvafe snowoff\n", __func__);
}
} else if (!strcmp(parm[0], "frame_skip_enable")) {
- if (kstrtoul(parm[1], 10, &val) < 0) {
- kfree(buf_orig);
- return -EINVAL;
- }
+ if (kstrtouint(parm[1], 10, &val) < 0)
+ goto tvafe_store_err;
devp->frame_skip_enable = val;
tvafe_pr_info("frame_skip_enable:%d\n",
devp->frame_skip_enable);
/*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",
__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 (kstrtouint(parm[1], 10, &val) < 0)
+ goto tvafe_store_err;
if (val) {
tvafe_cvd2_rf_ntsc50_en(true);
pr_info("[tvafe..]%s:tvafe_cvd2_rf_ntsc50_en\n",
pr_info("[tvafe..]%s:tvafe_cvd2_rf_ntsc50_dis\n",
__func__);
}
+ } else if (!strncmp(buff, "force_nostd", strlen("force_nostd"))) {
+ if (kstrtouint(parm[1], 10, &force_nostd) < 0)
+ goto tvafe_store_err;
+ pr_info("[tvafe..]%s: set force_nostd = %d\n",
+ __func__, force_nostd);
} else
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,
"echo frame_skip_enable val(d) > /sys/class/tvafe/tvafe0/debug;frame skip enable/disable\n");
len += sprintf(buf+len,
"echo state > /sys/class/tvafe/tvafe0/debug;show tvafe status\n");
+ len += sprintf(buf+len,
+ "echo force_nostd val(d) > /sys/class/tvafe/tvafe0/debug;set force_nostd policy\n");
return len;
}