mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 04:10:18 +09:00
atv_demod: Add atv afc [2/2]
PD#166320: Add atv afc(Modify module params use). Change-Id: I2d9d84c742ab1ce56c99ff8e40b483bd01d4d237 Signed-off-by: nengwen.chen <nengwen.chen@amlogic.com>
This commit is contained in:
@@ -14420,8 +14420,8 @@ F: drivers/amlogic/media/vout/lcd/lcd_extern/mipi_TL050FHV02CT.c
|
||||
|
||||
AMLOGIC ATV DEMOD DRIVER
|
||||
M: nengwen.chen <nengwen.chen@amlogic.com>
|
||||
F: drivers/amlogic/atv_demod/*
|
||||
F: include/linux/amlogic/aml_atvdemod.h
|
||||
F: drivers/amlogic/atv_demod/*
|
||||
|
||||
AMLOGIC ADD EXT MIPI DEFAULT DRIVER
|
||||
M: Weiming Liu <weiming.liu@amlogic.com>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
obj-$(CONFIG_AMLOGIC_ATV_DEMOD) += atvdemod_fe.o
|
||||
|
||||
atvdemod_fe-objs = atvdemod_func.o atvauddemod_func.o atv_demod_v4l2.o atv_demod_driver.o atv_demod_ops.o
|
||||
atvdemod_fe-objs = atvdemod_func.o atvauddemod_func.o atv_demod_v4l2.o atv_demod_driver.o atv_demod_ops.o atv_demod_debug.o
|
||||
|
||||
ccflags-y += -I.
|
||||
ccflags-y += -Idrivers/media/dvb-core
|
||||
|
||||
231
drivers/amlogic/atv_demod/atv_demod_debug.c
Normal file
231
drivers/amlogic/atv_demod/atv_demod_debug.c
Normal file
@@ -0,0 +1,231 @@
|
||||
/*
|
||||
* drivers/amlogic/atv_demod/atv_demod_debug.c
|
||||
*
|
||||
* Copyright (C) 2017 Amlogic, Inc. All rights reserved.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful, but WITHOUT
|
||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
|
||||
* more details.
|
||||
*
|
||||
*/
|
||||
|
||||
#include <linux/debugfs.h>
|
||||
#include <linux/uaccess.h>
|
||||
#include <linux/module.h>
|
||||
#include <linux/moduleparam.h>
|
||||
#include <linux/kernel.h>
|
||||
|
||||
#include "atv_demod_debug.h"
|
||||
|
||||
|
||||
#if !defined(AML_ATVDEMOD_DEBUGFS)
|
||||
|
||||
#undef u32
|
||||
#define u32 uint
|
||||
|
||||
#undef u64
|
||||
#define u64 ulong
|
||||
|
||||
#endif
|
||||
|
||||
/* name, mode, parent, type, value */
|
||||
/* u32, bool, u64 type add here for debugfs */
|
||||
#define DEBUG_FS_CREATE_NODES(dentry)\
|
||||
{\
|
||||
DEBUGFS_CREATE_NODE(reg_23cf, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(btsc_sap_mode, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(afc_limit, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(aml_timer_en, 0640, dentry, bool)\
|
||||
DEBUGFS_CREATE_NODE(timer_delay, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(timer_delay2, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(timer_delay3, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(afc_wave_cnt, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atvdemod_scan_mode, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(tuner_status_cnt, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(slow_mode, 0640, dentry, bool)\
|
||||
DEBUGFS_CREATE_NODE(broad_std, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(aud_std, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(aud_mode, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(aud_auto, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(over_threshold, 0640, dentry, u64)\
|
||||
DEBUGFS_CREATE_NODE(input_amplitude, 0640, dentry, u64)\
|
||||
DEBUGFS_CREATE_NODE(audio_det_en, 0640, dentry, bool)\
|
||||
DEBUGFS_CREATE_NODE(non_std_en, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(non_std_onoff, 0640, dentry, bool)\
|
||||
DEBUGFS_CREATE_NODE(non_std_times, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atv_video_gain, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(carrier_amplif_val, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(extra_input_fil_val, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(audio_det_mode, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(aud_dmd_jilinTV, 0640, dentry, bool)\
|
||||
DEBUGFS_CREATE_NODE(if_freq, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(if_inv, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(ademod_debug_en, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(btsc_detect_delay, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(signal_audmode, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(audio_thd_threshold1, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(gde_curve, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(sound_format, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(freq_hz_cvrt, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atvdemod_debug_en, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atvdemod_agc_pinmux, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atvdemod_afc_range, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atvdemod_afc_offset, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atvdemod_timer_en, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atvdemod_afc_en, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(atvdemod_monitor_en, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(audio_thd_en, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(pwm_kp, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(reg_dbg_en, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(audio_gain_val, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(audio_a2_threshold, 0640, dentry, u32)\
|
||||
DEBUGFS_CREATE_NODE(audio_a2_delay, 0640, dentry, u32)\
|
||||
}
|
||||
|
||||
|
||||
/* name, mode, parent, data, fops, type */
|
||||
/* int type add here for debugfs */
|
||||
#define DEBUG_FS_CREATE_FILES(dentry, fops)\
|
||||
{\
|
||||
DEBUGFS_CREATE_FILE(afc_offset, 0640, dentry, fops, int)\
|
||||
DEBUGFS_CREATE_FILE(non_std_thld_4c_h, 0640, dentry, fops, int)\
|
||||
DEBUGFS_CREATE_FILE(non_std_thld_4c_l, 0640, dentry, fops, int)\
|
||||
DEBUGFS_CREATE_FILE(non_std_thld_54_h, 0640, dentry, fops, int)\
|
||||
DEBUGFS_CREATE_FILE(non_std_thld_54_l, 0640, dentry, fops, int)\
|
||||
DEBUGFS_CREATE_FILE(sum1_thd_h, 0640, dentry, fops, int)\
|
||||
DEBUGFS_CREATE_FILE(sum1_thd_l, 0640, dentry, fops, int)\
|
||||
DEBUGFS_CREATE_FILE(sum2_thd_h, 0640, dentry, fops, int)\
|
||||
DEBUGFS_CREATE_FILE(sum2_thd_l, 0640, dentry, fops, int)\
|
||||
DEBUGFS_CREATE_FILE(afc_default, 0640, dentry, fops, int)\
|
||||
}
|
||||
|
||||
|
||||
#if defined(AML_ATVDEMOD_DEBUGFS)
|
||||
static struct dentry *debugfs_root;
|
||||
|
||||
DEBUGFS_DENTRY_DEFINE(afc_offset);
|
||||
DEBUGFS_DENTRY_DEFINE(non_std_thld_4c_h);
|
||||
DEBUGFS_DENTRY_DEFINE(non_std_thld_4c_l);
|
||||
DEBUGFS_DENTRY_DEFINE(non_std_thld_54_h);
|
||||
DEBUGFS_DENTRY_DEFINE(non_std_thld_54_l);
|
||||
DEBUGFS_DENTRY_DEFINE(sum1_thd_h);
|
||||
DEBUGFS_DENTRY_DEFINE(sum1_thd_l);
|
||||
DEBUGFS_DENTRY_DEFINE(sum2_thd_h);
|
||||
DEBUGFS_DENTRY_DEFINE(sum2_thd_l);
|
||||
DEBUGFS_DENTRY_DEFINE(afc_default);
|
||||
|
||||
struct dentry_value *debugfs_dentry[] = {
|
||||
DEBUGFS_DENTRY_VALUE(afc_offset),
|
||||
DEBUGFS_DENTRY_VALUE(non_std_thld_4c_h),
|
||||
DEBUGFS_DENTRY_VALUE(non_std_thld_4c_l),
|
||||
DEBUGFS_DENTRY_VALUE(non_std_thld_54_h),
|
||||
DEBUGFS_DENTRY_VALUE(non_std_thld_54_l),
|
||||
DEBUGFS_DENTRY_VALUE(sum1_thd_h),
|
||||
DEBUGFS_DENTRY_VALUE(sum1_thd_l),
|
||||
DEBUGFS_DENTRY_VALUE(sum2_thd_h),
|
||||
DEBUGFS_DENTRY_VALUE(sum2_thd_l),
|
||||
DEBUGFS_DENTRY_VALUE(afc_default),
|
||||
};
|
||||
|
||||
static int debugfs_open(struct inode *node, struct file *file)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static ssize_t debugfs_read(struct file *file, char __user *userbuf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct dentry *dent = file->f_path.dentry;
|
||||
int *val = NULL;
|
||||
int i = 0;
|
||||
char buf[20] = { 0 };
|
||||
int len = ARRAY_SIZE(debugfs_dentry);
|
||||
|
||||
for (i = 0; i < len; ++i) {
|
||||
if (debugfs_dentry[i]->dentry == dent) {
|
||||
val = debugfs_dentry[i]->value;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (val == NULL)
|
||||
return -EINVAL;
|
||||
|
||||
len = snprintf(buf, sizeof(buf), "%d\n", *val);
|
||||
|
||||
return simple_read_from_buffer(userbuf, count, ppos, buf, len);
|
||||
}
|
||||
|
||||
static ssize_t debugfs_write(struct file *file, const char __user *userbuf,
|
||||
size_t count, loff_t *ppos)
|
||||
{
|
||||
struct dentry *dent = file->f_path.dentry;
|
||||
int val = 0;
|
||||
int i = 0;
|
||||
char buf[20] = { 0 };
|
||||
int len = ARRAY_SIZE(debugfs_dentry);
|
||||
|
||||
count = min_t(size_t, count, (sizeof(buf) - 1));
|
||||
if (copy_from_user(buf, userbuf, count))
|
||||
return -EFAULT;
|
||||
|
||||
buf[count] = 0;
|
||||
|
||||
/*i = sscanf(buf, "%d", &val);*/
|
||||
i = kstrtoint(buf, 0, &val);
|
||||
if (i == 0) {
|
||||
for (i = 0; i < len; ++i) {
|
||||
if (debugfs_dentry[i]->dentry == dent) {
|
||||
*(debugfs_dentry[i]->value) = val;
|
||||
break;
|
||||
}
|
||||
}
|
||||
} else
|
||||
return -EINVAL;
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static const struct file_operations dfs_fops = {
|
||||
.open = debugfs_open,
|
||||
.read = debugfs_read,
|
||||
.write = debugfs_write,
|
||||
};
|
||||
#else
|
||||
DEBUG_FS_CREATE_NODES(NULL);
|
||||
DEBUG_FS_CREATE_FILES(NULL, NULL);
|
||||
#endif
|
||||
|
||||
int aml_atvdemod_create_debugfs(const char *name)
|
||||
{
|
||||
#if defined(AML_ATVDEMOD_DEBUGFS)
|
||||
debugfs_root = debugfs_create_dir(name, NULL);
|
||||
|
||||
if (IS_ERR(debugfs_root) || !debugfs_root) {
|
||||
pr_warn("failed to create debugfs directory\n");
|
||||
debugfs_root = NULL;
|
||||
return -1;
|
||||
}
|
||||
|
||||
DEBUG_FS_CREATE_NODES(debugfs_root);
|
||||
DEBUG_FS_CREATE_FILES(debugfs_root, dfs_fops);
|
||||
#endif
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
void aml_atvdemod_remove_debugfs(void)
|
||||
{
|
||||
#if defined(AML_ATVDEMOD_DEBUGFS)
|
||||
if (debugfs_root != NULL) {
|
||||
debugfs_remove_recursive(debugfs_root);
|
||||
debugfs_root = NULL;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -14,7 +14,7 @@
|
||||
#ifndef __ATV_DEMOD_DEBUG_H__
|
||||
#define __ATV_DEMOD_DEBUG_H__
|
||||
|
||||
extern int atvdemod_debug_en;
|
||||
extern unsigned int atvdemod_debug_en;
|
||||
|
||||
#undef pr_fmt
|
||||
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
|
||||
@@ -27,37 +27,99 @@ extern int atvdemod_debug_en;
|
||||
} while (0)
|
||||
|
||||
#undef pr_dbg
|
||||
#define pr_dbg(fmt, ...) \
|
||||
#define pr_dbg(fmt, ...)\
|
||||
do {\
|
||||
if (atvdemod_debug_en & 01)\
|
||||
printk(fmt, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#undef pr_err
|
||||
#define pr_err(fmt, ...) \
|
||||
#define pr_err(fmt, ...)\
|
||||
do {\
|
||||
if (1)\
|
||||
printk(fmt, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#undef pr_afc
|
||||
#define pr_afc(fmt, ...) \
|
||||
#define pr_afc(fmt, ...)\
|
||||
do {\
|
||||
if (atvdemod_debug_en & 0x02)\
|
||||
printk(fmt, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#undef pr_warn
|
||||
#define pr_warn(fmt, ...) \
|
||||
#define pr_warn(fmt, ...)\
|
||||
do {\
|
||||
if (1)\
|
||||
printk(fmt, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
#undef pr_audio
|
||||
#define pr_audio(fmt, ...) \
|
||||
#define pr_audio(fmt, ...)\
|
||||
do {\
|
||||
if (atvdemod_debug_en & 0x04)\
|
||||
printk(fmt, ##__VA_ARGS__);\
|
||||
} while (0)
|
||||
|
||||
|
||||
#if defined(CONFIG_DEBUG_FS)
|
||||
#define AML_ATVDEMOD_DEBUGFS
|
||||
#endif
|
||||
|
||||
#if defined(AML_ATVDEMOD_DEBUGFS)
|
||||
|
||||
#if 0 /* Want to add this for debufs params check.*/
|
||||
#define param_check(name, p, type)\
|
||||
{\
|
||||
static inline type __always_unused *__check_##name(void)\
|
||||
{\
|
||||
return p;\
|
||||
} \
|
||||
}
|
||||
#endif
|
||||
|
||||
#define DEBUGFS_CREATE_NODE(name, mode, parent, type)\
|
||||
{\
|
||||
extern type name;\
|
||||
debugfs_create_##type(#name, (S_IFREG | (mode)),\
|
||||
parent, &(name));\
|
||||
}
|
||||
|
||||
struct dentry_value {
|
||||
struct dentry *dentry;
|
||||
int *value;
|
||||
};
|
||||
|
||||
#define DEBUGFS_DENTRY_DEFINE(name)\
|
||||
extern int name;\
|
||||
struct dentry_value dentry_##name = {\
|
||||
.dentry = NULL,\
|
||||
.value = &(name)\
|
||||
}
|
||||
|
||||
#define DEBUGFS_DENTRY_VALUE(name) (&(dentry_##name))
|
||||
|
||||
#define DEBUGFS_CREATE_FILE(name, mode, parent, fops, type)\
|
||||
{\
|
||||
extern type name;\
|
||||
extern struct dentry_value dentry_##name;\
|
||||
dentry_##name.dentry = debugfs_create_file(#name,\
|
||||
mode, parent, ((void *)&(name)), &(fops));\
|
||||
}
|
||||
|
||||
#else
|
||||
|
||||
#define DEBUGFS_CREATE_NODE(name, mode, parent, type)\
|
||||
extern type name;\
|
||||
module_param(name, type, mode);\
|
||||
MODULE_PARM_DESC(name, "\n" #name "\n")
|
||||
|
||||
#define DEBUGFS_CREATE_FILE(name, mode, parent, fops, type)\
|
||||
DEBUGFS_CREATE_NODE(name, mode, parent, type)
|
||||
|
||||
#endif
|
||||
|
||||
extern int aml_atvdemod_create_debugfs(const char *name);
|
||||
extern void aml_atvdemod_remove_debugfs(void);
|
||||
|
||||
#endif /* __ATV_DEMOD_DEBUG_H__ */
|
||||
|
||||
@@ -592,7 +592,7 @@ static const struct of_device_id aml_atvdemod_dt_match[] = {
|
||||
|
||||
static struct platform_driver aml_atvdemod_driver = {
|
||||
.driver = {
|
||||
.name = "aml_atvdemod",
|
||||
.name = ATVDEMOD_DRIVER_NAME,
|
||||
.owner = THIS_MODULE,
|
||||
.of_match_table = aml_atvdemod_dt_match,
|
||||
},
|
||||
@@ -611,9 +611,17 @@ static int __init aml_atvdemod_init(void)
|
||||
if (ret < 0)
|
||||
return ret;
|
||||
|
||||
ret = aml_atvdemod_create_debugfs(ATVDEMOD_DRIVER_NAME);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed to create debugfs.\n", __func__);
|
||||
class_unregister(&aml_atvdemod_class);
|
||||
return ret;
|
||||
}
|
||||
|
||||
ret = platform_driver_register(&aml_atvdemod_driver);
|
||||
if (ret < 0) {
|
||||
pr_err("%s: failed to register driver.\n", __func__);
|
||||
aml_atvdemod_remove_debugfs();
|
||||
class_unregister(&aml_atvdemod_class);
|
||||
return ret;
|
||||
}
|
||||
@@ -626,6 +634,7 @@ static int __init aml_atvdemod_init(void)
|
||||
static void __exit aml_atvdemod_exit(void)
|
||||
{
|
||||
platform_driver_unregister(&aml_atvdemod_driver);
|
||||
aml_atvdemod_remove_debugfs();
|
||||
class_unregister(&aml_atvdemod_class);
|
||||
|
||||
pr_info("%s: OK.\n", __func__);
|
||||
|
||||
@@ -14,7 +14,6 @@
|
||||
#ifndef __ATV_DEMOD_DRIVER_H__
|
||||
#define __ATV_DEMOD_DRIVER_H__
|
||||
|
||||
extern int atvdemod_debug_en;
|
||||
|
||||
#include <media/v4l2-device.h>
|
||||
#include "drivers/media/dvb-core/dvb_frontend.h"
|
||||
|
||||
@@ -39,19 +39,10 @@ static DEFINE_MUTEX(atv_demod_list_mutex);
|
||||
static LIST_HEAD(hybrid_tuner_instance_list);
|
||||
|
||||
unsigned int reg_23cf = 0x88188832; /*IIR filter*/
|
||||
module_param(reg_23cf, uint, 0664);
|
||||
MODULE_PARM_DESC(reg_23cf, "\n reg_23cf\n");
|
||||
unsigned int btsc_sap_mode = 1; /*0: off 1:monitor 2:auto */
|
||||
|
||||
static int btsc_sap_mode = 1; /*0: off 1:monitor 2:auto */
|
||||
module_param(btsc_sap_mode, int, 0644);
|
||||
MODULE_DESCRIPTION("btsc sap mode\n");
|
||||
|
||||
static int afc_offset;
|
||||
module_param(afc_offset, int, 0644);
|
||||
MODULE_PARM_DESC(afc_offset, "\n afc_offset\n");
|
||||
static unsigned int afc_limit = 2100;/*+-2.1Mhz*/
|
||||
module_param(afc_limit, uint, 0644);
|
||||
MODULE_PARM_DESC(afc_limit, "\n afc_limit\n");
|
||||
int afc_offset;
|
||||
unsigned int afc_limit = 2100;/*+-2.1Mhz*/
|
||||
|
||||
static int no_sig_cnt;
|
||||
struct timer_list aml_timer;
|
||||
@@ -59,25 +50,13 @@ struct timer_list aml_timer;
|
||||
static unsigned int timer_init_state;
|
||||
static unsigned int aft_thread_enable;
|
||||
static unsigned int aft_thread_delaycnt;
|
||||
static unsigned int aml_timer_en = 1;
|
||||
module_param(aml_timer_en, uint, 0644);
|
||||
MODULE_PARM_DESC(aml_timer_en, "\n aml_timer_en\n");
|
||||
|
||||
static unsigned int timer_delay = 1;
|
||||
module_param(timer_delay, uint, 0644);
|
||||
MODULE_PARM_DESC(timer_delay, "\n timer_delay\n");
|
||||
|
||||
static unsigned int timer_delay2 = 10;
|
||||
module_param(timer_delay2, uint, 0644);
|
||||
MODULE_PARM_DESC(timer_delay2, "\n timer_delay2\n");
|
||||
|
||||
static unsigned int timer_delay3 = 10;/*100ms*/
|
||||
module_param(timer_delay3, uint, 0644);
|
||||
MODULE_PARM_DESC(timer_delay3, "\n timer_delay3\n");
|
||||
|
||||
static unsigned int afc_wave_cnt = 4;
|
||||
module_param(afc_wave_cnt, uint, 0644);
|
||||
MODULE_PARM_DESC(afc_wave_cnt, "\n afc_wave_cnt\n");
|
||||
bool aml_timer_en = true;
|
||||
unsigned int timer_delay = 1;
|
||||
unsigned int timer_delay2 = 10;
|
||||
unsigned int timer_delay3 = 10;/*100ms*/
|
||||
unsigned int afc_wave_cnt = 4;
|
||||
|
||||
|
||||
#define AFC_LOCK_STATUS_NULL 0
|
||||
@@ -287,7 +266,7 @@ void aml_timer_handler(unsigned long arg)
|
||||
return;
|
||||
}
|
||||
|
||||
if ((aml_timer_en == 0) || (fe->ops.info.type != FE_ANALOG))
|
||||
if ((aml_timer_en == false) || (fe->ops.info.type != FE_ANALOG))
|
||||
return;
|
||||
|
||||
schedule_work(&priv->demod_wq);
|
||||
@@ -297,7 +276,7 @@ static void afc_timer_disable(struct dvb_frontend *fe)
|
||||
{
|
||||
struct atv_demod_priv *priv = fe->analog_demod_priv;
|
||||
|
||||
if ((aml_timer_en == 1) && (timer_init_state == 1)) {
|
||||
if (aml_timer_en && (timer_init_state == 1)) {
|
||||
del_timer_sync(&aml_timer);
|
||||
cancel_work_sync(&priv->demod_wq);
|
||||
timer_init_state = 0;
|
||||
@@ -306,7 +285,7 @@ static void afc_timer_disable(struct dvb_frontend *fe)
|
||||
|
||||
static void afc_timer_enable(struct dvb_frontend *fe)
|
||||
{
|
||||
if (fe && (aml_timer_en == 1) && (timer_init_state == 0)) {
|
||||
if (fe && aml_timer_en && (timer_init_state == 0)) {
|
||||
init_timer(&aml_timer);
|
||||
aml_timer.function = aml_timer_handler;
|
||||
aml_timer.data = (ulong) fe;
|
||||
@@ -372,8 +351,6 @@ int aml_atvdemod_get_btsc_sap_mode(void)
|
||||
}
|
||||
|
||||
unsigned int atvdemod_scan_mode; /*IIR filter*/
|
||||
module_param(atvdemod_scan_mode, uint, 0664);
|
||||
MODULE_PARM_DESC(atvdemod_scan_mode, "\n atvdemod_scan_mode\n");
|
||||
|
||||
/* ret:5~100;the val is bigger,the signal is better */
|
||||
int aml_atvdemod_get_snr(struct dvb_frontend *fe)
|
||||
@@ -608,7 +585,8 @@ static void atv_demod_set_params(struct dvb_frontend *fe,
|
||||
|
||||
/* afc tune enable */
|
||||
if ((fe->ops.info.type == FE_ANALOG)
|
||||
&& (atv_demod_get_scan_mode() == 0))
|
||||
&& (atv_demod_get_scan_mode() == 0)
|
||||
&& (atvdemod_param->param.mode == 0))
|
||||
afc_timer_enable(fe);
|
||||
}
|
||||
|
||||
@@ -689,9 +667,9 @@ static int atv_demod_set_config(struct dvb_frontend *fe, void *priv_cfg)
|
||||
switch (*state) {
|
||||
case AML_ATVDEMOD_INIT:
|
||||
if (atv_demod_get_state() != ATVDEMOD_STATE_WORK) {
|
||||
atv_demod_enter_mode();
|
||||
if (fe->ops.tuner_ops.set_config)
|
||||
fe->ops.tuner_ops.set_config(fe, NULL);
|
||||
atv_demod_enter_mode();
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -43,13 +43,9 @@
|
||||
static DEFINE_MUTEX(v4l2_fe_mutex);
|
||||
/* static int v4l2_shutdown_timeout;*/
|
||||
|
||||
static int tuner_status_cnt = 8; /* 4-->16 test on sky mxl661 */
|
||||
module_param(tuner_status_cnt, int, 0644);
|
||||
MODULE_DESCRIPTION("after write a freq, max cnt value of read tuner status\n");
|
||||
unsigned int tuner_status_cnt = 8; /* 4-->16 test on sky mxl661 */
|
||||
|
||||
static int slow_mode;
|
||||
module_param(slow_mode, int, 0644);
|
||||
MODULE_DESCRIPTION("search the channel by slow_mode,by add +1MHz\n");
|
||||
bool slow_mode;
|
||||
|
||||
typedef int (*hook_func_t) (void);
|
||||
hook_func_t aml_fe_hook_atv_status;
|
||||
|
||||
@@ -14,25 +14,14 @@
|
||||
|
||||
/* #define AUDIO_MOD_DET_INTERNAL */
|
||||
|
||||
int ademod_debug_en;
|
||||
module_param(ademod_debug_en, int, 0644);
|
||||
MODULE_PARM_DESC(ademod_debug_en, "\n ademod_debug_en for audio demod debug\n");
|
||||
|
||||
static int btsc_detect_delay = 10;
|
||||
module_param(btsc_detect_delay, int, 0644);
|
||||
MODULE_PARM_DESC(btsc_detect_delay, "\n btsc_detect_delay for btsc detect delay\n");
|
||||
|
||||
int signal_audmode;
|
||||
module_param(signal_audmode, int, 0644);
|
||||
MODULE_PARM_DESC(signal_audmode, "\n signal_audmode for btsc signal audio mode\n");
|
||||
|
||||
static unsigned int audio_thd_threshold1 = 0x1000;
|
||||
module_param(audio_thd_threshold1, uint, 0644);
|
||||
MODULE_PARM_DESC(audio_thd_threshold1, "\n audio_thd_threshold1\n");
|
||||
|
||||
static unsigned int audio_thd_threshold2 = 0xf00;
|
||||
module_param(audio_thd_threshold2, uint, 0644);
|
||||
MODULE_PARM_DESC(audio_thd_threshold2, "\n audio_thd_threshold2\n");
|
||||
/* ademod_debug_en for audio demod debug */
|
||||
unsigned int ademod_debug_en;
|
||||
/* btsc_detect_delay for btsc detect delay */
|
||||
unsigned int btsc_detect_delay = 10;
|
||||
/* signal_audmode for btsc signal audio mode */
|
||||
unsigned int signal_audmode;
|
||||
unsigned int audio_thd_threshold1 = 0x1000;
|
||||
unsigned int audio_thd_threshold2 = 0xf00;
|
||||
|
||||
#undef pr_info
|
||||
#define pr_info(args...)\
|
||||
|
||||
@@ -31,109 +31,36 @@
|
||||
#include "atv_demod_ops.h"
|
||||
#include "atv_demod_driver.h"
|
||||
|
||||
static int broad_std = AML_ATV_DEMOD_VIDEO_MODE_PROP_NTSC;
|
||||
module_param(broad_std, int, 0644);
|
||||
MODULE_PARM_DESC(broad_std, "\n broad_std\n");
|
||||
unsigned int broad_std = AML_ATV_DEMOD_VIDEO_MODE_PROP_NTSC;
|
||||
unsigned int aud_std = AUDIO_STANDARD_NICAM_DK;
|
||||
unsigned int aud_mode = AUDIO_OUTMODE_STEREO;
|
||||
bool aud_auto = true;
|
||||
unsigned long over_threshold = 0xffff;
|
||||
unsigned long input_amplitude = 0xffff;
|
||||
bool audio_det_en;
|
||||
|
||||
int aud_std = AUDIO_STANDARD_NICAM_DK;
|
||||
module_param(aud_std, int, 0644);
|
||||
MODULE_PARM_DESC(aud_std, "\n audio std\n");
|
||||
unsigned int non_std_en;
|
||||
bool non_std_onoff;
|
||||
unsigned int non_std_times = 50;
|
||||
int non_std_thld_4c_h = 100;
|
||||
int non_std_thld_4c_l = 30;
|
||||
int non_std_thld_54_h = 500;
|
||||
int non_std_thld_54_l = 300;
|
||||
int sum1_thd_h;
|
||||
int sum1_thd_l = 0x7fffffff;
|
||||
int sum2_thd_h;
|
||||
int sum2_thd_l = 0x7fffffff;
|
||||
|
||||
int aud_mode = AUDIO_OUTMODE_STEREO;
|
||||
module_param(aud_mode, int, 0644);
|
||||
MODULE_PARM_DESC(aud_mode, "\n audio demod output mode val\n");
|
||||
unsigned int atv_video_gain;
|
||||
unsigned int carrier_amplif_val = 0xc030901;
|
||||
unsigned int extra_input_fil_val = 0x1030501;
|
||||
unsigned int audio_det_mode = AUDIO_AUTO_DETECT;
|
||||
bool aud_dmd_jilinTV;
|
||||
unsigned int if_freq = 4250000; /*PAL-DK:3250000;NTSC-M:4250000*/
|
||||
unsigned int if_inv;
|
||||
|
||||
int aud_auto = 1;
|
||||
module_param(aud_auto, int, 0644);
|
||||
MODULE_PARM_DESC(aud_auto, "\n audio demod auto detec\n");
|
||||
int afc_default = CARR_AFC_DEFAULT_VAL;
|
||||
|
||||
static unsigned long over_threshold = 0xffff;
|
||||
module_param(over_threshold, ulong, 0644);
|
||||
MODULE_PARM_DESC(over_threshold, "\n over_threshold\n");
|
||||
|
||||
static unsigned long input_amplitude = 0xffff;
|
||||
module_param(input_amplitude, ulong, 0644);
|
||||
MODULE_PARM_DESC(input_amplitude, "\n input_amplitude\n");
|
||||
|
||||
static bool audio_det_en;
|
||||
module_param(audio_det_en, bool, 0644);
|
||||
MODULE_PARM_DESC(audio_det_en, "\n audio_det_en\n");
|
||||
|
||||
static int non_std_en;
|
||||
module_param(non_std_en, int, 0644);
|
||||
MODULE_PARM_DESC(non_std_en, "\n non_std_en\n");
|
||||
|
||||
static int non_std_onoff;
|
||||
module_param(non_std_onoff, int, 0644);
|
||||
MODULE_PARM_DESC(non_std_onoff, "\n non_std_onoff\n");
|
||||
|
||||
static int non_std_times = 50;
|
||||
module_param(non_std_times, int, 0644);
|
||||
MODULE_PARM_DESC(non_std_times, "\n non_std_times\n");
|
||||
|
||||
static int non_std_thld_4c_h = 100;
|
||||
module_param(non_std_thld_4c_h, int, 0644);
|
||||
MODULE_PARM_DESC(non_std_thld_4c_h, "\n non_std_thld_4c_h\n");
|
||||
|
||||
static int non_std_thld_4c_l = 30;
|
||||
module_param(non_std_thld_4c_l, int, 0644);
|
||||
MODULE_PARM_DESC(non_std_thld_4c_l, "\n non_std_thld_4c_l\n");
|
||||
|
||||
static int non_std_thld_54_h = 500;
|
||||
module_param(non_std_thld_54_h, int, 0644);
|
||||
MODULE_PARM_DESC(non_std_thld_54_h, "\n non_std_thld_54_h\n");
|
||||
|
||||
static int non_std_thld_54_l = 300;
|
||||
module_param(non_std_thld_54_l, int, 0644);
|
||||
MODULE_PARM_DESC(non_std_thld_54_l, "\n non_std_thld_54_l\n");
|
||||
|
||||
static int sum1_thd_h;
|
||||
module_param(sum1_thd_h, int, 0644);
|
||||
MODULE_PARM_DESC(sum1_thd_h, "\n sum1_thd_h\n");
|
||||
|
||||
static int sum1_thd_l = 0x7fffffff;
|
||||
module_param(sum1_thd_l, int, 0644);
|
||||
MODULE_PARM_DESC(sum1_thd_l, "\n sum1_thd_l\n");
|
||||
|
||||
static int sum2_thd_h;
|
||||
module_param(sum2_thd_h, int, 0644);
|
||||
MODULE_PARM_DESC(sum2_thd_h, "\n sum2_thd_h\n");
|
||||
|
||||
static int sum2_thd_l = 0x7fffffff;
|
||||
module_param(sum2_thd_l, int, 0644);
|
||||
MODULE_PARM_DESC(sum2_thd_l, "\n sum2_thd_l\n");
|
||||
|
||||
static int atv_video_gain;
|
||||
module_param(atv_video_gain, int, 0644);
|
||||
MODULE_PARM_DESC(atv_video_gain, "\n atv_video_gain reg:0x0f44\n");
|
||||
|
||||
static int carrier_amplif_val = 0xc030901;
|
||||
module_param(carrier_amplif_val, int, 0644);
|
||||
MODULE_PARM_DESC(carrier_amplif_val, "\ncarrier_amplif_val (reg 0x0624)\n");
|
||||
|
||||
static int extra_input_fil_val = 0x1030501;
|
||||
module_param(extra_input_fil_val, int, 0644);
|
||||
MODULE_PARM_DESC(extra_input_fil_val, "\nextra_input_fil_val (reg 0x0900)\n");
|
||||
|
||||
static int audio_det_mode = AUDIO_AUTO_DETECT;
|
||||
module_param(audio_det_mode, int, 0644);
|
||||
MODULE_PARM_DESC(audio_det_mode, "\n audio_det_mode\n");
|
||||
|
||||
static int aud_dmd_jilinTV;
|
||||
module_param(aud_dmd_jilinTV, int, 0644);
|
||||
MODULE_PARM_DESC(aud_dmd_jilinTV, "\naud dmodulation setting for jilin TV\n");
|
||||
|
||||
static unsigned int if_freq = 4250000; /*PAL-DK:3250000;NTSC-M:4250000*/
|
||||
module_param(if_freq, uint, 0644);
|
||||
MODULE_PARM_DESC(if_freq, "\n if_freq\n");
|
||||
|
||||
static int if_inv;
|
||||
module_param(if_inv, int, 0644);
|
||||
MODULE_PARM_DESC(if_inv, "\n if_inv\n");
|
||||
|
||||
static int afc_default = CARR_AFC_DEFAULT_VAL;
|
||||
module_param(afc_default, int, 0644);
|
||||
MODULE_PARM_DESC(afc_default, "\n afc_default\n");
|
||||
|
||||
/*
|
||||
* GDE_Curve
|
||||
@@ -148,74 +75,26 @@ MODULE_PARM_DESC(afc_default, "\n afc_default\n");
|
||||
* I --> BYPASS
|
||||
* SECAM --> BYPASS
|
||||
*/
|
||||
static int gde_curve;
|
||||
module_param(gde_curve, int, 0644);
|
||||
MODULE_PARM_DESC(gde_curve, "\n gde_curve\n");
|
||||
unsigned int gde_curve;
|
||||
|
||||
static int sound_format;
|
||||
module_param(sound_format, int, 0644);
|
||||
MODULE_PARM_DESC(sound_format, "\n sound_format\n");
|
||||
|
||||
static unsigned int freq_hz_cvrt = AML_ATV_DEMOD_FREQ_60HZ_VERT;
|
||||
module_param(freq_hz_cvrt, int, 0644);
|
||||
MODULE_PARM_DESC(freq_hz_cvrt, "\n freq_hz\n");
|
||||
|
||||
int atvdemod_debug_en;
|
||||
module_param(atvdemod_debug_en, int, 0644);
|
||||
MODULE_PARM_DESC(atvdemod_debug_en, "\n atvdemod_debug_en\n");
|
||||
unsigned int sound_format;
|
||||
unsigned int freq_hz_cvrt = AML_ATV_DEMOD_FREQ_60HZ_VERT;
|
||||
unsigned int atvdemod_debug_en;
|
||||
|
||||
/*1:gpio mode output low;2:pwm mode*/
|
||||
static unsigned int atvdemod_agc_pinmux = 2;
|
||||
module_param(atvdemod_agc_pinmux, int, 0644);
|
||||
MODULE_PARM_DESC(atvdemod_agc_pinmux, "\n atvdemod_agc_pinmux\n");
|
||||
|
||||
static unsigned int atvdemod_afc_range = 5;
|
||||
module_param(atvdemod_afc_range, uint, 0644);
|
||||
MODULE_PARM_DESC(atvdemod_afc_range, "\n atvdemod_afc_range\n");
|
||||
|
||||
static unsigned int atvdemod_afc_offset = 500;
|
||||
module_param(atvdemod_afc_offset, uint, 0644);
|
||||
MODULE_PARM_DESC(atvdemod_afc_offset, "\n atvdemod_afc_offset\n");
|
||||
|
||||
static unsigned int atvdemod_timer_en = 1;
|
||||
module_param(atvdemod_timer_en, uint, 0644);
|
||||
MODULE_PARM_DESC(atvdemod_timer_en, "\n atvdemod_timer_en\n");
|
||||
|
||||
static unsigned int atvdemod_afc_en;
|
||||
module_param(atvdemod_afc_en, uint, 0644);
|
||||
MODULE_PARM_DESC(atvdemod_afc_en, "\n atvdemod_afc_en\n");
|
||||
|
||||
static unsigned int atvdemod_monitor_en;
|
||||
module_param(atvdemod_monitor_en, uint, 0644);
|
||||
MODULE_PARM_DESC(atvdemod_monitor_en, "\n atvdemod_monitor_en\n");
|
||||
|
||||
static unsigned int atvdemod_det_snr_en = 1;
|
||||
module_param(atvdemod_det_snr_en, uint, 0644);
|
||||
MODULE_PARM_DESC(atvdemod_det_snr_en, "\n atvdemod_det_snr_en\n");
|
||||
|
||||
static unsigned int audio_thd_en = 1;
|
||||
module_param(audio_thd_en, uint, 0644);
|
||||
MODULE_PARM_DESC(audio_thd_en, "\n audio_thd_en\n");
|
||||
|
||||
static unsigned int pwm_kp = 0x19;
|
||||
module_param(pwm_kp, uint, 0644);
|
||||
MODULE_PARM_DESC(pwm_kp, "\n pwm_kp\n");
|
||||
|
||||
static unsigned int reg_dbg_en;
|
||||
module_param(reg_dbg_en, uint, 0644);
|
||||
MODULE_PARM_DESC(reg_dbg_en, "\n reg_dbg_en\n");
|
||||
|
||||
static unsigned int audio_gain_val = 512;
|
||||
module_param(audio_gain_val, uint, 0644);
|
||||
MODULE_PARM_DESC(audio_gain_val, "\n audio_gain_val\n");
|
||||
|
||||
static unsigned int audio_a2_threshold = 0x800;
|
||||
module_param(audio_a2_threshold, uint, 0644);
|
||||
MODULE_PARM_DESC(audio_a2_threshold, "\n audio_a2_threshold\n");
|
||||
|
||||
static unsigned int audio_a2_delay = 10;
|
||||
module_param(audio_a2_delay, uint, 0644);
|
||||
MODULE_PARM_DESC(audio_a2_delay, "\n audio_a2_delay\n");
|
||||
unsigned int atvdemod_agc_pinmux = 2;
|
||||
unsigned int atvdemod_afc_range = 5;
|
||||
unsigned int atvdemod_afc_offset = 500;
|
||||
unsigned int atvdemod_timer_en = 1;
|
||||
unsigned int atvdemod_afc_en;
|
||||
unsigned int atvdemod_monitor_en;
|
||||
unsigned int atvdemod_det_snr_en = 1;
|
||||
unsigned int audio_thd_en = 1;
|
||||
unsigned int pwm_kp = 0x19;
|
||||
unsigned int reg_dbg_en;
|
||||
unsigned int audio_gain_val = 512;
|
||||
unsigned int audio_a2_threshold = 0x800;
|
||||
unsigned int audio_a2_delay = 10;
|
||||
|
||||
|
||||
enum AUDIO_SCAN_ID {
|
||||
|
||||
@@ -27,7 +27,6 @@ struct dvb_frontend;
|
||||
|
||||
#define HHI_ATV_DMD_SYS_CLK_CNTL 0x10f3
|
||||
|
||||
extern int atvdemod_debug_en;
|
||||
extern unsigned int reg_23cf; /* IIR filter */
|
||||
extern int broad_std_except_pal_m;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user