mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-08 20:07:46 +09:00
vbi: fix vbi teletext no vcnt [1/1]
PD#TV-3444 Problem: vbi teletext no vcnt vbi dump failed adc dump failed Solution: set 0x126[26]=1 fix dump issue fix adcdump issue Verify: test on x301 Change-Id: I7111a86f0259d2e57f06f885a1c8058d9578dc88 Signed-off-by: Nian Jing <nian.jing@amlogic.com>
This commit is contained in:
@@ -32,7 +32,7 @@
|
||||
/* ************************************************* */
|
||||
/* *** macro definitions ********************************************* */
|
||||
/* *********************************************************** */
|
||||
#define TVAFE_VER "Ref.2019/03/29"
|
||||
#define TVAFE_VER "Ref.2019/04/24"
|
||||
|
||||
/* used to set the flag of tvafe_dev_s */
|
||||
#define TVAFE_FLAG_DEV_OPENED 0x00000010
|
||||
|
||||
@@ -321,6 +321,8 @@ static void tvafe_cvd2_memory_init(struct tvafe_cvd2_mem_s *mem,
|
||||
cvd_vbi_mem_set(vbi_start, vbi_size);
|
||||
/*open front lpf for av ring*/
|
||||
W_APB_BIT(ACD_REG_26, 1, 8, 1);
|
||||
/*for vbi vcnt*/
|
||||
W_APB_BIT(ACD_REG_26, 1, 26, 1);
|
||||
#endif
|
||||
|
||||
}
|
||||
@@ -2016,16 +2018,8 @@ inline bool tvafe_cvd2_no_sig(struct tvafe_cvd2_s *cvd2,
|
||||
struct tvafe_cvd2_mem_s *mem)
|
||||
{
|
||||
static bool ret;
|
||||
static int time_flag;
|
||||
|
||||
tvafe_cvd2_get_signal_status(cvd2);
|
||||
|
||||
/*TVAFE register status need more time to be stable.*/
|
||||
/*for double time delay.*/
|
||||
time_flag++;
|
||||
if (time_flag%2 != 0)
|
||||
return ret;
|
||||
|
||||
/* get signal status from HW */
|
||||
|
||||
/* search video mode */
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
/* vbi start line: unit is hcount value */
|
||||
#define VBI_START_CC 0x54
|
||||
#define VBI_START_WSS 0x54
|
||||
#define VBI_START_TT 0x82
|
||||
#define VBI_START_TT 0x64
|
||||
#define VBI_START_VPS 0x82
|
||||
|
||||
/* cvd2 function enable/disable defines*/
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
#include "tvafe_regs.h"
|
||||
#include "tvafe_debug.h"
|
||||
#include "tvafe.h"
|
||||
#include "../vdin/vdin_ctl.h"
|
||||
|
||||
bool disableapi;
|
||||
bool force_stable;
|
||||
@@ -383,6 +384,9 @@ static ssize_t tvafe_dumpmem_store(struct device *dev,
|
||||
struct tvafe_dev_s *devp;
|
||||
char delim1[3] = " ";
|
||||
char delim2[2] = "\n";
|
||||
unsigned int highmem_flag = 0;
|
||||
unsigned long highaddr;
|
||||
int i;
|
||||
|
||||
strcat(delim1, delim2);
|
||||
if (!buff)
|
||||
@@ -415,15 +419,34 @@ static ssize_t tvafe_dumpmem_store(struct device *dev,
|
||||
kfree(buf_orig);
|
||||
return len;
|
||||
}
|
||||
if (devp->cma_config_flag == 1)
|
||||
buf = codec_mm_phys_to_virt(devp->mem.start);
|
||||
else
|
||||
highmem_flag =
|
||||
PageHighMem(phys_to_page(devp->mem.start));
|
||||
pr_info("highmem_flag:%d\n", highmem_flag);
|
||||
if (devp->cma_config_flag == 1 &&
|
||||
highmem_flag != 0) {
|
||||
/*tvafe dts config 5M memory*/
|
||||
for (i = 0;
|
||||
i < devp->cma_mem_size / SZ_1M;
|
||||
i++) {
|
||||
highaddr = devp->mem.start + i * SZ_1M;
|
||||
buf = vdin_vmap(highaddr, SZ_1M);
|
||||
if (!buf) {
|
||||
pr_info("vdin_vmap error\n");
|
||||
return len;
|
||||
}
|
||||
pr_info("buf:0x%p\n", buf);
|
||||
/*vdin_dma_flush(devp, buf, SZ_1M, DMA_FROM_DEVICE);*/
|
||||
vfs_write(filp, buf, SZ_1M, &pos);
|
||||
vdin_unmap_phyaddr(buf);
|
||||
}
|
||||
} else {
|
||||
buf = phys_to_virt(devp->mem.start);
|
||||
vfs_write(filp, buf, devp->mem.size, &pos);
|
||||
tvafe_pr_info("write buffer %2d of %s.\n",
|
||||
devp->mem.size, parm[1]);
|
||||
tvafe_pr_info("devp->mem.start %x .\n",
|
||||
devp->mem.start);
|
||||
vfs_write(filp, buf, devp->mem.size, &pos);
|
||||
tvafe_pr_info("write buffer %2d of %s.\n",
|
||||
devp->mem.size, parm[1]);
|
||||
tvafe_pr_info("devp->mem.start %x .\n",
|
||||
devp->mem.start);
|
||||
}
|
||||
vfs_fsync(filp, 0);
|
||||
filp_close(filp, NULL);
|
||||
set_fs(old_fs);
|
||||
|
||||
@@ -133,7 +133,7 @@ static void vbi_data_type_set(struct vbi_dev_s *devp)
|
||||
W_VBI_APB_REG(CVD2_VBI_DATA_TYPE_LINE23, vbi_data_type);
|
||||
W_VBI_APB_REG(CVD2_VBI_DATA_TYPE_LINE24, vbi_data_type);
|
||||
W_VBI_APB_REG(CVD2_VBI_DATA_TYPE_LINE25, vbi_data_type);
|
||||
W_VBI_APB_REG(CVD2_VBI_DATA_TYPE_LINE26, vbi_data_type);
|
||||
/*W_VBI_APB_REG(CVD2_VBI_DATA_TYPE_LINE26, vbi_data_type);*/
|
||||
}
|
||||
|
||||
static void vbi_dto_set(struct vbi_dev_s *devp)
|
||||
@@ -380,10 +380,12 @@ static irqreturn_t vbi_isr(int irq, void *dev_id)
|
||||
spin_unlock_irqrestore(&devp->vbi_isr_lock, flags);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
if (devp->vbi_start == false) {
|
||||
spin_unlock_irqrestore(&devp->vbi_isr_lock, flags);
|
||||
return IRQ_HANDLED;
|
||||
}
|
||||
|
||||
if (devp->tasklet_enable)
|
||||
tasklet_schedule(&devp->tsklt_slicer);
|
||||
spin_unlock_irqrestore(&devp->vbi_isr_lock, flags);
|
||||
@@ -640,7 +642,8 @@ static void vbi_slicer_task(unsigned long arg)
|
||||
ret = init_cc_data_sync(devp);
|
||||
if (!ret)
|
||||
return;
|
||||
|
||||
if (vbi_dbg_en & 2)
|
||||
tvafe_pr_info("pac_addr:%p\n", devp->pac_addr);
|
||||
if (devp->pac_addr > devp->pac_addr_end)
|
||||
devp->pac_addr = devp->pac_addr_start;
|
||||
|
||||
@@ -1305,7 +1308,6 @@ static void vbi_dump_mem(char *path, struct vbi_dev_s *devp)
|
||||
{
|
||||
struct file *filp = NULL;
|
||||
loff_t pos = 0;
|
||||
void *buf = NULL;
|
||||
mm_segment_t old_fs = get_fs();
|
||||
|
||||
set_fs(KERNEL_DS);
|
||||
@@ -1315,15 +1317,10 @@ static void vbi_dump_mem(char *path, struct vbi_dev_s *devp)
|
||||
tvafe_pr_info("create %s error.\n", path);
|
||||
return;
|
||||
}
|
||||
buf = phys_to_virt(devp->mem_start);
|
||||
if (buf == NULL) {
|
||||
tvafe_pr_info("buf is null!!!.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
vfs_write(filp, buf, devp->mem_size, &pos);
|
||||
vfs_write(filp, devp->pac_addr_start, devp->mem_size, &pos);
|
||||
tvafe_pr_info("write buffer addr:0x%p size: %2u to %s.\n",
|
||||
buf, devp->mem_size, path);
|
||||
devp->pac_addr_start, devp->mem_size, path);
|
||||
vfs_fsync(filp, 0);
|
||||
filp_close(filp, NULL);
|
||||
set_fs(old_fs);
|
||||
@@ -1443,6 +1440,10 @@ static ssize_t vbi_store(struct device *dev,
|
||||
vbi_buffer->data_wmode = val;
|
||||
tvafe_pr_info("data_wmode:%d\n", vbi_buffer->data_wmode);
|
||||
} else if (!strncmp(parm[0], "start", strlen("start"))) {
|
||||
W_APB_REG(ACD_REG_22, 0x07080000);
|
||||
/* manuel reset vbi */
|
||||
W_APB_REG(ACD_REG_22, 0x87080000);
|
||||
W_APB_REG(ACD_REG_22, 0x04080000);
|
||||
vbi_hw_init(devp);
|
||||
vbi_slicer_start(devp);
|
||||
/* enable data capture function */
|
||||
@@ -1451,10 +1452,11 @@ static ssize_t vbi_store(struct device *dev,
|
||||
devp->vs_delay = VBI_VS_DELAY;
|
||||
tvafe_pr_info("start done!!!\n");
|
||||
} else if (!strncmp(parm[0], "stop", strlen("stop"))) {
|
||||
vbi_slicer_stop(vbi_slicer);
|
||||
/* disable data capture function */
|
||||
devp->tasklet_enable = false;
|
||||
devp->vbi_start = false;
|
||||
init_cc_data_flag = 0;
|
||||
vbi_slicer_stop(vbi_slicer);
|
||||
/* manuel reset vbi */
|
||||
/* vbi reset release, vbi agent enable*/
|
||||
W_VBI_APB_REG(ACD_REG_22, 0x06080000);
|
||||
@@ -1475,6 +1477,7 @@ static ssize_t vbi_store(struct device *dev,
|
||||
tvafe_pr_info(" set slicer type to %d\n",
|
||||
vbi_slicer->type);
|
||||
} else if (!strncmp(parm[0], "open", strlen("open"))) {
|
||||
tasklet_enable(&devp->tsklt_slicer);
|
||||
vbi_ringbuffer_init(vbi_buffer, NULL,
|
||||
VBI_DEFAULT_BUFFER_PACKAGE_NUM);
|
||||
devp->slicer->type = VBI_TYPE_NULL;
|
||||
@@ -1490,6 +1493,7 @@ static ssize_t vbi_store(struct device *dev,
|
||||
tvafe_pr_err("request_irq fail\n");
|
||||
tvafe_pr_info(" open ok.\n");
|
||||
} else if (!strncmp(parm[0], "release", strlen("release"))) {
|
||||
tasklet_disable(&devp->tsklt_slicer);
|
||||
ret = vbi_slicer_free(devp, vbi_slicer);
|
||||
devp->tasklet_enable = false;
|
||||
devp->vbi_start = false; /*disable data capture function*/
|
||||
|
||||
Reference in New Issue
Block a user