mirror of
https://github.com/hardkernel/kernel_common_drivers.git
synced 2026-06-25 12:03:48 +09:00
dtv_demod: fix aml_demod_ioctl and dump adc issue(V3.5.39) [1/1]
PD#SWPL-168398 Problem: fix aml_demod_ioctl and dump adc issue Solution: 1.fix aml_demod_ioctl and dump adc issue 2.AMLDTVDEMOD_VER V3.5.39 Verify: t5m Change-Id: Id773ecace219ee607eff99a05f26600b0927fe12 Signed-off-by: zhicheng.huang <zhicheng.huang@amlogic.com>
This commit is contained in:
committed by
gerrit autosubmit
parent
ba4fe85ed9
commit
7b689cb35d
@@ -159,8 +159,8 @@ static long aml_demod_ioctl(struct file *file,
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
if (!devp->flg_cma_allc || !devp->cma_mem_size) {
|
||||
PR_ERR("not enter_mode or invalid cma_mem_size\n");
|
||||
if (!demod->inited) {
|
||||
PR_ERR("%s: demod not inited!\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
|
||||
@@ -291,6 +291,10 @@ static long aml_demod_ioctl(struct file *file,
|
||||
break;
|
||||
|
||||
case DEMOD_IOC_START_DUMP_ADC:
|
||||
if (!devp->flg_cma_allc || !devp->cma_mem_size) {
|
||||
PR_ERR("%s: cma alloc fail or invalid cma_mem_size!!\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = copy_from_user(&dump_param, argp, sizeof(unsigned int));
|
||||
if (ret)
|
||||
break;
|
||||
@@ -306,6 +310,10 @@ static long aml_demod_ioctl(struct file *file,
|
||||
break;
|
||||
|
||||
case DEMOD_IOC_START_DUMP_TS:
|
||||
if (!devp->flg_cma_allc || !devp->cma_mem_size) {
|
||||
PR_ERR("%s: cma alloc fail or invalid cma_mem_size!!\n", __func__);
|
||||
return -EINVAL;
|
||||
}
|
||||
ret = copy_from_user(&dump_param, argp, sizeof(unsigned int));
|
||||
if (ret)
|
||||
break;
|
||||
|
||||
@@ -47,6 +47,8 @@ static unsigned int atsc_mode_para;
|
||||
static unsigned long demod_dmc_id;
|
||||
static unsigned int demod_ddr_addr;
|
||||
static unsigned int demod_ddr_size;
|
||||
MODULE_PARM_DESC(demod_ddr_size, "\n\t\t demod_ddr_size");
|
||||
module_param(demod_ddr_size, int, 0644);
|
||||
|
||||
MODULE_PARM_DESC(testbus_addr, "");
|
||||
static unsigned int testbus_addr = 0x1000;
|
||||
@@ -438,13 +440,13 @@ static void wait_capture(int cap_cur_addr, int depth_MB, int start)
|
||||
time_out = time_out + 1;
|
||||
usleep_range(1000, 2000);
|
||||
readfirst = front_read_reg(cap_cur_addr);
|
||||
|
||||
PR_INFO("%s: cap_cur_addr:0x%x", __func__, readfirst);
|
||||
if ((last - readfirst) > 0)
|
||||
tmp = 0;
|
||||
else
|
||||
last = readfirst;
|
||||
|
||||
usleep_range(10000, 20000);
|
||||
usleep_range(100000, 200000);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -651,6 +653,8 @@ static int read_memory_to_file(char *path, unsigned int start_addr,
|
||||
if (!buf) {
|
||||
PR_ERR("buf NULL\n");
|
||||
return -1;
|
||||
} else {
|
||||
PR_INFO("%s: buf:%p", __func__, buf);
|
||||
}
|
||||
|
||||
demod_dma_flush(buf, size, DMA_FROM_DEVICE);
|
||||
@@ -834,10 +838,14 @@ unsigned int capture_adc_data_once(char *path, unsigned int capture_mode,
|
||||
break;
|
||||
}
|
||||
|
||||
if (!demod_ddr_size)
|
||||
if (!demod_ddr_size) {
|
||||
size = devp->mem_size - offset;
|
||||
else
|
||||
size = demod_ddr_size;
|
||||
} else {
|
||||
if (demod_ddr_size < devp->mem_size - offset)
|
||||
size = demod_ddr_size * SZ_1M;
|
||||
else
|
||||
size = devp->mem_size - offset;
|
||||
}
|
||||
|
||||
PR_INFO("%s:capture_mode:%d,test_mode:%d,start_addr:0x%x,offset:%dM,size:%dM\n",
|
||||
__func__, capture_mode, test_mode || testbus_test_mode,
|
||||
@@ -879,7 +887,7 @@ unsigned int capture_adc_data_once(char *path, unsigned int capture_mode,
|
||||
front_write_bits(0x39, 0, 28, 1);
|
||||
|
||||
tb_start = front_read_reg(0x3f);
|
||||
|
||||
PR_INFO("%s: tb_start: %#x", __func__, tb_start);
|
||||
if (devp->data->hw_ver >= DTVDEMOD_HW_T5D) {
|
||||
demod_top_write_reg(DEMOD_TOP_CFG_REG_4, top_saved);
|
||||
devp->demod_thread = polling_en;
|
||||
|
||||
@@ -163,6 +163,7 @@
|
||||
/* V3.5.036 fix T5D switch to dvbt2 unlock(sync from 5.4/4.9) */
|
||||
/* V3.5.037 fix dvbt2 mplp id list and mplp tune(execpt T5D) */
|
||||
/* V3.5.038 fix compile error when remove dvbt2 module */
|
||||
/* V3.5.039 fix aml_demod_ioctl and dump adc issue */
|
||||
/****************************************************/
|
||||
/****************************************************************/
|
||||
/* AMLDTVDEMOD_VER Description: */
|
||||
@@ -179,8 +180,8 @@
|
||||
/*->The last four digits indicate the release time */
|
||||
/****************************************************************/
|
||||
#define KERNEL_4_9_EN 1
|
||||
#define AMLDTVDEMOD_VER "V3.5.038"
|
||||
#define DTVDEMOD_VER "2024/04/25: fix compile error when remove dvbt2 module"
|
||||
#define AMLDTVDEMOD_VER "V3.5.039"
|
||||
#define DTVDEMOD_VER "2024/05/07: fix aml_demod_ioctl and dump adc issue"
|
||||
#define AMLDTVDEMOD_T2_FW_VER "v1430.20240326"
|
||||
#define DEMOD_DEVICE_NAME "dtvdemod"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user