diff options
Diffstat (limited to 'drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_debug.c')
-rw-r--r-- | drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_debug.c | 69 |
1 files changed, 64 insertions, 5 deletions
diff --git a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_debug.c b/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_debug.c index 80edd00..abe8ca7 100644 --- a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_debug.c +++ b/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_debug.c @@ -20,14 +20,70 @@ * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ -#include <linux/module.h> -#include <linux/kernel.h> -#include <linux/moduleparam.h> - #include "tcpal_os.h" #include "tcpal_debug.h" -module_param(tcbd_debug_class, int, 0644); +static s32 tcbd_spur_dbg; + +static s32 tcbd_spur_clock_config[5] = {0x60, 0x00, 0x0F, 0x02, 76800}; +static s32 clock_config_count = 5; + +static s32 tcbd_rom_from_fs; +static char *tcbd_rom_path = "/tmp/tcc3170.rom"; + +static u32 tcbd_mbox_rx[9] = {0, }; +static u32 tcbd_mbox_tx[9*10] = {0, }; + +static s32 mbox_rx_data_len = 9; +static s32 mbox_tx_data_len = 9*10; + +module_param(tcbd_rom_from_fs, int, 0664); +module_param(tcbd_rom_path, charp, 0664); +module_param(tcbd_spur_dbg, int, 0664); +module_param_array(tcbd_spur_clock_config, int, &clock_config_count, 0664); +module_param_array(tcbd_mbox_rx, int, &mbox_rx_data_len, 0664); +module_param_array(tcbd_mbox_tx, int, &mbox_tx_data_len, 0664); + +void tcbd_debug_mbox_rx(u16 *_cmd, s32 *_cnt, u32 **_data) +{ + *_cmd = tcbd_mbox_rx[0]; + *_cnt = tcbd_mbox_rx[1]; + *_data = &tcbd_mbox_rx[2]; +} + +void tcbd_debug_mbox_tx(u16 *_cmd, s32 *_cnt, u32 **_data) +{ + s32 i; + + for (i = 0; i < 10; i++) { + if (tcbd_mbox_tx[i * 9] != *_cmd) + continue; + *_cmd = tcbd_mbox_tx[i * 9 + 0]; + *_cnt = tcbd_mbox_tx[i * 9 + 1]; + *_data = &tcbd_mbox_tx[i * 9 + 2]; + break; + } +} + +s32 tcbd_debug_spur_dbg(void) +{ + return tcbd_spur_dbg; +} + +s32 tcbd_debug_rom_from_fs(void) +{ + return tcbd_rom_from_fs; +} + +s32 *tcbd_debug_spur_clk_cfg(void) +{ + return tcbd_spur_clock_config; +} + +char *tcbd_debug_rom_path(void) +{ + return tcbd_rom_path; +} u32 tcbd_debug_class = DEBUG_API_COMMON | @@ -45,3 +101,6 @@ u32 tcbd_debug_class = /*DEBUG_INTRRUPT | */ DEBUG_INFO | DEBUG_ERROR; + +module_param(tcbd_debug_class, int, 0664); + |