From deee9ec10856d603716cffe445552dc09fc556fb Mon Sep 17 00:00:00 2001 From: Nian Jing Date: Wed, 27 Feb 2019 19:31:40 +0800 Subject: [PATCH] vbi: add vbi debug print control [1/1] PD#SWPL-5217 Problem: vbi debug print too much Solution: add vbi debug print control Verify: verified by X301 Change-Id: If8848adb077aced68aac6b5443532037ee8dfff3 Signed-off-by: Nian Jing --- drivers/amlogic/media/vin/tvin/tvafe/tvafe_vbi.c | 23 +++++++++++++++++------ 1 file changed, 17 insertions(+), 6 deletions(-) diff --git a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_vbi.c b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_vbi.c index eaefbc7..cd9d01e 100644 --- a/drivers/amlogic/media/vin/tvin/tvafe/tvafe_vbi.c +++ b/drivers/amlogic/media/vin/tvin/tvafe/tvafe_vbi.c @@ -88,6 +88,7 @@ module_param(vbi_wakeup_interval, uint, 0664); static unsigned int vcnt = 1; static unsigned int wakeup_cnt; static unsigned int init_cc_data_flag; +static bool vbi_pr_en; static void vbi_hw_reset(struct vbi_dev_s *devp) { @@ -502,7 +503,8 @@ static void force_set_vcnt(unsigned char *rptr) l_val = *rptr & 0xff; h_val = *(rptr+1) & 0xff; vcnt = (h_val << 8) | l_val; - tvafe_pr_info("force set vcnt:0x%x\n", vcnt); + if (vbi_pr_en) + tvafe_pr_info("force set vcnt:0x%x\n", vcnt); } static void set_vbi_new_vcnt(struct vbi_dev_s *devp, unsigned char *rptr) @@ -540,7 +542,8 @@ static void set_vbi_new_vcnt(struct vbi_dev_s *devp, unsigned char *rptr) } vcnt = (h_val << 8) | l_val; - tvafe_pr_info("pre vcnt=0x%x, current vcnt=0x%x\n", temp, vcnt); + if (vbi_pr_en) + tvafe_pr_info("pre vcnt=0x%x, current vcnt=0x%x\n", temp, vcnt); if (vcnt > 0xffff) vcnt = temp; } @@ -560,8 +563,8 @@ static unsigned char *search_vbi_new_addr(struct vbi_dev_s *devp) vaddr = devp->pac_addr_start + paddr - devp->mem_start; temp = (unsigned long)vaddr; vaddr = (unsigned char *)((temp >> 4) << 4); - - tvafe_pr_info("vbi search new addr\n"); + if (vbi_pr_en) + tvafe_pr_info("vbi search new addr\n"); return vaddr; } @@ -600,10 +603,12 @@ static int check_if_sync_cc_data(struct vbi_dev_s *devp, unsigned char *addr) field_data_flag = 0; set_vbi_new_vcnt(devp, new_addr); } - tvafe_pr_info("not find vbi data.\n"); + if (vbi_pr_en) + tvafe_pr_info("not find vbi data.\n"); return -1; } else if (addr > devp->pac_addr_end) { - tvafe_pr_info("vbi ret_addr error.\n"); + if (vbi_pr_en) + tvafe_pr_info("vbi ret_addr error.\n"); return -1; } @@ -1419,6 +1424,12 @@ static ssize_t vbi_store(struct device *dev, vbi_buffer->pread, vbi_buffer->pwrite, vbi_buffer->data_wmode); tvafe_pr_info("dump satus done!!\n"); + } else if (!strncmp(parm[0], "vbi_pr_en", + strlen("vbi_pr_en"))) { + if (kstrtouint(parm[1], 10, &val) < 0) + return -EINVAL; + vbi_pr_en = val; + tvafe_pr_info("vbi_pr_en:%d\n", vbi_pr_en); } else if (!strncmp(parm[0], "enable_tasklet", strlen("enable_tasklet"))) { if (kstrtouint(parm[1], 10, &val) < 0) -- 2.7.4