diff options
Diffstat (limited to 'drivers/media/tdmb')
101 files changed, 0 insertions, 36982 deletions
diff --git a/drivers/media/tdmb/Kconfig b/drivers/media/tdmb/Kconfig deleted file mode 100644 index 10a51b0..0000000 --- a/drivers/media/tdmb/Kconfig +++ /dev/null @@ -1,89 +0,0 @@ -# -# TDMB config states -# - -#klaatu TDMB -config TDMB - bool "T-DMB" - help - This allows T-DMB support for Korea. - This module is designed for SPI or EBI2. - Select chipset and interface - -choice - depends on TDMB - depends on TDMB_VENDOR_FCI || TDMB_VENDOR_RAONTECH \ - || TDMB_VENDOR_INC || TDMB_VENDOR_TELECHIPS - prompt "interface" - default TDMB_SPI - config TDMB_SPI - bool "SPI" - config TDMB_EBI - bool "EBI" - config TDMB_TSIF - bool "TSIF" -endchoice - - config TDMB_VENDOR_FCI - depends on TDMB - bool "FCI" - -choice - depends on TDMB && TDMB_VENDOR_FCI - prompt "chip" - default TDMB_FC8053 - config TDMB_FC8053 - bool "FC8053" - config TDMB_FC8050 - bool "FC8050" -endchoice - -config TDMB_VENDOR_INC - depends on TDMB - bool "I&C" - -choice - depends on TDMB && TDMB_VENDOR_INC - prompt "chip" - default TDMB_T39F0 - config TDMB_T39F0 - bool "T39F0" - config TDMB_T3900 - bool "T3900" - config TDMB_T3700 - bool "T3700" - config TDMB_T3300 - bool "T3300" -endchoice - -config TDMB_VENDOR_RAONTECH - depends on TDMB - bool "Raontech" - -choice - depends on TDMB && TDMB_VENDOR_RAONTECH - prompt "chip" - default TDMB_MTV318 - config TDMB_MTV318 - bool "MTV318" -endchoice - -config TDMB_VENDOR_TELECHIPS - depends on TDMB - bool "Telechips" - -choice - depends on TDMB && TDMB_VENDOR_TELECHIPS - prompt "chip" - default TDMB_TCC3170 - config TDMB_TCC3170 - bool "TCC3170" -endchoice - -config TDMB_SIMUL - depends on TDMB - bool "Simulation" - -config TDMB_ANT_DET - depends on TDMB - bool "tdmb antenna detector" diff --git a/drivers/media/tdmb/Makefile b/drivers/media/tdmb/Makefile deleted file mode 100644 index 8bc2221..0000000 --- a/drivers/media/tdmb/Makefile +++ /dev/null @@ -1,41 +0,0 @@ -# -# Makefile for TDMB Device Drivers. -# - -ccflags-y += -Idrivers/media/tdmb -ccflags-y += -v - -obj-$(CONFIG_TDMB) += tdmb.o tdmb_data.o - -# T39F0 -ccflags-$(CONFIG_TDMB_T39F0) += -Idrivers/media/tdmb/t39f0 -obj-$(CONFIG_TDMB_T39F0) += tdmb_port_t3900.o -obj-$(CONFIG_TDMB_T39F0) += t3900/ -# T3900 -ccflags-$(CONFIG_TDMB_T3900) += -Idrivers/media/tdmb/t3900 -obj-$(CONFIG_TDMB_T3900) += tdmb_port_t3900.o -obj-$(CONFIG_TDMB_T3900) += t3900/ -# FC8050 -ccflags-$(CONFIG_TDMB_FC8050) += -Idrivers/media/tdmb/fc8050 -obj-$(CONFIG_TDMB_FC8050) += tdmb_port_fc8050.o -obj-$(CONFIG_TDMB_FC8050) += fc8050/ -# MTV318 -ccflags-$(CONFIG_TDMB_MTV318) += -Idrivers/media/tdmb/mtv318 -obj-$(CONFIG_TDMB_MTV318) += tdmb_port_mtv318.o -obj-$(CONFIG_TDMB_MTV318) += mtv318/ -# TCC3170 -ccflags-$(CONFIG_TDMB_TCC3170) += -Idrivers/media/tdmb/tcc3170 -ccflags-$(CONFIG_TDMB_TCC3170) += -Idrivers/media/tdmb/tcc3170/inc -ccflags-$(CONFIG_TDMB_TCC3170) += -Idrivers/media/tdmb/tcc3170/inc/tcpal -ccflags-$(CONFIG_TDMB_TCC3170) += -Idrivers/media/tdmb/tcc3170/inc/tcbd_diagnosis -ccflags-$(CONFIG_TDMB_TCC3170) += -Idrivers/media/tdmb/tcc3170/inc/tcbd_stream_parser -ccflags-$(CONFIG_TDMB_TCC3170) += -Idrivers/media/tdmb/tcc3170/inc/tcc_fic_decoder -obj-$(CONFIG_TDMB_TCC3170) += tdmb_port_tcc3170.o -obj-$(CONFIG_TDMB_TCC3170) += tcc3170/ -# Test -obj-$(CONFIG_TDMB_SIMUL) += tdmb_port_Simul.o - -# i/f -obj-$(CONFIG_TDMB_SPI) += tdmb_spi.o -obj-$(CONFIG_TDMB_EBI) += tdmb_ebi.o - diff --git a/drivers/media/tdmb/fc8050/Makefile b/drivers/media/tdmb/fc8050/Makefile deleted file mode 100644 index c2e2fc9..0000000 --- a/drivers/media/tdmb/fc8050/Makefile +++ /dev/null @@ -1,15 +0,0 @@ -obj-y += bbm.o -obj-y += dmbdrv_wrap_fc8050.o -obj-y += fc8050_bb.o -obj-y += fc8050_i2c.o -obj-y += fc8050_isr.o -obj-y += fc8050_spi.o -obj-y += fc8050_tun.o -obj-y += fci_hal.o -obj-y += fci_i2c.o -obj-y += fci_oal.o -obj-y += fci_tun.o -obj-y += fic.o -obj-y += ficdecoder.o - -ccflags-y += -Idrivers/media/tdmb diff --git a/drivers/media/tdmb/fc8050/bbm.c b/drivers/media/tdmb/fc8050/bbm.c deleted file mode 100644 index 0074803..0000000 --- a/drivers/media/tdmb/fc8050/bbm.c +++ /dev/null @@ -1,364 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : bbm.c - - Description : API of dmb baseband module - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - History : - ---------------------------------------------------------------------- - 2009/08/29 jason initial -*******************************************************************************/ - - -#include "fci_types.h" -#include "fci_tun.h" -#include "fc8050_regs.h" -#include "fc8050_bb.h" -#include "fci_hal.h" -#include "fc8050_isr.h" - -int bbm_com_reset(HANDLE hDevice) -{ - int res; - - res = fc8050_reset(hDevice); - - return res; -} - -int bbm_com_probe(HANDLE hDevice) -{ - int res; - - res = fc8050_probe(hDevice); - - return res; -} - -int bbm_com_init(HANDLE hDevice) -{ - int res; - - res = fc8050_init(hDevice); - - return res; -} - -int bbm_com_deinit(HANDLE hDevice) -{ - int res; - - res = fc8050_deinit(hDevice); - - return res; -} - -int bbm_com_read(HANDLE hDevice, u16 addr, u8 *data) -{ - int res; - - res = bbm_read(hDevice, addr, data); - - return res; -} - -int bbm_com_byte_read(HANDLE hDevice, u16 addr, u8 *data) -{ - int res; - - res = bbm_byte_read(hDevice, addr, data); - - return res; -} - -int bbm_com_word_read(HANDLE hDevice, u16 addr, u16 *data) -{ - int res; - - res = bbm_word_read(hDevice, addr, data); - - return res; -} - -int bbm_com_long_read(HANDLE hDevice, u16 addr, u32 *data) -{ - int res; - - res = bbm_long_read(hDevice, addr, data); - - return res; -} - -int bbm_com_bulk_read(HANDLE hDevice, u16 addr, u8 *data, u16 size) -{ - int res; - - res = bbm_bulk_read(hDevice, addr, data, size); - - return res; -} - -int bbm_com_data(HANDLE hDevice, u16 addr, u8 *data, u16 size) -{ - int res; - - res = bbm_data(hDevice, addr, data, size); - - return res; -} - -int bbm_com_write(HANDLE hDevice, u16 addr, u8 data) -{ - int res; - - res = bbm_write(hDevice, addr, data); - - return res; -} - -int bbm_com_byte_write(HANDLE hDevice, u16 addr, u8 data) -{ - int res; - - res = bbm_byte_write(hDevice, addr, data); - - return res; -} - -int bbm_com_word_write(HANDLE hDevice, u16 addr, u16 data) -{ - int res; - - res = bbm_word_write(hDevice, addr, data); - - return res; -} - -int bbm_com_long_write(HANDLE hDevice, u16 addr, u32 data) -{ - int res; - - res = bbm_long_write(hDevice, addr, data); - - return res; -} - -int bbm_com_bulk_write(HANDLE hDevice, u16 addr, u8 *data, u16 size) -{ - int res; - - res = bbm_bulk_write(hDevice, addr, data, size); - - return res; -} - -int bbm_com_tuner_read( - HANDLE hDevice, u8 addr, u8 address_len, u8 *buffer, u8 len) -{ - int res; - - res = tuner_i2c_read(hDevice, addr, address_len, buffer, len); - - return res; -} - -int bbm_com_tuner_write( - HANDLE hDevice, u8 addr, u8 address_len, u8 *buffer, u8 len) -{ - int res; - - res = tuner_i2c_write(hDevice, addr, address_len, buffer, len); - - return res; -} - -int bbm_com_tuner_set_freq(HANDLE hDevice, u32 freq) -{ - int res = BBM_OK; - - res = tuner_set_freq(hDevice, freq); - - return res; -} - -int bbm_com_tuner_select(HANDLE hDevice, u32 product, u32 band) -{ - int res = BBM_OK; - - res = tuner_select(hDevice, product, band); - - return res; -} - -int bbm_com_tuner_get_rssi(HANDLE hDevice, s32 *rssi) -{ - int res = BBM_OK; - - res = tuner_get_rssi(hDevice, rssi); - - return res; -} - -int bbm_com_scan_status(HANDLE hDevice) -{ - int res = BBM_OK; - - res = fc8050_scan_status(hDevice); - - return res; -} - -int bbm_com_channel_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - int res; - - res = fc8050_channel_select(hDevice, subchannel_id, service_channel_id); - - return res; -} - -int bbm_com_video_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId) -{ - int res; - - res = fc8050_video_select( - hDevice, subchannel_id, service_channel_id, cdiId); - - return res; -} - -int bbm_com_audio_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - int res; - - res = fc8050_audio_select(hDevice, subchannel_id, service_channel_id); - - return res; -} - -int bbm_com_data_select(HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - int res; - - res = fc8050_data_select(hDevice, subchannel_id, service_channel_id); - - return res; -} - -int bbm_com_channel_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - int res; - - res = fc8050_channel_deselect( - hDevice, subchannel_id, service_channel_id); - - return res; -} - -int bbm_com_video_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId) -{ - int res; - - res = fc8050_video_deselect( - hDevice, subchannel_id, service_channel_id, cdiId); - - return res; -} - -int bbm_com_audio_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - int res; - - res = fc8050_audio_deselect(hDevice, subchannel_id, service_channel_id); - - return res; -} - -int bbm_com_data_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - int res; - - res = fc8050_data_deselect(hDevice, subchannel_id, service_channel_id); - - return res; -} - -void bbm_com_isr(HANDLE hDevice) -{ - fc8050_isr(hDevice); -} - -int bbm_com_hostif_select(HANDLE hDevice, u8 hostif) -{ - int res = BBM_NOK; - - res = bbm_hostif_select(hDevice, hostif); - - return res; -} - -int bbm_com_hostif_deselect(HANDLE hDevice) -{ - int res = BBM_NOK; - - res = bbm_hostif_deselect(hDevice); - - return res; -} - -int bbm_com_fic_callback_register( - u32 userdata - , int (*callback)(u32 userdata, u8 *data, int length)) -{ - fic_user_data = userdata; - fic_callback = callback; - - return BBM_OK; -} - -int bbm_com_msc_callback_register( - u32 userdata - , int (*callback)(u32 userdata, u8 subchannel_id, u8 *data, int length)) -{ - msc_user_data = userdata; - msc_callback = callback; - - return BBM_OK; -} - -int bbm_com_fic_callback_deregister(HANDLE hDevice) -{ - fic_user_data = 0; - fic_callback = NULL; - - return BBM_OK; -} - -int bbm_com_msc_callback_deregister(HANDLE hDevice) -{ - msc_user_data = 0; - msc_callback = NULL; - - return BBM_OK; -} diff --git a/drivers/media/tdmb/fc8050/bbm.h b/drivers/media/tdmb/fc8050/bbm.h deleted file mode 100644 index 89fb26a..0000000 --- a/drivers/media/tdmb/fc8050/bbm.h +++ /dev/null @@ -1,102 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : bbm.h - - Description : API of dmb baseband module - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - History : - ---------------------------------------------------------------------- - 2009/08/29 jason initial -*******************************************************************************/ - - - -#ifndef __BBM_H__ -#define __BBM_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "fci_types.h" - -#define DRIVER_VER "VER 3.6.3" - -#define BBM_HPI 0 /* HPI */ -#define BBM_SPI 1 /* SPI */ -#define BBM_USB 2 /* USB */ -#define BBM_I2C 3 /* I2C */ -#define BBM_PPI 4 /* PPI */ - -extern int bbm_com_reset(HANDLE hDevice); -extern int bbm_com_probe(HANDLE hDevice); -extern int bbm_com_init(HANDLE hDevice); -extern int bbm_com_deinit(HANDLE hDevice); -extern int bbm_com_read(HANDLE hDevice, u16 addr, u8 *data); -extern int bbm_com_byte_read(HANDLE hDevice, u16 addr, u8 *data); -extern int bbm_com_word_read(HANDLE hDevice, u16 addr, u16 *data); -extern int bbm_com_long_read(HANDLE hDevice, u16 addr, u32 *data); -extern int bbm_com_bulk_read(HANDLE hDevice, u16 addr, u8 *data, u16 size); -extern int bbm_com_data(HANDLE hDevice, u16 addr, u8 *data, u16 size); -extern int bbm_com_write(HANDLE hDevice, u16 addr, u8 data); -extern int bbm_com_byte_write(HANDLE hDevice, u16 addr, u8 data); -extern int bbm_com_word_write(HANDLE hDevice, u16 addr, u16 data); -extern int bbm_com_long_write(HANDLE hDevice, u16 addr, u32 data); -extern int bbm_com_bulk_write(HANDLE hDevice, u16 addr, u8 *data, u16 size); -extern int bbm_com_tuner_read( - HANDLE hDevice, u8 addr, u8 address_len, u8 *buffer, u8 len); -extern int bbm_com_tuner_write( - HANDLE hDevice, u8 addr, u8 address_len, u8 *buffer, u8 len); -extern int bbm_com_tuner_set_freq(HANDLE hDevice, u32 freq); -extern int bbm_com_tuner_select(HANDLE hDevice, u32 product, u32 band); -extern int bbm_com_tuner_get_rssi(HANDLE hDevice, s32 *rssi); -extern int bbm_com_scan_status(HANDLE hDevice); -extern int bbm_com_channel_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int bbm_com_video_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId); -extern int bbm_com_audio_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int bbm_com_data_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int bbm_com_channel_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int bbm_com_video_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId); -extern int bbm_com_audio_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int bbm_com_data_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int bbm_com_hostif_select(HANDLE hDevice, u8 hostif); -extern int bbm_com_hostif_deselect(HANDLE hDevice); -extern int bbm_com_fic_callback_register( - u32 userdata - , int (*callback)(u32 userdata, u8 *data, int length)); -extern int bbm_com_msc_callback_register( - u32 userdata - , int (*callback)( - u32 userdata, u8 subchannel_id, u8 *data, int length)); -extern int bbm_com_fic_callback_deregister(HANDLE hDevice); -extern int bbm_com_msc_callback_deregister(HANDLE hDevice); -extern void bbm_com_isr(HANDLE hDevice); - -#ifdef __cplusplus -} -#endif - -#endif /* __BBM_H__ */ diff --git a/drivers/media/tdmb/fc8050/dmbdrv_wrap_fc8050.c b/drivers/media/tdmb/fc8050/dmbdrv_wrap_fc8050.c deleted file mode 100644 index 548e900..0000000 --- a/drivers/media/tdmb/fc8050/dmbdrv_wrap_fc8050.c +++ /dev/null @@ -1,607 +0,0 @@ -/* -* Copyright(c) 2008 SEC Corp. All Rights Reserved -* -* File name : DMBDrv_wrap_FC8050.c -* -* Description : fc8050 tuner control driver -* 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. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* History : -* ---------------------------------------------------------------------- -* 2009/01/19 changsul.park initial -* 2009/09/23 jason porting QSC6270 -*/ - -#include "dmbdrv_wrap_fc8050.h" -#include "fci_types.h" -#include "bbm.h" -#include "fci_oal.h" -#include "fc8050_regs.h" -#include "fic.h" -#include "fci_tun.h" -#include "tdmb.h" - -struct sub_channel_info_type dmb_subchannel_info; -struct sub_channel_info_type dab_subchannel_info; - - -static u32 saved_ber = 3000; -static u32 dmb_initialize; - -unsigned char current_service_type = 0x18; -unsigned char current_subchannel_id; - -int tdmb_interrupt_fic_callback(u32 userdata, u8 *data, int length) -{ - fic_decoder_put((struct fic *)data, length); - - return 0; -} - -#ifdef FEATURE_FC8050_DEBUG -#define FC8050_DMB 0x01 -#define FC8050_DATA 0x04 -#define FC8050_DAB 0x08 - -u16 dmb_mode = FC8050_DMB; -#endif - -int tdmb_interrupt_msc_callback( -u32 userdata, u8 subchannel_id, u8 *data, int length) -{ - tdmb_store_data(&data[0], length); - - return 0; -} - -static int viterbi_rt_ber_read(unsigned int *ber) -{ - u32 frame, error; - u8 control = 0; - - int res = BBM_OK; - - bbm_com_read(NULL, BBM_VT_CONTROL, &control); - control |= 0x10; - bbm_com_write(NULL, BBM_VT_CONTROL, control); - - bbm_com_long_read(NULL, BBM_VT_RT_BER_PERIOD, &frame); - bbm_com_long_read(NULL, BBM_VT_RT_ERROR_SUM, &error); - - control &= ~0x10; - bbm_com_write(NULL, BBM_VT_CONTROL, control); - - if (frame == 0) { - *ber = 0; - return BBM_NOK; - } - - *ber = (error * 10000 / frame); - - return res; -} - -static int get_signal_level(u32 ber, u8 *level) -{ - if (ber >= 900) - *level = 0; - else if ((ber >= 800) && (ber < 900)) - *level = 1; - else if ((ber >= 700) && (ber < 800)) - *level = 2; - else if ((ber >= 600) && (ber < 700)) - *level = 3; - else if ((ber >= 500) && (ber < 600)) - *level = 4; - else if ((ber >= 400) && (ber < 500)) - *level = 5; - else if (ber < 400) - *level = 6; - - return BBM_OK; -} - -void dmb_drv_isr() -{ - bbm_com_isr(NULL); -} - - -unsigned char dmb_drv_init(void) -{ - int i; -#ifdef FEATURE_INTERFACE_TEST_MODE - u8 data; - u16 wdata; - u32 ldata; - u8 temp = 0x1e; -#endif - -#ifdef CONFIG_TDMB_SPI - if (bbm_com_hostif_select(NULL, BBM_SPI)) - return TDMB_FAIL; -#elif defined(CONFIG_TDMB_EBI) - if (bbm_com_hostif_select(NULL, BBM_PPI)) - return TDMB_FAIL; -#endif - - /* check for factory chip interface test */ - if (bbm_com_probe(NULL) != BBM_OK) { - DPRINTK("%s : BBM_PROBE fail\n", __func__); - return TDMB_FAIL; - } - - bbm_com_fic_callback_register(0, tdmb_interrupt_fic_callback); - bbm_com_msc_callback_register(0, tdmb_interrupt_msc_callback); - - bbm_com_init(NULL); - bbm_com_tuner_select(NULL, FC8050_TUNER, BAND3_TYPE); - -#ifdef FEATURE_INTERFACE_TEST_MODE - for (i = 0; i < 1000; i++) { - bbm_com_write(NULL, 0x05, i & 0xff); - bbm_com_read(NULL, 0x05, &data); - if ((i & 0xff) != data) - DPRINTK("FC8000 byte test (0x%x,0x%x)\r\n" - , i & 0xff, data); - } - for (i = 0; i < 1000; i++) { - bbm_com_word_write(NULL, 0x0210, i & 0xffff); - bbm_com_word_read(NULL, 0x0210, &wdata); - if ((i & 0xffff) != wdata) - DPRINTK("FC8000 word test (0x%x,0x%x)\r\n" - , i & 0xffff, wdata); - } - for (i = 0; i < 1000; i++) { - bbm_com_long_write(NULL, 0x0210, i & 0xffffffff); - bbm_com_long_read(NULL, 0x0210, &ldata); - if ((i & 0xffffffff) != ldata) - DPRINTK("FC8000 long test (0x%x,0x%x)\r\n" - , i & 0xffffffff, ldata); - } - for (i = 0; i < 1000; i++) { - temp = i&0xff; - bbm_com_tuner_write(NULL, 0x12, 0x01, &temp, 0x01); - bbm_com_tuner_read(NULL, 0x12, 0x01, &data, 0x01); - if ((i & 0xff) != data) - DPRINTK("FC8000 tuner test (0x%x,0x%x)\r\n" - , i & 0xff, data); - } - temp = 0x51; - bbm_com_tuner_write(NULL, 0x12, 0x01, &temp, 0x01); -#endif - - saved_ber = 3000; - dmb_initialize = 1; - - return TDMB_SUCCESS; -} - -unsigned char dmb_drv_deinit(void) -{ - dmb_initialize = 0; - - bbm_com_video_deselect(NULL, 0, 0, 0); - bbm_com_audio_deselect(NULL, 0, 3); - bbm_com_data_deselect(NULL, 0, 2); - bbm_com_write(NULL, BBM_COM_STATUS_ENABLE, 0x00); - - ms_wait(100); - - bbm_com_deinit(NULL); - - bbm_com_fic_callback_deregister(NULL); - bbm_com_msc_callback_deregister(NULL); - - bbm_com_hostif_deselect(NULL); - - return TDMB_SUCCESS; -} - -unsigned char dmb_drv_scan_ch(unsigned long frequency) -{ - struct esbinfo_t *esb; - - if (!dmb_initialize) - return TDMB_FAIL; - - if (bbm_com_tuner_set_freq(NULL, frequency)) { - bbm_com_word_write(NULL, BBM_BUF_INT, 0x00ff); - return TDMB_FAIL; - } - - fic_decoder_subchannel_info_clean(); - bbm_com_word_write(NULL, BBM_BUF_INT, 0x01ff); - - if (bbm_com_scan_status(NULL)) { - bbm_com_word_write(NULL, BBM_BUF_INT, 0x00ff); - return TDMB_FAIL; - } - - /* wait 1.2 sec for gathering fic information */ - ms_wait(1200); - - bbm_com_word_write(NULL, BBM_BUF_INT, 0x00ff); - - esb = fic_decoder_get_ensemble_info(0); - if (esb->flag != 99) { - fic_decoder_subchannel_info_clean(); - return TDMB_FAIL; - } - - if (strnlen(esb->label, sizeof(esb->label)) <= 0) { - fic_decoder_subchannel_info_clean(); - return TDMB_FAIL; - } - - return TDMB_SUCCESS; -} - -int dmb_drv_get_dmb_sub_ch_cnt() -{ - struct service_info_t *svc_info; - int i, n; - - if (!dmb_initialize) - return 0; - - n = 0; - for (i = 0; i < MAX_SVC_NUM; i++) { - svc_info = fic_decoder_get_service_info_list(i); - - if ((svc_info->flag & 0x07) == 0x07) { - if ((svc_info->tmid == 0x01) - && (svc_info->dscty == 0x18)) - n++; - } - } - - return n; -} - -int dmb_drv_get_dab_sub_ch_cnt() -{ - struct service_info_t *svc_info; - int i, n; - - if (!dmb_initialize) - return 0; - - n = 0; - for (i = 0; i < MAX_SVC_NUM; i++) { - svc_info = fic_decoder_get_service_info_list(i); - - if ((svc_info->flag & 0x07) == 0x07) { - if ((svc_info->tmid == 0x00) - && (svc_info->ascty == 0x00)) - n++; - } - } - - return n; -} - -char *dmb_drv_get_ensemble_label() -{ - struct esbinfo_t *esb; - - if (!dmb_initialize) - return NULL; - - esb = fic_decoder_get_ensemble_info(0); - - if (esb->flag == 99) - return (char *)esb->label; - - return NULL; -} - -char *dmb_drv_get_sub_ch_dmb_label(int subchannel_count) -{ - int i, n; - struct service_info_t *svc_info; - char *label = NULL; - - if (!dmb_initialize) - return NULL; - - n = 0; - for (i = 0; i < MAX_SVC_NUM; i++) { - svc_info = fic_decoder_get_service_info_list(i); - - if ((svc_info->flag & 0x07) == 0x07) { - if ((svc_info->tmid == 0x01) - && (svc_info->dscty == 0x18)) { - if (n == subchannel_count) { - label = (char *) svc_info->label; - break; - } - n++; - } - } - } - - return label; -} - -char *dmb_drv_get_sub_ch_dab_label(int subchannel_count) -{ - int i, n; - struct service_info_t *svc_info; - char *label = NULL; - - if (!dmb_initialize) - return NULL; - - n = 0; - for (i = 0; i < MAX_SVC_NUM; i++) { - svc_info = fic_decoder_get_service_info_list(i); - - if ((svc_info->flag & 0x07) == 0x07) { - if ((svc_info->tmid == 0x00) - && (svc_info->ascty == 0x00)) { - if (n == subchannel_count) { - label = (char *) svc_info->label; - break; - } - n++; - } - } - } - - return label; -} - -struct sub_channel_info_type *dmb_drv_get_fic_dmb(int subchannel_count) -{ - int i, n, j; - struct esbinfo_t *esb; - struct service_info_t *svc_info; - u8 num_of_user_appl; - - if (!dmb_initialize) - return NULL; - - memset((void *)&dmb_subchannel_info, 0, sizeof(dmb_subchannel_info)); - - n = 0; - for (i = 0; i < MAX_SVC_NUM; i++) { - svc_info = fic_decoder_get_service_info_list(i); - - if ((svc_info->flag & 0x07) == 0x07) { - if ((svc_info->tmid == 0x01) - && (svc_info->dscty == 0x18)) { - if (n == subchannel_count) { - dmb_subchannel_info.ucSubchID - = svc_info->sub_channel_id; - dmb_subchannel_info.uiStartAddress - = 0; - dmb_subchannel_info.ucTMId - = svc_info->tmid; - dmb_subchannel_info.ucServiceType - = svc_info->dscty; - dmb_subchannel_info.ulServiceID - = svc_info->sid; - - num_of_user_appl = - svc_info->num_of_user_appl; - dmb_subchannel_info.num_of_user_appl - = num_of_user_appl; - for (j = 0; j < num_of_user_appl; j++) { - dmb_subchannel_info. - user_appl_type[j] - = svc_info->user_appl_type[j]; - dmb_subchannel_info. - user_appl_length[j] - = svc_info->user_appl_length[j]; - memcpy( - &dmb_subchannel_info. - user_appl_data[j][0] - , &svc_info-> - user_appl_data[j][0] - , dmb_subchannel_info. - user_appl_length[j]); - } - - esb = fic_decoder_get_ensemble_info(0); - if (esb->flag == 99) - dmb_subchannel_info.uiEnsembleID - = esb->eid; - else - dmb_subchannel_info.uiEnsembleID - = 0; - - break; - } - n++; - } - } - } - - return &dmb_subchannel_info; -} - -struct sub_channel_info_type *dmb_drv_get_fic_dab(int subchannel_count) -{ - int i, n; - struct esbinfo_t *esb; - struct service_info_t *svc_info; - - if (!dmb_initialize) - return NULL; - - memset((void *)&dab_subchannel_info, 0, sizeof(dab_subchannel_info)); - - n = 0; - for (i = 0; i < MAX_SVC_NUM; i++) { - svc_info = fic_decoder_get_service_info_list(i); - - if ((svc_info->flag & 0x07) == 0x07) { - if ((svc_info->tmid == 0x00) - && (svc_info->ascty == 0x00)) { - if (n == subchannel_count) { - dab_subchannel_info.ucSubchID = - svc_info->sub_channel_id; - dab_subchannel_info.uiStartAddress = 0; - dab_subchannel_info.ucTMId - = svc_info->tmid; - dab_subchannel_info.ucServiceType = - svc_info->ascty; - dab_subchannel_info.ulServiceID = - svc_info->sid; - esb = fic_decoder_get_ensemble_info(0); - if (esb->flag == 99) - dmb_subchannel_info.uiEnsembleID - = esb->eid; - else - dmb_subchannel_info.uiEnsembleID - = 0; - - break; - } - n++; - } - } - } - - return &dab_subchannel_info; -} - -#ifdef FEATURE_FC8050_DEBUG -void fc8050_isr_interruptclear(void) -{ - u8 status = 0; - - bbm_com_read(NULL, BBM_COM_INT_STATUS, &status); - bbm_com_write(NULL, BBM_COM_INT_STATUS, status); - bbm_com_write(NULL, BBM_COM_INT_STATUS, 0x00); -} - -void dmb_drv_check_overrun(u8 reset) -{ - u16 overrun; - u16 temp = 0; - - bbm_com_word_read(NULL, BBM_BUF_OVERRUN, &overrun); - - if (overrun & dmb_mode) { - /* overrun clear */ - bbm_com_word_write(NULL, BBM_BUF_OVERRUN, overrun); - bbm_com_word_write(NULL, BBM_BUF_OVERRUN, 0x0000); - - if (reset) { - /* buffer restore */ - bbm_com_word_read(NULL, BBM_BUF_ENABLE, &temp); - temp &= ~dmb_mode; - bbm_com_word_write(NULL, BBM_BUF_ENABLE, temp); - temp |= dmb_mode; - bbm_com_word_write(NULL, BBM_BUF_ENABLE, temp); - - /* external interrupt restore */ - fc8050_isr_interruptclear(); - } - - DPRINTK("FC8050 Overrun occured\n"); - } - -} -#endif - -unsigned char dmb_drv_set_ch( -unsigned long frequency -, unsigned char subchannel -, unsigned char sevice_type) -{ - if (!dmb_initialize) - return TDMB_FAIL; - - current_service_type = sevice_type; - current_subchannel_id = subchannel; - - bbm_com_video_deselect(NULL, 0, 0, 0); - bbm_com_audio_deselect(NULL, 0, 3); - bbm_com_data_deselect(NULL, 0, 2); - - bbm_com_word_write(NULL, BBM_BUF_INT, 0x00ff); - - if (bbm_com_tuner_set_freq(NULL, frequency) != BBM_OK) - return TDMB_FAIL; - - if (sevice_type == 0x18) - bbm_com_video_select(NULL, subchannel, 0, 0); - else if (sevice_type == 0x00) - bbm_com_audio_select(NULL, subchannel, 3); - else - bbm_com_data_select(NULL, subchannel, 2); - -#ifdef FEATURE_FC8050_DEBUG - if (sevice_type == 0x18) - dmb_mode = FC8050_DMB; - else if (sevice_type == 0x00) - dmb_mode = FC8050_DAB; - else - dmb_mode = FC8050_DATA; -#endif - - return TDMB_SUCCESS; -} - -unsigned short dmb_drv_get_ber() -{ - return saved_ber; -} - -unsigned char dmb_drv_get_ant(void) -{ - u8 level = 0; - unsigned int ber; - - if (!dmb_initialize) { - saved_ber = 3000; - return 0; - } - - if (viterbi_rt_ber_read(&ber)) { - saved_ber = 3000; - return 0; - } - - if (ber <= 20) - ber = 0; - - saved_ber = ber; - if (get_signal_level(ber, &level)) - return 0; - -#ifdef FEATURE_FC8050_DEBUG - dmb_drv_check_overrun(1); -#endif - - return level; -} - -signed short dmb_drv_get_rssi() -{ - s32 rssi; - - if (!dmb_initialize) { - rssi = -110; - return rssi; - } - - bbm_com_tuner_get_rssi(NULL, &rssi); - - return (signed short)rssi; -} diff --git a/drivers/media/tdmb/fc8050/dmbdrv_wrap_fc8050.h b/drivers/media/tdmb/fc8050/dmbdrv_wrap_fc8050.h deleted file mode 100644 index 802e421..0000000 --- a/drivers/media/tdmb/fc8050/dmbdrv_wrap_fc8050.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -* Copyright(c) 2008 SEC Corp. All Rights Reserved -* -* File name : dmbdrv_wrap_fc8050.h -* -* Description : fc8050 tuner control driver -* 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. -* -* You should have received a copy of the GNU General Public License -* along with this program; if not, write to the Free Software -* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -* -* History : -* ---------------------------------------------------------------------- -* -*/ - -#ifndef __DMBDRV_WRAP_FC8050_H -#define __DMBDRV_WRAP_FC8050_H - -#include <linux/string.h> -#include <linux/delay.h> - -#define TDMB_SUCCESS 1 -#define TDMB_FAIL 0 - -#define USER_APPL_NUM_MAX 12 -#define USER_APPL_DATA_SIZE_MAX 24 - -struct sub_channel_info_type { - unsigned short uiEnsembleID; - unsigned char ucSubchID; - unsigned short uiStartAddress; - unsigned char ucTMId; - unsigned char ucServiceType; - unsigned long ulServiceID; - unsigned char num_of_user_appl; - unsigned short user_appl_type[USER_APPL_NUM_MAX]; - unsigned char user_appl_length[USER_APPL_NUM_MAX]; - unsigned char user_appl_data - [USER_APPL_NUM_MAX][USER_APPL_DATA_SIZE_MAX]; -}; - -void dmb_drv_isr(void); -unsigned char dmb_drv_init(void); -unsigned char dmb_drv_deinit(void); -unsigned char dmb_drv_scan_ch(unsigned long frequency); -int dmb_drv_get_dmb_sub_ch_cnt(void); -int dmb_drv_get_dab_sub_ch_cnt(void); -char *dmb_drv_get_ensemble_label(void); -char *dmb_drv_get_sub_ch_dmb_label(int subchannel_count); -char *dmb_drv_get_sub_ch_dab_label(int subchannel_count); -struct sub_channel_info_type *dmb_drv_get_fic_dmb(int subchannel_count); -struct sub_channel_info_type *dmb_drv_get_fic_dab(int subchannel_count); -unsigned char dmb_drv_set_ch( - unsigned long frequency - , unsigned char subchannel - , unsigned char sevice_type); -unsigned short dmb_drv_get_ber(void); -unsigned char dmb_drv_get_ant(void); -signed short dmb_drv_get_rssi(void); -int tdmb_interrupt_fic_callback(u32 userdata, u8 *data, int length); -int tdmb_interrupt_msc_callback( - u32 userdata, u8 subchannel_id, u8 *data, int length); -#endif diff --git a/drivers/media/tdmb/fc8050/fc8050_bb.c b/drivers/media/tdmb/fc8050/fc8050_bb.c deleted file mode 100644 index 1f5b825..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_bb.c +++ /dev/null @@ -1,607 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_bb.c - - Description : API of dmb baseband module - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - History : - ---------------------------------------------------------------------- - 2009/08/29 jason initial - BB Config 1p0 -*******************************************************************************/ -#include <linux/kernel.h> -#include "fci_types.h" -#include "fci_oal.h" -#include "fci_hal.h" -#include "fci_tun.h" -#include "fc8050_regs.h" - -#define POWER_SAVE_MODE -#define MSMCHIP - -#define LOCK_TIME_TICK 5 /* 5ms */ -#define SLOCK_MAX_TIME 200 -#define FLOCK_MAX_TIME 300 -#define DLOCK_MAX_TIME 500 - -static int fc8050_power_save_on(HANDLE hDevice) -{ - u8 tmp = 0x64; - - bbm_write(hDevice, BBM_DIDP_POWER_OPT0, 0x06); - bbm_write(hDevice, BBM_DIDP_POWER_OPT1, 0x06); - bbm_write(hDevice, BBM_DIDP_POWER_OPT2, 0x07); - bbm_write(hDevice, BBM_FFT_ADC_CONTROL, 0x1c); - - tuner_i2c_write(hDevice, 0x61, 1, &tmp, 1); - - print_log(hDevice, "Power Save On\n"); - - return BBM_OK; -} - -static int fc8050_power_save_off(HANDLE hDevice) -{ - u8 tmp = 0x1e; - - bbm_write(hDevice, BBM_DIDP_POWER_OPT0, 0x04); - bbm_write(hDevice, BBM_DIDP_POWER_OPT1, 0x05); - bbm_write(hDevice, BBM_DIDP_POWER_OPT2, 0x05); - bbm_write(hDevice, BBM_FFT_ADC_CONTROL, 0x9c); - - tuner_i2c_write(hDevice, 0x61, 1, &tmp, 1); - - print_log(hDevice, "Power Save Off\n"); - - return BBM_OK; -} - -static int fc8050_cu_size_check(HANDLE hDevice, u8 svcId, u16 *cuSize) -{ - int res = BBM_NOK; - int i; - u16 subch_info = 0; - - *cuSize = 0; - - for (i = 0; i < 40; i++) { - bbm_word_read(hDevice, 0x192 + 12 * svcId, &subch_info); - - if (subch_info & 0x3ff) { - *cuSize = subch_info & 0x3ff; - res = BBM_OK; - - print_log(hDevice - , "CU CHECK LOOP COUNT: %d ms\n", i * 10); - break; - } - - ms_wait(10); - } - - return res; -} - -static int fc8050_set_xtal(HANDLE hDevice) -{ -#if (FC8050_FREQ_XTAL == 19200) - /* Default XTAL */ -#elif (FC8050_FREQ_XTAL == 16384) - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x0); - bbm_write(hDevice, BBM_QDD_COEF, 0x2); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x1); - bbm_write(hDevice, BBM_QDD_COEF, 0xff); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x2); - bbm_write(hDevice, BBM_QDD_COEF, 0xfd); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x3); - bbm_write(hDevice, BBM_QDD_COEF, 0x0); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x4); - bbm_write(hDevice, BBM_QDD_COEF, 0x4); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x5); - bbm_write(hDevice, BBM_QDD_COEF, 0x3); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x6); - bbm_write(hDevice, BBM_QDD_COEF, 0xfc); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x7); - bbm_write(hDevice, BBM_QDD_COEF, 0xf9); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x8); - bbm_write(hDevice, BBM_QDD_COEF, 0x2); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x9); - bbm_write(hDevice, BBM_QDD_COEF, 0xc); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xa); - bbm_write(hDevice, BBM_QDD_COEF, 0x4); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xb); - bbm_write(hDevice, BBM_QDD_COEF, 0xf0); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xc); - bbm_write(hDevice, BBM_QDD_COEF, 0xed); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xd); - bbm_write(hDevice, BBM_QDD_COEF, 0x13); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xe); - bbm_write(hDevice, BBM_QDD_COEF, 0x4f); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xf); - bbm_write(hDevice, BBM_QDD_COEF, 0x6b); - bbm_write(hDevice, 0xe8, 0x00); - bbm_write(hDevice, 0xe9, 0x00); - bbm_write(hDevice, 0xea, 0x00); - bbm_write(hDevice, 0xeb, 0x04); - bbm_write(hDevice, 0xec, 0x80); - bbm_write(hDevice, 0xed, 0x80); - bbm_write(hDevice, 0xee, 0x06); -#elif (FC8050_FREQ_XTAL == 24576) - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x0); - bbm_write(hDevice, BBM_QDD_COEF, 0x2); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x1); - bbm_write(hDevice, BBM_QDD_COEF, 0xff); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x2); - bbm_write(hDevice, BBM_QDD_COEF, 0xfd); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x3); - bbm_write(hDevice, BBM_QDD_COEF, 0x0); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x4); - bbm_write(hDevice, BBM_QDD_COEF, 0x4); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x5); - bbm_write(hDevice, BBM_QDD_COEF, 0x3); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x6); - bbm_write(hDevice, BBM_QDD_COEF, 0xfc); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x7); - bbm_write(hDevice, BBM_QDD_COEF, 0xf9); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x8); - bbm_write(hDevice, BBM_QDD_COEF, 0x2); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x9); - bbm_write(hDevice, BBM_QDD_COEF, 0xc); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xa); - bbm_write(hDevice, BBM_QDD_COEF, 0x4); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xb); - bbm_write(hDevice, BBM_QDD_COEF, 0xf0); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xc); - bbm_write(hDevice, BBM_QDD_COEF, 0xed); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xd); - bbm_write(hDevice, BBM_QDD_COEF, 0x13); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xe); - bbm_write(hDevice, BBM_QDD_COEF, 0x4f); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xf); - bbm_write(hDevice, BBM_QDD_COEF, 0x6b); - bbm_write(hDevice, 0xe8, 0x00); - bbm_write(hDevice, 0xe9, 0x00); - bbm_write(hDevice, 0xea, 0x00); - bbm_write(hDevice, 0xeb, 0x04); - bbm_write(hDevice, 0xec, 0x80); - bbm_write(hDevice, 0xed, 0x80); - bbm_write(hDevice, 0xee, 0x05); -#elif (FC8050_FREQ_XTAL == 27000) - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x0); - bbm_write(hDevice, BBM_QDD_COEF, 0xfe); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x1); - bbm_write(hDevice, BBM_QDD_COEF, 0xfe); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x2); - bbm_write(hDevice, BBM_QDD_COEF, 0x1); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x3); - bbm_write(hDevice, BBM_QDD_COEF, 0x4); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x4); - bbm_write(hDevice, BBM_QDD_COEF, 0x3); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x5); - bbm_write(hDevice, BBM_QDD_COEF, 0xfd); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x6); - bbm_write(hDevice, BBM_QDD_COEF, 0xf9); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x7); - bbm_write(hDevice, BBM_QDD_COEF, 0xff); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x8); - bbm_write(hDevice, BBM_QDD_COEF, 0x9); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x9); - bbm_write(hDevice, BBM_QDD_COEF, 0x9); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xa); - bbm_write(hDevice, BBM_QDD_COEF, 0xfb); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xb); - bbm_write(hDevice, BBM_QDD_COEF, 0xed); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xc); - bbm_write(hDevice, BBM_QDD_COEF, 0xf5); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xd); - bbm_write(hDevice, BBM_QDD_COEF, 0x1c); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xe); - bbm_write(hDevice, BBM_QDD_COEF, 0x4b); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xf); - bbm_write(hDevice, BBM_QDD_COEF, 0x61); - bbm_write(hDevice, 0xe8, 0x4b); - bbm_write(hDevice, 0xe9, 0x11); - bbm_write(hDevice, 0xea, 0xa4); - bbm_write(hDevice, 0xeb, 0x03); - bbm_write(hDevice, 0xec, 0x8c); - bbm_write(hDevice, 0xed, 0x75); - bbm_write(hDevice, 0xee, 0x05); -#elif (FC8050_FREQ_XTAL == 27120) - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x0); - bbm_write(hDevice, BBM_QDD_COEF, 0xfe); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x1); - bbm_write(hDevice, BBM_QDD_COEF, 0xfe); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x2); - bbm_write(hDevice, BBM_QDD_COEF, 0x1); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x3); - bbm_write(hDevice, BBM_QDD_COEF, 0x4); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x4); - bbm_write(hDevice, BBM_QDD_COEF, 0x2); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x5); - bbm_write(hDevice, BBM_QDD_COEF, 0xfc); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x6); - bbm_write(hDevice, BBM_QDD_COEF, 0xf9); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x7); - bbm_write(hDevice, BBM_QDD_COEF, 0xff); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x8); - bbm_write(hDevice, BBM_QDD_COEF, 0x9); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x9); - bbm_write(hDevice, BBM_QDD_COEF, 0x9); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xa); - bbm_write(hDevice, BBM_QDD_COEF, 0xfb); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xb); - bbm_write(hDevice, BBM_QDD_COEF, 0xed); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xc); - bbm_write(hDevice, BBM_QDD_COEF, 0xf5); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xd); - bbm_write(hDevice, BBM_QDD_COEF, 0x1c); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xe); - bbm_write(hDevice, BBM_QDD_COEF, 0x4b); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xf); - bbm_write(hDevice, BBM_QDD_COEF, 0x61); - bbm_write(hDevice, 0xe8, 0x80); - bbm_write(hDevice, 0xe9, 0xf1); - bbm_write(hDevice, 0xea, 0x9f); - bbm_write(hDevice, 0xeb, 0x03); - bbm_write(hDevice, 0xec, 0x8d); - bbm_write(hDevice, 0xed, 0x74); - bbm_write(hDevice, 0xee, 0x05); -#elif (FC8050_FREQ_XTAL == 38400) - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x0); - bbm_write(hDevice, BBM_QDD_COEF, 0xfe); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x1); - bbm_write(hDevice, BBM_QDD_COEF, 0x0); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x2); - bbm_write(hDevice, BBM_QDD_COEF, 0x3); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x3); - bbm_write(hDevice, BBM_QDD_COEF, 0x3); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x4); - bbm_write(hDevice, BBM_QDD_COEF, 0xff); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x5); - bbm_write(hDevice, BBM_QDD_COEF, 0xfa); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x6); - bbm_write(hDevice, BBM_QDD_COEF, 0xfb); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x7); - bbm_write(hDevice, BBM_QDD_COEF, 0x3); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x8); - bbm_write(hDevice, BBM_QDD_COEF, 0xa); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0x9); - bbm_write(hDevice, BBM_QDD_COEF, 0x5); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xa); - bbm_write(hDevice, BBM_QDD_COEF, 0xf7); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xb); - bbm_write(hDevice, BBM_QDD_COEF, 0xed); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xc); - bbm_write(hDevice, BBM_QDD_COEF, 0xfa); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xd); - bbm_write(hDevice, BBM_QDD_COEF, 0x1f); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xe); - bbm_write(hDevice, BBM_QDD_COEF, 0x49); - bbm_write(hDevice, BBM_QDD_COEF_BANK_SEL, 0xf); - bbm_write(hDevice, BBM_QDD_COEF, 0x5c); - bbm_write(hDevice, 0xe8, 0x36); - bbm_write(hDevice, 0xe9, 0xd0); - bbm_write(hDevice, 0xea, 0x69); - bbm_write(hDevice, 0xeb, 0x03); - bbm_write(hDevice, 0xec, 0x96); - bbm_write(hDevice, 0xed, 0x6d); - bbm_write(hDevice, 0xee, 0x04); -#endif - return BBM_OK; -} - -int fc8050_reset(HANDLE hDevice) -{ - bbm_write(hDevice, BBM_COM_RESET, 0xFE); - ms_wait(1); - bbm_write(hDevice, BBM_COM_RESET, 0xFF); - - return BBM_OK; -} - -int fc8050_probe(HANDLE hDevice) -{ - u16 ver; - bbm_word_read(hDevice, BBM_QDD_CHIP_IDL, &ver); - - printk(KERN_DEBUG "tdmb %s : ver(0x%x)\n", __func__, ver); - return (ver == 0x8050) ? BBM_OK : BBM_NOK; -} - -int fc8050_init(HANDLE hDevice) -{ - u8 intMask; - - fc8050_reset(hDevice); - fc8050_set_xtal(hDevice); - - bbm_write(hDevice, BBM_BUF_MISC_CTRL, 0x19); - - /* bbm_write(hDevice, BBM_24M_CLK_EN, 0xff); */ - bbm_write(hDevice, BBM_VT_CONTROL, 0x03); - bbm_word_write(hDevice, BBM_SYNC_CNTRL, 0x0020); - bbm_write(hDevice, BBM_FIC_CRC_CONTROL, 0x03); - bbm_write(hDevice, BBM_BUF_TEST_MODE, 0x08); - bbm_write(hDevice, 0x33c, 0x03); - - bbm_write(hDevice, BBM_FFT_MODEM_STSH, 0x03); - bbm_write(hDevice, BBM_DIDP_MODE, 0x01); - bbm_write(hDevice, BBM_SYNC_DET_CNTRL, 0x01); - bbm_word_write(hDevice, BBM_SYNC_DET_MAX_THRL, 0x0A00); - bbm_write(hDevice, BBM_SYNC_DET_MODE_ENABLE, 0x01); - bbm_write(hDevice, BBM_BUF_CLOCK_EN, 0xff); - bbm_write(hDevice, BBM_FFT_SCALEV_IFFT, 0xea); - bbm_write(hDevice, BBM_SYNC_FT_RANGE, 0x20); - bbm_write(hDevice, BBM_QDD_AGC530_EN, 0x53); - bbm_write(hDevice, BBM_QDD_BLOCK_AVG_SIZE, 0x48); - bbm_write(hDevice, BBM_QDD_BLOCK_AVG_SIZE_LOCK, 0x49); - bbm_word_write(hDevice, BBM_QDD_GAIN_CONSTANT, 0x0303); - bbm_write(hDevice, BBM_QDD_DET_CNT_BOUND, 0x60); - bbm_write(hDevice, BBM_QDD_REF_AMPL, 0x00); - bbm_write(hDevice, BBM_QDD_BW_CTRL_LOCK, 0x50); - bbm_write(hDevice, BBM_QDD_DC_CTRL, 0x3f); - - bbm_write(hDevice, BBM_RS_CONTROL, 0x01); - bbm_word_write(hDevice, BBM_RS_BER_PERIOD, 0x14e); - -#if defined(POWER_SAVE_MODE) - bbm_write(hDevice, BBM_DIDP_POWER_OPT0, 0x06); - bbm_write(hDevice, BBM_DIDP_ADD_N_SHIFT0, 0x41); - bbm_write(hDevice, BBM_DIDP_POWER_OPT1, 0x06); - bbm_write(hDevice, BBM_DIDP_ADD_N_SHIFT1, 0xf1); - bbm_write(hDevice, BBM_DIDP_POWER_OPT2, 0x07); - bbm_write(hDevice, BBM_FFT_ADC_CONTROL, 0x1c); -#else - bbm_write(hDevice, BBM_DIDP_POWER_OPT0, 0x04); - bbm_write(hDevice, BBM_DIDP_ADD_N_SHIFT0, 0x21); - bbm_write(hDevice, BBM_DIDP_POWER_OPT1, 0x05); - bbm_write(hDevice, BBM_DIDP_ADD_N_SHIFT1, 0x21); - bbm_write(hDevice, BBM_DIDP_POWER_OPT2, 0x05); - bbm_write(hDevice, BBM_FFT_ADC_CONTROL, 0x9c); -#endif - - bbm_word_write(hDevice, BBM_BUF_FIC_START, FIC_BUF_START); - bbm_word_write(hDevice, BBM_BUF_FIC_END, FIC_BUF_END); - bbm_word_write(hDevice, BBM_BUF_FIC_THR, FIC_BUF_THR); - bbm_word_write(hDevice, BBM_BUF_CH0_START, CH0_BUF_START); - bbm_word_write(hDevice, BBM_BUF_CH0_END, CH0_BUF_END); - bbm_word_write(hDevice, BBM_BUF_CH0_THR, CH0_BUF_THR); - bbm_word_write(hDevice, BBM_BUF_CH1_START, CH1_BUF_START); - bbm_word_write(hDevice, BBM_BUF_CH1_END, CH1_BUF_END); - bbm_word_write(hDevice, BBM_BUF_CH1_THR, CH1_BUF_THR); - bbm_word_write(hDevice, BBM_BUF_CH2_START, CH2_BUF_START); - bbm_word_write(hDevice, BBM_BUF_CH2_END, CH2_BUF_END); - bbm_word_write(hDevice, BBM_BUF_CH2_THR, CH2_BUF_THR); - bbm_word_write(hDevice, BBM_BUF_CH3_START, CH3_BUF_START); - bbm_word_write(hDevice, BBM_BUF_CH3_END, CH3_BUF_END); - bbm_word_write(hDevice, BBM_BUF_CH3_THR, CH3_BUF_THR); - - bbm_word_write(hDevice, BBM_BUF_INT, 0x01ff); - bbm_word_write(hDevice, BBM_BUF_ENABLE, 0x01ff); - - intMask = BBM_MF_INT; - bbm_write(hDevice, BBM_COM_INT_ENABLE, intMask); - bbm_write(hDevice, BBM_COM_STATUS_ENABLE, intMask); - - return BBM_OK; -} - -int fc8050_deinit(HANDLE hDevice) -{ - bbm_write(hDevice, BBM_COM_RESET, 0x00); - return BBM_OK; -} - -int fc8050_channel_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - u16 cuSize = 0; - - bbm_write(hDevice - , BBM_DIDP_CH0_SUBCH + service_channel_id - , 0x40 | subchannel_id); - - if (fc8050_cu_size_check(hDevice, service_channel_id, &cuSize)) { - fc8050_power_save_off(hDevice); - return BBM_OK; - } - - if (cuSize >= 672) { - fc8050_power_save_off(hDevice); - return BBM_OK; - } - - fc8050_power_save_on(hDevice); - - return BBM_OK; -} - -int fc8050_video_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId) -{ - if (fc8050_channel_select( - hDevice, subchannel_id, service_channel_id) != BBM_OK) - return BBM_NOK; - - bbm_write(hDevice - , BBM_CDI0_SUBCH_EN+cdiId, 0x40 | subchannel_id); - bbm_write(hDevice - , BBM_BUF_CH0_SUBCH+service_channel_id, 0x40 | subchannel_id); - - return BBM_OK; -} - -int fc8050_audio_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - if (fc8050_channel_select( - hDevice, subchannel_id, service_channel_id) != BBM_OK) - return BBM_NOK; - - bbm_write(hDevice - , BBM_BUF_CH0_SUBCH+service_channel_id, 0x40 | subchannel_id); - - return BBM_OK; -} - -int fc8050_data_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - if (fc8050_channel_select( - hDevice, subchannel_id, service_channel_id) != BBM_OK) - return BBM_NOK; - - bbm_write(hDevice - , BBM_BUF_CH0_SUBCH+service_channel_id, 0x40 | subchannel_id); - - return BBM_OK; -} - -int fc8050_channel_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - int i; - - bbm_write(hDevice, BBM_DIDP_CH0_SUBCH + service_channel_id, 0); - - for (i = 0; i < 12; i++) - bbm_write(hDevice, 0x190 + service_channel_id * 12 + i, 0); - - return BBM_OK; -} - -int fc8050_video_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId) -{ - if (fc8050_channel_deselect( - hDevice, subchannel_id, service_channel_id) != BBM_OK) - return BBM_NOK; - - bbm_write(hDevice, BBM_BUF_CH0_SUBCH+service_channel_id, 0x00); - bbm_write(hDevice, BBM_CDI0_SUBCH_EN+cdiId, 0x00); - - return BBM_OK; -} - -int fc8050_audio_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - if (fc8050_channel_deselect( - hDevice, subchannel_id, service_channel_id) != BBM_OK) - return BBM_NOK; - - bbm_write(hDevice, BBM_BUF_CH0_SUBCH+service_channel_id, 0); - - return BBM_OK; -} - -int fc8050_data_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id) -{ - if (fc8050_channel_deselect( - hDevice, subchannel_id, service_channel_id) != BBM_OK) - return BBM_NOK; - - bbm_write(hDevice, BBM_BUF_CH0_SUBCH+service_channel_id, 0); - - return BBM_OK; -} - -int fc8050_scan_status(HANDLE hDevice) -{ - int i, res = BBM_NOK; - u8 mode = 0, status = 0, sync_status = 0; - int slock_cnt, flock_cnt, dlock_cnt; - - bbm_read(hDevice, BBM_SYNC_DET_CNTRL, &mode); - - if ((mode & 0x01) == 0x01) { - slock_cnt = SLOCK_MAX_TIME / LOCK_TIME_TICK; - flock_cnt = FLOCK_MAX_TIME / LOCK_TIME_TICK; - dlock_cnt = DLOCK_MAX_TIME / LOCK_TIME_TICK; - - /* OFDM Detect */ - for (i = 0; i < slock_cnt; i++) { - ms_wait(LOCK_TIME_TICK); - - bbm_read(hDevice, BBM_SYNC_DET_STATUS, &status); - - if (status & 0x01) - break; - } - - if (i == slock_cnt) { - printk(KERN_DEBUG "tdmb:status(0x%x) s(%d)\n", - status, slock_cnt); - return BBM_NOK; - } - - if ((status & 0x02) == 0x00) { - printk(KERN_DEBUG "tdmb %s : status(0x%x)\n", - __func__, status); - return BBM_NOK; - } - - /* FRS */ - for (i += 1; i < flock_cnt; i++) { - ms_wait(LOCK_TIME_TICK); - - bbm_read(hDevice, BBM_SYNC_STATUS, &sync_status); - - if (sync_status & 0x01) - break; - } - - if (i == flock_cnt) { - printk(KERN_DEBUG "tdmb %s : flock_cnt(0x%x)\n" - , __func__ - , flock_cnt); - return BBM_NOK; - } - - /* Digital Lock */ - for (i += 1; i < dlock_cnt; i++) { - ms_wait(LOCK_TIME_TICK); - - bbm_read(hDevice, BBM_SYNC_STATUS, &sync_status); - - if (sync_status & 0x20) { - printk(KERN_DEBUG "tdmb:sync_status(0x%x)\n", - sync_status); - return BBM_OK; - } - } - } else { - dlock_cnt = DLOCK_MAX_TIME / LOCK_TIME_TICK; - - for (i = 0; i < dlock_cnt; i++) { - ms_wait(LOCK_TIME_TICK); - - bbm_read(hDevice, BBM_SYNC_STATUS, &sync_status); - if (sync_status & 0x20) { - printk(KERN_DEBUG "tdmb:sync_status(0x%x)\n", - sync_status); - return BBM_OK; - } - } - } - - printk(KERN_DEBUG "tdmb %s : res(0x%x)\n" - , __func__, res); - - return res; -} diff --git a/drivers/media/tdmb/fc8050/fc8050_bb.h b/drivers/media/tdmb/fc8050/fc8050_bb.h deleted file mode 100644 index 8e9f699..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_bb.h +++ /dev/null @@ -1,63 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_bb.h - - Description : baseband header file - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - History : - ---------------------------------------------------------------------- - 2009/09/14 jason initial -*******************************************************************************/ - -#ifndef __FC8050_BB_H__ -#define __FC8050_BB_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -extern int fc8050_reset(HANDLE hDevice); -extern int fc8050_probe(HANDLE hDevice); -extern int fc8050_init(HANDLE hDevice); -extern int fc8050_deinit(HANDLE hDevice); - -extern int fc8050_scan_status(HANDLE hDevice); - -extern int fc8050_channel_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int fc8050_video_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId); -extern int fc8050_audio_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int fc8050_data_select( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); - -extern int fc8050_channel_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int fc8050_video_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id, u8 cdiId); -extern int fc8050_audio_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); -extern int fc8050_data_deselect( - HANDLE hDevice, u8 subchannel_id, u8 service_channel_id); - -#ifdef __cplusplus -} -#endif - -#endif /* __FC8050_BB_H__ */ diff --git a/drivers/media/tdmb/fc8050/fc8050_i2c.c b/drivers/media/tdmb/fc8050/fc8050_i2c.c deleted file mode 100644 index 38f3067..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_i2c.c +++ /dev/null @@ -1,171 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_i2c.c - - Description : fc8050 host interface - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- -*******************************************************************************/ - -#include "fci_types.h" -#include "fc8050_regs.h" - -#define HPIC_READ 0x01 /* read command */ -#define HPIC_WRITE 0x02 /* write command */ -#define HPIC_AINC 0x04 /* address increment */ -#define HPIC_BMODE 0x00 /* byte mode */ -#define HPIC_WMODE 0x10 /* word mode */ -#define HPIC_LMODE 0x20 /* long mode */ -#define HPIC_ENDIAN 0x00 /* little endian */ -#define HPIC_CLEAR 0x80 /* currently not used */ - -#define CHIP_ADRR 0x58 - -static int i2c_bulkread(HANDLE hDevice, u8 addr, u8 *data, u16 length) -{ - return 0; -} - -static int i2c_bulkwrite(HANDLE hDevice, u8 addr, u8 *data, u16 length) -{ - return 0; -} - -static int i2c_dataread(HANDLE hDevice, u8 addr, u8 *data, u16 length) -{ - return i2c_bulkread(hDevice, addr, data, length); -} - -int fc8050_i2c_init(HANDLE hDevice, u16 param1, u16 param2) -{ - return BBM_OK; -} - -int fc8050_i2c_byteread(HANDLE hDevice, u16 addr, u8 *data) -{ - int res; - u8 command = HPIC_READ | HPIC_BMODE | HPIC_ENDIAN; - res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= i2c_bulkread(hDevice, BBM_DATA_REG, data, 1); - - return res; -} - -int fc8050_i2c_wordread(HANDLE hDevice, u16 addr, u16 *data) -{ - int res; - u8 command = HPIC_READ | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - - if (BBM_SCI_DATA <= addr && BBM_SCI_SYNCRX >= addr) - command = HPIC_READ | HPIC_WMODE | HPIC_ENDIAN; - - res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= i2c_bulkread(hDevice, BBM_DATA_REG, (u8 *)data, 2); - - return res; -} - -int fc8050_i2c_longread(HANDLE hDevice, u16 addr, u32 *data) -{ - int res; - u8 command = HPIC_READ | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= i2c_bulkread(hDevice, BBM_DATA_REG, (u8 *)data, 4); - - return res; -} - -int fc8050_i2c_bulkread(HANDLE hDevice, u16 addr, u8 *data, u16 length) -{ - int res; - u8 command = HPIC_READ | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= i2c_bulkread(hDevice, BBM_DATA_REG, data, length); - - return res; -} - -int fc8050_i2c_bytewrite(HANDLE hDevice, u16 addr, u8 data) -{ - int res; - u8 command = HPIC_WRITE | HPIC_BMODE | HPIC_ENDIAN; - res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= i2c_bulkwrite(hDevice, BBM_DATA_REG, (u8 *)&data, 1); - - return res; -} - -int fc8050_i2c_wordwrite(HANDLE hDevice, u16 addr, u16 data) -{ - int res; - u8 command = HPIC_WRITE | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - - if (BBM_SCI_DATA <= addr && BBM_SCI_SYNCRX >= addr) - command = HPIC_WRITE | HPIC_WMODE | HPIC_ENDIAN; - - res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= i2c_bulkwrite(hDevice, BBM_DATA_REG, (u8 *)&data, 2); - - return res; -} - -int fc8050_i2c_longwrite(HANDLE hDevice, u16 addr, u32 data) -{ - int res; - u8 command = HPIC_WRITE | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= i2c_bulkwrite(hDevice, BBM_DATA_REG, (u8 *)&data, 4); - - return res; -} - -int fc8050_i2c_bulkwrite(HANDLE hDevice, u16 addr, u8 *data, u16 length) -{ - int res; - u8 command = HPIC_WRITE | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= i2c_bulkwrite(hDevice, BBM_DATA_REG, data, length); - - return res; -} - -int fc8050_i2c_dataread(HANDLE hDevice, u16 addr, u8 *data, u16 length) -{ - int res; - u8 command = HPIC_READ | HPIC_BMODE | HPIC_ENDIAN; - res = i2c_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= i2c_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= i2c_dataread(hDevice, BBM_DATA_REG, data, length); - - return res; -} - -int fc8050_i2c_deinit(HANDLE hDevice) -{ - return BBM_OK; -} diff --git a/drivers/media/tdmb/fc8050/fc8050_i2c.h b/drivers/media/tdmb/fc8050/fc8050_i2c.h deleted file mode 100644 index b212d2c..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_i2c.h +++ /dev/null @@ -1,50 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_i2c.c - - Description : API of dmb baseband module - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - History : - ---------------------------------------------------------------------- - 2009/09/14 jason initial -*******************************************************************************/ - -#ifndef __FC8050_I2C_H__ -#define __FC8050_I2C_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -extern int fc8050_i2c_init(HANDLE hDevice, u16 param1, u16 param2); -extern int fc8050_i2c_byteread(HANDLE hDevice, u16 addr, u8 *data); -extern int fc8050_i2c_wordread(HANDLE hDevice, u16 addr, u16 *data); -extern int fc8050_i2c_longread(HANDLE hDevice, u16 addr, u32 *data); -extern int fc8050_i2c_bulkread(HANDLE hDevice, u16 addr, u8 *data, u16 length); -extern int fc8050_i2c_bytewrite(HANDLE hDevice, u16 addr, u8 data); -extern int fc8050_i2c_wordwrite(HANDLE hDevice, u16 addr, u16 data); -extern int fc8050_i2c_longwrite(HANDLE hDevice, u16 addr, u32 data); -extern int fc8050_i2c_bulkwrite(HANDLE hDevice, u16 addr, u8 *data, u16 length); -extern int fc8050_i2c_dataread(HANDLE hDevice, u16 addr, u8 *data, u16 length); -extern int fc8050_i2c_deinit(HANDLE hDevice); - -#ifdef __cplusplus -} -#endif - -#endif /* __FC8050_I2C_H__ */ diff --git a/drivers/media/tdmb/fc8050/fc8050_isr.c b/drivers/media/tdmb/fc8050/fc8050_isr.c deleted file mode 100644 index e181d49..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_isr.c +++ /dev/null @@ -1,116 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_isr.c - - Description : fc8050 interrupt service routine - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/08/29 jason initial -*******************************************************************************/ - -#include "fci_types.h" -#include "fci_hal.h" -#include "fc8050_regs.h" -#include "fc8050_isr.h" - -static u8 fic_buffer[512+4]; -static u8 msc_buffer[8192+4]; - -int (*fic_callback)(u32 userdata, u8 *data, int length) = NULL; -int (*msc_callback)(u32 userdata, u8 subchid, u8 *data, int length) = NULL; - -u32 fic_user_data; -u32 msc_user_data; - - -void fc8050_isr(HANDLE hDevice) -{ - u8 ext_int_status = 0; - - bbm_read(hDevice, BBM_COM_INT_STATUS, &ext_int_status); - bbm_write(hDevice, BBM_COM_INT_STATUS, ext_int_status); - bbm_write(hDevice, BBM_COM_INT_STATUS, 0x00); - - if (ext_int_status & BBM_MF_INT) { - u16 buf_int_status = 0; - u16 size; - int i; - - bbm_word_read(hDevice, BBM_BUF_STATUS, &buf_int_status); - bbm_word_write(hDevice, BBM_BUF_STATUS, buf_int_status); - bbm_word_write(hDevice, BBM_BUF_STATUS, 0x0000); - - if (buf_int_status & 0x0100) { - bbm_word_read(hDevice, BBM_BUF_FIC_THR, &size); - size += 1; - if (size-1) { - bbm_data(hDevice, BBM_COM_FIC_DATA - , &fic_buffer[4], size); - -#ifdef CONFIG_TDMB_SPI - if (fic_callback) - (*fic_callback)(fic_user_data - , &fic_buffer[6], size); -#else - if (fic_callback) - (*fic_callback)(fic_user_data - , &fic_buffer[4], size); -#endif - } - } - - for (i = 0; i < 8; i++) { - if (buf_int_status & (1 << i)) { - bbm_word_read(hDevice - , BBM_BUF_CH0_THR+i*2, &size); - size += 1; - - if (size-1) { - u8 sub_ch_id; - - bbm_read(hDevice, BBM_BUF_CH0_SUBCH+i - , &sub_ch_id); - sub_ch_id = sub_ch_id & 0x3f; - - bbm_data(hDevice, (BBM_COM_CH0_DATA+i) - , &msc_buffer[4], size); - -#ifdef CONFIG_TDMB_SPI - if (msc_callback) - (*msc_callback)( - msc_user_data - , sub_ch_id - , &msc_buffer[6] - , size); -#else - if (msc_callback) - (*msc_callback)( - msc_user_data - , sub_ch_id - , &msc_buffer[4] - , size); -#endif - } - } - } - - } - -} diff --git a/drivers/media/tdmb/fc8050/fc8050_isr.h b/drivers/media/tdmb/fc8050/fc8050_isr.h deleted file mode 100644 index 2c20368..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_isr.h +++ /dev/null @@ -1,54 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_isr.h - - Description : API of dmb baseband module - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - - History : - ---------------------------------------------------------------------- - 2009/09/11 jason initial -*******************************************************************************/ - -#ifndef __FC8050_ISR__ -#define __FC8050_ISR__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "fci_types.h" - -extern u32 fic_user_data; -extern u32 msc_user_data; - -#ifdef FEATURE_FC8050_DEBUG -extern u16 dmb_mode; -#endif - -extern int (*fic_callback)(u32 userdata, u8 *data, int length); -extern int (*msc_callback)(u32 userdata, u8 subchid, u8 *data, int length); - -extern void fc8050_isr(HANDLE hDevice); - -#ifdef __cplusplus -} -#endif - -#endif /* __FC8050_ISR__ */ diff --git a/drivers/media/tdmb/fc8050/fc8050_regs.h b/drivers/media/tdmb/fc8050/fc8050_regs.h deleted file mode 100644 index 56483c2..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_regs.h +++ /dev/null @@ -1,414 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_regs.h - - Description : baseband header file - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/09/14 jason initial -*******************************************************************************/ - -#ifndef __FC8050_REGS_H__ -#define __FC8050_REGS_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -/* X-TAL Frequency Configuration */ -/* #define FC8050_FREQ_XTAL 16384 */ -/* #define FC8050_FREQ_XTAL 19200 */ -#define FC8050_FREQ_XTAL 24576 -/* #define FC8050_FREQ_XTAL 27000 */ -/* #define FC8050_FREQ_XTAL 38400 */ -#define FEATURE_FC8050_DEBUG -/* #define FEATURE_INTERFACE_TEST_MODE */ - -/* INTERRUPT SOURCE */ -#define BBM_MF_INT 0x0001 -#define BBM_WAGC_INT 0x0002 -#define BBM_RECFG_INT 0x0004 -#define BBM_TII_INT 0x0008 -#define BBM_SYNC_INT 0x0010 -#define BBM_I2C_INT 0x0020 -#define BBM_SCI_INT 0x0040 - -/* Host Access Common Register */ -#define BBM_COMMAND_REG 0x0000 -#define BBM_ADDRESS_REG 0x0001 -#define BBM_DATA_REG 0x0002 - -/* COMMON */ -#define BBM_COM_AP2APB_LT 0x0000 -#define BBM_COM_RESET 0x0001 -#define BBM_COM_INT_STATUS 0x0002 -#define BBM_COM_INT_ENABLE 0x0003 -#define BBM_COM_STATUS_ENABLE 0x0006 -#define BBM_COM_FIC_DATA 0x0007 -#define BBM_COM_CH0_DATA 0x0008 -#define BBM_COM_CH1_DATA 0x0009 -#define BBM_COM_CH2_DATA 0x000a -#define BBM_COM_CH3_DATA 0x000b -#define BBM_COM_CH4_DATA 0x000c -#define BBM_COM_CH5_DATA 0x000d -#define BBM_COM_CH6_DATA 0x000e -#define BBM_COM_CH7_DATA 0x000f - -/* QDD */ -#define BBM_QDD_SYNC_RST_EN 0x0010 -#define BBM_QDD_CHIP_IDL 0x0012 -#define BBM_QDD_CHIP_IDH 0x0013 -#define BBM_QDD_COMMAN 0x0014 -#define BBM_QDD_TUN_COMMA 0x0015 -#define BBM_QDD_TRAGET_RMS 0x0016 -#define BBM_QDD_TUN_GAIN 0x0017 -#define BBM_QDD_TUN_GAIN_LOC 0x0018 -#define BBM_QDD_QLEVEL 0x0019 -#define BBM_QDD_GAIN_MIN 0x001a -#define BBM_QDD_GAIN_MAX 0x001b -#define BBM_QDD_AGC_GAIN 0x001c -#define BBM_QDD_IF_RMS 0x001d -#define BBM_QDD_AGC_CTRL 0x001e -#define BBM_QDD_AGC_PERIOD 0x001f -#define BBM_QDD_AGC_STEP 0x0020 -#define BBM_QDD_DC_CTRL 0x0021 -#define BBM_QDD_I_COMP 0x0022 -#define BBM_QDD_Q_COMP 0x0023 -#define BBM_QDD_I_DC 0x0024 -#define BBM_QDD_Q_DC 0x0025 -#define BBM_QDD_PWM_VALL 0x0026 -#define BBM_QDD_PWM_VALH 0x0027 -#define BBM_QDD_PWM_CTRL 0x0028 -#define BBM_QDD_UPDN_PERIOD 0x0029 -#define BBM_QDD_M_FREQ_OFFSET 0x002a -#define BBM_QDD_COEF_BANK_SEL 0x0030 -#define BBM_QDD_COEF 0x0031 -#define BBM_QDD_AGC530_EN 0x0032 -#define BBM_QDD_BLOCK_AVG_SIZE 0x0033 -#define BBM_QDD_BLOCK_AVG_SIZE_LOCK 0x0034 -#define BBM_QDD_GAIN_UPDATE_SPEED 0x0035 -#define BBM_QDD_REF_AMPL 0x0036 -#define BBM_QDD_BW_CTRL_LOCK 0x0037 -#define BBM_QDD_GAIN_CONSTANT 0x0038 -#define BBM_QDD_GAIN_CONSTANT_LOCK 0x0039 -#define BBM_QDD_BLOCK_AVG 0x003a -#define BBM_QDD_DET_CNT_BOUND 0x003c -#define BBM_QDD_AGC_LOCK 0x003e -#define BBM_QDD_UPDOWN_CLK_PERIOD 0x003f - -/* SYNC */ -#define BBM_SYNC_WIN_SIZE 0x0050 -#define BBM_SYNC_FRSYNC_PERIOD 0x0052 -#define BBM_SYNC_NF_ON 0x0053 -#define BBM_SYNC_RMS_CLIP 0x0054 -#define BBM_SYNC_GSG_CF 0x0056 -#define BBM_SYNC_MIN_CF 0x0057 -#define BBM_SYNC_GCMD_CF 0x0058 -#define BBM_SYNC_FTERR_THRESH 0x005A -#define BBM_SYNC_MA_GAIN 0x005B -#define BBM_SYNC_FTSYNC_CTRL 0x005C -#define BBM_SYNC_LPF_POWER 0x005e -#define BBM_SYNC_HPF_POWER 0x005f -#define BBM_SYNC_MODE 0x0060 -#define BBM_SYNC_FFT_SHIFT 0x0061 -#define BBM_SYNC_FF_ERROR 0x0062 -#define BBM_SYNC_CIR_THRESH 0x0064 -#define BBM_SYNC_FF_AVG_LEN 0x0065 -#define BBM_SYNC_D4GIBSHIFT 0x0066 -#define BBM_SYNC_CF_CBW 0x0067 -#define BBM_SYNC_CF_ERROR 0x0068 -#define BBM_SYNC_CFOFFSET_RNGP 0x006a -#define BBM_SYNC_CFOFFSET_RNGM 0x006b -#define BBM_SYNC_CFOFFSET_TGT 0x006c -#define BBM_SYNC_FIC_CNTRL 0x006d -#define BBM_SYNC_DET_CNTRL 0x0070 -#define BBM_SYNC_DET_ACC_PERIOD 0x0071 -#define BBM_SYNC_DET_MAX_THRL 0x0072 -#define BBM_SYNC_DET_MAX_THRH 0x0073 -#define BBM_SYNC_DET_MAX_MAGL 0x0074 -#define BBM_SYNC_DET_MAX_MAGH 0x0075 -#define BBM_SYNC_DET_MEAN_MAGL 0x0076 -#define BBM_SYNC_DET_MEAN_MAGH 0x0077 -#define BBM_SYNC_DET_STATUS 0x0078 -#define BBM_SYNC_DET_DONECNT 0x0079 -#define BBM_SYNC_DET_OKCNT 0x007A -#define BBM_SYNC_DET_MODE_ENABLE 0x007B - -#define BBM_SYNC_NSBLK 0x0090 -#define BBM_SYNC_FTOFFSET 0x0092 -#define BBM_SYNC_FT_RANGE 0x0094 -#define BBM_SYNC_CNTRL 0x0096 -#define BBM_SYNC_STATUS 0x0098 -#define BBM_SYNC_AMD_RANGE 0x009a -#define BBM_SYNC_ERR_THRESH 0x009e -#define BBM_SYNC_LOOP 0x009f -#define BBM_SYNC_WINDOW 0x00a0 -#define BBM_SYNC_NONZERO 0x00a1 -#define BBM_SYNC_LOOP_OUT 0x00a2 -#define BBM_SYNC_TUNER 0x00a4 -#define BBM_SYNC_TII_CTRL 0x00a5 -#define BBM_SYNC_MIN_THRESH 0x00a6 -#define BBM_SYNC_MAINID1 0x00a7 -#define BBM_SYNC_SUBID1 0x00a8 -#define BBM_SYNC_MAINID2 0x00a9 -#define BBM_SYNC_SUBID2 0x00aa -#define BBM_SYNC_ID1_POWER 0x00ab -#define BBM_SYNC_ID2_POWER 0x00ac -#define BBM_SYNC_TII_THRESH 0x00ad -#define BBM_SYNC_MODE_TARGET 0x00ae -#define BBM_SYNC_SYNC_TEST_SEL 0x00af - -/* AGC */ -#define BBM_AGC_REFGAIN 0x0110 -#define BBM_AGC_PERIOD 0x0111 -#define BBM_AGC_GAIN_EXP 0x0113 -#define BBM_AGC_GAIN_FRP 0x0114 -#define BBM_AGC_RMS 0x0116 -#define BBM_AGC_MTH 0x0117 -#define BBM_AGC_Q_LEVEL 0x0118 -#define BBM_AGC_UPDATE_VAL 0x0119 -#define BBM_AGC_FIXED_ON 0x011b -#define BBM_AGC_EXP_FIXED 0x011c -#define BBM_AGC_FR_FIXED 0x011d -#define BBM_AGC_CTRL 0x011f - -/* FFT */ -#define BBM_FFT_SCALEV_FFT 0x0120 -#define BBM_FFT_SCALEV_IFFT 0x0122 -#define BBM_FFT_ADC_CONTROL 0x0128 -#define BBM_FFT_MODEM_STSL 0x0129 -#define BBM_FFT_MODEM_STSH 0x012A -#define BBM_FFT_PAD_DRIVING_SEL 0x012B - -/* TII */ -#define BBM_TII_IF_EN 0x0130 -#define BBM_TII_DATA 0x0131 -#define BBM_TII_DATA_LEN 0x0132 - -/* DIDP */ -#define BBM_DIDP_CH_EN 0x0150 -#define BBM_DIDP_MODE 0x0151 -#define BBM_DIDP_CH0_SUBCH 0x0152 -#define BBM_DIDP_CH1_SUBCH 0x0153 -#define BBM_DIDP_CH2_SUBCH 0x0154 -#define BBM_DIDP_CH3_SUBCH 0x0155 -#define BBM_DIDP_CH4_SUBCH 0x0156 -#define BBM_DIDP_CH5_SUBCH 0x0157 -#define BBM_DIDP_CH6_SUBCH 0x0158 -#define BBM_DIDP_CH7_SUBCH 0x0159 -#define BBM_DIDP_POWER_OPT0 0x015a -#define BBM_DIDP_ADD_N_SHIFT0 0x015b -#define BBM_DIDP_POWER_OPT1 0x015c -#define BBM_DIDP_ADD_N_SHIFT1 0x015d -#define BBM_DIDP_POWER_OPT2 0x015e -#define BBM_DIDP_ADD_N_SHIFT2 0x015f - -/* VT */ -#define BBM_VT_BER_PERIOD 0x0210 -#define BBM_VT_ERROR_SUM 0x0214 -#define BBM_VT_RT_BER_PERIOD 0x0218 -#define BBM_VT_RT_ERROR_SUM 0x021c -#define BBM_VT_CONTROL 0x0220 - -/* FIC */ -#define BBM_FIC_CRC_CONTROL 0x0222 -#define BBM_FIC_ERR_SUM 0x0223 - -/* CDI */ -#define BBM_CDI0_SUBCH_EN 0x0224 -#define BBM_CDI1_SUBCH_EN 0x0225 -#define BBM_CDI0_COUNT 0x0226 -#define BBM_CDI1_COUNT 0x0227 -#define BBM_CDI0_ERROR 0x0228 -#define BBM_CDI1_ERROR 0x0229 -#define BBM_CDI_SYNC_PATTERN 0x022a -#define BBM_CDI_CONTROL 0x022b - -/* RS */ -#define BBM_RS_BER_PERIOD 0x022c -#define BBM_RS_FAIL_COUNT 0x022e -#define BBM_RS_ERR_SUM 0x0230 -#define BBM_RS_RT_BER_PER 0x0234 -#define BBM_RS_RT_FAIL_CNT 0x0236 -#define BBM_RS_RT_ERR_SUM 0x0238 -#define BBM_RS_CONTROL 0x023e - -/* BUF */ -#define BBM_BUF_STATUS 0x0250 -#define BBM_BUF_OVERRUN 0x0252 -#define BBM_BUF_ENABLE 0x0254 -#define BBM_BUF_INT 0x0256 -#define BBM_BUF_STS_CTRL 0x0258 -#define BBM_BUF_STS_CLK_DIV 0x0259 -#define BBM_BUF_STS_CHID 0x025a -#define BBM_BUF_CLOCK_EN 0x025b -#define BBM_BUF_MISC_CTRL 0x025c -#define BBM_BUF_TEST_MODE 0x025d -#define BBM_BUF_TEST_SIGNAL 0x025e -#define BBM_BUF_CH0_SUBCH 0x0260 -#define BBM_BUF_CH1_SUBCH 0x0261 -#define BBM_BUF_CH2_SUBCH 0x0262 -#define BBM_BUF_CH3_SUBCH 0x0263 -#define BBM_BUF_CH4_SUBCH 0x0264 -#define BBM_BUF_CH5_SUBCH 0x0265 -#define BBM_BUF_CH6_SUBCH 0x0266 -#define BBM_BUF_CH7_SUBCH 0x0267 -#define BBM_BUF_CH0_START 0x0268 -#define BBM_BUF_CH1_START 0x026a -#define BBM_BUF_CH2_START 0x026c -#define BBM_BUF_CH3_START 0x026e -#define BBM_BUF_CH4_START 0x0270 -#define BBM_BUF_CH5_START 0x0272 -#define BBM_BUF_CH6_START 0x0274 -#define BBM_BUF_CH7_START 0x0276 -#define BBM_BUF_FIC_START 0x0278 -#define BBM_BUF_CH0_END 0x0290 -#define BBM_BUF_CH1_END 0x0292 -#define BBM_BUF_CH2_END 0x0294 -#define BBM_BUF_CH3_END 0x0296 -#define BBM_BUF_CH4_END 0x0298 -#define BBM_BUF_CH5_END 0x029a -#define BBM_BUF_CH6_END 0x029c -#define BBM_BUF_CH7_END 0x029e -#define BBM_BUF_FIC_END 0x02a0 -#define BBM_BUF_CH0_THR 0x02a2 -#define BBM_BUF_CH1_THR 0x02a4 -#define BBM_BUF_CH2_THR 0x02a6 -#define BBM_BUF_CH3_THR 0x02a8 -#define BBM_BUF_CH4_THR 0x02aa -#define BBM_BUF_CH5_THR 0x02ac -#define BBM_BUF_CH6_THR 0x02ae -#define BBM_BUF_CH7_THR 0x02b0 -#define BBM_BUF_FIC_THR 0x02b2 - -/* I2C */ -#define BBM_I2C_PR 0x0310 -#define BBM_I2C_CTR 0x0312 -#define BBM_I2C_RXR 0x0313 -#define BBM_I2C_SR 0x0314 -#define BBM_I2C_TXR 0x0315 -#define BBM_I2C_CR 0x0316 - -#define BBM_TS_PAUSE 0x0378 -#define BBM_TS_SELECT 0x037A - -/* SCI (PL131) */ -/* 0x000 SCIDATA ,SCI Data register */ -#define BBM_SCI_DATA 0x0390 -/* 0x004 SCICR0 ,SCI Control register 0 */ -#define BBM_SCI_CR0 0x0392 -/* 0x008 SCICR1 ,SCI Control register 1 */ -#define BBM_SCI_CR1 0x0394 -/* 0x00C SCICR2 ,SCI Control register 2 */ -#define BBM_SCI_CR2 0x0396 -/* 0x010 SCICLKICC ,SCI Smart card clock frequency */ -#define BBM_SCI_CLKICC 0x0398 -/* 0x014 SCIVALUE ,SCI Baud cycles time register */ -#define BBM_SCI_VALUE 0x039a -/* 0x018 SCIBAUD ,SCI Baud rate clock time */ -#define BBM_SCI_BAUD 0x039c -/* 0x01C SCITIDE ,SCI Tx and Rx Tide mark */ -#define BBM_SCI_TIDE 0x039e -/* 0x020 SCIDMACR ,SCI Direct Memory Access control register */ -#define BBM_SCI_DMACR 0x03a0 -/* 0x024 SCISTABLE ,SCI Debounce time register */ -#define BBM_SCI_STABLE 0x03a2 -/* 0x028 SCIATIME ,SCI card activation event time register */ -#define BBM_SCI_ATIME 0x03a4 -/* 0x02C SCIDTIME ,SCI card deactivation event time register */ -#define BBM_SCI_DTIME 0x03a6 -/* 0x030 SCIATRSTIME ,SCI ATR start time register */ -#define BBM_SCI_ATRSTIME 0x03a8 -/* 0x034 SCIATRDTIME ,SCI ATR duration time register */ -#define BBM_SCI_ATRDTIME 0x03aa -/* 0x038 SCISTOPTIME ,SCI Duration before Card Clk can be stopped */ -#define BBM_SCI_STOPTIME 0x03ac -/* 0x03C SCISTARTTIME ,SCI Duration before Card Clk can be re-started */ -#define BBM_SCI_STARTTIME 0x03ae -/* 0x040 SCIRETRY ,SCI Tx and Rx Retry register */ -#define BBM_SCI_RETRY 0x03b0 -/* 0x044 SCICHTIMELS ,SCI Char to char timeout timeout least sig. */ -#define BBM_SCI_CHTIMELS 0x03b2 -/* 0x048 SCICHTIMEMS ,SCI Char to char timeout timeout most sig. */ -#define BBM_SCI_CHTIMEMS 0x03b4 -/* 0x04C SCIBLKTIMELS ,SCI Receive timeout between blocks least sig. */ -#define BBM_SCI_BLKTIMELS 0x03b6 -/* 0x050 SCIBLKTIMEMS ,SCI Receive timeout between blocks most sig. */ -#define BBM_SCI_BLKTIMEMS 0x03b8 -/* 0x054 SCICHGUARD ,SCI Character guard time register */ -#define BBM_SCI_CHGUARD 0x03ba -/* 0x058 SCIBLKGUARD ,SCI Block guard time register */ -#define BBM_SCI_BLKGUARD 0x03bc -/* 0x05C SCIRXTIME ,SCI RX read timeout register */ -#define BBM_SCI_RXTIME 0x03be -/* 0x060 SCIFIFOSTATUS ,SCI TX and RX FIFO Status */ -#define BBM_SCI_FIFOSTATUS 0x03d0 -/* 0X064 SCITXCOUNT ,SCI TX FIFO fill level */ -#define BBM_SCI_TXCOUNT 0x03d2 -/* 0x068 SCIRXCOUNT ,SCI RX FIFO fill level */ -#define BBM_SCI_RXCOUNT 0x03d4 -/* 0x06C SCIIMSC ,SCI Interrupt mask set or clear register */ -#define BBM_SCI_IMSC 0x03d6 -/* 0x070 SCIRIS ,SCI Raw interrupt status register */ -#define BBM_SCI_RIS 0x03d8 -/* 0x074 SCIMIS ,SCI Masked interrupt status register */ -#define BBM_SCI_MIS 0x03da -/* 0x078 SCIICR ,SCI Interrupt clear register */ -#define BBM_SCI_ICR 0x03dc -/* 0x07C SCISYNCACT ,SCI Synchronous mode Activation register */ -#define BBM_SCI_SYNCACT 0x03de -/* 0x080 SCISYNCTX ,SCI Synchronous mode transmit register */ -#define BBM_SCI_SYNCTX 0x03e0 -/* 0x084 SCISYNCRX ,SCI Synchronous mode receive register */ -#define BBM_SCI_SYNCRX 0x03e2 - -/* ---------------------------------------------------- -// BUFFER MANAGEMENT -//---------------------------------------------------- */ -#define FIC_BUF_START 0x0000 -#define FIC_BUF_LENGTH (32*24) -#define FIC_BUF_END (FIC_BUF_START + FIC_BUF_LENGTH - 1) -#define FIC_BUF_THR (FIC_BUF_LENGTH/2-1) - -#define CH0_BUF_START (FIC_BUF_START + FIC_BUF_LENGTH) -#define CH0_BUF_LENGTH (188*40*2) -#define CH0_BUF_END (CH0_BUF_START + CH0_BUF_LENGTH - 1) -#define CH0_BUF_THR (CH0_BUF_LENGTH/2-1) - -#define CH1_BUF_START (FIC_BUF_START + FIC_BUF_LENGTH) -#define CH1_BUF_LENGTH (0) -#define CH1_BUF_END (CH1_BUF_START + CH1_BUF_LENGTH - 1) -#define CH1_BUF_THR (0) - -#define CH2_BUF_START (FIC_BUF_START + FIC_BUF_LENGTH) -#define CH2_BUF_LENGTH (128*6) -#define CH2_BUF_END (CH2_BUF_START + CH2_BUF_LENGTH - 1) -#define CH2_BUF_THR (CH2_BUF_LENGTH/2-1) - -#define CH3_BUF_START (FIC_BUF_START + FIC_BUF_LENGTH) -#define CH3_BUF_LENGTH (188*20*2) -#define CH3_BUF_END (CH3_BUF_START + CH3_BUF_LENGTH - 1) -#define CH3_BUF_THR (CH3_BUF_LENGTH/2-1) - -#ifdef __cplusplus -} -#endif - -#endif /* __FC8050_REGS_H__ */ diff --git a/drivers/media/tdmb/fc8050/fc8050_spi.c b/drivers/media/tdmb/fc8050/fc8050_spi.c deleted file mode 100644 index 23db2d5..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_spi.c +++ /dev/null @@ -1,324 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_spi.c - - Description : fc8050 host interface - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - History : - ---------------------------------------------------------------------- - 2009/08/29 jason initial -*******************************************************************************/ -#include <linux/input.h> -#include <linux/spi/spi.h> - -#include "fci_types.h" -#include "fc8050_regs.h" -#include "fci_oal.h" -#include "fc8050_spi.h" - -#include "tdmb.h" - -#define DRIVER_NAME "fc8050_spi" - -#define HPIC_READ 0x01 /* read command */ -#define HPIC_WRITE 0x02 /* write command */ -#define HPIC_AINC 0x04 /* address increment */ -#define HPIC_BMODE 0x00 /* byte mode */ -#define HPIC_WMODE 0x10 /* word mode */ -#define HPIC_LMODE 0x20 /* long mode */ -#define HPIC_ENDIAN 0x00 /* little endian */ -#define HPIC_CLEAR 0x80 /* currently not used */ - -#define CHIPID 0 -#if (CHIPID == 0) -#define SPI_CMD_WRITE 0x0 -#define SPI_CMD_READ 0x1 -#define SPI_CMD_BURST_WRITE 0x2 -#define SPI_CMD_BURST_READ 0x3 -#else -#define SPI_CMD_WRITE 0x4 -#define SPI_CMD_READ 0x5 -#define SPI_CMD_BURST_WRITE 0x6 -#define SPI_CMD_BURST_READ 0x7 -#endif - -struct spi_device *fc8050_spi; - -static u8 tx_data[10]; - -static DEFINE_MUTEX(lock); - -int fc8050_spi_write_then_read( - struct spi_device *spi - , u8 *txbuf - , u16 tx_length - , u8 *rxbuf - , u16 rx_length) -{ - s32 res; - - struct spi_message message; - struct spi_transfer x; - - spi_message_init(&message); - memset(&x, 0, sizeof x); - - spi_message_add_tail(&x, &message); - - x.tx_buf = txbuf; - x.rx_buf = txbuf; - x.len = tx_length + rx_length; - - res = spi_sync(spi, &message); - - memcpy(rxbuf, x.rx_buf + tx_length, rx_length); - - return res; -} - -int fc8050_spi_write_then_burstread( - struct spi_device *spi - , u8 *txbuf - , u16 tx_length - , u8 *rxbuf - , u16 rx_length) -{ - s32 res; - - struct spi_message message; - struct spi_transfer x; - - spi_message_init(&message); - memset(&x, 0, sizeof x); - - spi_message_add_tail(&x, &message); - - x.tx_buf = txbuf; - x.rx_buf = rxbuf; - x.len = tx_length + rx_length; - - res = spi_sync(spi, &message); - - return res; -} - -static int spi_bulkread(HANDLE hDevice, u8 addr, u8 *data, u16 length) -{ - s32 ret; - - tx_data[0] = SPI_CMD_BURST_READ; - tx_data[1] = addr; - - fc8050_spi = tdmb_get_spi_handle(); - ret = fc8050_spi_write_then_read( - fc8050_spi, &tx_data[0], 2, &data[0], length); - - if (ret) { - print_log(0, "fc8050_spi_bulkread fail : %d\n", ret); - return BBM_NOK; - } - - return BBM_OK; -} - -static int spi_bulkwrite(HANDLE hDevice, u8 addr, u8 *data, u16 length) -{ - s32 ret; - s32 i; - - tx_data[0] = SPI_CMD_BURST_WRITE; - tx_data[1] = addr; - - for (i = 0; i < length; i++) - tx_data[2+i] = data[i]; - - fc8050_spi = tdmb_get_spi_handle(); - ret = fc8050_spi_write_then_read( - fc8050_spi, &tx_data[0], length+2, NULL, 0); - - if (ret) { - print_log(0, "fc8050_spi_bulkwrite fail : %d\n", ret); - return BBM_NOK; - } - - return BBM_OK; -} - -static int spi_dataread(HANDLE hDevice, u8 addr, u8 *data, u16 length) -{ - s32 ret = 0; - - tx_data[0] = SPI_CMD_BURST_READ; - tx_data[1] = addr; - - fc8050_spi = tdmb_get_spi_handle(); - - ret = fc8050_spi_write_then_burstread( - fc8050_spi, &tx_data[0], 2, &data[0], length); - - if (ret) { - print_log(0, "fc8050_spi_dataread fail : %d\n", ret); - return BBM_NOK; - } - - return BBM_OK; -} - -int fc8050_spi_init(HANDLE hDevice, u16 param1, u16 param2) -{ - - return BBM_OK; -} - -int fc8050_spi_byteread(HANDLE hDevice, u16 addr, u8 *data) -{ - int res; - u8 command = HPIC_READ | HPIC_BMODE | HPIC_ENDIAN; - - mutex_lock(&lock); - res = spi_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= spi_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= spi_bulkread(hDevice, BBM_DATA_REG, data, 1); - mutex_unlock(&lock); - - return res; -} - -int fc8050_spi_wordread(HANDLE hDevice, u16 addr, u16 *data) -{ - int res; - u8 command = HPIC_READ | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - - if (BBM_SCI_DATA <= addr && BBM_SCI_SYNCRX >= addr) - command = HPIC_READ | HPIC_WMODE | HPIC_ENDIAN; - - mutex_lock(&lock); - res = spi_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= spi_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= spi_bulkread(hDevice, BBM_DATA_REG, (u8 *)data, 2); - mutex_unlock(&lock); - - return res; -} - -int fc8050_spi_longread(HANDLE hDevice, u16 addr, u32 *data) -{ - int res; - u8 command = HPIC_READ | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - - mutex_lock(&lock); - res = spi_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= spi_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= spi_bulkread(hDevice, BBM_DATA_REG, (u8 *)data, 4); - mutex_unlock(&lock); - - return res; -} - -int fc8050_spi_bulkread(HANDLE hDevice, u16 addr, u8 *data, u16 length) -{ - int res; - u8 command = HPIC_READ | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - - mutex_lock(&lock); - res = spi_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= spi_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= spi_bulkread(hDevice, BBM_DATA_REG, data, length); - mutex_unlock(&lock); - - return res; -} - -int fc8050_spi_bytewrite(HANDLE hDevice, u16 addr, u8 data) -{ - int res; - u8 command = HPIC_WRITE | HPIC_BMODE | HPIC_ENDIAN; - - mutex_lock(&lock); - res = spi_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= spi_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= spi_bulkwrite(hDevice, BBM_DATA_REG, (u8 *)&data, 1); - mutex_unlock(&lock); - - return res; -} - -int fc8050_spi_wordwrite(HANDLE hDevice, u16 addr, u16 data) -{ - int res; - u8 command = HPIC_WRITE | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - - if (BBM_SCI_DATA <= addr && BBM_SCI_SYNCRX >= addr) - command = HPIC_WRITE | HPIC_WMODE | HPIC_ENDIAN; - - mutex_lock(&lock); - res = spi_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= spi_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= spi_bulkwrite(hDevice, BBM_DATA_REG, (u8 *)&data, 2); - mutex_unlock(&lock); - - return res; -} - -int fc8050_spi_longwrite(HANDLE hDevice, u16 addr, u32 data) -{ - int res; - u8 command = HPIC_WRITE | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - - mutex_lock(&lock); - res = spi_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= spi_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= spi_bulkwrite(hDevice, BBM_DATA_REG, (u8 *)&data, 4); - mutex_unlock(&lock); - - return res; -} - -int fc8050_spi_bulkwrite(HANDLE hDevice, u16 addr, u8 *data, u16 length) -{ - int res; - u8 command = HPIC_WRITE | HPIC_AINC | HPIC_BMODE | HPIC_ENDIAN; - - mutex_lock(&lock); - res = spi_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= spi_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= spi_bulkwrite(hDevice, BBM_DATA_REG, data, length); - mutex_unlock(&lock); - - return res; -} - -int fc8050_spi_dataread(HANDLE hDevice, u16 addr, u8 *data, u16 length) -{ - int res; - u8 command = HPIC_READ | HPIC_BMODE | HPIC_ENDIAN; - - mutex_lock(&lock); - res = spi_bulkwrite(hDevice, BBM_COMMAND_REG, &command, 1); - res |= spi_bulkwrite(hDevice, BBM_ADDRESS_REG, (u8 *)&addr, 2); - res |= spi_dataread(hDevice, BBM_DATA_REG, data, length); - mutex_unlock(&lock); - - return res; -} - -int fc8050_spi_deinit(HANDLE hDevice) -{ - print_log(NULL, "fc8050_spi_deinit\n"); - return BBM_OK; -} diff --git a/drivers/media/tdmb/fc8050/fc8050_spi.h b/drivers/media/tdmb/fc8050/fc8050_spi.h deleted file mode 100644 index c973701..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_spi.h +++ /dev/null @@ -1,51 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_spi.c - - Description : API of dmb baseband module - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/09/14 jason initial -*******************************************************************************/ - -#ifndef __FC8050_SPI__ -#define __FC8050_SPI__ - -#ifdef __cplusplus -extern "C" { -#endif - -extern int fc8050_spi_init(HANDLE hDevice, u16 param1, u16 param2); -extern int fc8050_spi_byteread(HANDLE hDevice, u16 addr, u8 *data); -extern int fc8050_spi_wordread(HANDLE hDevice, u16 addr, u16 *data); -extern int fc8050_spi_longread(HANDLE hDevice, u16 addr, u32 *data); -extern int fc8050_spi_bulkread(HANDLE hDevice, u16 addr, u8 *data, u16 length); -extern int fc8050_spi_bytewrite(HANDLE hDevice, u16 addr, u8 data); -extern int fc8050_spi_wordwrite(HANDLE hDevice, u16 addr, u16 data); -extern int fc8050_spi_longwrite(HANDLE hDevice, u16 addr, u32 data); -extern int fc8050_spi_bulkwrite(HANDLE hDevice, u16 addr, u8 *data, u16 length); -extern int fc8050_spi_dataread(HANDLE hDevice, u16 addr, u8 *data, u16 length); -extern int fc8050_spi_deinit(HANDLE hDevice); - -#ifdef __cplusplus -} -#endif - -#endif /* __FC8050_SPI__ */ diff --git a/drivers/media/tdmb/fc8050/fc8050_tun.c b/drivers/media/tdmb/fc8050/fc8050_tun.c deleted file mode 100644 index 7b73f77..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_tun.c +++ /dev/null @@ -1,255 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_tun.c - - Description : fc8050 host interface - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/09/14 jason initial - 2009/11/26 MPW Config1p0 - 2010/02/24 SLR Config1p0 - 2010/05/04 SLR Config1p2 -*******************************************************************************/ - -#include "fci_types.h" -#include "fci_oal.h" -#include "fci_tun.h" -#include "fci_hal.h" -#include "fc8050_regs.h" - -#define FEATURE_TUNER_BURST_MODE - -static int fc8050_write(HANDLE hDevice, u8 addr, u8 data) -{ - int res; - u8 tmp; - - tmp = data; - res = tuner_i2c_write(hDevice, addr, 1, &tmp, 1); - - return res; -} - -static int fc8050_read(HANDLE hDevice, u8 addr, u8 *data) -{ - int res; - - res = tuner_i2c_read(hDevice, addr, 1, data, 1); - - return res; -} - -static int fc8050_set_filter(HANDLE hDevice) -{ - int i; - u8 cal_mon = 0; - -#if (FC8050_FREQ_XTAL == 19200) - fc8050_write(hDevice, 0x02, 0x86); - - fc8050_write(hDevice, 0x3B, 0x52); - fc8050_write(hDevice, 0x32, 0x09); -#elif (FC8050_FREQ_XTAL == 16384) - fc8050_write(hDevice, 0x02, 0x86); - - fc8050_write(hDevice, 0x3B, 0x45); - fc8050_write(hDevice, 0x32, 0x09); -#elif (FC8050_FREQ_XTAL == 24576) - fc8050_write(hDevice, 0x02, 0x86); - - fc8050_write(hDevice, 0x3B, 0x68); - fc8050_write(hDevice, 0x32, 0x09); -#elif (FC8050_FREQ_XTAL == 27000) - fc8050_write(hDevice, 0x02, 0x86); - - fc8050_write(hDevice, 0x3B, 0x71); - fc8050_write(hDevice, 0x32, 0x09); -#elif (FC8050_FREQ_XTAL == 27120) - fc8050_write(hDevice, 0x02, 0x86); - - fc8050_write(hDevice, 0x3B, 0x74); - fc8050_write(hDevice, 0x32, 0x09); -#elif (FC8050_FREQ_XTAL == 38400) - fc8050_write(hDevice, 0x02, 0x86); - - fc8050_write(hDevice, 0x3B, 0xA1); - fc8050_write(hDevice, 0x32, 0x09); -#else - return BBM_NOK; -#endif - - for (i = 0; i < 10; i++) { - ms_wait(5); - fc8050_read(hDevice, 0x33, &cal_mon); - if ((cal_mon & 0xC0) == 0xC0) - break; - fc8050_write(hDevice, 0x32, 0x01); - fc8050_write(hDevice, 0x32, 0x09); - } - - fc8050_write(hDevice, 0x32, 0x01); - - return BBM_OK; -} - -static int fc8050_lband_init(HANDLE hDevice) -{ - print_log(hDevice, "fc8050_lband_init\n"); - return BBM_NOK; -} - -static int fc8050_band3_init(HANDLE hDevice) -{ - print_log(hDevice, "fc8050_band3_init\n"); - - fc8050_write(hDevice, 0x00, 0x00); - - fc8050_write(hDevice, 0x00, 0x00); - fc8050_write(hDevice, 0x02, 0x86); - - fc8050_write(hDevice, 0x05, 0xD8); - fc8050_write(hDevice, 0x0A, 0x83); - fc8050_write(hDevice, 0x16, 0x0d); - fc8050_write(hDevice, 0x13, 0x88); - fc8050_write(hDevice, 0x15, 0x00); - fc8050_write(hDevice, 0x21, 0x73); - - fc8050_write(hDevice, 0x57, 0x40); - fc8050_write(hDevice, 0x69, 0x8C); - fc8050_write(hDevice, 0x51, 0x04); - fc8050_write(hDevice, 0x53, 0x00); - fc8050_write(hDevice, 0x54, 0x28); - fc8050_write(hDevice, 0x45, 0x40); - fc8050_write(hDevice, 0x46, 0x32); - fc8050_write(hDevice, 0x48, 0x40); - fc8050_write(hDevice, 0x49, 0x32); - fc8050_write(hDevice, 0x7A, 0x88); - fc8050_write(hDevice, 0x53, 0x01); - fc8050_write(hDevice, 0x58, 0x34); - fc8050_write(hDevice, 0x59, 0x2A); - fc8050_write(hDevice, 0x5A, 0x1D); - fc8050_write(hDevice, 0x5B, 0x14); - fc8050_write(hDevice, 0x61, 0x64); - fc8050_write(hDevice, 0x74, 0x3A); - fc8050_write(hDevice, 0x75, 0x1E); - fc8050_write(hDevice, 0x6A, 0x0C); - fc8050_write(hDevice, 0x6C, 0x0C); - fc8050_write(hDevice, 0x6E, 0x0C); - fc8050_write(hDevice, 0x70, 0x0C); - fc8050_write(hDevice, 0x72, 0x0C); - fc8050_write(hDevice, 0x7C, 0x0C); - fc8050_write(hDevice, 0x4E, 0x26); - fc8050_write(hDevice, 0x31, 0x13); - fc8050_write(hDevice, 0x34, 0x53); - fc8050_write(hDevice, 0x43, 0x20); - fc8050_write(hDevice, 0x2e, 0x70); - - fc8050_set_filter(hDevice); - return BBM_OK; -} - -int fc8050_tuner_init(HANDLE hDevice, u32 band) -{ - int res = BBM_NOK; - - bbm_write(hDevice, BBM_QDD_COMMAN, 0x5C); - bbm_write(hDevice, BBM_QDD_AGC_STEP, 0x03); - bbm_write(hDevice, BBM_QDD_TUN_COMMA, 0x40); - bbm_write(hDevice, BBM_QDD_TUN_GAIN, 0x24); - bbm_write(hDevice, BBM_QDD_AGC_PERIOD, 0x14); - bbm_write(hDevice, BBM_QDD_TRAGET_RMS, 0x60); - bbm_write(hDevice, BBM_QDD_TUN_GAIN_LOC, 0x44); - bbm_write(hDevice, BBM_QDD_GAIN_MAX, 0x38); - - if (band == LBAND_TYPE) - res = fc8050_lband_init(hDevice); - else if (band == BAND3_TYPE) - res = fc8050_band3_init(hDevice); - else - return BBM_NOK; - - if (res != BBM_OK) - return res; - - return res; -} - -int fc8050_set_freq(HANDLE hDevice, u32 band, u32 f_lo) -{ - u32 f_diff, f_diff_shifted, n_val, k_val; - u32 f_vco = f_lo * 12; - u32 r_val = (f_vco >= 25 * FC8050_FREQ_XTAL) ? 1 : 2; - u32 f_comp = FC8050_FREQ_XTAL/r_val; - u8 pre_shift_bits = 4; - u8 data_0x0E; - - fc8050_write(hDevice, 0x0a, 0x85); - fc8050_write(hDevice, 0x16, 0x0d); - - n_val = f_vco / f_comp; - - f_diff = f_vco - f_comp * n_val; - f_diff_shifted = f_diff << (20 - pre_shift_bits); - k_val = f_diff_shifted / ((f_comp) >> pre_shift_bits); - - k_val = (f_diff_shifted + (f_comp >> (pre_shift_bits+1))) - / (f_comp >> pre_shift_bits); - - data_0x0E = ((r_val == 1) ? 0x40 : 0x50) + (unsigned char)(k_val >> 16); - fc8050_write(hDevice, 0x0E, data_0x0E); - fc8050_write(hDevice, 0x0F, (unsigned char)(k_val >> 8)); - fc8050_write(hDevice, 0x10, (unsigned char)(k_val)); - fc8050_write(hDevice, 0x11, (unsigned char)(n_val)); - - fc8050_write(hDevice, 0x0a, 0x83); - - return BBM_OK; -} - -int fc8050_get_rssi(HANDLE hDevice, int *rssi) -{ - int res = BBM_OK; - u8 LNA, RFVGA, PREAMP_PGA, CSF = 0x00; - int K = -66; -#ifdef FEATURE_TUNER_BURST_MODE - u32 burst_data; - - res = tuner_i2c_read(hDevice, 0x76, 1, (unsigned char *)&burst_data, 4); - - LNA = burst_data&0x000000ff; - RFVGA = (burst_data&0x0000ff00)>>8; - CSF = (burst_data&0x00ff0000)>>16; - PREAMP_PGA = (burst_data&0xff000000)>>24; -#else - res = fc8050_read(hDevice, 0x76, &LNA); - res |= fc8050_read(hDevice, 0x77, &RFVGA); - res |= fc8050_read(hDevice, 0x78, &CSF); - res |= fc8050_read(hDevice, 0x79, &PREAMP_PGA); -#endif - - if (res != BBM_OK) - return res; - - *rssi = (((LNA & 0x07) * 5) + (RFVGA * 7 / 10) - + ((PREAMP_PGA >> 7) * 6) + ((CSF & 0x7) * 6) - - ((PREAMP_PGA & 0x7F) >> 1) + K); - - return BBM_OK; -} diff --git a/drivers/media/tdmb/fc8050/fc8050_tun.h b/drivers/media/tdmb/fc8050/fc8050_tun.h deleted file mode 100644 index 17c547c..0000000 --- a/drivers/media/tdmb/fc8050/fc8050_tun.h +++ /dev/null @@ -1,43 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8050_tun.c - - Description : API of dmb baseband module - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/09/11 jason initial -*******************************************************************************/ - -#ifndef __FC8050_TUNER__ -#define __FC8050_TUNER__ - -#ifdef __cplusplus -extern "C" { -#endif - -extern int fc8050_tuner_init(HANDLE hDevice, enum band_type band); -extern int fc8050_set_freq(HANDLE hDevice, enum band_type band, u32 f_lo); -extern int fc8050_get_rssi(HANDLE hDevice, int *rssi); - -#ifdef __cplusplus -} -#endif - -#endif /* __FC8050_TUNER__ */ diff --git a/drivers/media/tdmb/fc8050/fci_hal.c b/drivers/media/tdmb/fc8050/fci_hal.c deleted file mode 100644 index 508c4c3..0000000 --- a/drivers/media/tdmb/fc8050/fci_hal.c +++ /dev/null @@ -1,231 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fci_hal.c - - Description : fc8050 host interface - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/08/29 jason initial -*******************************************************************************/ - -#include "fci_types.h" -#include "bbm.h" -#include "fci_hal.h" -/* #include "fc8050_hpi.h" */ -#include "fc8050_spi.h" -/* #include "fc8050_ppi.h" */ -#include "fc8050_i2c.h" - -#define FEATURE_INTERFACE_DEBUG -struct interface_port { - int (*init)(HANDLE hDevice, u16 param1, u16 param2); - - int (*byteread)(HANDLE hDevice, u16 addr, u8 *data); - int (*wordread)(HANDLE hDevice, u16 addr, u16 *data); - int (*longread)(HANDLE hDevice, u16 addr, u32 *data); - int (*bulkread)(HANDLE hDevice, u16 addr, u8 *data, u16 size); - - int (*bytewrite)(HANDLE hDevice, u16 addr, u8 data); - int (*wordwrite)(HANDLE hDevice, u16 addr, u16 data); - int (*longwrite)(HANDLE hDevice, u16 addr, u32 data); - int (*bulkwrite)(HANDLE hDevice, u16 addr, u8 *data, u16 size); - - int (*dataread)(HANDLE hDevice, u16 addr, u8 *data, u16 size); - - int (*deinit)(HANDLE hDevice); -} ; - -static struct interface_port ifport; -static u8 hostif_type = BBM_SPI; - -int bbm_hostif_get(HANDLE hDevice, u8 *hostif) -{ - *hostif = hostif_type; - - return BBM_OK; -} - -int bbm_hostif_select(HANDLE hDevice, u8 hostif) -{ - hostif_type = hostif; - - switch (hostif) { - case BBM_SPI: - ifport.init = fc8050_spi_init; - ifport.byteread = fc8050_spi_byteread; - ifport.wordread = fc8050_spi_wordread; - ifport.longread = fc8050_spi_longread; - ifport.bulkread = fc8050_spi_bulkread; - - ifport.bytewrite = fc8050_spi_bytewrite; - ifport.wordwrite = fc8050_spi_wordwrite; - ifport.longwrite = fc8050_spi_longwrite; - ifport.bulkwrite = fc8050_spi_bulkwrite; - - ifport.dataread = fc8050_spi_dataread; - - ifport.deinit = fc8050_spi_deinit; - break; -#ifndef FEATURE_INTERFACE_DEBUG - case BBM_HPI: - ifport.init = fc8050_hpi_init; - ifport.byteread = fc8050_hpi_byteread; - ifport.wordread = fc8050_hpi_wordread; - ifport.longread = fc8050_hpi_longread; - ifport.bulkread = fc8050_hpi_bulkread; - - ifport.bytewrite = fc8050_hpi_bytewrite; - ifport.wordwrite = fc8050_hpi_wordwrite; - ifport.longwrite = fc8050_hpi_longwrite; - ifport.bulkwrite = fc8050_hpi_bulkwrite; - - ifport.dataread = fc8050_hpi_dataread; - - ifport.deinit = fc8050_hpi_deinit; - break; - case BBM_I2C: - ifport.init = fc8050_i2c_init; - ifport.byteread = fc8050_i2c_byteread; - ifport.wordread = fc8050_i2c_wordread; - ifport.longread = fc8050_i2c_longread; - ifport.bulkread = fc8050_i2c_bulkread; - - ifport.bytewrite = fc8050_i2c_bytewrite; - ifport.wordwrite = fc8050_i2c_wordwrite; - ifport.longwrite = fc8050_i2c_longwrite; - ifport.bulkwrite = fc8050_i2c_bulkwrite; - - ifport.dataread = fc8050_i2c_dataread; - - ifport.deinit = fc8050_i2c_deinit; - break; - case BBM_PPI: - ifport.init = fc8050_ppi_init; - ifport.byteread = fc8050_ppi_byteread; - ifport.wordread = fc8050_ppi_wordread; - ifport.longread = fc8050_ppi_longread; - ifport.bulkread = fc8050_ppi_bulkread; - - ifport.bytewrite = fc8050_ppi_bytewrite; - ifport.wordwrite = fc8050_ppi_wordwrite; - ifport.longwrite = fc8050_ppi_longwrite; - ifport.bulkwrite = fc8050_ppi_bulkwrite; - - ifport.dataread = fc8050_ppi_dataread; - - ifport.deinit = fc8050_ppi_deinit; - break; -#endif - default: - return BBM_E_HOSTIF_SELECT; - } - - if (ifport.init(hDevice, 0, 0)) - return BBM_E_HOSTIF_INIT; - - return BBM_OK; -} - -int bbm_hostif_deselect(HANDLE hDevice) -{ - if (ifport.deinit(hDevice)) - return BBM_NOK; - - hostif_type = BBM_HPI; - - return BBM_OK; -} - -int bbm_read(HANDLE hDevice, u16 addr, u8 *data) -{ - if (ifport.byteread(hDevice, addr, data)) - return BBM_E_BB_REG_READ; - return BBM_OK; -} - -int bbm_byte_read(HANDLE hDevice, u16 addr, u8 *data) -{ - if (ifport.byteread(hDevice, addr, data)) - return BBM_E_BB_REG_READ; - return BBM_OK; -} - -int bbm_word_read(HANDLE hDevice, u16 addr, u16 *data) -{ - if (ifport.wordread(hDevice, addr, data)) - return BBM_E_BB_REG_READ; - return BBM_OK; -} - -int bbm_long_read(HANDLE hDevice, u16 addr, u32 *data) -{ - if (ifport.longread(hDevice, addr, data)) - return BBM_E_BB_REG_READ; - return BBM_OK; -} - -int bbm_bulk_read(HANDLE hDevice, u16 addr, u8 *data, u16 length) -{ - if (ifport.bulkread(hDevice, addr, data, length)) - return BBM_E_BB_REG_READ; - return BBM_OK; -} - -int bbm_write(HANDLE hDevice, u16 addr, u8 data) -{ - if (ifport.bytewrite(hDevice, addr, data)) - return BBM_E_BB_REG_WRITE; - return BBM_OK; -} - -int bbm_byte_write(HANDLE hDevice, u16 addr, u8 data) -{ - if (ifport.bytewrite(hDevice, addr, data)) - return BBM_E_BB_REG_WRITE; - return BBM_OK; -} - -int bbm_word_write(HANDLE hDevice, u16 addr, u16 data) -{ - if (ifport.wordwrite(hDevice, addr, data)) - return BBM_E_BB_REG_WRITE; - return BBM_OK; -} - -int bbm_long_write(HANDLE hDevice, u16 addr, u32 data) -{ - if (ifport.longwrite(hDevice, addr, data)) - return BBM_E_BB_REG_WRITE; - return BBM_OK; -} - -int bbm_bulk_write(HANDLE hDevice, u16 addr, u8 *data, u16 length) -{ - if (ifport.bulkwrite(hDevice, addr, data, length)) - return BBM_E_BB_REG_WRITE; - return BBM_OK; -} - -int bbm_data(HANDLE hDevice, u16 addr, u8 *data, u16 length) -{ - if (ifport.dataread(hDevice, addr, data, length)) - return BBM_E_BB_REG_WRITE; - return BBM_OK; -} diff --git a/drivers/media/tdmb/fc8050/fci_hal.h b/drivers/media/tdmb/fc8050/fci_hal.h deleted file mode 100644 index 68cfb8f..0000000 --- a/drivers/media/tdmb/fc8050/fci_hal.h +++ /dev/null @@ -1,57 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fc8000_hal.h - - Description : fc8000 host interface header - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/08/29 jason initial -*******************************************************************************/ - -#ifndef __FCI_HAL_H__ -#define __FCI_HAL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -extern int bbm_hostif_select(HANDLE hDevice, u8 hostif); -extern int bbm_hostif_deselect(HANDLE hDevice); -extern int bbm_hostif_get(HANDLE hDevice, u8 *hostif); - -extern int bbm_read(HANDLE hDevice, u16 addr, u8 *data); -extern int bbm_byte_read(HANDLE hDevice, u16 addr, u8 *data); -extern int bbm_word_read(HANDLE hDevice, u16 addr, u16 *data); -extern int bbm_long_read(HANDLE hDevice, u16 addr, u32 *data); -extern int bbm_bulk_read(HANDLE hDevice, u16 addr, u8 *data, u16 length); - -extern int bbm_write(HANDLE hDevice, u16 addr, u8 data); -extern int bbm_byte_write(HANDLE hDevice, u16 addr, u8 data); -extern int bbm_word_write(HANDLE hDevice, u16 addr, u16 data); -extern int bbm_long_write(HANDLE hDevice, u16 addr, u32 data); -extern int bbm_bulk_write(HANDLE hDevice, u16 addr, u8 *data, u16 length); - -extern int bbm_data(HANDLE hDevice, u16 addr, u8 *data, u16 length); - -#ifdef __cplusplus -} -#endif - -#endif /* __FCI_HAL_H__ */ diff --git a/drivers/media/tdmb/fc8050/fci_i2c.c b/drivers/media/tdmb/fc8050/fci_i2c.c deleted file mode 100644 index 2cad84d..0000000 --- a/drivers/media/tdmb/fc8050/fci_i2c.c +++ /dev/null @@ -1,263 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fci_i2c.c - - Description : fci i2c driver - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/09/11 jason initial -*******************************************************************************/ - -#include <linux/input.h> - - -#include "fci_types.h" -#include "fci_oal.h" -#include "fc8050_regs.h" -#include "fci_hal.h" - -/* #define FEATURE_FCI_I2C_CHECK_STATUS */ - -#define I2CSTAT_TIP 0x02 /* Tip bit */ -#define I2CSTAT_NACK 0x80 /* Nack bit */ - -#define I2C_TIMEOUT 1 /* 1 second */ - -#define I2C_CR_STA 0x80 -#define I2C_CR_STO 0x40 -#define I2C_CR_RD 0x20 -#define I2C_CR_WR 0x10 -#define I2C_CR_NACK 0x08 -#define I2C_CR_IACK 0x01 - -#define I2C_WRITE 0 -#define I2C_READ 1 - -#define I2C_OK 0 -#define I2C_NOK 1 -#define I2C_NACK 2 -#define I2C_NOK_LA 3 /* Lost arbitration */ -#define I2C_NOK_TOUT 4 /* time out */ - -static int wait_for_xfer(HANDLE hDevice) -{ - int i; - int res = I2C_OK; - u8 status; - - i = I2C_TIMEOUT * 10000; - /* wait for transfer complete */ - do { - bbm_read(hDevice, BBM_I2C_SR, &status); - i--; - } while ((i > 0) && (status & I2CSTAT_TIP)); - - /* check time out or nack */ - if (status & I2CSTAT_TIP) - res = I2C_NOK_TOUT; - -#ifdef FEATURE_FCI_I2C_CHECK_STATUS - else { - bbm_read(hDevice, BBM_I2C_SR, &status); - if (status & I2CSTAT_NACK) - res = I2C_NACK; - else - res = I2C_OK; - } -#endif - return res; -} - -static int fci_i2c_transfer( - HANDLE hDevice, u8 cmd_type, u8 chip - , u8 addr[], u8 addr_len, u8 data[], u8 data_len) -{ - int i; - int result = I2C_OK; - - switch (cmd_type) { - case I2C_WRITE: - bbm_write(hDevice, BBM_I2C_TXR, chip | cmd_type); - bbm_write(hDevice, BBM_I2C_CR, I2C_CR_STA | I2C_CR_WR); -#ifdef FEATURE_FCI_I2C_CHECK_STATUS - result = wait_for_xfer(hDevice); - if (result != I2C_OK) - return result; -#endif - if (addr && addr_len) { - i = 0; - while ((i < addr_len) && (result == I2C_OK)) { - bbm_write(hDevice, BBM_I2C_TXR, addr[i]); - bbm_write(hDevice, BBM_I2C_CR, I2C_CR_WR); -#ifdef FEATURE_FCI_I2C_CHECK_STATUS - result = wait_for_xfer(hDevice); - if (result != I2C_OK) - return result; -#endif - i++; - } - } - - i = 0; - while ((i < data_len) && (result == I2C_OK)) { - bbm_write(hDevice, BBM_I2C_TXR, data[i]); - bbm_write(hDevice, BBM_I2C_CR, I2C_CR_WR); -#ifdef FEATURE_FCI_I2C_CHECK_STATUS - result = wait_for_xfer(hDevice); - if (result != I2C_OK) - return result; -#endif - i++; - } - - bbm_write(hDevice, BBM_I2C_CR, I2C_CR_STO); -#ifdef FEATURE_FCI_I2C_CHECK_STATUS - result = wait_for_xfer(hDevice); - if (result != I2C_OK) - return result; -#endif - break; - case I2C_READ: - if (addr && addr_len) { - bbm_write(hDevice, BBM_I2C_TXR, chip | I2C_WRITE); - bbm_write(hDevice, BBM_I2C_CR, I2C_CR_STA | I2C_CR_WR); -#ifdef FEATURE_FCI_I2C_CHECK_STATUS - result = wait_for_xfer(hDevice); - if (result != I2C_OK) - return result; -#endif - - i = 0; - while ((i < addr_len) && (result == I2C_OK)) { - bbm_write(hDevice, BBM_I2C_TXR, addr[i]); - bbm_write(hDevice, BBM_I2C_CR, I2C_CR_WR); -#ifdef FEATURE_FCI_I2C_CHECK_STATUS - result = wait_for_xfer(hDevice); - if (result != I2C_OK) - return result; -#endif - i++; - } - } - - bbm_write(hDevice, BBM_I2C_TXR, chip | I2C_READ); - bbm_write(hDevice, BBM_I2C_CR, I2C_CR_STA | I2C_CR_WR); -#ifdef FEATURE_FCI_I2C_CHECK_STATUS - result = wait_for_xfer(hDevice); - if (result != I2C_OK) - return result; -#endif - - i = 0; - while ((i < data_len) && (result == I2C_OK)) { - if (i == data_len - 1) { - bbm_write(hDevice, BBM_I2C_CR - , I2C_CR_RD|I2C_CR_NACK); - result = wait_for_xfer(hDevice); - if ((result != I2C_NACK) - && (result != I2C_OK)) { - print_log(hDevice, "NACK4-0[%02x]\n" - , result); - return result; - } - } else { - bbm_write(hDevice, BBM_I2C_CR, I2C_CR_RD); - result = wait_for_xfer(hDevice); - if (result != I2C_OK) { - print_log(hDevice, "NACK4-1[%02x]\n" - , result); - return result; - } - } - bbm_read(hDevice, BBM_I2C_RXR, &data[i]); - i++; - } - - bbm_write(hDevice, BBM_I2C_CR, I2C_CR_STO); -#ifdef FEATURE_FCI_I2C_CHECK_STATUS - result = wait_for_xfer(hDevice); - if ((result != I2C_NACK) && (result != I2C_OK)) { - print_log(hDevice, "NACK5[%02X]\n", result); - return result; - } -#endif - break; - default: - return I2C_NOK; - } - - return I2C_OK; -} - -int fci_i2c_init(HANDLE hDevice, int speed, int slaveaddr) -{ - u16 pr, rpr = 0; - - pr = (u16)((4800 / speed) - 1); - /* pr=400; */ - bbm_word_write(hDevice, BBM_I2C_PR, pr); - - bbm_word_read(hDevice, BBM_I2C_PR, &rpr); - if (pr != rpr) - return BBM_NOK; - - /* i2c master core enable & interrupt enable */ - bbm_write(hDevice, BBM_I2C_CTR, 0xC0); - - return BBM_OK; -} - -int fci_i2c_read( - HANDLE hDevice, u8 chip, u8 addr, u8 address_len, u8 *data, u8 len) -{ - int ret; - u8 tmp[4] = {0xcc, 0xcc, 0xcc, 0xcc}; - - ret = fci_i2c_transfer(hDevice, I2C_READ, chip << 1 - , &addr, address_len, &tmp[0], len); - if (ret != I2C_OK) { - print_log(hDevice - , "fci_i2c_read() result=%d, addr = %x, data=%x\n" - , ret, addr, *data); - return ret; - } - - /* *data = tmp[0]; */ - memcpy(data, tmp, len); - - return ret; -} - -int fci_i2c_write( - HANDLE hDevice, u8 chip, u8 addr, u8 address_len, u8 *data, u8 len) -{ - int ret; - u8 *paddr = &addr; - - ret = fci_i2c_transfer(hDevice, I2C_WRITE, chip << 1 - , paddr, address_len, data, len); - - if (ret != I2C_OK) - print_log(hDevice - , "fci_i2c_write() result=%d, addr= %x, data=%x\n" - , ret, addr, *data); - - return ret; -} diff --git a/drivers/media/tdmb/fc8050/fci_i2c.h b/drivers/media/tdmb/fc8050/fci_i2c.h deleted file mode 100644 index a519a49..0000000 --- a/drivers/media/tdmb/fc8050/fci_i2c.h +++ /dev/null @@ -1,47 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fci_i2c.h - - Description : fci i2c driver header - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/09/11 jason initial -*******************************************************************************/ - -#ifndef __FCI_I2C_H__ -#define __FCI_I2C_H__ - -#include "fci_types.h" - -#ifdef __cplusplus -extern "C" { -#endif - -extern int fci_i2c_init(HANDLE hDevice, int speed, int slaveaddr); -extern int fci_i2c_read( - HANDLE hDevice, u8 chip, u8 addr, u8 address_len, u8 *data, u8 len); -extern int fci_i2c_write( - HANDLE hDevice, u8 chip, u8 addr, u8 address_len, u8 *data, u8 len); - -#ifdef __cplusplus -} -#endif - -#endif /* __FCI_I2C_H__ */ diff --git a/drivers/media/tdmb/fc8050/fci_oal.c b/drivers/media/tdmb/fc8050/fci_oal.c deleted file mode 100644 index 51d7d9a..0000000 --- a/drivers/media/tdmb/fc8050/fci_oal.c +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fci_oal.c - - Description : OS Adaptation Layer - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/09/13 jason initial -*******************************************************************************/ -#include <linux/delay.h> - -#include "fci_types.h" - -void print_log(HANDLE hDevice, char *fmt, ...) -{ - -} - -void ms_wait(int ms) -{ - usleep_range(ms*1000, ms*1000); -} diff --git a/drivers/media/tdmb/fc8050/fci_oal.h b/drivers/media/tdmb/fc8050/fci_oal.h deleted file mode 100644 index f11f522..0000000 --- a/drivers/media/tdmb/fc8050/fci_oal.h +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fci_oal.h - - Description : OS Adatation Layer header - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/09/13 jason initial -*******************************************************************************/ - -#ifndef __FCI_OAL_H__ -#define __FCI_OAL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -extern void print_log(HANDLE hDevice, char *fmt, ...); -extern void ms_wait(int ms); - -#ifdef __cplusplus -} -#endif - -#endif /* __FCI_OAL_H__ */ diff --git a/drivers/media/tdmb/fc8050/fci_tun.c b/drivers/media/tdmb/fc8050/fci_tun.c deleted file mode 100644 index 461217f..0000000 --- a/drivers/media/tdmb/fc8050/fci_tun.c +++ /dev/null @@ -1,166 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : tuner.c - - Description : tuner driver - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/08/29 jason initial -*******************************************************************************/ - -#include "fci_types.h" -#include "fci_oal.h" -#include "fci_hal.h" -#include "fci_tun.h" -#include "fci_i2c.h" -#include "fc8050_regs.h" -#include "fc8050_bb.h" -#include "fc8050_tun.h" - -#define FC8000_TUNER_ADDR 0x56 -#define FC2501_TUNER_ADDR 0x60 -#define FC2507_TUNER_ADDR 0x60 -#define FC2580_TUNER_ADDR 0x56 -#define FC2582_TUNER_ADDR 0x56 -#define FC8050_TUNER_ADDR 0x5F - -static u8 tuner_addr = FC8050_TUNER_ADDR; -static enum band_type tuner_band = BAND3_TYPE; - -struct tuner_i2c_driver { - int (*init) - (HANDLE hDevice, int speed, int slaveaddr); - int (*read) - (HANDLE hDevice, u8 chip, u8 addr - , u8 address_len, u8 *data, u8 len); - int (*write) - (HANDLE hDevice, u8 chip, u8 addr - , u8 address_len, u8 *data, u8 len); -}; - -struct tuner_driver { - int (*init)(HANDLE hDevice, enum band_type band); - int (*set_freq) - (HANDLE hDevice, enum band_type band, u32 f_lo); - int (*get_rssi)(HANDLE hDevice, int *rssi); -}; - -static struct tuner_i2c_driver tuner_ctrl; -static struct tuner_driver tuner; - -int tuner_ctrl_select(HANDLE hDevice, enum i2c_type type) -{ - switch (type) { - case FCI_I2C_TYPE: - tuner_ctrl.init = fci_i2c_init; - tuner_ctrl.read = fci_i2c_read; - tuner_ctrl.write = fci_i2c_write; - break; - default: - return BBM_E_TN_CTRL_SELECT; - } - - if (tuner_ctrl.init(hDevice, 400, 0)) - return BBM_E_TN_CTRL_INIT; - return BBM_OK; -} - -int tuner_i2c_read(HANDLE hDevice, u8 addr, u8 address_len, u8 *data, u8 len) -{ - if (tuner_ctrl.read(hDevice, tuner_addr, addr, address_len, data, len)) - return BBM_E_TN_REG_READ; - return BBM_OK; -} - -int tuner_i2c_write(HANDLE hDevice, u8 addr, u8 address_len, u8 *data, u8 len) -{ - if (tuner_ctrl.write(hDevice, tuner_addr, addr, address_len, data, len)) - return BBM_E_TN_REG_WRITE; - return BBM_OK; -} - -int tuner_type(HANDLE hDevice, u32 *type) -{ - *type = tuner_band; - - return BBM_OK; -} - -int tuner_set_freq(HANDLE hDevice, u32 freq) -{ - int res = BBM_NOK; - u8 tmp; - - if (tuner.init == NULL) { - print_log(hDevice, "TUNER NULL ERROR\n"); - return BBM_NOK; - } - - res = tuner.set_freq(hDevice, tuner_band, freq); - if (res != BBM_OK) { - print_log(hDevice, "TUNER res ERROR\n"); - return BBM_NOK; - } - -#if (FC8050_FREQ_XTAL == 19200) || (FC8050_FREQ_XTAL == 27000) \ - || (FC8050_FREQ_XTAL == 27120) || (FC8050_FREQ_XTAL == 38400) - tmp = (u8)(33554432/freq); - bbm_write(hDevice, 0xf1, tmp); -#endif - - fc8050_reset(hDevice); - - return res; -} - -int tuner_select(HANDLE hDevice, u32 product, u32 band) -{ - switch (product) { - case FC8050_TUNER: - tuner_ctrl_select(hDevice, FCI_I2C_TYPE); - - tuner.init = fc8050_tuner_init; - tuner.set_freq = fc8050_set_freq; - tuner.get_rssi = fc8050_get_rssi; - - tuner_band = (enum band_type) band; - tuner_addr = FC8050_TUNER_ADDR; - break; - default: - return BBM_E_TN_SELECT; - } - - if (tuner.init == NULL) { - print_log(hDevice, "[ERROR] Can not supported Tuner(%d,%d)\n" - , product, band); - return BBM_E_TN_SELECT; - } - - if (tuner.init(hDevice, tuner_band)) - return BBM_E_TN_INIT; - return BBM_OK; -} - -int tuner_get_rssi(HANDLE hDevice, s32 *rssi) -{ - if (tuner.get_rssi(hDevice, rssi)) - return BBM_E_TN_RSSI; - return BBM_OK; -} diff --git a/drivers/media/tdmb/fc8050/fci_tun.h b/drivers/media/tdmb/fc8050/fci_tun.h deleted file mode 100644 index 259b95d..0000000 --- a/drivers/media/tdmb/fc8050/fci_tun.h +++ /dev/null @@ -1,65 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fci_tun.h - - Description : tuner control driver header - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/08/29 jason initial -*******************************************************************************/ - -#ifndef __FCI_TUN_H__ -#define __FCI_TUN_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "fci_types.h" - -enum i2c_type { - FCI_I2C_TYPE = 0 -}; - -enum band_type { - BAND3_TYPE = 0, - LBAND_TYPE -}; - -enum product_type { - FC8000_TUNER = 0, - FC8050_TUNER -}; - -extern int tuner_i2c_init(HANDLE hDevice, int speed, int slaveaddr); -extern int tuner_i2c_read( - HANDLE hDevice, u8 addr, u8 address_len, u8 *data, u8 len); -extern int tuner_i2c_write( - HANDLE hDevice, u8 addr, u8 address_len, u8 *data, u8 len); - -extern int tuner_select(HANDLE hDevice, u32 product, u32 band); -extern int tuner_set_freq(HANDLE hDevice, u32 freq); -extern int tuner_get_rssi(HANDLE hDevice, s32 *rssi); - -#ifdef __cplusplus -} -#endif - -#endif /* __FCI_TUN_H__ */ diff --git a/drivers/media/tdmb/fc8050/fci_types.h b/drivers/media/tdmb/fc8050/fci_types.h deleted file mode 100644 index 16f57f2..0000000 --- a/drivers/media/tdmb/fc8050/fci_types.h +++ /dev/null @@ -1,77 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : fci_types.h - - Description : - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- - 2009/08/31 jason initial -*******************************************************************************/ - -#ifndef __FCI_TYPES_H__ -#define __FCI_TYPES_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#ifndef HANDLE -#define HANDLE void * -#endif - -#define s8 char -#define s16 short int -#define s32 int -#define u8 unsigned char -#define u16 unsigned short -#define u32 unsigned int -#define TRUE 1 -#define FALSE 0 - -#ifndef NULL -#define NULL 0 -#endif - -#define BBM_OK 0 -#define BBM_NOK 1 - -#define BBM_E_FAIL 0x00000001 -#define BBM_E_HOSTIF_SELECT 0x00000002 -#define BBM_E_HOSTIF_INIT 0x00000003 -#define BBM_E_BB_REG_WRITE 0x00000100 -#define BBM_E_BB_REG_READ 0x00000101 -#define BBM_E_TN_REG_WRITE 0x00000200 -#define BBM_E_TN_REG_READ 0x00000201 -#define BBM_E_TN_CTRL_SELECT 0x00000202 -#define BBM_E_TN_CTRL_INIT 0x00000203 -#define BBM_E_TN_SELECT 0x00000204 -#define BBM_E_TN_INIT 0x00000205 -#define BBM_E_TN_RSSI 0x00000206 -#define BBM_E_TN_SET_FREQ 0x00000207 -#define BBM_E_MUX_SYNC 0x00010000 -#define BBM_E_MUX_DATA_MASK 0x00010001 -#define BBM_E_MUX_SUBCHANNEL 0x00010002 -#define BBM_E_MUX_INDICATOR 0x00010003 - -#ifdef __cplusplus -} -#endif - -#endif /* __FCI_TYPES_H__ */ diff --git a/drivers/media/tdmb/fc8050/fic.c b/drivers/media/tdmb/fc8050/fic.c deleted file mode 100644 index 5acb6d3..0000000 --- a/drivers/media/tdmb/fc8050/fic.c +++ /dev/null @@ -1,80 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : FIC.c - - Description : FIC Wrapper - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- -*******************************************************************************/ -#include "fic.h" - -int fic_decoder_put(struct fic *pfic, u16 length) -{ - return fic_decoder(pfic, length); -} - -struct esbinfo_t *fic_decoder_get_ensemble_info(u32 freq) -{ - return get_emsemble_info(); -} - -struct subch_info_t *fic_decoder_get_subchannel_info(u8 subchannel_id) -{ - return get_subchannel_info(subchannel_id); -} - -struct service_info_t *fic_decoder_get_service_info(u32 sid) -{ - return get_service_info(sid); -} - -struct scInfo_t *fic_decoder_get_sc_info(u16 scid) -{ - return get_sc_info(scid); -} - -struct service_info_t *fic_decoder_get_service_info_list(u8 service_index) -{ - return get_service_info_list(service_index); -} - -void fic_decoder_subchannel_org_prn(int subchannel_id) -{ - subchannel_org_prn(subchannel_id); -} - -int fic_decoder_subchannel_org_to_didp( - struct subch_info_t *sub_ch_info, struct didp_info_t *pdidp) -{ - return subchannel_org_to_didp(sub_ch_info, pdidp); -} - -int fic_decoder_found_all_labels(void) -{ - if (found_all_labels()) - return 1; - return 0; -} - -int fic_decoder_subchannel_info_clean(void) -{ - subchannel_org_clean(); - return 0; -} diff --git a/drivers/media/tdmb/fc8050/fic.h b/drivers/media/tdmb/fc8050/fic.h deleted file mode 100644 index f09fad9..0000000 --- a/drivers/media/tdmb/fc8050/fic.h +++ /dev/null @@ -1,42 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : FIC.h - - Description : FIC Wrapper - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - History : - ---------------------------------------------------------------------- -*******************************************************************************/ -#ifndef __FIC_H__ -#define __FIC_H__ - -#include "ficdecoder.h" - -int fic_decoder_put(struct fic *pfic, u16 length); -struct esbinfo_t *fic_decoder_get_ensemble_info(u32 freq); -struct subch_info_t *fic_decoder_get_subchannel_info(u8 subchannel_id); -struct service_info_t *fic_decoder_get_service_info(u32 sid); -struct scInfo_t *fic_decoder_get_sc_info(u16 scid); -struct service_info_t *fic_decoder_get_service_info_list(u8 service_index); -void fic_decoder_subchannel_org_prn(int subchannel_id); -int fic_decoder_found_all_labels(void); -int fic_decoder_subchannel_info_clean(void); -int fic_decoder_subchannel_org_to_didp - (struct subch_info_t *sub_ch_info, struct didp_info_t *pdidp); - -#endif /* __FIC_H__ */ diff --git a/drivers/media/tdmb/fc8050/ficdecoder.c b/drivers/media/tdmb/fc8050/ficdecoder.c deleted file mode 100644 index abfd991..0000000 --- a/drivers/media/tdmb/fc8050/ficdecoder.c +++ /dev/null @@ -1,1654 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : ficdecoder.c - - Description : fic parser - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - History : - ---------------------------------------------------------------------- -*******************************************************************************/ -#include <linux/string.h> -#include <linux/delay.h> - -#include "ficdecoder.h" -#include "fci_oal.h" - -#define MSB(X) (((X) >> 8) & 0Xff) -#define LSB(X) ((X) & 0Xff) -#define BYTESWAP(X) ((LSB(X)<<8) | MSB(X)) - -struct esbinfo_t ensemble_info[MAX_ESB_NUM]; -struct service_info_t service_info[MAX_SVC_NUM]; -struct scInfo_t sc_info[MAX_SC_NUM]; -struct subch_info_t subchannel_info[MAX_SUBCH_NUM]; -struct didp_info_t didpInfo[MAX_DIDP_NUM]; - -static int fig0_decoder(struct fig *pFig); -static int fig1_decoder(struct fig *pFig); - -static int fig0_ext1_decoder(u8 cn, u8 *fibBuffer, int figLength); -static int fig0_ext2_decoder(u8 *fibBuffer, int figLength, int pd); -static int fig0_ext3_decoder(u8 *fibBuffer, int figLength); -/* static int fig0_ext4_decoder(u8 *fibBuffer, int figLength); */ -static int fig0_ext10_decoder(u8 *fibBuffer, int figLength); -static int fig0_ext13_decoder(u8 *fibBuffer, int figLength, int pd); -static int fig0_ext14_decoder(u8 *fibBuffer, int figLength); -static int fig0_ext15_decoder(u8 *fibBuffer, int figLength, int pd); -static int fig0_ext18_decoder(u8 *fibBuffer, int figLength); -static int fig1_ext0_decoder(u8 *fibBuffer, int figLength); -static int fig1_ext5_decoder(u8 *fibBuffer, int figLength); -static int fig1_ext1_decoder(u8 *fibBuffer, int figLength); -static int fig1_ext4_decoder(u8 *fibBuffer, int figLength); - -const u16 bitrate_profile[64][3] = { /* CU PL Bit Rates */ - { 16, 5, 32}, { 21, 4, 32}, { 24, 3, 32}, - { 29, 2, 32}, { 35, 1, 32}, { 24, 5, 48}, - { 29, 4, 48}, { 35, 3, 48}, { 42, 2, 48}, - { 52, 1, 48}, { 29, 5, 56}, { 35, 4, 56}, - { 42, 3, 56}, { 52, 2, 56}, { 32, 5, 64}, - { 42, 4, 64}, { 48, 3, 64}, { 58, 2, 64}, - { 70, 1, 64}, { 40, 5, 80}, { 52, 4, 80}, - { 58, 3, 80}, { 70, 2, 80}, { 84, 1, 80}, - { 48, 5, 96}, { 58, 4, 96}, { 70, 3, 96}, - { 84, 2, 96}, {104, 1, 96}, { 58, 5, 112}, - { 70, 4, 112}, { 84, 3, 112}, {104, 2, 112}, - { 64, 5, 128}, { 84, 4, 128}, { 96, 3, 128}, - {116, 2, 128}, {140, 1, 128}, { 80, 5, 160}, - {104, 4, 160}, {116, 3, 160}, {140, 2, 160}, - {168, 1, 160}, { 96, 5, 192}, {116, 4, 192}, - {140, 3, 192}, {168, 2, 192}, {208, 1, 192}, - {116, 5, 224}, {140, 4, 224}, {168, 3, 224}, - {208, 2, 224}, {232, 1, 224}, {128, 5, 256}, - {168, 4, 256}, {192, 3, 256}, {232, 2, 256}, - {280, 1, 256}, {160, 5, 320}, {208, 4, 320}, - {280, 2, 320}, {192, 5, 384}, {280, 3, 384}, - {416, 1, 384} -}; - -const u16 uep_profile[14][5][9] = { /* L1 L2 L3 L4 PI1 PI2 PI3 PI4 pad */ - /* 32kbps */ - { - { 3, 5, 13, 3, 24, 17, 12, 17, 4}, - { 3, 4, 14, 3, 22, 13, 8, 13, 0}, - { 3, 4, 14, 3, 15, 9, 6, 8, 0}, - { 3, 3, 18, 0, 11, 6, 5, 0, 0}, - { 3, 4, 17, 0, 5, 3, 2, 0, 0} - }, - - /* 48kbps */ - { - { 3, 5, 25, 3, 24, 18, 13, 18, 0}, - { 3, 4, 26, 3, 24, 14, 8, 15, 0}, - { 3, 4, 26, 3, 15, 10, 6, 9, 4}, - { 3, 4, 26, 3, 9, 6, 4, 6, 0}, - { 4, 3, 26, 3, 5, 4, 2, 3, 0} - }, - - /* 56kbps */ - { - { 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* not use */ - { 6, 10, 23, 3, 23, 13, 8, 13, 8}, - { 6, 12, 21, 3, 16, 7, 6, 9, 0}, - { 6, 10, 23, 3, 9, 6, 4, 5, 0}, - { 6, 10, 23, 3, 5, 4, 2, 3, 0} - }, - - /* 64kbps */ - { - { 6, 11, 28, 3, 24, 18, 12, 18, 4}, - { 6, 10, 29, 3, 23, 13, 8, 13, 8}, - { 6, 12, 27, 3, 16, 8, 6, 9, 0}, - { 6, 9, 33, 0, 11, 6, 5, 0, 0}, - { 6, 9, 31, 2, 5, 3, 2, 3, 0} - }, - - /* 80kbps */ - { - { 6, 10, 41, 3, 24, 17, 12, 18, 4}, - { 6, 10, 41, 3, 23, 13, 8, 13, 8}, - { 6, 11, 40, 3, 16, 8, 6, 7, 0}, - { 6, 10, 41, 3, 11, 6, 5, 6, 0}, - { 6, 10, 41, 3, 6, 3, 2, 3, 0} - }, - - /* 96kbps */ - { - { 6, 13, 50, 3, 24, 18, 13, 19, 0}, - { 6, 10, 53, 3, 22, 12, 9, 12, 0}, - { 6, 12, 51, 3, 16, 9, 6, 10, 4}, - { 7, 10, 52, 3, 9, 6, 4, 6, 0}, - { 7, 9, 53, 3, 5, 4, 2, 4, 0} - }, - - /* 112kbps */ - { - { 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* not use */ - { 11, 21, 49, 3, 23, 12, 9, 14, 4}, - { 11, 23, 47, 3, 16, 8, 6, 9, 0}, - { 11, 21, 49, 3, 9, 6, 4, 8, 0}, - { 14, 17, 50, 3, 5, 4, 2, 5, 0} - }, - - /* 128kbps */ - { - { 11, 20, 62, 3, 24, 17, 13, 19, 8}, - { 11, 21, 61, 3, 22, 12, 9, 14, 0}, - { 11, 22, 60, 3, 16, 9, 6, 10, 4}, - { 11, 21, 61, 3, 11, 6, 5, 7, 0}, - { 12, 19, 62, 3, 5, 3, 2, 4, 0} - }, - - /* 160kbps */ - { - { 11, 22, 84, 3, 24, 18, 12, 19, 0}, - { 11, 21, 85, 3, 22, 11, 9, 13, 0}, - { 11, 24, 82, 3, 16, 8, 6, 11, 0}, - { 11, 23, 83, 3, 11, 6, 5, 9, 0}, - { 11, 19, 87, 3, 5, 4, 2, 4, 0} - }, - - /* 192kbps */ - { - { 11, 21, 109, 3, 24, 20, 13, 24, 0}, - { 11, 20, 110, 3, 22, 13, 9, 13, 8}, - { 11, 24, 106, 3, 16, 10, 6, 11, 0}, - { 11, 22, 108, 3, 10, 6, 4, 9, 0}, - { 11, 20, 110, 3, 6, 4, 2, 5, 0} - }, - - /* 224kbps */ - { - { 11, 24, 130, 3, 24, 20, 12, 20, 4}, - { 11, 22, 132, 3, 24, 16, 10, 15, 0}, - { 11, 20, 134, 3, 16, 10, 7, 9, 0}, - { 12, 26, 127, 3, 12, 8, 4, 11, 0}, - { 12, 22, 131, 3, 8, 6, 2, 6, 4} - }, - - /* 256kbps */ - { - { 11, 26, 152, 3, 24, 19, 14, 18, 4}, - { 11, 22, 156, 3, 24, 14, 10, 13, 8}, - { 11, 27, 151, 3, 16, 10, 7, 10, 0}, - { 11, 24, 154, 3, 12, 9, 5, 10, 4}, - { 11, 24, 154, 3, 6, 5, 2, 5, 0} - }, - - /* 320kbps */ - { - { 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* not use */ - { 11, 26, 200, 3, 24, 17, 9, 17, 0}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* not use */ - { 11, 25, 201, 3, 13, 9, 5, 10, 8}, - { 11, 26, 200, 3, 8, 5, 2, 6, 4} - }, - - /* 384kbps */ - { - { 12, 28, 245, 3, 24, 20, 14, 23, 8}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* not use */ - { 11, 24, 250, 3, 16, 9, 7, 10, 4}, - { 0, 0, 0, 0, 0, 0, 0, 0, 0}, /* not use */ - { 11, 27, 247, 3, 8, 6, 2, 7, 0} - } -}; - -int crc_good_cnt; -int crc_bad_cnt; -int fic_nice_cnt; - -int announcement; -int bbm_recfg_flag; - -struct esbinfo_t *get_emsemble_info(void) -{ - return &ensemble_info[0]; -} - -struct subch_info_t *get_subchannel_info(u8 subchannel_id) -{ - struct subch_info_t *sub_ch_info; - int i; - - for (i = 0; i < MAX_SUBCH_NUM; i++) { - sub_ch_info = &subchannel_info[i]; - if ((sub_ch_info->flag != 0) - && (sub_ch_info->subchannel_id == subchannel_id)) - break; - } - - if (i == MAX_SUBCH_NUM) { - for (i = 0; i < MAX_SUBCH_NUM; i++) { - sub_ch_info = &subchannel_info[i]; - if (sub_ch_info->flag == 0) - break; - } - if (i == MAX_SUBCH_NUM) - return NULL; - } - - return sub_ch_info; -} - -struct service_info_t *get_service_info_list(u8 service_index) -{ - return &service_info[service_index]; -} - -struct service_info_t *get_service_info(u32 sid) -{ - struct service_info_t *svc_info; - int i; - - for (i = 0; i < MAX_SVC_NUM; i++) { - svc_info = &service_info[i]; - if ((svc_info->flag != 0) && (sid == svc_info->sid)) - break; - } - - if (i == MAX_SVC_NUM) { - for (i = 0; i < MAX_SVC_NUM; i++) { - svc_info = &service_info[i]; - if (svc_info->flag == 0) { - svc_info->sid = sid; - break; - } - } - if (i == MAX_SVC_NUM) - return NULL; - } - - return svc_info; -} - -struct scInfo_t *get_sc_info(u16 scid) -{ - struct scInfo_t *pScInfo; - int i; - - for (i = 0; i < MAX_SC_NUM; i++) { - pScInfo = &sc_info[i]; - if ((pScInfo->flag == 99) && (pScInfo->scid == scid)) { - /* pScInfo->scid = 0xffff; */ - break; - } - } - if (i == MAX_SVC_NUM) { - for (i = 0; i < MAX_SVC_NUM; i++) { - pScInfo = &sc_info[i]; - if (pScInfo->flag == 0) - break; - } - if (i == MAX_SC_NUM) - return NULL; - } - - return pScInfo; -} - -static unsigned short crc16(unsigned char *fibBuffer, int len) -{ - int i, j, k; - unsigned int sta, din; - unsigned int crc_tmp = 0x0; - int crc_buf[16]; - int crc_coff[16] = { /* CRC16 CCITT REVERSED */ - 0, 0, 0, 0, /* 0x0 */ - 1, 0, 0, 0, /* 0x8 */ - 0, 0, 0, 1, /* 0x1 */ - 0, 0, 0, 1 /* 0x1 */ - }; - - for (j = 0; j < 16; j++) - crc_buf[j] = 0x1; - - for (i = 0; i < len; i++) { - sta = fibBuffer[i] & 0xff; - - for (k = 7; k >= 0; k--) { - din = ((sta >> k) & 0x1) ^ (crc_buf[15] & 0x1); - - for (j = 15; j > 0; j--) - crc_buf[j] = - (crc_buf[j-1] & 0x1) - ^ ((crc_coff[j-1] * din) & 0x1); - - crc_buf[0] = din; - } - } - - crc_tmp = 0; - for (j = 15; j >= 0; j--) - crc_tmp = (crc_tmp << 1) | (crc_buf[j] & 0x1); - - return ~crc_tmp & 0xffff; -} - -int fic_crc_ctrl = 1; /* fic crc check enable */ - -int fic_decoder(struct fic *pfic, u16 length) -{ - struct fib *pfib; - int result = 0; - int i; - u16 bufferCnt; - - bufferCnt = length; - - if (bufferCnt % 32) { - /* print_log(NULL - , "FIC BUFFER LENGTH ERROR %d\n", bufferCnt); */ - return 1; - } - - for (i = 0; i < bufferCnt/32; i++) { - pfib = &pfic->fib[i]; - if (fic_crc_ctrl) { - if (crc16(pfib->data, 30) == BYTESWAP(pfib->crc)) { - crc_good_cnt++; - result = fib_decoder(pfib); - } else { - crc_bad_cnt++; - /* print_log(NULL, "CRC ERROR: FIB %d\n", i); */ - } - } else { - result = fib_decoder(pfib); - crc_good_cnt++; - } - } - - return result; -} - -int fib_decoder(struct fib *pfib) -{ - struct fig *pFig; - int type, length; - int fib_ptr = 0; - int result = 0; - - while (fib_ptr < 30) { - pFig = (struct fig *)&pfib->data[fib_ptr]; - - type = (pFig->head >> 5) & 0x7; - length = pFig->head & 0x1f; - - if (pFig->head == 0xff || !length) { /* end mark */ - break; - } - - fic_nice_cnt++; - - switch (type) { - case 0: - result = fig0_decoder(pFig); /* MCI & SI */ - break; - case 1: - result = fig1_decoder(pFig); /* SI */ - /* - if (result) - print_log(NULL, "SI Error [%x]\n", result); - */ - break; - - default: - /* - print_log(NULL, "FIG 0x%X Length : 0x%X 0x%X\n" - , type, length, fib_ptr); - */ - result = 1; - break; - } - - fib_ptr += length + 1; - } - - return result; -} - -/* - * MCI & SI - */ -static int fig0_decoder(struct fig *pFig) -{ - int result = 0; - int extension, length, pd; - u8 cn; - - length = pFig->head & 0x1f; - cn = (pFig->data[0] & 0x80) >> 7; - if ((bbm_recfg_flag == 1) && (cn == 0)) - return 0; - /* if (cn) - print_log(NULL, "N"); - */ - extension = pFig->data[0] & 0x1F; - pd = (pFig->data[0] & 0x20) >> 5; - - switch (extension) { - case 1: - result = fig0_ext1_decoder(cn, &pFig->data[1], length); - break; - case 2: - result = fig0_ext2_decoder(&pFig->data[1], length, pd); - break; - case 3: /* Service component in packet mode or without CA */ - result = fig0_ext3_decoder(&pFig->data[1], length); - break; - case 4: /* Service component with CA */ - /* - result = fig0_ext4_decoder(&pFig->data[1], length); - */ - break; - case 10: /* Date & Time */ - result = fig0_ext10_decoder(&pFig->data[1], length-1); - break; - case 13: - result = fig0_ext13_decoder(&pFig->data[1], length, pd); - break; - case 14: /* FEC */ - result = fig0_ext14_decoder(&pFig->data[1], length); - break; - case 15: - result = fig0_ext15_decoder(&pFig->data[1], length, pd); - break; - case 0: /* Ensembel Information */ - case 5: /* Language */ - case 8: /* Service component global definition */ - case 9: /* Country LTO and International table */ - case 17: /* Programme Type */ - result = dummy_decoder(&pFig->data[1], length); - break; - case 18: /* Announcements */ - if (announcement) - result = - fig0_ext18_decoder(&pFig->data[1], length); - break; - case 19: /* Announcements switching */ - /* - print_log(NULL, "FIG 0x%X/0x%X Length : 0x%X\n" - , 0, extension, length); - */ - break; - default: - /* - print_log(NULL, "FIG 0x%X/0x%X Length : 0x%X\n" - , 0, extension, length); - */ - result = 1; - break; - } - - return result; -} - -static int fig1_decoder(struct fig *pFig) -{ - int result = 0; - int length; - int /*charset, oe,*/ extension; - - length = pFig->head & 0x1f; - /* charset = (pFig->data[0] >> 4) & 0xF; */ - /* oe = (pFig->data[0]) >> 3 & 0x1; */ - extension = pFig->data[0] & 0x7; - - switch (extension) { - case 0: /* Ensembel Label */ - result = fig1_ext0_decoder(&pFig->data[1], length); - break; - case 1: /* Programme service Label */ - result = fig1_ext1_decoder(&pFig->data[1], length); - break; - case 5: /* Data service Label */ - result = fig1_ext5_decoder(&pFig->data[1], length); - break; - case 4: /* Service component Label */ - result = fig1_ext4_decoder(&pFig->data[1], length); - break; - default: - /* - print_log(NULL, "FIG 0x%X/0x%X Length : 0x%X\n" - , 1, extension, length); - */ - result = 1; - break; - } - - return result; -} - -int dummy_decoder(u8 *fibBuffer, int figLength) -{ - return 0; -} - -/* - * FIG 0/1 MCI, Sub Channel Organization - */ -int fig0_ext1_decoder(u8 cn, u8 *fibBuffer, int figLength) -{ - u8 sta; - int result = 0; - int readcnt = 0; - - u8 subchannel_id; - struct subch_info_t *sub_ch_info; - - while (figLength-1 > readcnt) { - sta = fibBuffer[readcnt++]; - if (sta == 0xFF) - break; - subchannel_id = (sta >> 2) & 0x3F; - sub_ch_info = get_subchannel_info(subchannel_id); - if (sub_ch_info == NULL) { - /*print_log(NULL, "subchannel_info error ..\n"); */ - return 1; - } - - sub_ch_info->flag = 99; - sub_ch_info->mode = 0; /* T-DMB */ - sub_ch_info->subchannel_id = subchannel_id; - - sub_ch_info->start_address = (sta & 0x3) << 8; - sta = fibBuffer[readcnt++]; - sub_ch_info->start_address |= sta; - sta = fibBuffer[readcnt++]; - sub_ch_info->form_type = (sta & 0x80) >> 7; - - switch (sub_ch_info->form_type) { - case 0: /* short form */ - sub_ch_info->table_switch = (sta & 0x40) >> 6; - sub_ch_info->table_index = sta & 0x3f; - break; - case 1: /* long form */ - sub_ch_info->option = (sta & 0x70) >> 4; - sub_ch_info->protect_level = (sta & 0x0c) >> 2; - sub_ch_info->subch_size = (sta & 0x03) << 8; - sta = fibBuffer[readcnt++]; - sub_ch_info->subch_size |= sta; - break; - default: - /* - print_log(NULL, "Unknown Form Type %d\n" - , sub_ch_info->form_type); - */ - result = 1; - break; - } - if (cn) { - if (sub_ch_info->re_config == 0) - sub_ch_info->re_config = 1; - /* ReConfig Info Updated */ - } - } - - return result; -} - -/* - * FIG 0/2 MCI, Sub Channel Organization - */ -static int fig0_ext2_decoder(u8 *fibBuffer, int figLength, int pd) -{ - struct service_info_t *svc_info; - struct subch_info_t *sub_ch_info; - u8 sta; - int result = 0; - int readcnt = 0; - u32 sid = 0xffffffff; - int nscps; - u32 temp; - int tmid; - int i; - - while (figLength-1 > readcnt) { - temp = 0; - - temp = fibBuffer[readcnt++]; - temp = (temp << 8) | fibBuffer[readcnt++]; - - - switch (pd) { - case 0: /* 16-bit sid, used for programme services */ - { - temp = temp; - /*sid = temp & 0xFFF; */ - sid = temp; - } - break; - case 1: /*32bit sid, used for data service */ - { - temp = (temp << 8) | fibBuffer[readcnt++]; - temp = (temp << 8) | fibBuffer[readcnt++]; - - /*sid = temp & 0xFFFFF; */ - sid = temp; - } - break; - default: - break; - } - - svc_info = get_service_info(sid); - if (svc_info == NULL) { - /*print_log(NULL, "get_service_info Error ...\n"); */ - break; - } - - svc_info->addrType = pd; - svc_info->sid = sid; - svc_info->flag |= 0x02; - - sta = fibBuffer[readcnt++]; /* flag, CAId, nscps */ - - nscps = sta & 0xF; - - svc_info->nscps = nscps; - - for (i = 0; i < nscps; i++) { - sta = fibBuffer[readcnt++]; - tmid = (sta >> 6) & 0x3; - /* svc_info->tmid = tmid; */ - - switch (tmid) { - case 0: /* MSC stream audio */ - svc_info->ascty = sta & 0x3f; - sta = fibBuffer[readcnt++]; - if ((sta & 0x02) == 0x02) { /* Primary */ - svc_info->sub_channel_id - = (sta >> 2) & 0x3F; - svc_info->tmid = tmid; - } - sub_ch_info = - get_subchannel_info(svc_info->sub_channel_id); - if (sub_ch_info == NULL) { - /* - print_log(NULL - , "get_subchannel_info Error ...\n"); - */ - return 1; - } - sub_ch_info->sid = svc_info->sid; - svc_info->flag |= 0x04; - break; - case 1: /* MSC stream data */ - svc_info->dscty = sta & 0x3f; - sta = fibBuffer[readcnt++]; - if ((sta & 0x02) == 0x02) { /* Primary */ - svc_info->sub_channel_id - = (sta >> 2) & 0x3F; - svc_info->tmid = tmid; - } - sub_ch_info = - get_subchannel_info(svc_info->sub_channel_id); - if (sub_ch_info == NULL) { - /* - print_log(NULL - , "get_subchannel_info Error ...\n"); - */ - return 1; - } - sub_ch_info->sid = svc_info->sid; - svc_info->flag |= 0x04; - break; - case 2: /* FIDC */ - svc_info->dscty = sta & 0x3f; - sta = fibBuffer[readcnt++]; - if ((sta & 0x02) == 0x02) { /* Primary */ - svc_info->fidc_id = (sta & 0xFC) >> 2; - svc_info->tmid = tmid; - } - svc_info->flag |= 0x04; - break; - case 3: /* MSC packet data */ - svc_info->scid = (sta & 0x3F) << 6; - sta = fibBuffer[readcnt++]; - if ((sta & 0x02) == 0x02) { /* Primary */ - svc_info->scid |= (sta & 0xFC) >> 2; - svc_info->tmid = tmid; - } - /* by iproda */ - svc_info->flag |= 0x04; - break; - default: - /* print_log(NULL - , "Unkown tmid [%X]\n", tmid); */ - result = 1; - break; - } - } - } - - return result; -} - -int fig0_ext3_decoder(u8 *fibBuffer, int figLength) -{ - u8 sta; - int result = 0; - int readcnt = 0; - u16 scid; - int i; - - struct scInfo_t *pScInfo; - struct service_info_t *svc_info; - struct subch_info_t *sub_ch_info; - - while (figLength-1 > readcnt) { - scid = 0; - sta = fibBuffer[readcnt++]; - scid = sta; - scid = scid << 4; - sta = fibBuffer[readcnt++]; - scid |= (sta & 0xf0) >> 4; - - pScInfo = get_sc_info(scid); - if (pScInfo == NULL) { - /* print_log(NULL, "get_sc_info Error ...\n"); */ - return 1; - } - - pScInfo->flag = 99; - pScInfo->scid = scid; - pScInfo->scca_flag = sta & 0x1; - sta = fibBuffer[readcnt++]; - pScInfo->dg_flag = (sta & 0x80) >> 7; - pScInfo->dscty = (sta & 0x3f); - sta = fibBuffer[readcnt++]; - pScInfo->sub_channel_id = (sta & 0xfc) >> 2; - pScInfo->packet_address = sta & 0x3; - pScInfo->packet_address = pScInfo->packet_address << 8; - sta = fibBuffer[readcnt++]; - pScInfo->packet_address |= sta; - if (pScInfo->scca_flag) { - sta = fibBuffer[readcnt++]; - pScInfo->scca = sta; - pScInfo->scca = pScInfo->scca << 8; - sta = fibBuffer[readcnt++]; - pScInfo->scca |= sta; - } - - for (i = 0; i < MAX_SVC_NUM; i++) { - svc_info = &service_info[i]; - if (svc_info->scid == pScInfo->scid - && svc_info->tmid == 3) { - sub_ch_info = - get_subchannel_info(pScInfo->sub_channel_id); - if (sub_ch_info == NULL) { - /* - print_log(NULL - , "get_subchannel_info Error ...\n"); - */ - return 1; - } - - sub_ch_info->sid = svc_info->sid; - svc_info->sub_channel_id - = sub_ch_info->subchannel_id; - } - } - } - - return result; -} - -/*int fig0_ext4_decoder(u8 *fibBuffer, int figLength) { - int result = 0; - int readcnt = 0; - int Mf, sub_channel_id, CAOrg; - - while (figLength - 1 > readcnt) { - Mf = (fibBuffer[readcnt] & 0x40) >> 6; - sub_channel_id = (fibBuffer[readcnt] & 0x3f); - CAOrg = - (fibBuffer[readcnt + 1] << 8) + fibBuffer[readcnt + 2]; - readcnt += 3; - //print_log(NULL, "CA MF: %d, SubChiD: %d, CAOrg: %d\n" - , Mf, sub_channel_id, CAOrg); - } - - return result; -}*/ - -/* - * FIG 0/10 Date & Time - */ -int fig0_ext10_decoder(u8 *fibBuffer, int figLength) -{ - int result = 0; - - u8 MJD, /*ConfInd,*/ UTCflag; - /* u16 LSI; */ - u8 hour = 0; /*minutes = 0, seconds = 0*/ - u16 milliseconds = 0; - - MJD = (fibBuffer[0] & 0x7f) << 10; - MJD |= (fibBuffer[1] << 2); - MJD |= (fibBuffer[2] & 0xc0) >> 6; - /*LSI = (fibBuffer[2] & 0x20) >> 5; */ - /*ConfInd = (fibBuffer[2] & 0x10) >> 4; */ - UTCflag = (fibBuffer[2] & 0x08) >> 3; - - hour = (fibBuffer[2] & 0x07) << 2; - hour |= (fibBuffer[3] & 0xc0) >> 6; - - /* minutes = fibBuffer[3] & 0x3f; */ - - if (UTCflag) { - /* seconds = (fibBuffer[4] & 0xfc) >> 2; */ - milliseconds = (fibBuffer[4] & 0x03) << 8; - milliseconds |= fibBuffer[5]; - } - - /* - print_log(NULL, " %d:%d:%d.%d\n" - , hour+9, minutes, seconds, milliseconds); - */ - - return result; -} - -/* - * FIG 0/13 Announcement - */ -int fig0_ext13_decoder(u8 *fibBuffer, int figLength, int pd) -{ - u8 sta; - int result = 0; - int readcnt = 0; - u32 sid = 0xffffffff; - /* u8 SCIdS; */ - u8 NumOfUAs; - u16 UAtype; - u8 UAlen; - int i, j; - - struct service_info_t *svc_info; - - - while (figLength-1 > readcnt) { - switch (pd) { - case 0: /* 16-bit sid, used for programme services */ - { - u32 temp; - - temp = 0; - - temp = fibBuffer[readcnt++]; - temp = (temp << 8) | fibBuffer[readcnt++]; - - sid = temp; - } - break; - case 1: /* 32bit sid, used for data service */ - { - u32 temp; - - temp = 0; - - temp = fibBuffer[readcnt++]; - temp = (temp << 8) | fibBuffer[readcnt++]; - temp = (temp << 8) | fibBuffer[readcnt++]; - temp = (temp << 8) | fibBuffer[readcnt++]; - - sid = temp; - } - break; - default: - break; - } - - svc_info = get_service_info(sid); - if (svc_info == NULL) { - /* print_log(NULL, "get_service_info Error ...\n"); */ - break; - } - svc_info->sid = sid; - - svc_info->flag |= 0x04; - - sta = fibBuffer[readcnt++]; - - /* SCIdS = (sta & 0xff00) >> 4; */ - NumOfUAs = sta & 0xff; - - /* Because of Visual Radio */ - svc_info->num_of_user_appl = NumOfUAs; - - for (i = 0; i < NumOfUAs; i++) { - UAtype = 0; - sta = fibBuffer[readcnt++]; - UAtype = sta; - sta = fibBuffer[readcnt++]; - UAtype = (UAtype << 3) | ((sta >> 5) & 0x07); - - /* Because of Visual Radio */ - UAlen = sta & 0x1f; - - svc_info->user_appl_type[i] = UAtype; - svc_info->user_appl_length[i] = UAlen; - - for (j = 0; j < UAlen; j++) { - sta = fibBuffer[readcnt++]; - svc_info->user_appl_data[i][j] = sta; - } - } - } - - return result; -} - -int fig0_ext14_decoder(u8 *fibBuffer, int figLength) -{ - int result = 0; - int readcnt = 0; - unsigned char subch, fec_scheme; - struct subch_info_t *sub_ch_info; - - while (figLength-1 > readcnt) { - subch = (fibBuffer[readcnt] & 0xfc) >> 2; - fec_scheme = (fibBuffer[readcnt] & 0x03); - readcnt++; - /* - print_log(NULL, "SubChID: %d, FEC Scheme: %d\n" - , subch, fec_scheme); - */ - sub_ch_info = get_subchannel_info(subch); - if (sub_ch_info) - sub_ch_info->fec_schem = fec_scheme; - } - - return result; -} - - /* - * TMMB kjju TODO - */ -int fig0_ext15_decoder(u8 *fibBuffer, int figLength, int pd) -{ - u8 sta; - int result = 0; - int readcnt = 0; - u8 subchannel_id; - struct subch_info_t *sub_ch_info; - - while (figLength-1 > readcnt) { - sta = fibBuffer[readcnt++]; - if (sta == 0xFF) - break; - - subchannel_id = (sta & 0xfc) >> 2; - sub_ch_info = get_subchannel_info(subchannel_id); - if (sub_ch_info == NULL) { - /* print_log(NULL, "subchannel_info error ..\n"); */ - return 1; - } - - sub_ch_info->flag = 99; - sub_ch_info->mode = 1; /* T-MMB */ - sub_ch_info->subchannel_id = subchannel_id; - sub_ch_info->start_address = (sta & 0x3) << 8; - - sta = fibBuffer[readcnt++]; - sub_ch_info->start_address |= sta; - - sub_ch_info = get_subchannel_info(sub_ch_info->subchannel_id); - if (sub_ch_info == NULL) { - /* print_log(NULL, "subchannel_info error ..\n"); */ - return 1; - } - - sta = fibBuffer[readcnt++]; - - sub_ch_info->mod_type = (sta & 0xc0) >> 6; - sub_ch_info->enc_type = (sta & 0x20) >> 5; - sub_ch_info->intv_depth = (sta & 0x18) >> 3; - sub_ch_info->pl = (sta & 0x04) >> 2; - sub_ch_info->subch_size = (sta & 0x03) << 8; - - sta = fibBuffer[readcnt++]; - sub_ch_info->subch_size |= sta; - } - - return result; -} - -/* - * FIG 0/18 Announcement - */ -int fig0_ext18_decoder(u8 *fibBuffer, int figLength) -{ - u8 sta; - int result = 0; - int readcnt = 0; - u16 sid; - /* u8 CId; */ - u16 AsuFlag; - int nocs; - int i; - - while (figLength-1 > readcnt) { - sta = fibBuffer[readcnt++]; - sid = sta << 8; - sta = fibBuffer[readcnt++]; - sid |= sta; - /* print_log(NULL, "sid = 0x%X, ", sid); */ - - sta = fibBuffer[readcnt++]; - AsuFlag = sta << 8; - sta = fibBuffer[readcnt++]; - AsuFlag |= sta; - /* print_log(NULL, "AsuFlag = 0x%X, ", AsuFlag); */ - - sta = fibBuffer[readcnt++]; - nocs = sta & 0x1F; - /* print_log(NULL, "nocs = 0x%X, ", nocs); */ - - for (i = 0; i < nocs; i++) { - sta = fibBuffer[readcnt++]; - /* CId = sta; */ - /* print_log(NULL, "CId = %d, ", CId); */ - } - /* print_log(NULL, "\n"); */ - } - - return result; -} - -static int fig1_ext0_decoder(u8 *fibBuffer, int figLength) -{ - int result = 0; - int readcnt = 0; - int i; - - u16 eid; - u16 flag; - - eid = 0; - eid = fibBuffer[readcnt++]; - eid = eid << 8 | fibBuffer[readcnt++]; - - for (i = 0; i < 16; i++) - ensemble_info[0].label[i] = fibBuffer[readcnt++]; - - flag = 0; - flag = fibBuffer[readcnt++]; - flag = flag << 8 | fibBuffer[readcnt++]; - - ensemble_info[0].label[16] = '\0'; - ensemble_info[0].flag = 99; - ensemble_info[0].eid = eid; - /* - print_log(DMB_FIC_INFO"FIG 1/0 label [%x][%s]\n" - , eid, ensemble_info[0].label); - */ - - for (i = 16-1; i >= 0; i--) { - if (ensemble_info[0].label[i] == 0x20) - ensemble_info[0].label[i] = 0; - else { - if (i == 16-1) - ensemble_info[0].label[i] = 0; - break; - } - } - - return result; -} - -static int fig1_ext1_decoder(u8 *fibBuffer, int figLength) -{ - struct service_info_t *svc_info; - u32 temp; - int result = 0; - int readcnt = 0; - int i; - - u16 sid; - - temp = 0; - temp = fibBuffer[readcnt++]; - temp = temp << 8 | fibBuffer[readcnt++]; - - sid = temp; - - svc_info = get_service_info(sid); - if (svc_info == NULL) { - /* print_log(NULL, "get_service_info Error ...\n"); */ - return 1; - } - - svc_info->sid = sid; - - svc_info->flag |= 0x01; - - for (i = 0; i < 16; i++) - svc_info->label[i] = fibBuffer[readcnt++]; - - svc_info->label[16] = '\0'; - /* print_log(NULL, "FIG 1/1 label [%x][%s]\n", sid, svc_info->label); */ - - for (i = 16-1; i >= 0; i--) { - if (svc_info->label[i] == 0x20) - svc_info->label[i] = 0; - else { - if (i == 16-1) - svc_info->label[i] = 0; - break; - } - } - - /* print_log(NULL, "FIG 1/5 label [%x][%s]\n", sid, svc_info->label); */ - - return result; -} - -static int fig1_ext4_decoder(u8 *fibBuffer, int figLength) -{ - struct scInfo_t *pScInfo; - u8 sta; - u8 pd; - u32 temp; - int result = 0; - int readcnt = 0; - int i; - - u16 scid; - /* u32 sid; */ - u16 flag; - - sta = fibBuffer[readcnt++]; - - pd = (sta & 0x80) >> 7; - scid = (sta & 0x0f); - - temp = 0; - temp = fibBuffer[readcnt++]; - temp = temp << 8 | fibBuffer[readcnt++]; - - if (pd) { - temp = temp << 8 | fibBuffer[readcnt++]; - temp = temp << 8 | fibBuffer[readcnt++]; - /* sid = temp; */ - } else { - /* sid = temp; */ - } - - pScInfo = get_sc_info(scid); - if (pScInfo == NULL) { - /* print_log(NULL, "get_service_info Error ...\n"); */ - return 1; - } - - pScInfo->flag = 99; - pScInfo->scid = scid; - - for (i = 0; i < 16; i++) - pScInfo->label[i] = fibBuffer[readcnt++]; - - flag = 0; - flag = fibBuffer[readcnt++]; - flag = flag << 8 | fibBuffer[readcnt++]; - - pScInfo->label[16] = '\0'; - /* print_log(NULL, "FIG 1/4 label [%x][%s]\n", sid, pScInfo->label); */ - - for (i = 16-1; i >= 0; i--) { - if (pScInfo->label[i] == 0x20) - pScInfo->label[i] = 0; - else { - if (i == 16-1) - pScInfo->label[i] = 0; - break; - } - } - - /*print_log(NULL, "FIG 1/5 label [%x][%s]\n", sid, svc_info->label); */ - - return result; -} - -static int fig1_ext5_decoder(u8 *fibBuffer, int figLength) -{ - struct service_info_t *svc_info; - u32 temp; - int result = 0; - int readcnt = 0; - int i; - - u32 sid; - u16 flag; - - temp = 0; - temp = fibBuffer[readcnt++]; - temp = temp << 8 | fibBuffer[readcnt++]; - temp = temp << 8 | fibBuffer[readcnt++]; - temp = temp << 8 | fibBuffer[readcnt++]; - - sid = temp; - - svc_info = get_service_info(sid); - if (svc_info == NULL) { - /* print_log(NULL, "get_service_info Error ...\n"); */ - return 1; - } - - svc_info->sid = sid; - - svc_info->flag |= 0x01; - - for (i = 0; i < 16; i++) - svc_info->label[i] = fibBuffer[readcnt++]; - - flag = 0; - flag = fibBuffer[readcnt++]; - flag = flag << 8 | fibBuffer[readcnt++]; - - svc_info->label[16] = '\0'; - - for (i = 16-1; i >= 0; i--) { - if (svc_info->label[i] == 0x20) - svc_info->label[i] = 0; - else { - if (i == 16-1) - svc_info->label[i] = 0; - break; - } - } - - /* print_log(NULL, "FIG 1/5 label [%x][%s]\n", sid, svc_info->label); */ - - return result; -} - -void subchannel_org_prn(int subchannel_id) -{ - struct didp_info_t didp; - struct subch_info_t *sub_ch_info; - - memset(&didp, 0, sizeof(didp)); - - sub_ch_info = get_subchannel_info(subchannel_id); - if (sub_ch_info == NULL) - return; - - if (sub_ch_info->flag == 99) { - subchannel_org_to_didp(sub_ch_info, &didp); - /* - if (sub_ch_info->service_channel_id & 0x40) - print_log(NULL, "service_channel_id = 0x%X, " - , sub_ch_info->service_channel_id & 0x3F); - else - print_log(NULL, "service_channel_id = NOTUSE, "); - */ - switch (sub_ch_info->re_config) { - case 0: - /* print_log(NULL, "re_config = INIT\n"); */ - break; - case 1: - /* print_log(NULL, "re_config = UPDATED\n"); */ - break; - case 2: - /* print_log(NULL, "re_config = DONE\n"); */ - break; - } - - /* print_log(NULL, "sid = 0x%X\n", sub_ch_info->sid); */ - /* didp_prn(&didp); */ - } -} - -void subchannel_org_clean(void) -{ - int i; - - memset(ensemble_info, 0, sizeof(struct esbinfo_t) * MAX_ESB_NUM); - memset(service_info, 0, sizeof(struct service_info_t) * MAX_SVC_NUM); - memset(sc_info, 0, sizeof(struct scInfo_t) * MAX_SC_NUM); - memset(subchannel_info, 0, sizeof(struct subch_info_t) * MAX_SUBCH_NUM); - - for (i = 0; i < MAX_SUBCH_NUM; i++) - subchannel_info[i].flag = 0; - - for (i = 0; i < MAX_SVC_NUM; i++) { - service_info[i].flag = 0; - service_info[i].scid = 0xffff; - } - - for (i = 0; i < MAX_SC_NUM; i++) - sc_info[i].scid = 0xffff; - - return; -} - -int bitrate_to_index(u16 bitrate) -{ - int index; - - switch (bitrate) { - case 32: - index = 0; break; - case 48: - index = 1; break; - case 56: - index = 2; break; - case 64: - index = 3; break; - case 80: - index = 4; break; - case 96: - index = 5; break; - case 112: - index = 6; break; - case 128: - index = 7; break; - case 160: - index = 8; break; - case 192: - index = 9; break; - case 224: - index = 10; break; - case 256: - index = 11; break; - case 320: - index = 12; break; - case 384: - index = 13; break; - default: - index = -1; break; - } - - return index; -} - -int GetN(struct subch_info_t *sub_ch_info, int *n) -{ - int result = 0; - - switch (sub_ch_info->option) { - case 0: - switch (sub_ch_info->protect_level) { - case 0: - *n = sub_ch_info->subch_size / 12; - break; - case 1: - *n = sub_ch_info->subch_size / 8; - break; - case 2: - *n = sub_ch_info->subch_size / 6; - break; - case 3: - *n = sub_ch_info->subch_size / 4; - break; - default: - /* - print_log(NULL, "Unknown Protection Level %d\n" - , sub_ch_info->protect_level); - */ - result = 1; - break; - } - break; - case 1: - switch (sub_ch_info->protect_level) { - case 0: - *n = sub_ch_info->subch_size / 27; - break; - case 1: - *n = sub_ch_info->subch_size / 21; - break; - case 2: - *n = sub_ch_info->subch_size / 18; - break; - case 3: - *n = sub_ch_info->subch_size / 15; - break; - default: - /* - print_log(NULL, "Unknown Protection Level %d\n" - , sub_ch_info->protect_level); - */ - result = 1; - break; - } - break; - default: - /* print_log(NULL, "Unknown Option %d\n" - , sub_ch_info->option); */ - result = 1; - break; - } - - return result; -} - -int subchannel_org_to_didp( - struct subch_info_t *sub_ch_info, struct didp_info_t *pdidp) -{ - int index, bitrate, level; - int result = 0, n = 0; - u16 subch_size = 0; - u16 dataRate; - u8 intv_depth = 0; - - if (sub_ch_info->flag != 99) - return 1; - - switch (sub_ch_info->mode) { - case 0: /* T-DMB */ - pdidp->mode = sub_ch_info->mode; - switch (sub_ch_info->form_type) { - case 0: /* short form UEP */ - pdidp->subchannel_id = sub_ch_info->subchannel_id; - pdidp->start_address = sub_ch_info->start_address; - pdidp->form_type = sub_ch_info->form_type; - subch_size = - bitrate_profile[sub_ch_info->table_index][0]; - pdidp->speed = - bitrate_profile[sub_ch_info->table_index][2]; - - level = bitrate_profile[sub_ch_info->table_index][1]; - bitrate = bitrate_profile[sub_ch_info->table_index][2]; - index = bitrate_to_index(bitrate); - - if (index < 0) { - result = 1; - break; - } - - pdidp->l1 = uep_profile[index][level-1][0]; - pdidp->l2 = uep_profile[index][level-1][1]; - pdidp->l3 = uep_profile[index][level-1][2]; - pdidp->l4 = uep_profile[index][level-1][3]; - pdidp->p1 = (u8)uep_profile[index][level-1][4]; - pdidp->p2 = (u8)uep_profile[index][level-1][5]; - pdidp->p3 = (u8)uep_profile[index][level-1][6]; - pdidp->p4 = (u8)uep_profile[index][level-1][7]; - pdidp->pad = (u8)uep_profile[index][level-1][8]; - break; - case 1: /* long form EEP */ - pdidp->subchannel_id = sub_ch_info->subchannel_id; - pdidp->start_address = sub_ch_info->start_address; - pdidp->form_type = sub_ch_info->form_type; - subch_size = sub_ch_info->subch_size; - pdidp->l3 = 0; - pdidp->p3 = 0; - pdidp->l4 = 0; - pdidp->p4 = 0; - pdidp->pad = 0; - - if (GetN(sub_ch_info, &n)) { - result = 1; - break; - } - - switch (sub_ch_info->option) { - case 0: - switch (sub_ch_info->protect_level) { - case 0: - pdidp->l1 = 6*n - 3; - pdidp->l2 = 3; - pdidp->p1 = 24; - pdidp->p2 = 23; - break; - case 1: - if (n > 1) { - pdidp->l1 = 2*n - 3; - pdidp->l2 = 4*n + 3; - pdidp->p1 = 14; - pdidp->p2 = 13; - } else { - pdidp->l1 = 5; - pdidp->l2 = 1; - pdidp->p1 = 13; - pdidp->p2 = 12; - } - break; - case 2: - pdidp->l1 = 6*n - 3; - pdidp->l2 = 3; - pdidp->p1 = 8; - pdidp->p2 = 7; - break; - case 3: - pdidp->l1 = 4*n - 3; - pdidp->l2 = 2*n + 3; - pdidp->p1 = 3; - pdidp->p2 = 2; - break; - default: - result = 1; - break; - } - pdidp->speed = 8*n; - break; - case 1: - switch (sub_ch_info->protect_level) { - case 0: - pdidp->l1 = 24*n - 3; - pdidp->l2 = 3; - pdidp->p1 = 10; - pdidp->p2 = 9; - break; - case 1: - pdidp->l1 = 24*n - 3; - pdidp->l2 = 3; - pdidp->p1 = 6; - pdidp->p2 = 5; - break; - case 2: - pdidp->l1 = 24*n - 3; - pdidp->l2 = 3; - pdidp->p1 = 4; - pdidp->p2 = 3; - break; - case 3: - pdidp->l1 = 24*n - 3; - pdidp->l2 = 3; - pdidp->p1 = 2; - pdidp->p2 = 1; - break; - default: - break; - } - pdidp->speed = 32*n; - break; - default: - result = 1; - break; - } - break; - default: - result = 1; - break; - } - - if (subch_size <= pdidp->subch_size) - pdidp->reconfig_offset = 0; - else - pdidp->reconfig_offset = 1; - - pdidp->subch_size = subch_size; - break; - case 1: /* T-MMB */ - pdidp->mode = sub_ch_info->mode; - pdidp->start_address = sub_ch_info->start_address; - pdidp->subchannel_id = sub_ch_info->subchannel_id; - pdidp->subch_size = sub_ch_info->subch_size; - pdidp->mod_type = sub_ch_info->mod_type; - pdidp->enc_type = sub_ch_info->enc_type; - pdidp->intv_depth = sub_ch_info->intv_depth; - pdidp->pl = sub_ch_info->pl; - - switch (pdidp->mod_type) { - case 0: - n = pdidp->subch_size / 18; - break; - case 1: - n = pdidp->subch_size / 12; - break; - case 2: - n = pdidp->subch_size / 9; - break; - default: - result = 1; - break; - } - - switch (pdidp->intv_depth) { - case 0: - intv_depth = 16; - break; - case 1: - intv_depth = 32; - break; - case 2: - intv_depth = 64; - break; - default: - result = 1; - break; - } - - if (result == 1) - break; - - if (pdidp->pl) { - dataRate = n * 32; - pdidp->mi = - (((((dataRate * 3) / 2) * 24) / intv_depth) * 3) - / 4; - } else { - dataRate = n * 24; - pdidp->mi = - ((((dataRate * 2) * 24) / intv_depth) * 3) / 4; - } - break; - default: - break; - } - - return result; -} - -int found_all_labels(void) -{ - ms_wait(1200); - return 1; -} diff --git a/drivers/media/tdmb/fc8050/ficdecoder.h b/drivers/media/tdmb/fc8050/ficdecoder.h deleted file mode 100644 index ae39402..0000000 --- a/drivers/media/tdmb/fc8050/ficdecoder.h +++ /dev/null @@ -1,183 +0,0 @@ -/***************************************************************************** - Copyright(c) 2009 FCI Inc. All Rights Reserved - - File name : ficdecoder.h - - Description : fic parser - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - - - History : - ---------------------------------------------------------------------- -*******************************************************************************/ -#ifndef __ficdecodera_h__ -#define __ficdecodera_h__ - -#include "fci_types.h" - -#define MAX_ESB_NUM 1 -#define MAX_SVC_NUM 128 -#define MAX_SC_NUM 128 -#define MAX_SUBCH_NUM 64 -#define MAX_DIDP_NUM 8 - -#define MAX_USER_APPL_NUM 15 -#define MAX_USER_APPL_DATA_SIZE 24 - -struct fig { - u8 head; - u8 data[29]; -}; - -struct fib { - u8 data[30]; - u16 crc; -}; - -struct fic { - /* Fib fib[12]; */ - struct fib fib[32]; -}; - -struct figdata { - u8 head; - u8 data[28]; -}; - -struct esbinfo_t { - u8 flag; - u16 eid; - u8 label[32]; -}; - -struct service_info_t { - u8 flag; - u32 sid; - u16 scid; - u8 ascty; - u8 dscty; - u8 fidc_id; - u8 addrType; /* PD */ - u8 tmid; - u8 sub_channel_id; - u8 nscps; - u8 label[32]; - - u8 num_of_user_appl; - u16 user_appl_type[MAX_USER_APPL_NUM]; - u8 user_appl_length[MAX_USER_APPL_NUM]; - u8 user_appl_data[MAX_USER_APPL_NUM][MAX_USER_APPL_DATA_SIZE]; -}; - -struct scInfo_t { - u8 flag; - u16 scid; - u8 dscty; - u8 sub_channel_id; - u8 scca_flag; - u8 dg_flag; - u16 packet_address; - u16 scca; - u8 label[32]; -}; - -struct subch_info_t { - u8 flag; - u8 subchannel_id; - u16 start_address; - u8 form_type; - u8 table_index; - u8 table_switch; - u8 option; - u8 protect_level; - u16 subch_size; - u32 sid; - u8 service_channel_id; - u8 re_config; - - /* T-MMB */ - u8 mode; /* 0 T-DMB, 1 T-MMB */ - u8 mod_type; - u8 enc_type; - u8 intv_depth; - u8 pl; - /* T-MMB */ - - /* FEC */ - u8 fec_schem; - -}; - -struct didp_info_t { - u8 flag; - u8 reconfig_offset; - u8 subchannel_id; - u16 start_address; - u8 form_type; - u16 subch_size; - u16 speed; /* kbsp */ - u16 l1; - u8 p1; - u16 l2; - u8 p2; - u16 l3; - u8 p3; - u16 l4; - u8 p4; - u8 pad; - /* T-MMB */ - u8 mode; /* 0 T-DMB, 1 T-MMB */ - u8 mod_type; - u8 enc_type; - u8 intv_depth; - u8 pl; - u16 mi; /* kies use */ - /* T-MMB */ -}; - -#ifdef __cplusplus - extern "C" { -#endif - -extern struct esbinfo_t ensemble_info[MAX_ESB_NUM]; -extern struct service_info_t service_info[MAX_SVC_NUM]; -extern struct subch_info_t subchannel_info[MAX_SUBCH_NUM]; -extern struct didp_info_t didpInfo[MAX_DIDP_NUM]; - - -extern int fic_decoder(struct fic *pfic, u16 length); -extern int fib_decoder(struct fib *pfib); -extern struct esbinfo_t *get_emsemble_info(void); -extern struct subch_info_t *get_subchannel_info(u8 subchannel_id); -extern struct service_info_t *get_service_info(u32 sid); -extern struct scInfo_t *get_sc_info(u16 scid); -extern struct service_info_t *get_service_info_list(u8 service_index); -extern void subchannel_org_clean(void); -extern void subchannel_org_prn(int subchannel_id); -extern int found_all_labels(void); -extern void didp_prn(struct didp_info_t *pdidp); -extern int set_didp_reg(int service_channel_id, struct didp_info_t *pdidp); -extern int subchannel_org_to_didp( - struct subch_info_t *sub_ch_info, struct didp_info_t *pdidp); -extern void subchannel_org_prn(int subchannel_id); -extern int dummy_decoder(u8 *fibBuffer, int figLength); - - -#ifdef __cplusplus - } /* extern "C" {*/ -#endif - -#endif /* __ficdecoder_h__ */ diff --git a/drivers/media/tdmb/mtv318/Makefile b/drivers/media/tdmb/mtv318/Makefile deleted file mode 100644 index ad4ce80..0000000 --- a/drivers/media/tdmb/mtv318/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -obj-y += raontv.o -obj-y += raontv_port.o -obj-y += raontv_rf.o -obj-y += raontv_ficdec.o -obj-y += raontv_tdmb.o - -ccflags-y += -Idrivers/media/tdmb diff --git a/drivers/media/tdmb/mtv318/raontv.c b/drivers/media/tdmb/mtv318/raontv.c deleted file mode 100644 index d450aa9..0000000 --- a/drivers/media/tdmb/mtv318/raontv.c +++ /dev/null @@ -1,117 +0,0 @@ -/* - * - * File name: drivers/media/tdmb/mtv318/src/raontv.c - * - * Description : RAONTECH TV device driver. - * - * Copyright (C) (2011, RAONTECH) - * - * 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 version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include "raontv_rf.h" - -BOOL g_fRtvChannelChange; - -enum E_RTV_ADC_CLK_FREQ_TYPE g_eRtvAdcClkFreqType; -BOOL g_fRtvStreamEnabled; - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_ISDBT_ENABLE) -enum E_RTV_COUNTRY_BAND_TYPE g_eRtvCountryBandType; -#endif - -#ifdef RTV_DAB_ENABLE -enum E_RTV_TV_MODE_TYPE g_curDabSetType; -#endif - -#ifdef RTV_IF_EBI2 -VU8 g_bRtvEbiMapSelData = 0x7; -#endif - -UINT g_nRtvMscThresholdSize; - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -U8 g_bRtvIntrMaskRegL; - -#else -#if !defined(RTV_CIF_MODE_ENABLED) || !defined(RTV_FIC_POLLING_MODE) -U8 g_bRtvIntrMaskRegL; -#endif -#endif - -void rtv_ConfigureHostIF(void) -{ -#if defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x77, 0x15); /* TSIF Enable */ - RTV_REG_SET(0x22, 0x48); - -#if defined(RTV_IF_MPEG2_PARALLEL_TSIF) - RTV_REG_SET(0x04, 0x01); /* I2C + TSIF Mode Enable*/ -#else - RTV_REG_SET(0x04, 0x29); /* I2C + TSIF Mode Enable*/ -#endif - - RTV_REG_SET(0x0C, 0xF4); /* TSIF Enable*/ - -#elif defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x77, 0x14); /*SPI Mode Enable*/ - RTV_REG_SET(0x04, 0x28); /* SPI Mode Enable*/ - RTV_REG_SET(0x0C, 0xF5); - -#else -#error "Code not present" -#endif -} - -INT rtv_InitSystem(enum E_RTV_TV_MODE_TYPE eTvMode, - enum E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType) -{ - INT nRet; - int i; - - g_fRtvChannelChange = FALSE; - - g_fRtvStreamEnabled = FALSE; - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - g_bRtvIntrMaskRegL = 0xFF; -#else -#ifndef RTV_CIF_MODE_ENABLED /* Individual Mode */ - g_bRtvIntrMaskRegL = 0xFF; -#endif -#endif - - for (i = 1; i <= 100; i++) { - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x7D, 0x06); - if (RTV_REG_GET(0x7D) == 0x06) - goto RTV_POWER_ON_SUCCESS; - - RTV_DBGMSG1("[rtv_InitSystem] Power On wait: %d\n", i); - - RTV_DELAY_MS(5); - } - - RTV_DBGMSG1("rtv_InitSystem: Power On Check error: %d\n", i); - return RTV_POWER_ON_CHECK_ERROR; - -RTV_POWER_ON_SUCCESS: - - rtvRF_ConfigurePowerType(eTvMode); - nRet = rtvRF_ConfigureAdcClock(eTvMode, eAdcClkFreqType); - - if (nRet != RTV_SUCCESS) - return nRet; - - return RTV_SUCCESS; -} diff --git a/drivers/media/tdmb/mtv318/raontv.h b/drivers/media/tdmb/mtv318/raontv.h deleted file mode 100644 index 3a1d762..0000000 --- a/drivers/media/tdmb/mtv318/raontv.h +++ /dev/null @@ -1,274 +0,0 @@ -/* -* -* File name: drivers/media/tdmb/mtv318/src/raontv.h -* -* Description : RAONTECH TV device driver API header file. -* -* Copyright (C) (2011, RAONTECH) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#ifndef __RAONTV_H__ -#define __RAONTV_H__ - -#ifdef __cplusplus -extern "C"{ -#endif - -#include "raontv_port.h" - -#define RAONTV_CHIP_ID 0x8A - -/*============================================================================== - * - * Common definitions and types. - * - *============================================================================*/ -#ifndef NULL - #define NULL 0 -#endif - -#ifndef FALSE - #define FALSE 0 -#endif - -#ifndef TRUE - #define TRUE 1 -#endif - -#ifndef MAX - #define MAX(a, b) (((a) > (b)) ? (a) : (b)) -#endif - -#ifndef MIN - #define MIN(a, b) (((a) < (b)) ? (a) : (b)) -#endif - -#ifndef ABS - #define ABS(x) (((x) < 0) ? -(x) : (x)) -#endif - - -#define RTV_TS_PACKET_SIZE 188 - - -/* Error codes. */ -#define RTV_SUCCESS 0 -#define RTV_INVAILD_COUNTRY_BAND -1 -#define RTV_UNSUPPORT_ADC_CLK -2 -#define RTV_INVAILD_TV_MODE -3 -#define RTV_CHANNEL_NOT_DETECTED -4 -#define RTV_INSUFFICIENT_CHANNEL_BUF -5 -#define RTV_INVAILD_FREQ -6 -#define RTV_INVAILD_SUB_CHANNEL_ID -7 /* for T-DMB and DAB */ -#define RTV_NO_MORE_SUB_CHANNEL -8 /* for T-DMB and DAB */ -#define RTV_INVAILD_THRESHOLD_SIZE -9 -#define RTV_POWER_ON_CHECK_ERROR -10 -#define RTV_PLL_UNLOCKED -11 -#define RTV_ADC_CLK_UNLOCKED -12 - - - - - -enum E_RTV_COUNTRY_BAND_TYPE { - RTV_COUNTRY_BAND_JAPAN = 0, - RTV_COUNTRY_BAND_KOREA, - RTV_COUNTRY_BAND_BRAZIL, - RTV_COUNTRY_BAND_ARGENTINA -}; - - -/* Do not modify the order! */ -enum E_RTV_ADC_CLK_FREQ_TYPE { - RTV_ADC_CLK_FREQ_8_MHz = 0, - RTV_ADC_CLK_FREQ_8_192_MHz, - RTV_ADC_CLK_FREQ_9_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - MAX_NUM_RTV_ADC_CLK_FREQ_TYPE -}; - - -/*============================================================================ - * - * FM definitions, types and APIs. - * - *============================================================================*/ -#define RTV_FM_PILOT_LOCK_MASK 0x1 -#define RTV_FM_RDS_LOCK_MASK 0x2 -#define RTV_FM_CHANNEL_LOCK_OK (RTV_FM_PILOT_LOCK_MASK|RTV_FM_RDS_LOCK_MASK) - -#define RTV_FM_RSSI_DIVIDER 10 - -enum E_RTV_FM_OUTPUT_MODE_TYPE { - RTV_FM_OUTPUT_MODE_AUTO = 0, - RTV_FM_OUTPUT_MODE_MONO = 1, - RTV_FM_OUTPUT_MODE_STEREO = 2 -}; - -void rtvFM_StandbyMode(int on); -void rtvFM_GetLockStatus(UINT *pLockVal, UINT *pLockCnt); -S32 rtvFM_GetRSSI(void); -void rtvFM_SetOutputMode(enum E_RTV_FM_OUTPUT_MODE_TYPE eOutputMode); -void rtvFM_DisableStreamOut(void); -void rtvFM_EnableStreamOut(void); -INT rtvFM_SetFrequency(U32 dwChFreqKHz); -INT rtvFM_SearchFrequency(U32 *pDetectedFreqKHz - , U32 dwStartFreqKHz, U32 dwEndFreqKHz); -INT rtvFM_ScanFrequency(U32 *pChBuf, UINT nNumChBuf - , U32 dwStartFreqKHz, U32 dwEndFreqKHz); -INT rtvFM_Initialize(enum E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType - , UINT nThresholdSize); - - -/*============================================================================ - * - * TDMB definitions, types and APIs. - * - *===========================================================================*/ -#define RTV_TDMB_OFDM_LOCK_MASK 0x1 -#define RTV_TDMB_FEC_LOCK_MASK 0x2 -#define RTV_TDMB_CHANNEL_LOCK_OK \ - (RTV_TDMB_OFDM_LOCK_MASK|RTV_TDMB_FEC_LOCK_MASK) - -#define RTV_TDMB_BER_DIVIDER 100000 -#define RTV_TDMB_CNR_DIVIDER 1000 -#define RTV_TDMB_RSSI_DIVIDER 1000 - -enum E_RTV_TDMB_SERVICE_TYPE { - RTV_TDMB_SERVICE_VIDEO = 0, - RTV_TDMB_SERVICE_AUDIO, - RTV_TDMB_SERVICE_DATA -}; - -struct RTV_TDMB_TII_INFO { - int tii_combo; - int tii_pattern; - int tii_tower; - int tii_strength; -}; - - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - #define RTV_CIF_HEADER_SIZE 4 /* bytes */ -#else - #define RTV_CIF_HEADER_SIZE 16 /* bytes */ -#endif - - -struct RTV_CIF_DEC_INFO { -#if defined(RTV_IF_TSIF) - UINT fic_size; /* Result size. */ - U8 *fic_buf_ptr; /* Destination buffer address. */ -#endif - - /* Result size. */ - UINT msc_size[RTV_MAX_NUM_SUB_CHANNEL_USED]; - /* Result sub channel ID. */ - UINT msc_subch_id[RTV_MAX_NUM_SUB_CHANNEL_USED]; - /* Destination buffer address. */ - U8 *msc_buf_ptr[RTV_MAX_NUM_SUB_CHANNEL_USED]; -}; - -BOOL rtvCIFDEC_Decode(struct RTV_CIF_DEC_INFO *ptDecInfo, - const U8 *pbTsBuf, UINT nTsLen); -#if defined(RTV_IF_SPI) && defined(RTV_CIF_HEADER_INSERTED) -BOOL rtvCIFDEC_CheckCifData_SPI(const U8 *pbTsBuf, UINT nTsLen); -#endif - - -void rtvTDMB_StandbyMode(int on); -UINT rtvTDMB_GetLockStatus(void); -U32 rtvTDMB_GetPER(void); -S32 rtvTDMB_GetRSSI(void); -U32 rtvTDMB_GetCNR(void); -U32 rtvTDMB_GetCER(void); -U32 rtvTDMB_GetBER(void); -UINT rtvTDMB_GetAntennaLevel(U32 dwCER); -U32 rtvTDMB_GetPreviousFrequency(void); -void rtvTDMB_DisableStreamOut(void); -INT rtvTDMB_OpenSubChannel(U32 dwChFreqKHz, UINT nSubChID, - enum E_RTV_TDMB_SERVICE_TYPE eServiceType, - UINT nThresholdSize); -INT rtvTDMB_CloseSubChannel(UINT nSubChID); -void rtvTDMB_CloseAllSubChannels(void); -INT rtvTDMB_ScanFrequency(U32 dwChFreqKHz); -UINT rtvTDMB_ReadFIC(U8 *pbBuf); -void rtvTDMB_CloseFIC(void); -void rtvTDMB_OpenFIC(void); -INT rtvTDMB_Initialize(enum E_RTV_COUNTRY_BAND_TYPE eRtvCountryBandType); - - -/*============================================================================ - * - * DAB definitions, types and APIs. - * - *============================================================================*/ -#define RTV_DAB_OFDM_LOCK_MASK 0x1 -#define RTV_DAB_FEC_LOCK_MASK 0x2 -#define RTV_DAB_CHANNEL_LOCK_OK \ - (RTV_TDMB_OFDM_LOCK_MASK|RTV_TDMB_FEC_LOCK_MASK) - -#define RTV_DAB_BER_DIVIDER 100000 -#define RTV_DAB_CNR_DIVIDER 1000 -#define RTV_DAB_RSSI_DIVIDER 10 - -enum E_RTV_DAB_SERVICE_TYPE { - RTV_DAB_SERVICE_VIDEO = 0, - RTV_DAB_SERVICE_AUDIO, - RTV_DAB_SERVICE_DATA -}; - -struct RTV_DAB_TII_INFO { - int tii_combo; - int tii_pattern; - int tii_tower; - int tii_strength; -}; - - -enum E_RTV_DAB_TRANSMISSION_MODE { - RTV_DAB_TRANSMISSION_MODE1 = 0, - RTV_DAB_TRANSMISSION_MODE2, - RTV_DAB_TRANSMISSION_MODE3, - RTV_DAB_TRANSMISSION_MODE4, - RTV_DAB_INVALID_TRANSMISSION_MODE -}; - - -void rtvDAB_StandbyMode(int on); -UINT rtvDAB_GetLockStatus(void); -U32 rtvDAB_GetPER(void); -S32 rtvDAB_GetRSSI(void); -U32 rtvDAB_GetCNR(void); -U32 rtvDAB_GetCER(void); -U32 rtvDAB_GetBER(void); -U32 rtvDAB_GetPreviousFrequency(void); -void rtvDAB_DisableStreamOut(void); -INT rtvDAB_OpenSubChannel(U32 dwChFreqKHz, UINT nSubChID - , enum E_RTV_DAB_SERVICE_TYPE eServiceType, UINT nThresholdSize); -INT rtvDAB_CloseSubChannel(UINT nSubChID); -void rtvDAB_CloseAllSubChannels(void); -INT rtvDAB_ScanFrequency(U32 dwChFreqKHz); -UINT rtvDAB_ReadFIC(U8 *pbBuf, UINT nFicSize); -UINT rtvDAB_GetFicSize(void); -void rtvDAB_CloseFIC(void); -void rtvDAB_OpenFIC(void); -INT rtvDAB_Initialize(void); - - -#ifdef __cplusplus -} -#endif - -#endif /* __RAONTV_H__ */ - diff --git a/drivers/media/tdmb/mtv318/raontv_ficdec.c b/drivers/media/tdmb/mtv318/raontv_ficdec.c deleted file mode 100644 index 35ec74a..0000000 --- a/drivers/media/tdmb/mtv318/raontv_ficdec.c +++ /dev/null @@ -1,2710 +0,0 @@ -/* -* -* File name: drivers/media/tdmb/mtv318/src/raontv_ficdec.c -* -* Description : RAONTECH FIC Decoder driver. -* -* Copyright (C) (2011, RAONTECH) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include <linux/string.h> -#include "raontv_ficdec_internal.h" -#include "raontv_internal.h" - -struct ensemble_info_type ensble; - -/*****************************/ -/* FIC Information Variable */ -/*****************************/ -static struct FIG_DATA fig_data; -static const U8 FIC_BIT_MASK[8] = {0x0, 0x80, 0xC0, 0xE0, 0xFF, - 0xF8, 0xFC, 0xFE}; - - -/**********************************/ -/* FIC information get function */ -/**********************************/ -static S32 Get_Bytes(U8 cnt, void *Res) -{ - S32 i; - - for (i = 0; i < cnt; i++) { - *((U8 *) Res+i) = *(fig_data.data+fig_data.byte_cnt); - fig_data.byte_cnt++; - } - - return RTV_OK; -} - -static S32 Get_Bits(U8 cnt, void *Res) -{ - *(U8 *)Res = (U8) (*(fig_data.data+fig_data.byte_cnt) & - (FIC_BIT_MASK[cnt] >> fig_data.bit_cnt)); - - *(U8 *)Res = (*(U8 *)Res) >> (8-cnt-fig_data.bit_cnt); - fig_data.bit_cnt += cnt; - if (fig_data.bit_cnt == 8) { - fig_data.byte_cnt++; - fig_data.bit_cnt = 0; - } - return RTV_OK; -} - -void *Get_FIG0_EXT[] = { - (void *) Get_FIG0_EXT0, (void *) Get_FIG0_EXT1, - (void *) Get_FIG0_EXT2, (void *) Get_FIG0_EXT3, - (void *) Get_FIG0_EXT4, (void *) Get_FIG0_EXT5, - (void *) Get_FIG0_EXT6, (void *) Get_FIG0_EXT7, - (void *) Get_FIG0_EXT8, (void *) Get_FIG0_EXT9, - (void *) Get_FIG0_EXT10, (void *) Get_FIG0_EXT11, - (void *) Get_FIG0_EXT12, (void *) Get_FIG0_EXT13, - (void *) Get_FIG0_EXT14, (void *) Get_FIG0_EXT15, - (void *) Get_FIG0_EXT16, (void *) Get_FIG0_EXT17, - (void *) Get_FIG0_EXT18, (void *) Get_FIG0_EXT19, - (void *) Get_FIG0_EXT20, (void *) Get_FIG0_EXT21, - (void *) Get_FIG0_EXT22, (void *) Get_FIG0_EXT23, - (void *) Get_FIG0_EXT24, (void *) Get_FIG0_EXT25, - (void *) Get_FIG0_EXT26, (void *) Get_FIG0_EXT27, - (void *) Get_FIG0_EXT28, (void *) Get_FIG0_EXT29, - (void *) Get_FIG0_EXT30, (void *) Get_FIG0_EXT31, - 0 -}; - -void *Get_FIG1_EXT[] = { - (void *) Get_FIG1_EXT0, (void *) Get_FIG1_EXT1, - (void *) Get_FIG1_EXT2, (void *) Get_FIG1_EXT3, - (void *) Get_FIG1_EXT4, (void *) Get_FIG1_EXT5, - (void *) Get_FIG1_EXT6, (void *) Get_FIG1_EXT7, - 0 -}; - -void *Get_FIG2_EXT[] = { - (void *) Get_FIG2_EXT0, (void *) Get_FIG2_EXT1, - (void *) Get_FIG2_EXT2, (void *) Get_FIG2_EXT3, - (void *) Get_FIG2_EXT4, (void *) Get_FIG2_EXT5, - (void *) Get_FIG2_EXT6, (void *) Get_FIG2_EXT7, - 0 -}; - -void *Get_FIG5_EXT[] = { - (void *) Get_FIG5_EXT0, (void *) Get_FIG5_EXT1, (void *) Get_FIG5_EXT2, - 0 -}; - -void *FIG_PARSER[] = { - (void *) MCI_SI_DEC, - (void *) SI_LABEL_DEC1, - (void *) SI_LABEL_DEC2, - (void *) RESERVED1, - (void *) RESERVED2, - (void *) FIDC_DEC, - (void *) CA_DEC, - (void *) RESERVED3, - 0 -}; - -S32 Get_FIG_Init(U8 *data) -{ - fig_data.data = data; - fig_data.byte_cnt = 0; - fig_data.bit_cnt = 0; - return RTV_OK; -} - -S32 Get_FIG_Header(struct FIG_DATA *fig_data) -{ - - Get_Bytes(1, &(fig_data->length)); - if (fig_data->length == PN_FIB_END_MARKER) - return PN_FIB_END_MARKER; - - fig_data->type = (fig_data->length) >> 5; - fig_data->length = (fig_data->length) & 0x1f; - return RTV_OK; -} - -S32 FIB_INIT_DEC(U8 *fib_ptr) -{ - U8 fib_cnt = 0; - U8 fic_cmd = 1; - - while (fib_cnt < 30) { - Get_FIG_Init(fib_ptr+fib_cnt); - - if (Get_FIG_Header(&fig_data) == PN_FIB_END_MARKER) - return RTV_OK; - if (fig_data.length == 0) - return RTV_FAIL; - - ((S32 (*) (U8)) FIG_PARSER[fig_data.type]) (fic_cmd); - - fib_cnt += (fig_data.length+1); - } - - return RTV_OK; -} - -S32 MCI_SI_DEC(U8 fic_cmd) -{ - U8 C_N, OE, P_D, EXT; - - Get_Bits(1, &C_N); - Get_Bits(1, &OE); - Get_Bits(1, &P_D); - Get_Bits(5, &EXT); - - ((S32 (*) (U8, U8, U8)) Get_FIG0_EXT[EXT]) (fic_cmd, P_D, C_N); - return RTV_OK; -} - -S32 SI_LABEL_DEC1(U8 fic_cmd) -{ - U8 Charset, OE, EXT; - - Get_Bits(4, &Charset); - Get_Bits(1, &OE); - Get_Bits(3, &EXT); - - ((S32 (*) (U8, U8)) Get_FIG1_EXT[EXT]) (fic_cmd, Charset); - return RTV_OK; -} - -S32 SI_LABEL_DEC2(U8 fic_cmd) -{ - U8 Toggle_Flag, Seg_Index, OE, EXT; - - Get_Bits(1, &Toggle_Flag); - Get_Bits(3, &Seg_Index); - Get_Bits(1, &OE); - Get_Bits(3, &EXT); - - ((S32 (*) (U8, U8)) Get_FIG2_EXT[EXT]) (fic_cmd, Seg_Index); - return RTV_OK; -} - -S32 RESERVED1(U8 fic_cmd) -{ - return RTV_OK; -} - -S32 RESERVED2(U8 fic_cmd) -{ - return RTV_OK; -} - -S32 FIDC_DEC(U8 fic_cmd) -{ - U8 D1, D2, TCid, EXT; - - Get_Bits(1, &D1); - Get_Bits(1, &D2); - Get_Bits(3, &TCid); - Get_Bits(3, &EXT); - - ((S32 (*) (U8, U8, U8, U8)) Get_FIG5_EXT[EXT]) (D1, D2, fic_cmd, TCid); - return RTV_OK; -} - -S32 CA_DEC(U8 fic_cmd) -{ - U8 F_L, EXT; - - Get_Bits(2, &F_L); - Get_Bits(6, &EXT); - return RTV_OK; -} - -S32 RESERVED3(U8 fic_cmd) -{ - return RTV_OK; -} - -/* -* FIG TYPE 0 Extension Function -* Ensemble Information */ -S32 Get_FIG0_EXT0(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2; - - struct FIG_TYPE0_Ext0 type0_ext0; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext0.Eid = (temp1 << 8) | temp2; - - Get_Bits(2, &type0_ext0.Change_flag); - Get_Bits(1, &type0_ext0.AI_flag); - - Get_Bits(5, &type0_ext0.CIF_Count0); - Get_Bytes(1, &type0_ext0.CIF_Count1); - - if (type0_ext0.Change_flag != 0) - Get_Bytes(1, &type0_ext0.Occurence_Change); - - if (fic_cmd) { - ENS_DESC.id = type0_ext0.Eid; - ENS_DESC.change_flag = type0_ext0.Change_flag; - ENS_DESC.Alarm_flag = type0_ext0.AI_flag; - } - } - - return RTV_OK; -} - -/* Basic sub-channel organization */ -S32 Get_FIG0_EXT1(U8 fic_cmd, U8 P_D, U8 C_N) -{ -U8 temp1, temp2, cnt; -S32 bit_rate, sub_ch_size, p_l; - -struct FIG_TYPE0_Ext1 type0_ext1; - -while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(6, &type0_ext1.SubChid); - Get_Bits(2, &temp1); - Get_Bytes(1, &temp2); - type0_ext1.StartAdd = (temp1 << 8) | temp2; - - Get_Bits(1, &type0_ext1.S_L_form); - if (type0_ext1.S_L_form) { - Get_Bits(3, &type0_ext1.Option); - Get_Bits(2, &type0_ext1.Protection_Level); - Get_Bits(2, &temp1); - Get_Bytes(1, &temp2); - type0_ext1.Sub_ch_size = (temp1 << 8) | temp2; - type0_ext1.Size_Protection = (type0_ext1.Option << 12) - | (type0_ext1.Protection_Level << 10) - | type0_ext1.Sub_ch_size; - } else { - Get_Bits(1, &type0_ext1.Table_sw); - Get_Bits(6, &type0_ext1.Table_index); - type0_ext1.Size_Protection = (type0_ext1.Table_sw << 6) - | type0_ext1.Table_index; - } - - if (fic_cmd) { - if (C_N) { - GET_SUBCH_INFO(&type0_ext1, &bit_rate, - &sub_ch_size, &p_l); - /*Old SId & New SId matching */ - for (cnt = 0 - ; cnt < NEXT_ENS_DESC.svr_comp_num - ; cnt++){ - - if (NEXT_ENS_DESC.svr_comp[cnt].SubChid - == type0_ext1.SubChid) { - - NEXT_ENS_DESC.svr_comp[cnt].START_Addr - = type0_ext1.StartAdd; - NEXT_ENS_DESC.svr_comp[cnt].SUB_CH_Size - = sub_ch_size; - NEXT_ENS_DESC.svr_comp[cnt].P_L - = p_l; - NEXT_ENS_DESC.svr_comp[cnt].BIT_RATE - = bit_rate; - } - } - } else { - GET_SUBCH_INFO(&type0_ext1, - &bit_rate, - &sub_ch_size, &p_l); - - for (cnt = 0 - ; cnt < ENS_DESC.svr_comp_num - ; cnt++) { - /*Old SId & New SId matching */ - if (ENS_DESC.svr_comp[cnt].SubChid - == type0_ext1.SubChid) { - ENS_DESC.svr_comp[cnt].START_Addr - = type0_ext1.StartAdd; - ENS_DESC.svr_comp[cnt].SUB_CH_Size - = sub_ch_size; - ENS_DESC.svr_comp[cnt].P_L - = p_l; - ENS_DESC.svr_comp[cnt].BIT_RATE - = bit_rate; - } - } - } - } -} - -return RTV_OK; -} - -static INLINE void update_next_ens_desc_type0_ext2( - struct ENSEMBLE_DESC *next, - struct FIG_TYPE0_Ext2 *type0_ext2, - U8 P_D) -{ - UINT l = 0; - - if (P_D) { - next->svr_desc[next->svr_num].P_D = 1; - next->svr_desc[next->svr_num].ECC - = type0_ext2->ECC; - } else - next->svr_desc[next->svr_num].P_D = 0; - - next->svr_desc[next->svr_num].Country_id = type0_ext2->Country_id; - next->svr_desc[next->svr_num].Service_ref = type0_ext2->Service_ref; - next->svr_desc[next->svr_num].Sid = type0_ext2->Sid; - - next->svr_desc[next->svr_num].Local_flag = type0_ext2->Local_flag; - next->svr_desc[next->svr_num].CAID = type0_ext2->CAID; - next->svr_desc[next->svr_num].Num_ser_comp = type0_ext2->Num_ser_comp; - - for (l = 0; l < type0_ext2->Num_ser_comp; l++) { - - next->svr_desc[next->svr_num].ser_comp_num[l] - = next->svr_comp_num; - next->svr_comp[next->svr_comp_num].TMID - = type0_ext2->svr_comp_des[l].TMID; - /* Transport Mechanism Identifier. */ - switch (type0_ext2->svr_comp_des[l].TMID) { - /* MSC stream Audio mode. */ - case MSC_STREAM_AUDIO: - next->svr_comp[next->svr_comp_num].Sid - = type0_ext2->Sid; - next->svr_comp[next->svr_comp_num].ASCTy - = type0_ext2->svr_comp_des[l].ASCTy; - next->svr_comp[next->svr_comp_num].SubChid - = type0_ext2->svr_comp_des[l].SubChid; - next->svr_comp[next->svr_comp_num].P_S - = type0_ext2->svr_comp_des[l].P_S; - next->svr_comp[next->svr_comp_num].CA_flag - = type0_ext2->svr_comp_des[l].CA_flag; - break; - /* MSC stream data mode. */ - case MSC_STREAM_DATA: - next->svr_comp[next->svr_comp_num].Sid - = type0_ext2->Sid; - next->svr_comp[next->svr_comp_num].DSCTy - = type0_ext2->svr_comp_des[l].DSCTy; - next->svr_comp[next->svr_comp_num].SubChid - = type0_ext2->svr_comp_des[l].SubChid; - next->svr_comp[next->svr_comp_num].P_S - = type0_ext2->svr_comp_des[l].P_S; - next->svr_comp[next->svr_comp_num].CA_flag - = type0_ext2->svr_comp_des[l].CA_flag; - break; - /* FIDC mode. */ - case FIDC: - next->svr_comp[next->svr_comp_num].Sid - = type0_ext2->Sid; - next->svr_comp[next->svr_comp_num].DSCTy - = type0_ext2->svr_comp_des[l].DSCTy; - next->svr_comp[next->svr_comp_num].FIDCid - = type0_ext2->svr_comp_des[l].FIDCid; - next->svr_comp[next->svr_comp_num].P_S - = type0_ext2->svr_comp_des[l].P_S; - next->svr_comp[next->svr_comp_num].CA_flag - = type0_ext2->svr_comp_des[l].CA_flag; - break; - /* MSC Packet data mode. */ - case MSC_PACKET_DATA: - next->svr_comp[next->svr_comp_num].Sid - = type0_ext2->Sid; - next->svr_comp[next->svr_comp_num].SCid - = type0_ext2->svr_comp_des[l].SCid; - next->svr_comp[next->svr_comp_num].P_S - = type0_ext2->svr_comp_des[l].P_S; - next->svr_comp[next->svr_comp_num].CA_flag - = type0_ext2->svr_comp_des[l].CA_flag; - break; - } - next->svr_comp_num++; - } - next->svr_num++; - -} - - -static INLINE void update_current_ens_desc_type0_ext2( - struct ENSEMBLE_DESC *cur, - struct FIG_TYPE0_Ext2 *type0_ext2, - U8 P_D) -{ - UINT l = 0; - - if (P_D) { - cur->svr_desc[cur->svr_num].P_D = 1; - cur->svr_desc[cur->svr_num].ECC = type0_ext2->ECC; - } else - cur->svr_desc[cur->svr_num].P_D = 0; - - cur->svr_desc[cur->svr_num].Country_id = type0_ext2->Country_id; - cur->svr_desc[cur->svr_num].Service_ref = type0_ext2->Service_ref; - cur->svr_desc[cur->svr_num].Sid = type0_ext2->Sid; - - cur->svr_desc[cur->svr_num].Local_flag = type0_ext2->Local_flag; - cur->svr_desc[cur->svr_num].CAID = type0_ext2->CAID; - cur->svr_desc[cur->svr_num].Num_ser_comp = type0_ext2->Num_ser_comp; - - for (l = 0; l < type0_ext2->Num_ser_comp; l++) { - cur->svr_desc[cur->svr_num].ser_comp_num[l] = cur->svr_comp_num; - cur->svr_comp[cur->svr_comp_num].TMID - = type0_ext2->svr_comp_des[l].TMID; - - switch (type0_ext2->svr_comp_des[l].TMID) { - case MSC_STREAM_AUDIO: - /* MSC stream Audio mode. */ - cur->svr_comp[cur->svr_comp_num].Sid - = type0_ext2->Sid; - cur->svr_comp[cur->svr_comp_num].ASCTy - = type0_ext2->svr_comp_des[l].ASCTy; - cur->svr_comp[cur->svr_comp_num].SubChid - = type0_ext2->svr_comp_des[l].SubChid; - cur->svr_comp[cur->svr_comp_num].P_S - = type0_ext2->svr_comp_des[l].P_S ; - cur->svr_comp[cur->svr_comp_num].CA_flag - = type0_ext2->svr_comp_des[l].CA_flag; - break; - case MSC_STREAM_DATA: - /* MSC stream data mode.*/ - cur->svr_comp[cur->svr_comp_num].Sid - = type0_ext2->Sid; - cur->svr_comp[cur->svr_comp_num].DSCTy - = type0_ext2->svr_comp_des[l].DSCTy; - cur->svr_comp[cur->svr_comp_num].SubChid - = type0_ext2->svr_comp_des[l].SubChid; - cur->svr_comp[cur->svr_comp_num].P_S - = type0_ext2->svr_comp_des[l].P_S; - cur->svr_comp[cur->svr_comp_num].CA_flag - = type0_ext2->svr_comp_des[l].CA_flag; - break; - case FIDC: - /* FIDC mode. */ - #if 0 - /* EWS Data have no Label in Korea */ - if (type0_ext2->svr_comp_des[l].DSCTy == 2) { - cur->svr_comp_num--; - cur->svr_num--; - } - #endif - cur->svr_comp[cur->svr_comp_num].Sid - = type0_ext2->Sid; - cur->svr_comp[cur->svr_comp_num].DSCTy - = type0_ext2->svr_comp_des[l].DSCTy; - cur->svr_comp[cur->svr_comp_num].FIDCid - = type0_ext2->svr_comp_des[l].FIDCid; - cur->svr_comp[cur->svr_comp_num].P_S - = type0_ext2->svr_comp_des[l].P_S; - cur->svr_comp[cur->svr_comp_num].CA_flag - = type0_ext2->svr_comp_des[l].CA_flag; - break; - case MSC_PACKET_DATA: - /* MSC Packet data mode.*/ - cur->svr_comp[cur->svr_comp_num].Sid - = type0_ext2->Sid; - cur->svr_comp[cur->svr_comp_num].SCid - = type0_ext2->svr_comp_des[l].SCid; - cur->svr_comp[cur->svr_comp_num].P_S - = type0_ext2->svr_comp_des[l].P_S; - cur->svr_comp[cur->svr_comp_num].CA_flag - = type0_ext2->svr_comp_des[l].CA_flag; - break; - } - cur->svr_comp_num++; - } - cur->svr_num++; -} - - - - - -/* Basic service and service component definition */ -S32 Get_FIG0_EXT2(U8 fic_cmd, U8 P_D, U8 C_N) -{ -U8 temp1, temp2, temp3; -UINT cnt, update_flag = 0; - -struct FIG_TYPE0_Ext2 type0_ext2; - -while (fig_data.byte_cnt < fig_data.length) { - if (P_D) { - Get_Bytes(1, &type0_ext2.ECC); - Get_Bits(4, &type0_ext2.Country_id); - Get_Bits(4, &temp1); - Get_Bytes(1, &temp2); - Get_Bytes(1, &temp3); - type0_ext2.Service_ref = (temp1 << 16) - | (temp2 << 8) | temp3; - type0_ext2.Sid = (type0_ext2.ECC << 24) - | (type0_ext2.Country_id << 20) - | type0_ext2.Service_ref; - } else { - Get_Bits(4, &type0_ext2.Country_id); - Get_Bits(4, &temp1); - Get_Bytes(1, &temp2); - type0_ext2.Service_ref = (temp1 << 8) | temp2; - type0_ext2.Sid = (type0_ext2.Country_id << 12) - | type0_ext2.Service_ref; - } - - Get_Bits(1, &type0_ext2.Local_flag); - Get_Bits(3, &type0_ext2.CAID); - Get_Bits(4, &type0_ext2.Num_ser_comp); - - for (cnt = 0; cnt < type0_ext2.Num_ser_comp; cnt++) { - Get_Bits(2, &type0_ext2.svr_comp_des[cnt].TMID); - switch (type0_ext2.svr_comp_des[cnt].TMID) { - case MSC_STREAM_AUDIO: - Get_Bits(6, - &type0_ext2.svr_comp_des[cnt].ASCTy); - Get_Bits(6, - &type0_ext2.svr_comp_des[cnt].SubChid); - Get_Bits(1, - &type0_ext2.svr_comp_des[cnt].P_S); - Get_Bits(1, - &type0_ext2.svr_comp_des[cnt].CA_flag); - break; - case MSC_STREAM_DATA: - Get_Bits(6, - &type0_ext2.svr_comp_des[cnt].DSCTy); - Get_Bits(6, - &type0_ext2.svr_comp_des[cnt].SubChid); - Get_Bits(1, - &type0_ext2.svr_comp_des[cnt].P_S); - Get_Bits(1, - &type0_ext2.svr_comp_des[cnt].CA_flag); - break; - case FIDC: - Get_Bits(6, - &type0_ext2.svr_comp_des[cnt].DSCTy); - Get_Bits(6, - &type0_ext2.svr_comp_des[cnt].FIDCid); - Get_Bits(1, - &type0_ext2.svr_comp_des[cnt].P_S); - Get_Bits(1, - &type0_ext2.svr_comp_des[cnt].CA_flag); - break; - case MSC_PACKET_DATA: - Get_Bits(6, &temp1); - Get_Bits(6, &temp2); - type0_ext2.svr_comp_des[cnt].SCid = (temp1 << 6) - |temp2; - Get_Bits(1, &type0_ext2.svr_comp_des[cnt].P_S); - Get_Bits(1, - &type0_ext2.svr_comp_des[cnt].CA_flag); - break; - } - } - - if (fic_cmd) { - if (C_N) { - update_flag = 1; - for (cnt = 0 - ; cnt < NEXT_ENS_DESC.svr_num - ; cnt++) { - /*Old SId & New SId matching */ - if (NEXT_ENS_DESC.svr_desc[cnt].Sid - == type0_ext2.Sid) { - update_flag = 0; - break; - } - } - - if (update_flag) { - update_next_ens_desc_type0_ext2(&NEXT_ENS_DESC, - &type0_ext2, P_D); - } - } else { - update_flag = 1; - for (cnt = 0; cnt < ENS_DESC.svr_num; cnt++) { - /*Old SId & New SId matching */ - if (ENS_DESC.svr_desc[cnt].Sid - == type0_ext2.Sid) { - update_flag = 0; - break; - } - } - - if (update_flag) { - update_current_ens_desc_type0_ext2(&ENS_DESC, - &type0_ext2, P_D); - } - } - } -} - -return RTV_OK; -} - - -static INLINE void update_ens_desc_type0_ext3( - struct ENSEMBLE_DESC *next, - struct ENSEMBLE_DESC *cur, - struct FIG_TYPE0_Ext3 *type0_ext3, - U8 C_N) -{ - UINT k = 0; - - if (C_N) { - for (k = 0; k < next->svr_comp_num; k++) { - if ((next->svr_comp[k].TMID == MSC_PACKET_DATA) && - (next->svr_comp[k].SCid == type0_ext3->SCid)) { - next->svr_comp[k].SubChid - = type0_ext3->SubChid; - next->svr_comp[k].Packet_add - = type0_ext3->Packet_add; - next->svr_comp[k].DSCTy - = type0_ext3->DSCTy; - next->svr_comp[k].DG_flag - = type0_ext3->DG_flag; - - if (type0_ext3->CA_Org_flag) - next->svr_comp[k].CA_Org - = type0_ext3->CA_Org; - } - } - } else { - for (k = 0; k < cur->svr_comp_num; k++) { - if ((cur->svr_comp[k].TMID == MSC_PACKET_DATA) && - (cur->svr_comp[k].SCid == type0_ext3->SCid)) { - cur->svr_comp[k].SubChid - = type0_ext3->SubChid; - cur->svr_comp[k].Packet_add - = type0_ext3->Packet_add; - - cur->svr_comp[k].DSCTy - = type0_ext3->DSCTy; - cur->svr_comp[k].DG_flag - = type0_ext3->DG_flag; - - if (type0_ext3->CA_Org_flag) - cur->svr_comp[k].CA_Org - = type0_ext3->CA_Org; - } - } - } -} - -/* Service component in packet mode with or without Conditional Access */ -S32 Get_FIG0_EXT3(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2; - - struct FIG_TYPE0_Ext3 type0_ext3; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bytes(1, &temp1); - Get_Bits(4, &temp2); - type0_ext3.SCid = (temp1 << 4) | temp2; - - Get_Bits(3, &temp1); - Get_Bits(1, &type0_ext3.CA_Org_flag); - Get_Bits(1, &type0_ext3.DG_flag); - Get_Bits(1, &temp2); - Get_Bits(6, &type0_ext3.DSCTy); - Get_Bits(6, &type0_ext3.SubChid); - - Get_Bits(2, &temp1); - Get_Bytes(1, &temp2); - type0_ext3.Packet_add = (temp1 << 8) | temp2; - - if (type0_ext3.CA_Org_flag) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext3.CA_Org = (temp1 << 8) | temp2; - } - - if (fic_cmd) { - update_ens_desc_type0_ext3(&NEXT_ENS_DESC, - &ENS_DESC, &type0_ext3, - C_N); - } - } - - return RTV_OK; -} - - -static INLINE void update_ens_desc_type0_ext4( - struct ENSEMBLE_DESC *next, - struct ENSEMBLE_DESC *cur, - struct FIG_TYPE0_Ext4 *type0_ext4, - U8 C_N) -{ - UINT k = 0; - - if (C_N) { - for (k = 0; k < next->svr_comp_num; k++) { - if (type0_ext4->M_F) { - if ((next->svr_comp[k].FIDCid - == type0_ext4->FIDCid)) - next->svr_comp[k].CA_Org - = type0_ext4->CA_Org; - } else { - if ((next->svr_comp[k].SubChid - == type0_ext4->SubChid)) - next->svr_comp[k].CA_Org - = type0_ext4->CA_Org; - } - } - } else { - for (k = 0; k < cur->svr_comp_num; k++) { - if (type0_ext4->M_F) { - if ((cur->svr_comp[k].FIDCid - == type0_ext4->FIDCid)) - cur->svr_comp[k].CA_Org - = type0_ext4->CA_Org; - } else { - if ((cur->svr_comp[k].SubChid - == type0_ext4->SubChid)) - cur->svr_comp[k].CA_Org - = type0_ext4->CA_Org; - } - } - } - -} - - -/* Service component with Conditional Access in stream mode or FIC */ -S32 Get_FIG0_EXT4(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2; - - struct FIG_TYPE0_Ext4 type0_ext4; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(1, &temp1); - Get_Bits(1, &type0_ext4.M_F); - - if (type0_ext4.M_F) - Get_Bits(6, &type0_ext4.FIDCid); - else - Get_Bits(6, &type0_ext4.SubChid); - - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext4.CA_Org = (temp1 << 8) | temp2; - - if (fic_cmd) { - update_ens_desc_type0_ext4(&NEXT_ENS_DESC, - &ENS_DESC, - &type0_ext4, - C_N); - } - } - - return RTV_OK; -} - -static INLINE void update_current_ens_desc_type0_ext5( - struct ENSEMBLE_DESC *cur, - struct FIG_TYPE0_Ext5 *type0_ext5) -{ - UINT k; - - for (k = 0; k < cur->svr_comp_num; k++) { - if (type0_ext5->L_S_flag) { - if (cur->svr_comp[k].SCid == type0_ext5->SCid) - cur->svr_comp[k].language - = type0_ext5->Language; - } else { - if (type0_ext5->MSC_FIC_flag) { - if (cur->svr_comp[k].FIDCid - == type0_ext5->FIDCid) - cur->svr_comp[k].language - = type0_ext5->Language; - } else { - if (cur->svr_comp[k].SubChid - == type0_ext5->SubChid) - cur->svr_comp[k].language - = type0_ext5->Language; - } - } - } -} - -/* Service Component Language */ -S32 Get_FIG0_EXT5(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2, temp3; - - struct FIG_TYPE0_Ext5 type0_ext5; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(1, &type0_ext5.L_S_flag); - if (type0_ext5.L_S_flag) { - Get_Bits(3, &temp1); - Get_Bits(4, &temp2); - Get_Bytes(1, &temp3); - type0_ext5.SCid = (temp2 << 8) | temp3; - } else { - Get_Bits(1, &type0_ext5.MSC_FIC_flag); - if (type0_ext5.MSC_FIC_flag) - Get_Bits(6, &type0_ext5.FIDCid); - else - Get_Bits(6, &type0_ext5.SubChid); - - } - Get_Bytes(1, &type0_ext5.Language); - - if (fic_cmd) { - update_current_ens_desc_type0_ext5(&ENS_DESC, - &type0_ext5); - } - } - - return RTV_OK; -} - -/* Service Linking Information */ -S32 Get_FIG0_EXT6(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2, temp3, temp4; - U8 k; - - struct FIG_TYPE0_Ext6 type0_ext6; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(1, &type0_ext6.id_list_flag); - Get_Bits(1, &type0_ext6.LA); - Get_Bits(1, &type0_ext6.S_H); - Get_Bits(1, &type0_ext6.ILS); - Get_Bits(4, &temp1); - Get_Bytes(1, &temp2); - type0_ext6.LSN = (temp1 << 8) | temp2; - - if (type0_ext6.id_list_flag) { - if (P_D) { - Get_Bits(4, &temp1); - Get_Bits(4, &type0_ext6.Num_ids); - - for (k = 0; k < type0_ext6.Num_ids; k++) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - Get_Bytes(1, &temp3); - Get_Bytes(1, &temp4); - type0_ext6.Sid[k] = (temp1 << 24) - | (temp2 << 16) | (temp3 << 8) - | temp4; - } - } else { - Get_Bits(1, &temp1); - Get_Bits(2, &type0_ext6.idLQ); - Get_Bits(1, &type0_ext6.Shd); - Get_Bits(4, &type0_ext6.Num_ids); - - for (k = 0; k < type0_ext6.Num_ids; k++) { - if (type0_ext6.ILS) - Get_Bytes(1, - &type0_ext6.ECC[k]); - - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext6.id[k] = (temp1 << 8) | temp2; - } - } - } - - if (fic_cmd) { - /* Not yet implementation - * - * */ - } - } - - return RTV_OK; -} - -S32 Get_FIG0_EXT7(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} - - -static INLINE void update_ens_desc_type0_ext8( - struct ENSEMBLE_DESC *next, - struct ENSEMBLE_DESC *cur, - struct FIG_TYPE0_Ext8 *type0_ext8, - U8 C_N) -{ -UINT k; - -if (C_N) { - for (k = 0; k < next->svr_comp_num; k++) { - if (type0_ext8->L_S_flag) { - if (next->svr_comp[k].SCid - == type0_ext8->SCid) { - if (next->svr_comp[k].Sid - == type0_ext8->Sid) - next->svr_comp[k].SCidS - = type0_ext8->SCidS; - } - } else { - if (type0_ext8->MSC_FIC_flag) { - if (next->svr_comp[k].FIDCid - == type0_ext8->FIDCid) { - if (next->svr_comp[k].Sid - == type0_ext8->Sid) - next->svr_comp[k].SCidS - = type0_ext8->SCidS; - } - } else { - if (next->svr_comp[k].SubChid - == type0_ext8->SubChid) { - if (next->svr_comp[k].Sid - == type0_ext8->Sid) - next->svr_comp[k].SCidS - = type0_ext8->SCidS; - } - } - } - } -} else { - for (k = 0; k < cur->svr_comp_num; k++) { - if (type0_ext8->L_S_flag) { - if (cur->svr_comp[k].SCid - == type0_ext8->SCid) { - if (cur->svr_comp[k].Sid - == type0_ext8->Sid) - cur->svr_comp[k].SCidS - = type0_ext8->SCidS; - } - } else { - if (type0_ext8->MSC_FIC_flag) { - if (cur->svr_comp[k].FIDCid - == type0_ext8->FIDCid) { - if (cur->svr_comp[k].Sid - == type0_ext8->Sid) - cur->svr_comp[k].SCidS - = type0_ext8->SCidS; - } - } else { - if (cur->svr_comp[k].SubChid - == type0_ext8->SubChid) { - if (cur->svr_comp[k].Sid - == type0_ext8->Sid) - cur->svr_comp[k].SCidS - = type0_ext8->SCidS; - } - } - } - } -} - -} - - - -/* Service component global definition*/ -S32 Get_FIG0_EXT8(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2, temp3, temp4; - - struct FIG_TYPE0_Ext8 type0_ext8; - - while (fig_data.byte_cnt < fig_data.length) { - if (P_D) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - Get_Bytes(1, &temp3); - Get_Bytes(1, &temp4); - type0_ext8.Sid = (temp1 << 24) - | (temp2 << 16) - | (temp3 << 8) - | temp4; - } else { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext8.Sid = (temp1 << 8) | temp2; - } - - Get_Bits(1, &type0_ext8.Ext_flag); - Get_Bits(3, &temp1); - Get_Bits(4, &type0_ext8.SCidS); - Get_Bits(1, &type0_ext8.L_S_flag); - - if (type0_ext8.L_S_flag) { - Get_Bits(3, &temp1); - Get_Bits(4, &temp2); - Get_Bytes(1, &temp3); - type0_ext8.SCid = (temp2 << 8) | temp3; - } else { - Get_Bits(1, &type0_ext8.MSC_FIC_flag); - if (type0_ext8.MSC_FIC_flag) - Get_Bits(6, &type0_ext8.FIDCid); - else - Get_Bits(6, &type0_ext8.SubChid); - } - - if (type0_ext8.Ext_flag) - Get_Bytes(1, &temp1); - - if (fic_cmd) { - update_ens_desc_type0_ext8(&NEXT_ENS_DESC, - &ENS_DESC, - &type0_ext8, - C_N); - } - } - - return RTV_OK; -} - -/* Country, LTO and International Table */ -S32 Get_FIG0_EXT9(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2, temp3, temp4; - U8 k = 0; - - struct FIG_TYPE0_Ext9 type0_ext9; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(1, &type0_ext9.Ext_flag); - Get_Bits(1, &type0_ext9.LTO_unique); - Get_Bits(6, &type0_ext9.Ensemble_LTO); - - Get_Bytes(1, &type0_ext9.Ensemble_ECC); - Get_Bytes(1, &type0_ext9.Inter_Table_ID); - - if (type0_ext9.Ext_flag) { - Get_Bits(2, &type0_ext9.Num_Ser); - Get_Bits(6, &type0_ext9.LTO); - - if (P_D) { - for (k = 0; k < type0_ext9.Num_Ser; k++) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - Get_Bytes(1, &temp3); - Get_Bytes(1, &temp4); - type0_ext9.Sid[k] = (temp1 << 24) - | (temp2 << 16) - | (temp3 << 8) - | temp4; - } - } else { - if (type0_ext9.Num_Ser != 0) - Get_Bytes(1, &type0_ext9.ECC); - - for (k = 0; k < type0_ext9.Num_Ser; k++) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext9.Sid[k] - = (temp1 << 8) | temp2; - } - } - } - - if (fic_cmd) { - ENS_DESC.date_time_info.LTO = type0_ext9.Ensemble_LTO; - ENS_DESC.date_time_info.get_flag |= LTO_FLAG; - } - } - - return RTV_OK; -} - -/* Date and Time */ -S32 Get_FIG0_EXT10(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2, temp3; - - struct FIG_TYPE0_Ext10 type0_ext10; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(1, &temp1); - Get_Bits(7, &temp1); - Get_Bytes(1, &temp2); - Get_Bits(2, &temp3); - - type0_ext10.MJD = (temp1 << 10) | (temp2 << 2) | temp3; - - Get_Bits(1, &type0_ext10.LSI); - Get_Bits(1, &type0_ext10.Conf_ind); - Get_Bits(1, &type0_ext10.UTC_flag); - Get_Bits(3, &temp1); - Get_Bits(2, &temp2); - type0_ext10.Hours = (temp1 << 2) | temp2; - Get_Bits(6, &type0_ext10.Minutes); - - if (type0_ext10.UTC_flag) { - Get_Bits(6, &type0_ext10.Seconds); - Get_Bits(2, &temp1); - Get_Bytes(1, &temp2); - type0_ext10.Milliseconds = (temp1 << 8) | temp2; - } - - if (fic_cmd) { - ENS_DESC.date_time_info.MJD = type0_ext10.MJD; - ENS_DESC.date_time_info.LSI = type0_ext10.LSI; - ENS_DESC.date_time_info.conf_ind = type0_ext10.Conf_ind; - ENS_DESC.date_time_info.utc_flag = type0_ext10.UTC_flag; - ENS_DESC.date_time_info.hours = type0_ext10.Hours; - ENS_DESC.date_time_info.minutes = type0_ext10.Minutes; - if (type0_ext10.UTC_flag) { - ENS_DESC.date_time_info.seconds - = type0_ext10.Seconds; - ENS_DESC.date_time_info.milliseconds - = type0_ext10.Milliseconds; - } - - ENS_DESC.date_time_info.get_flag |= TIME_FLAG; - } - } - - return RTV_OK; -} - -/* Region Definition */ -S32 Get_FIG0_EXT11(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} -S32 Get_FIG0_EXT12(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} - - -static INLINE void update_ens_desc_type0_ext13( - struct FIG_TYPE0_Ext13 *type0_ext13) -{ -UINT i, k, j, p, cnt; - -for (i = 0; i < ENS_DESC.svr_num; i++) { - if (type0_ext13->Sid == ENS_DESC.svr_desc[i].Sid) { - for (cnt = 0; cnt < ENS_DESC.svr_desc[i].Num_ser_comp; cnt++) { - j = ENS_DESC.svr_desc[i].ser_comp_num[cnt]; - ENS_DESC.svr_comp[j].Num_User_App - = type0_ext13->Num_User_App; - for (k = 0; k < type0_ext13->Num_User_App; k++) { - ENS_DESC.svr_comp[j].User_APP_Type[k] - = type0_ext13->User_APP_Type[k]; - ENS_DESC.svr_comp[j].User_APP_data_length[k] - = type0_ext13->User_APP_data_length[k]; - for (p = 0; - p < type0_ext13->User_APP_data_length[k]; p++) - ENS_DESC.svr_comp[j].User_APP_data[p] - = type0_ext13->User_APP_data[p]; - } - } - } -} - -} - -/* User Application Information */ -S32 Get_FIG0_EXT13(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2, temp3, temp4; - UINT k, p; - - struct FIG_TYPE0_Ext13 type0_ext13; - - while (fig_data.byte_cnt < fig_data.length) { - if (P_D) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - Get_Bytes(1, &temp3); - Get_Bytes(1, &temp4); - type0_ext13.Sid = (temp1 << 24) | (temp2 << 16) - | (temp3 << 8) | temp4; - } else { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext13.Sid = (temp1 << 8) | temp2; - } - - Get_Bits(4, &type0_ext13.SCidS); - Get_Bits(4, &type0_ext13.Num_User_App); - - for (k = 0; k < type0_ext13.Num_User_App; k++) { - Get_Bytes(1, &temp1); - Get_Bits(3, &temp2); - type0_ext13.User_APP_Type[k] = (temp1 << 3) | temp2; - - Get_Bits(5, &type0_ext13.User_APP_data_length[k]); -/* - if (type0_ext13.User_APP_data_length[k]> 2) { - Get_Bits(1, &type0_ext13.CA_flag); - Get_Bits(1, &type0_ext13.CA_Org_flag); - Get_Bits(1, &temp1); - Get_Bits(5, &type0_ext13.X_PAD_App_Ty); - Get_Bits(1, &type0_ext13.DG_flag); - Get_Bits(1, &temp2); - Get_Bits(6, &type0_ext13.DSCTy); - - if (type0_ext13.CA_Org_flag) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext13.CA_Org - = (temp1 << 8) | temp2; - } - } -*/ - for (p = 0; p < type0_ext13.User_APP_data_length[k] - ; p++) - Get_Bytes(1, &type0_ext13.User_APP_data[p]); - - } - - if (fic_cmd) - update_ens_desc_type0_ext13(&type0_ext13); - } - - return RTV_OK; -} - -/* FEC sub-channel organization */ -S32 Get_FIG0_EXT14(U8 fic_cmd, U8 P_D, U8 C_N) -{ -UINT cnt; - -struct FIG_TYPE0_Ext14 type0_ext14; - -while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(6, &type0_ext14.SubChid); - Get_Bits(2, &type0_ext14.FEC_scheme); - - if (fic_cmd) { - if (C_N) { - for (cnt = 0; - cnt < NEXT_ENS_DESC.svr_comp_num; cnt++) { - if (type0_ext14.SubChid - == NEXT_ENS_DESC.svr_comp[cnt].SubChid) - NEXT_ENS_DESC.svr_comp[cnt].FEC_scheme - = type0_ext14.FEC_scheme; - } - } else { - for (cnt = 0; cnt < ENS_DESC.svr_comp_num; cnt++) { - if (type0_ext14.SubChid - == ENS_DESC.svr_comp[cnt].SubChid) - ENS_DESC.svr_comp[cnt].FEC_scheme - = type0_ext14.FEC_scheme; - } - } - } -} - -return RTV_OK; -} - -S32 Get_FIG0_EXT15(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} - -/* Program Number */ -S32 Get_FIG0_EXT16(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2; - /*U8 cnt;*/ - - struct FIG_TYPE0_Ext16 type0_ext16; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext16.Sid = (temp1 << 8) | temp2; - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext16.PNum = (temp1 << 8) | temp2; - Get_Bits(2, &temp1); - Get_Bits(4, &temp2); - Get_Bits(1, &type0_ext16.Continuation_flag); - Get_Bits(1, &type0_ext16.Update_flag); - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext16.New_Sid = (temp1 << 8) | temp2; - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext16.New_PNum = (temp1 << 8) | temp2; -#if 0 - if (fic_cmd) { - for (cnt = 0; cnt < ENS_DESC.svr_num; cnt++) { - if (type0_ext16.Sid - == ENS_DESC.svr_desc[cnt].Sid) - /* Not yet implementation */ - - } - } -#endif - } - - return RTV_OK; -} - -/* Program Type */ -S32 Get_FIG0_EXT17(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2; - U8 cnt; - - struct FIG_TYPE0_Ext17 type0_ext17; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext17.Sid = (temp1 << 8) | temp2; - - Get_Bits(1, &type0_ext17.S_D); - Get_Bits(1, &type0_ext17.P_S); - Get_Bits(1, &type0_ext17.L_flag); - Get_Bits(1, &type0_ext17.CC_flag); - Get_Bits(4, &temp1); - - if (type0_ext17.L_flag) - Get_Bytes(1, &type0_ext17.Language); - - Get_Bits(3, &temp2); - Get_Bits(5, &type0_ext17.Int_code); - - if (type0_ext17.CC_flag) { - Get_Bits(3, &temp1); - Get_Bits(5, &type0_ext17.Comp_code); - } - - if (fic_cmd) { - if (ENS_DESC.svr_num != 0) { - for (cnt = 0; cnt < ENS_DESC.svr_num; cnt++) { - if (type0_ext17.Sid - == ENS_DESC.svr_desc[cnt].Sid) - ENS_DESC.svr_desc[cnt].int_code - = type0_ext17.Int_code; - - } - } - } - } - - return RTV_OK; -} - -/* Announcement support */ -S32 Get_FIG0_EXT18(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2; - U8 i; - /*U8 cnt; */ - - struct FIG_TYPE0_Ext18 type0_ext18; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext18.Sid = (temp1 << 8) | temp2; - - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext18.ASU_flags = (temp1 << 8) | temp2; - - Get_Bits(3, &temp1); - Get_Bits(5, &type0_ext18.Num_clusters); - - - for (i = 0; i < type0_ext18.Num_clusters; i++) - Get_Bytes(1, &type0_ext18.Cluster_ID[i]); - -#if 0 - if (fic_cmd) { - for (cnt = 0; cnt < ENS_DESC.svr_num; cnt++) { - if (type0_ext18.Sid - == ENS_DESC.svr_desc[cnt].Sid) - /* Not yet implementation */ - } - } -#endif - } - - return RTV_OK; -} - -/* Announcement switching */ -S32 Get_FIG0_EXT19(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2; - - struct FIG_TYPE0_Ext19 type0_ext19; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bytes(1, &type0_ext19.Cluster_ID); - - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext19.ASW_flags = (temp1 << 8) | temp2; - - Get_Bits(1, &type0_ext19.New_flag); - Get_Bits(1, &type0_ext19.Region_flag); - Get_Bits(6, &type0_ext19.SubChid); - - if (type0_ext19.Region_flag) { - Get_Bits(2, &temp1); - Get_Bits(6, &type0_ext19.Regionid_Lower_Part); - } -#if 0 - if (fic_cmd) - /* Not yet implementation */ -#endif - } - - return RTV_OK; -} - -S32 Get_FIG0_EXT20(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} -/* Frequency Information */ -S32 Get_FIG0_EXT21(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} -/* Transmitter Identification Information (TII) database */ -S32 Get_FIG0_EXT22(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2; - U8 i; - - struct FIG_TYPE0_Ext22 type0_ext22; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(1, &type0_ext22.M_S); - if (type0_ext22.M_S) { - Get_Bits(7, &type0_ext22.Mainid); - Get_Bits(5, &temp1); - Get_Bits(3, &type0_ext22.Num_Subid_fields); - - for (i = 0; i < type0_ext22.Num_Subid_fields; i++) { - Get_Bits(5, &type0_ext22.Subid[i]); - Get_Bits(3, &temp1); - Get_Bytes(1, &temp2); - type0_ext22.TD[i] = (temp1 << 8) | temp2; - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext22.Latitude_offset[i] - = (temp1 << 8) | temp2; - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext22.Longitude_offset[i] - = (temp1 << 8) | temp2; - } - } else { - Get_Bits(7, &type0_ext22.Mainid); - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext22.Latitude_coarse = (temp1 << 8) | temp2; - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext22.Longitude_coarse = (temp1 << 8) | temp2; - Get_Bits(4, &type0_ext22.Latitude_fine); - Get_Bits(4, &type0_ext22.Longitude_fine); - } -#if 0 - if (fic_cmd) - /* Not yet implementation */ -#endif - } - - return RTV_OK; -} -S32 Get_FIG0_EXT23(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} - -/* Other Ensemble Service */ -S32 Get_FIG0_EXT24(U8 fic_cmd, U8 P_D, U8 C_N) -{ - U8 temp1, temp2, temp3, temp4; - U8 i; - /* U8 cnt;*/ - - struct FIG_TYPE0_Ext24 type0_ext24; - - while (fig_data.byte_cnt < fig_data.length) { - if (P_D) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - Get_Bytes(1, &temp3); - Get_Bytes(1, &temp4); - type0_ext24.Sid - = (temp1 << 24) - | (temp2 << 16) | (temp3 << 8) | temp4; - } else { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext24.Sid = (temp1 << 8) | temp2; - } - - Get_Bits(1, &temp1); - Get_Bits(3, &type0_ext24.CAid); - Get_Bits(4, &type0_ext24.Number_Eids); - - for (i = 0; i < type0_ext24.Number_Eids; i++) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - type0_ext24.Eid[i] = (temp1 << 8) | temp2; - } -#if 0 - if (fic_cmd) { - for (cnt = 0; cnt < ENS_DESC.svr_num; cnt++) { - if (type0_ext24.Sid - == ENS_DESC.svr_desc[cnt].Sid) - /* Not yet implementation*/ - - } - } -#endif - } - - return RTV_OK; -} - -/* Other Ensemble Announcement support */ -S32 Get_FIG0_EXT25(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} -/* Other Ensemble Announcement switching */ -S32 Get_FIG0_EXT26(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} -/* FM Announcement support */ -S32 Get_FIG0_EXT27(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} -/* FM Announcement switching */ -S32 Get_FIG0_EXT28(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} -S32 Get_FIG0_EXT29(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} -S32 Get_FIG0_EXT30(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} -/* FIC re-direction */ -S32 Get_FIG0_EXT31(U8 fic_cmd, U8 P_D, U8 C_N) -{ - return RTV_OK; -} - - -/* FIG TYPE 1 Extension Function */ -/* Ensemble Label */ -S32 Get_FIG1_EXT0(U8 fic_cmd, U8 Char_Set) -{ - U16 Eid; - U8 label[17]; - S8 i = 0; - U8 temp1, temp2; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - Eid = (temp1 << 8) | temp2; - - if (fic_cmd) { - Get_Bytes(16, label); - - if (!ENS_DESC.label_flag) { - for (i = 15; i >= 0; i--) { - if (label[i] != 0x20) { - label[i+1] = '\0'; - break; - } - } - label[16] = '\0'; - - ENS_DESC.charset = Char_Set; - memcpy(ENS_DESC.Label, label, 17); - ENS_DESC.label_flag = 1; - } - } - } - - return RTV_OK; -} - -/* Program Service Label */ -S32 Get_FIG1_EXT1(U8 fic_cmd, U8 Char_Set) -{ -U32 sid; -U8 label[17]; -U8 cnt; -S8 i; -U8 temp1, temp2; - -while (fig_data.byte_cnt < fig_data.length) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - sid = (temp1 << 8) | temp2; - - if (fic_cmd) { - Get_Bytes(16, label); - - for (cnt = 0; cnt < ENS_DESC.svr_num; cnt++) { - if (sid == ENS_DESC.svr_desc[cnt].Sid) { - if (!ENS_DESC.svr_desc[cnt].label_flag) { - for (i = 15; i >= 0; i--) { - if (label[i] != 0x20) { - label[i+1] = '\0'; - break; - } - } - label[16] = '\0'; - - ENS_DESC.svr_desc[cnt].charset - = Char_Set; - memcpy(ENS_DESC.svr_desc[cnt].Label, - label, 17); - ENS_DESC.svr_desc[cnt].label_flag = 1; - ENS_DESC.label_num++; - } - } - } - } -} - -return RTV_OK; -} - -S32 Get_FIG1_EXT2(U8 fic_cmd, U8 Char_Set) -{ - return RTV_OK; -} - -/* Region Label */ -S32 Get_FIG1_EXT3(U8 fic_cmd, U8 Char_Set) -{ - U8 temp1; - U8 RegionId_Lower_part; - U8 label[17]; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(2, &temp1); - Get_Bits(6, &RegionId_Lower_part); - - if (fic_cmd) - Get_Bytes(16, label); - } - - return RTV_OK; -} - -/* Service Component Label */ -S32 Get_FIG1_EXT4(U8 fic_cmd, U8 Char_Set) -{ - U8 P_D; - U8 SCidS; - U32 sid; - U8 label[17]; - S8 i = 0, k = 0; - U8 temp1, temp2, temp3, temp4; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(1, &P_D); - Get_Bits(3, &temp1); - Get_Bits(4, &SCidS); - - if (P_D) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - Get_Bytes(1, &temp3); - Get_Bytes(1, &temp4); - sid = (temp1 << 24) - | (temp2 << 16) | (temp3 << 8) | temp4; - } else { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - sid = (temp1 << 8) | temp2; - } - - if (fic_cmd) { - Get_Bytes(16, label); - - for (k = 0; k < ENS_DESC.svr_comp_num; k++) { - if ((ENS_DESC.svr_comp[k].Sid == sid) - && (ENS_DESC.svr_comp[k].SCidS - == SCidS)) { - for (i = 15; i >= 0; i--) { - if (label[i] != 0x20) { - label[i+1] = '\0'; - break; - } - } - label[16] = '\0'; - - ENS_DESC.svr_comp[k].charset - = Char_Set; - memcpy(ENS_DESC.svr_comp[k].Label, - label, 17); - break; - } - } - } - } - - return RTV_OK; -} - -/* Data Service Label */ -S32 Get_FIG1_EXT5(U8 fic_cmd, U8 Char_Set) -{ -U32 sid; -U8 label[17]; -U8 cnt; -S8 i; -U8 temp1, temp2, temp3, temp4; - -while (fig_data.byte_cnt < fig_data.length) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - Get_Bytes(1, &temp3); - Get_Bytes(1, &temp4); - sid = (temp1 << 24) | (temp2 << 16) | (temp3 << 8) | temp4; - - if (fic_cmd) { - Get_Bytes(16, label); - - for (cnt = 0; cnt < ENS_DESC.svr_num; cnt++) { - if (sid == ENS_DESC.svr_desc[cnt].Sid) { - if (!ENS_DESC.svr_desc[cnt].label_flag) { - for (i = 15; i >= 0; i--) { - if (label[i] != 0x20) { - label[i+1] = '\0'; - break; - } - } - label[16] = '\0'; - - ENS_DESC.svr_desc[cnt].charset - = Char_Set; - memcpy(ENS_DESC.svr_desc[cnt].Label, - label, 17); - ENS_DESC.svr_desc[cnt].label_flag = 1; - ENS_DESC.label_num++; - } - } - } - } -} - -return RTV_OK; -} - -/* X-PAD user application label */ -S32 Get_FIG1_EXT6(U8 fic_cmd, U8 Char_Set) -{ - U8 P_D; - U8 SCidS; - U32 sid; - U8 X_PAD_app_type; - U8 label[17]; - U8 temp1, temp2, temp3, temp4; - - while (fig_data.byte_cnt < fig_data.length) { - Get_Bits(1, &P_D); - Get_Bits(3, &temp1); - Get_Bits(4, &SCidS); - - if (P_D) { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - Get_Bytes(1, &temp3); - Get_Bytes(1, &temp4); - sid = (temp1 << 24) - | (temp2 << 16) | (temp3 << 8) | temp4; - } else { - Get_Bytes(1, &temp1); - Get_Bytes(1, &temp2); - sid = (temp1 << 8) | temp2; - } - - Get_Bits(2, &temp1); - Get_Bits(1, &temp2); - Get_Bits(5, &X_PAD_app_type); - - if (fic_cmd) - Get_Bytes(16, label); - } - - return RTV_OK; -} - -S32 Get_FIG1_EXT7(U8 fic_cmd, U8 Char_Set) -{ - return RTV_OK; -} - - -/* FIG TYPE 2 Extension Function */ -/* Ensemble Label */ -S32 Get_FIG2_EXT0(U8 fic_cmd, U8 Seg_Index) -{ - return RTV_OK; -} - -/* Program Service Label */ -S32 Get_FIG2_EXT1(U8 fic_cmd, U8 Seg_Index) -{ - return RTV_OK; -} - -S32 Get_FIG2_EXT2(U8 fic_cmd, U8 Seg_Index) -{ - return RTV_OK; -} - -/* Region Label */ -S32 Get_FIG2_EXT3(U8 fic_cmd, U8 Seg_Index) -{ - return RTV_OK; -} - -/* Service Component Label */ -S32 Get_FIG2_EXT4(U8 fic_cmd, U8 Seg_Index) -{ - return RTV_OK; -} - -/* Data Service Label */ -S32 Get_FIG2_EXT5(U8 fic_cmd, U8 Seg_Index) -{ - return RTV_OK; -} - -/* X-PAD user application label */ -S32 Get_FIG2_EXT6(U8 fic_cmd, U8 Seg_Index) -{ - return RTV_OK; -} - -/* Character Definition */ -S32 Get_FIG2_EXT7(U8 fic_cmd, U8 Seg_Index) -{ - return RTV_OK; -} - - -/* FIG TYPE 5 Extension Function */ -/* Paging */ -S32 Get_FIG5_EXT0(U8 D1, U8 D2, U8 fic_cmd, U8 TCid) -{ - U8 cnt = 0; - U8 FIDC_ID; - - FIDC_ID = (TCid << 3) | 0x00; - - if (fic_cmd) { - for (cnt = 0; cnt < ENS_DESC.svr_comp_num; cnt++) { - if (FIDC_ID == ENS_DESC.svr_comp[cnt].FIDCid) { - ENS_DESC.svr_comp[cnt].TCid = TCid; - ENS_DESC.svr_comp[cnt].Ext = 0; - } - } - } - - return RTV_OK; -} - -/* Traffic Message Channel (TMC) */ -S32 Get_FIG5_EXT1(U8 D1, U8 D2, U8 fic_cmd, U8 TCid) -{ - U8 cnt = 0; - U8 FIDC_ID; - - FIDC_ID = (TCid << 3) | 0x01; - - if (fic_cmd) { - for (cnt = 0; cnt < ENS_DESC.svr_comp_num; cnt++) { - if (FIDC_ID == ENS_DESC.svr_comp[cnt].FIDCid) { - ENS_DESC.svr_comp[cnt].TCid = TCid; - ENS_DESC.svr_comp[cnt].Ext = 1; - } - } - } - - return RTV_OK; -} - -/* Emergency Warning System (EWS) */ -S32 Get_FIG5_EXT2(U8 D1, U8 D2, U8 fic_cmd, U8 TCid) -{ - U8 cnt = 0; - U8 FIDC_ID; - - FIDC_ID = (TCid << 3) | 0x02; - - if (fic_cmd) { - for (cnt = 0; cnt < ENS_DESC.svr_comp_num; cnt++) { - if (FIDC_ID == ENS_DESC.svr_comp[cnt].FIDCid) { - ENS_DESC.svr_comp[cnt].TCid = TCid; - ENS_DESC.svr_comp[cnt].Ext = 2; - } - } - } - - return RTV_OK; -} - - -U8 GET_SUBCH_INFO(struct FIG_TYPE0_Ext1 *type0_ext1, - S32 *BIT_RATE, S32 *SUB_CH_Size, S32 *P_L) -{ -/*Indicate the option used for the long form coding(Equal Error Protection)*/ - if (type0_ext1->S_L_form) { - *SUB_CH_Size = type0_ext1->Sub_ch_size; - *P_L = ((type0_ext1->S_L_form<<7) - | (type0_ext1->Option<<6) - | type0_ext1->Protection_Level); - - if (type0_ext1->Option == 0x1) { - switch (type0_ext1->Protection_Level) { - case 0: - *BIT_RATE = (type0_ext1->Sub_ch_size)*32/27; - break; - case 1: - *BIT_RATE = (type0_ext1->Sub_ch_size)*32/21; - break; - case 2: - *BIT_RATE = (type0_ext1->Sub_ch_size)*32/18; - break; - case 3: - *BIT_RATE = (type0_ext1->Sub_ch_size)*32/15; - break; - } - } else if (type0_ext1->Option == 0x0) { - switch (type0_ext1->Protection_Level) { - case 0: - *BIT_RATE = (type0_ext1->Sub_ch_size)*2/3; - break; - case 1: - *BIT_RATE = (type0_ext1->Sub_ch_size); - break; - case 2: - *BIT_RATE = (type0_ext1->Sub_ch_size)*4/3; - break; - case 3: - *BIT_RATE = (type0_ext1->Sub_ch_size)*2; - break; - } - } - } else { - *SUB_CH_Size = SUBCH_UEP_TABLE[type0_ext1->Table_index][0]; - *P_L = SUBCH_UEP_TABLE[type0_ext1->Table_index][1]; - *BIT_RATE = SUBCH_UEP_TABLE[type0_ext1->Table_index][2]; - } - - return RTV_OK; -} - -U8 GET_DATE_TIME(struct DATE_TIME_INFO *time_desc) -{ - U16 MJD_Ref[2] = {2000, 51544}; /*2000.01.01 reference day*/ - U8 month0_table[12] = {31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - U8 month1_table[12] = {31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31}; - U16 UTC_hours, MJD_temp, day_temp; - U8 increase_year, leap_year_num; - U8 normal_year_num, offset_flag, offset_value; - U16 MJDRef_year; - U16 MJDRef_month; - U16 MJDRef_day = 0; - U8 week; - U8 k = 0, i = 0; - -/* sense of the Local Time Offset (0: positive offset 1: negative offset)*/ - offset_flag = (ENS_DESC.date_time_info.LTO & 0x20) >> 5; - - /* Local time offset value (0 ~ 23)*/ - offset_value = (ENS_DESC.date_time_info.LTO & 0x1f) / 2; - - /* UTC hours */ - UTC_hours = ENS_DESC.date_time_info.hours; - - if (offset_flag) { - if (UTC_hours < offset_value) - time_desc->time_flag = 0; - else - time_desc->time_flag = 1; - } else { - if (((23-offset_value) < UTC_hours) && (UTC_hours < 24)) - time_desc->time_flag = 0; - else - time_desc->time_flag = 1; - } - - /* current MJD - ref MJD */ - MJD_temp = ENS_DESC.date_time_info.MJD - MJD_Ref[1]; - increase_year = MJD_temp / 365; /* 2000 + x year */ - - /* detection 2000 + x year */ - time_desc->years = MJD_Ref[0] + increase_year; - leap_year_num = (increase_year - 1) / 4; /* 366 year number */ - normal_year_num = (increase_year - 1) % 4;/* 365 year number */ - - /* first MJD for current year */ - MJDRef_year - = MJD_Ref[1] + 366 * (leap_year_num + 1) - + 365 * ((3 * leap_year_num) + normal_year_num); - - - if (time_desc->time_flag) - MJDRef_month = ENS_DESC.date_time_info.MJD - MJDRef_year; - else { - if (offset_flag) - MJDRef_month - = ENS_DESC.date_time_info.MJD - - MJDRef_year - 1; - else - MJDRef_month = ENS_DESC.date_time_info.MJD - - MJDRef_year + 1; - } - - for (k = 0; k < 12; k++) { - day_temp = MJDRef_month - MJDRef_day; - - if (normal_year_num == 3) { - if (day_temp >= month1_table[k]) - MJDRef_day += month1_table[k]; - else { - /* detection month */ - time_desc->months_dec = k + 1; - strcpy((char *)time_desc->months_ste, - MONTH_TABLE[k]); - - /* detection day */ - time_desc->days = day_temp + 1; - break; - } - } else { - if (day_temp >= month0_table[k]) - MJDRef_day += month0_table[k]; - else { - /* detection month */ - time_desc->months_dec = k + 1; - strcpy((char *)time_desc->months_ste, - MONTH_TABLE[k]); - /* detection day */ - time_desc->days = day_temp + 1; - break; - } - } - } - - week = MJD_temp % 7; - for (i = 0; i < 7; i++) { - if (i == week) { - if (time_desc->time_flag) { - strcpy((char *)time_desc->weeks, - WEEK_TABLE[i]); - } else { - if (offset_flag) - strcpy((char *)time_desc->weeks, - WEEK_TABLE[i-1]); - else - strcpy((char *)time_desc->weeks, - WEEK_TABLE[i+1]); - } - break; - } - } - - if (ENS_DESC.date_time_info.utc_flag) { - if (time_desc->time_flag) { - time_desc->hours - = ENS_DESC.date_time_info.hours + offset_value; - if (time_desc->hours < 12) - time_desc->apm_flag = 0; - else if (time_desc->hours == 12) - time_desc->apm_flag = 1; - else { - time_desc->hours = time_desc->hours - 12; - time_desc->apm_flag = 1; - } - } else { - if (offset_flag) { - time_desc->hours - = (ENS_DESC.date_time_info.hours + 12) - - offset_value; - time_desc->apm_flag = 1; - } else { - time_desc->hours - = (ENS_DESC.date_time_info.hours - + offset_value) - 24; - time_desc->apm_flag = 0; - } - } - - time_desc->minutes = ENS_DESC.date_time_info.minutes; - time_desc->seconds = ENS_DESC.date_time_info.seconds; - time_desc->milliseconds = ENS_DESC.date_time_info.milliseconds; - } else { - if (time_desc->time_flag) { - time_desc->hours - = ENS_DESC.date_time_info.hours + offset_value; - if (time_desc->hours < 12) - time_desc->apm_flag = 0; - else if (time_desc->hours == 12) - time_desc->apm_flag = 1; - else { - time_desc->hours = time_desc->hours - 12; - time_desc->apm_flag = 1; - } - } else { - if (offset_flag) { - time_desc->hours - = (ENS_DESC.date_time_info.hours + 12) - - offset_value; - time_desc->apm_flag = 1; - } else { - time_desc->hours - = (ENS_DESC.date_time_info.hours - + offset_value) - 24; - time_desc->apm_flag = 0; - } - } - - time_desc->minutes = ENS_DESC.date_time_info.minutes; - } - - return RTV_OK; -} - - -char *PROGRAM_TYPE_CODE16[32] = { - "None", "News", "Current_Affairs", "Information", "Sport", - "Education", "Drama", "Arts", "Science", "Talk", - "Pop_Music", "Rock_Music", "Easy_Listening", - "Light_Classical", "Classical_Music", - "Other_Music", "Weather", "Finance", "Children's", "Factual", - "Religion", "Phone_In", "Travel", "Leisure", "Jazz_and_Blues", - "Country_Music", "National_Music", - "Oldies_Music", "Folk_Music", "Documentary" -}; - -char *PROGRAM_TYPE_CODE8[32] = { - "None", "News", "Affairs", "Info", "Sport", - "Educate", "Drama", "Arts", "Science", "Talk", - "Pop", "Rock", "Easy", "Classics", "Classics", - "Other_M", "Weather", "Finance", "Children", "Factual", - "Religion", "Phone_In", "Travel", "Leisure", "Jazz", - "Country", "Nation_M", "Oldies", "Folk", "Document" -}; - -char *USER_APP_TYPE_CODE[11] = { - "Reserved", "Not used", "MOT Slideshow", "MOT BWS", "TPEG", - "DGPS", "TMC", "EPG", "DAB Java", "DMB", "Reserved" -}; - -char *FIDC_EXT_CODE[3] = { - "Paging", "Traffic Message(TMC)", "Emergency Warning(EWS)" -}; - -char *ASCTy[3] = { - "Foreground Sound", "Background Sound", "Multi-CH Audio" -}; - -char *DSCTy[11] = { - "Unspecified Data", "Traffic Message(TMC)", "Emergency Warning(EWS)", - "ITTS", "Paging", "TDC", - "KDMB", "Embedded IP", "MOT", "Proprietary Service", "Reserved" -}; - -char *ANNOUNCEMENT_TYPE_CODE[12] = { - "Alarm", "Road Traffic flash", "Transport flash", "Warning/Service", - "News flash", "Area weather flash", - "Event announcement", "Special event", "Programme information", - "Sport report", "Financial report", - "Reserved for future definition" -}; - -int SUBCH_SIZE_TABLE[64] = { 32, 32, 32, 32, 32, 48, 48, 48, 48, 48, - 56, 56, 56, 56, 64, 64, 64, 64, 64, 80, - 80, 80, 80, 80, 96, 96, 96, 96, 96, 112, - 112, 112, 112, 128, 128, 128, 128, 128, 160, 160, - 160, 160, 160, 192, 192, 192, 192, 192, 224, 224, - 224, 224, 224, 256, 256, 256, 256, 256, 320, 320, - 320, 384, 384, 384}; - -int SUBCH_UEP_TABLE[64][3] = { - /* 0 {Sub-channel size, Protection level, Bit rate} */ - {16, 5, 32}, {21, 4, 32}, {24, 3, 32}, {29, 2, 32}, - {35, 1, 32}, {24, 5, 48}, {29, 4, 48}, {35, 3, 48}, /*4 */ - {42, 4, 48}, {52, 1, 48}, {29, 5, 56}, {35, 4, 56}, /* 8 */ - {42, 3, 56}, {52, 2, 56}, {32, 5, 64}, {42, 4, 64}, /* 12 */ - {48, 3, 64}, {58, 2, 64}, {70, 1, 64}, {40, 5, 80}, /* 16 */ - {52, 4, 80}, {58, 3, 80}, {70, 2, 80}, {84, 1, 80}, /* 20 */ - {48, 5, 96}, {58, 4, 96}, {70, 3, 96}, {84, 2, 96}, /* 24 */ - {104, 1, 96}, {58, 5, 112}, {70, 4, 112}, {84, 3, 112}, /* 28 */ - {104, 2, 112}, {64, 5, 128}, {84, 4, 128}, {96, 3, 128}, /* 32 */ - {116, 2, 128}, {140, 1, 128}, {80, 5, 160}, {104, 4, 160},/* 36 */ - {116, 3, 160}, {140, 2, 160}, {168, 1, 160}, {96, 5, 192}, /* 40 */ - {116, 4, 192}, {140, 3, 192}, {168, 2, 192}, {208, 1, 192}, /* 44 */ - {116, 5, 224}, {140, 4, 224}, {168, 3, 224}, {208, 2, 224}, /* 48 */ - {232, 1, 224}, {128, 5, 256}, {168, 4, 256}, {192, 3, 256}, /* 52 */ - {232, 2, 256}, {280, 1, 256}, {160, 5, 320}, {208, 4, 320}, /* 56 */ - {280, 2, 320}, {192, 5, 384}, {280, 3, 384}, {416, 1, 384}, /* 60 */ -}; - -char *MONTH_TABLE[12] = { - "Jan", "Feb", "Mar", "Apr", "May", "Jun", - "Jul", "Aug", "Sep", "Oct", "Nov", "Dec" -}; - -char *WEEK_TABLE[8] = { - "SAT", "SUN", "MON", "TUE", "WED", "THU", "FRI", "SAT" -}; -/* -int MJD_TABLE[][] ={ - {53370, 1, 2005}, {53735, 1, 2006}, - {54100, 1, 2007}, {54465, 1, 2008}, - {53401, 2, 2005}, {53766, 2, 2006}, - {54131, 2, 2007}, {54496, 2, 2008}, - {53429, 3, 2005}, {53794, 3, 2006}, - {54159, 3, 2007}, {54525, 3, 2008}, - {53460, 4, 2005}, {53825, 4, 2006}, - {54190, 4, 2007}, {54556, 4, 2008}, - {53490, 5, 2005}, {53855, 5, 2006}, - {54220, 5, 2007}, {54586, 5, 2008}, - {53521, 6, 2005}, {53866, 6, 2006}, - {54251, 6, 2007}, {54617, 6, 2008}, - {53551, 7, 2005}, {53916, 7, 2006}, - {54281, 7, 2007}, {54647, 7, 2008}, - {53582, 8, 2005}, {53947, 8, 2006}, - {54312, 8, 2007}, {54678, 8, 2008}, - {53613, 9, 2005}, {53978, 9, 2006}, - {54343, 9, 2007}, {54709, 9, 2008}, - {53643, 10, 2005}, {54008, 10, 2006}, - {54373, 10, 2007}, {54739, 10, 2008}, - {53674, 11, 2005}, {54039, 11, 2006}, - {54404, 11, 2007}, {54770, 11, 2008}, - {53704, 12, 2005}, {54069, 12, 2006}, - {54434, 12, 2007}, {54800, 12, 2008}, -}; -*/ - -char *EWS_PRIORITY_TABLE[4] = { - "Unknown", "º¸Åë", "±ä±Þ", "¸Å¿ì±ä±Þ" -}; - -char *EWS_REGION_FORM_TABLE[4] = { - "´ëÇѹα¹ Àü±¹", - "´ëÇѹα¹ Á¤ºÎ ÁöÁ¤", - "ÇàÀںΠÇàÁ¤µ¿ Ç¥±â", - "Rfa" -}; - -char *EWS_OFFICIAL_ORGANIZATION_TABLE[4] = { - "¼Ò¹æ¹æÀçû", "½Ã,µµ", "±º,µµ", "Rfa" -}; - -char *EWS_CATEGORY[67][3] = { - {"È£¿ì ÁÖÀǺ¸", "HRA", "Heavy Rain Watch"}, - {"È£¿ì °æº¸", "HRW", "Heavy Rain Warning"}, - {"´ë¼³ ÁÖÀǺ¸", "HSW", "Heavy Snow Watch"}, - {"´ë¼³ °æº¸", "HAS", "Heavy Snow Warning"}, - {"ÆødzÇØÀÏÁÖÀǺ¸", "SSA", "Storm Surge Watch"}, - {"ÆødzÇØÀÏ °æº¸", "SSW", "Storm Surge Warning"}, - {"Ȳ»ç °æº¸", "YSW", "Yellow Sand Warning"}, - {"ÇÑÆÄ ÁÖÀǺ¸", "CWA", "Cold Wave Watch"}, - {"ÇÑÆÄ °æº¸", "CWW", "Cold Wave Warning"}, - {"dz¶û °æº¸", "WWW", "Wind and Waves Warning"}, - {"°ÇÁ¶ °æº¸", "HAW", "Heavy Arid Warning"}, - {"»êºÒ °æº¸", "MFW", "Mountain Fire Warning"}, - {"±³Åë ÅëÁ¦", "RTW", "Regulate Traffic Warning"}, - {"±¹°¡ ºñ»ó »óȲ ¹ß»ý", - "EAN", "Emergency Action Notification(National only)"}, - {"±¹°¡ ºñ»ó »óȲ Á¾·á", - "EAT", "Emergency Action Termination(National only)"}, - {"Áß¾Ó Àç³ ¾ÈÀü ´ëÃ¥ º»ºÎ", - "NIC", "National Information Center"}, - {"Àü±¹Àû ÁÖ±â Å×½ºÆ®", "NPT", "National Periodic Test"}, - {"Àü±¹Àû ¿ùº° Àǹ« Å×½ºÆ®", "RMT", "Required Monthly Test"}, - {"Àü±¹Àû ÁÖ°£º° Àǹ« Å×½ºÆ®", "RWT", "Required Weekly Test"}, - {"Ư¼ö ¼ö½Å±â Å×½ºÆ®", "STT", "Special Terminal Test"}, - {"ÇàÁ¤ ¸Þ½ÃÁö", "ADR", "Administrative Message"}, - {"»ê»çÅ °æº¸", "AVW", "Avalanche Warning"}, - {"»ê»çÅ ÁÖÀǺ¸", "AVA", "Avalanche Watch"}, - {"Æødz¼³°æº¸", "BZW", "Blizzard Warning"}, - {"¾î¸°ÀÌ À¯±« ±ä±Þ »óȲ", - "CAE", "Child Abduction Emergency"}, - {"½Ã¹Î À§Çè »óȲ °æº¸", "CDW", "Civil Danger Warning"}, - {"½Ã¹Î ÀÀ±Þ »óȲ ¸Þ½ÃÁö", "CEM", "Civil Emergency Message"}, - {"ÇØ¾È Ä§¼ö °æº¸", "CFW", "Coastal Flood Warning"}, - {"ÇØ¾È Ä§¼ö ÁÖÀǺ¸", "CFA", "Coastal Flood Watch"}, - {"¸ð·¡ Æødz °æº¸", "DSW", "Dust Storm Warning"}, - {"ÁöÁø °æº¸", "EQW", "Earthquake Warning"}, - {"Áï½Ã ´ëÇÇ", "EVI", "Evacuation Immediate"}, - {"ÈÀç °æº¸", "FRW", "Fire Warning"}, - {"±ä±Þ È«¼ö °æº¸", "FFW", "Flash Flood Warning"}, - {"±ä±Þ È«¼ö ÁÖÀǺ¸", "FFA", "Flash Flood Watch"}, - {"±ä±Þ È«¼ö »óȲ", "FFS", "Flash Flood Statement"}, - {"È«¼ö °æº¸", "FLW", "Flood Warning"}, - {"È«¼ö ÁÖÀǺ¸", "FLA", "Flood Watch"}, - {"È«¼ö »óȲ", "FLS", "Flood Statement"}, - {"À§Çè ¹°Áú °æº¸", - "HMW", "Hazardous Materials Warning"}, - {"°Ç³ °æº¸", "HWW", "High Wind Warning"}, - {"°Ç³ ÁÖÀǺ¸", "HWA", "High Wind Watch"}, - {"ÅÂdz °æº¸", "HUW", "Hurricane Warning"}, - {"ÅÂdz ÁÖÀǺ¸", "HUA", "Hurricane Watch"}, - {"ÅÂdzÁ¤º¸", "HLS", "Hurricane Statement"}, - {"¹ýÁýÇà °æ°í", "LEW", "Law Enforcement Warning"}, - {"Áö¿ª ±ä±Þ »óȲ", "LAE", "Local Area Emergency"}, - {"Åë½Å ¸ÞÁö½Ã ¾Ë¸²", - "NMN", "Network Message Notification"}, - {"119 ÀüÈ ºÒÅë ÀÀ±Þ »óȲ", - "TOE", "119 Telephone Outage Emergency"}, - {"ÇÙ¹ßÀü¼Ò °ü·Ã °æº¸", - "NUW", "Nuclear Power Plant Warning"}, - {"½ÇÁ¦/¿¬½À °æº¸", "DMO", "Practice/Demo Warning"}, - {"¹æ»ç´É À§Çè °æº¸", - "RHW", "Radiological Hazard Warning"}, - {"³ú¿ì °æº¸", "SVR", "Severe Thunderstorm Warning"}, - {"³ú¿ì ÁÖÀǺ¸", "SVA", "Severe Thunderstorm Watch"}, - {"¾Ç±â»óÁ¤º¸", "SVS", "Severe Weather Statement"}, - {"¾ÈÀüÇÑ Àå¼Ò·Î Çdz °æº¸", - "SPW", "Shelter in Place Warning"}, - {"Ư¼ö ÇØ¾ç °æº¸", "SMW", "Special Marine Warning"}, - {"ƯÀÌ ±â»ó Á¤º¸", "SPS", "Special Weather Statement"}, - {"Åä³×À̵µ °æº¸", "TOR", "Tornado Warning"}, - {"Åä³×À̵µ ÁÖÀǺ¸", "TOA", "Tornado Watch"}, - {"¿´ë Æødz(ÅÂdz) °æº¸", "TRW", "Tropical Storm Warning"}, - {"¿´ë Æødz(ÅÂdz) ÁÖÀǺ¸", "TRA", "Tropical Storm Watch"}, - {"ÁöÁøÇØÀÏ °æº¸", "TSW", "Tsunami Warning"}, - {"ÁöÁøÇØÀÏ ÁÖÀǺ¸", "TSA", "Tsunami Watch"}, - {"È»ê °æº¸", "VOW", "Volcano Warning"}, - {"´«Æødz °æº¸", "WSW", "Winter Storm Warning"}, - {"´«Æødz ÁÖÀǺ¸", "WSA", "Winter Storm Watch"} -}; - -static const U16 crc_ccitt_tab[] = { - 0x0000, 0x1021, 0x2042, 0x3063, 0x4084, 0x50A5, 0x60C6, 0x70E7, - 0x8108, 0x9129, 0xA14A, 0xB16B, 0xC18C, 0xD1AD, 0xE1CE, 0xF1EF, - 0x1231, 0x0210, 0x3273, 0x2252, 0x52B5, 0x4294, 0x72F7, 0x62D6, - 0x9339, 0x8318, 0xB37B, 0xA35A, 0xD3BD, 0xC39C, 0xF3FF, 0xE3DE, - 0x2462, 0x3443, 0x0420, 0x1401, 0x64E6, 0x74C7, 0x44A4, 0x5485, - 0xA56A, 0xB54B, 0x8528, 0x9509, 0xE5EE, 0xF5CF, 0xC5AC, 0xD58D, - 0x3653, 0x2672, 0x1611, 0x0630, 0x76D7, 0x66F6, 0x5695, 0x46B4, - 0xB75B, 0xA77A, 0x9719, 0x8738, 0xF7DF, 0xE7FE, 0xD79D, 0xC7BC, - 0x48C4, 0x58E5, 0x6886, 0x78A7, 0x0840, 0x1861, 0x2802, 0x3823, - 0xC9CC, 0xD9ED, 0xE98E, 0xF9AF, 0x8948, 0x9969, 0xA90A, 0xB92B, - 0x5AF5, 0x4AD4, 0x7AB7, 0x6A96, 0x1A71, 0x0A50, 0x3A33, 0x2A12, - 0xDBFD, 0xCBDC, 0xFBBF, 0xEB9E, 0x9B79, 0x8B58, 0xBB3B, 0xAB1A, - 0x6CA6, 0x7C87, 0x4CE4, 0x5CC5, 0x2C22, 0x3C03, 0x0C60, 0x1C41, - 0xEDAE, 0xFD8F, 0xCDEC, 0xDDCD, 0xAD2A, 0xBD0B, 0x8D68, 0x9D49, - 0x7E97, 0x6EB6, 0x5ED5, 0x4EF4, 0x3E13, 0x2E32, 0x1E51, 0x0E70, - 0xFF9F, 0xEFBE, 0xDFDD, 0xCFFC, 0xBF1B, 0xAF3A, 0x9F59, 0x8F78, - 0x9188, 0x81A9, 0xB1CA, 0xA1EB, 0xD10C, 0xC12D, 0xF14E, 0xE16F, - 0x1080, 0x00A1, 0x30C2, 0x20E3, 0x5004, 0x4025, 0x7046, 0x6067, - 0x83B9, 0x9398, 0xA3FB, 0xB3DA, 0xC33D, 0xD31C, 0xE37F, 0xF35E, - 0x02B1, 0x1290, 0x22F3, 0x32D2, 0x4235, 0x5214, 0x6277, 0x7256, - 0xB5EA, 0xA5CB, 0x95A8, 0x8589, 0xF56E, 0xE54F, 0xD52C, 0xC50D, - 0x34E2, 0x24C3, 0x14A0, 0x0481, 0x7466, 0x6447, 0x5424, 0x4405, - 0xA7DB, 0xB7FA, 0x8799, 0x97B8, 0xE75F, 0xF77E, 0xC71D, 0xD73C, - 0x26D3, 0x36F2, 0x0691, 0x16B0, 0x6657, 0x7676, 0x4615, 0x5634, - 0xD94C, 0xC96D, 0xF90E, 0xE92F, 0x99C8, 0x89E9, 0xB98A, 0xA9AB, - 0x5844, 0x4865, 0x7806, 0x6827, 0x18C0, 0x08E1, 0x3882, 0x28A3, - 0xCB7D, 0xDB5C, 0xEB3F, 0xFB1E, 0x8BF9, 0x9BD8, 0xABBB, 0xBB9A, - 0x4A75, 0x5A54, 0x6A37, 0x7A16, 0x0AF1, 0x1AD0, 0x2AB3, 0x3A92, - 0xFD2E, 0xED0F, 0xDD6C, 0xCD4D, 0xBDAA, 0xAD8B, 0x9DE8, 0x8DC9, - 0x7C26, 0x6C07, 0x5C64, 0x4C45, 0x3CA2, 0x2C83, 0x1CE0, 0x0CC1, - 0xEF1F, 0xFF3E, 0xCF5D, 0xDF7C, 0xAF9B, 0xBFBA, 0x8FD9, 0x9FF8, - 0x6E17, 0x7E36, 0x4E55, 0x5E74, 0x2E93, 0x3EB2, 0x0ED1, 0x1EF0 -}; - -static S32 CRC_CHECK(U8 *data, U16 data_len) -{ - - U16 crc = 0xffff; - U16 crc2 = 0xffff; - U16 crc_val, i; - U8 crc_cal_data; - - for (i = 0; i < (data_len - 2); i++) { - crc_cal_data = *(data+i); - crc = (crc<<8)^crc_ccitt_tab[(crc>>8)^(crc_cal_data)++]; - } - - crc_val = *(data+i)<<8; - crc_val = crc_val | *(data+i+1); - - crc2 = (crc_val^crc2); - - if (crc == crc2) - return RTV_OK; - else - return RTV_FAIL; -} - - -/*****************************/ -/* FIC Information Variable */ -/*****************************/ -struct ENSEMBLE_DESC ENS_DESC, NEXT_ENS_DESC; -U32 FIC_CONUT; - - -static UINT fib_crc_err_cnt; -S32 FIC_Init_Dec(U8 *fic, U8 fib_num, U8 CN) -{ - U32 i; - U32 ret; - unsigned int fib_crc_pos = 0; - FIC_CONUT++; - - for (i = 0; i < fib_num; i++) { - if (CRC_CHECK(fic+fib_crc_pos, 32) != RTV_OK) { - fib_crc_pos += 32; - fib_crc_err_cnt++; - return FIC_CRC_ERR; - } - - ret = FIB_INIT_DEC(fic+fib_crc_pos); - - if (ENS_DESC.svr_num) { - if ((ENS_DESC.svr_num == ENS_DESC.label_num) - &&/* (FIC_CONUT > 5) - &&*/ (ENS_DESC.label_flag == 1)) { - FIC_CONUT = 0; - return FIC_DONE; - } - } - fib_crc_pos += 32; - } - return FIC_GOING; -} - -#ifdef USER_APPLICATION_TYPE -static UINT rtvTDMB_SetVisualRadioInfo(SubChInfoType *subChInfo) -{ - UINT i = 0, j = 0; - - subChInfo->bVisualRadio = 0; - - /* UA Type - TV, Visual Radio : 0x009 */ - for (i = 0; i < subChInfo->NumberofUserAppl; i++) { - if (subChInfo->UserApplType[i] == 0x009) { - for (j = 0; j < subChInfo->UserApplLength[i]; j++) { - if ((subChInfo->UserApplData[j][0] == 0x01) - && (subChInfo->UserApplData[j][1] - == 0x02)) { - subChInfo->bVisualRadio = 1; - return 1; - } - } - } - } - return 0; -} -#endif - - -static BOOL fic_decode_run; - - -BOOL rtvFICDEC_Decode(U32 ch_freq_khz) -{ - UINT ret; - UINT cnt = 0; - U8 int_type_val1; - U8 fic_buf[384+1]; - /*UINT crc_err_cnt = 0; */ - UINT read_cnt = 0; - unsigned long diff_jiffies = get_jiffies_64(); - unsigned long diff_jiffies_1; - - fic_decode_run = TRUE; - fib_crc_err_cnt = 0; - - FIC_CONUT = 0; - memset(&ENS_DESC, 0, sizeof(struct ENSEMBLE_DESC)); - - RTV_GUARD_LOCK; - - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(INT_E_UCLRL, 0x01); - - while (++cnt <= 408) { - if (fic_decode_run == FALSE) - break; - - int_type_val1 = RTV_REG_GET(INT_E_STATL); - - /* RTV_DBGMSG0("FIC_Check rootine!\n");*/ - if (int_type_val1 & FIC_E_INT) { - read_cnt++; - - RTV_REG_MAP_SEL(FIC_PAGE); - RTV_REG_BURST_GET(0x10, fic_buf, 384+1); - - /* FIC interrupt status clear */ - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(INT_E_UCLRL, 0x01); - - ret = FIC_Init_Dec(&fic_buf[1], 12, 0); - if (ret == FIC_DONE) { - diff_jiffies_1 = get_jiffies_64(); - RTV_DBGMSG2\ - ("[mtv] CNT: %u, FICread time ms (%u)\n", - read_cnt, - jiffies_to_msecs(diff_jiffies_1-diff_jiffies)); - - /*RTV_DBGMSG1\ - ("[mtv] FIC_Parseing DONE time ms (%u)\n\n", - jiffies_to_msecs(get_jiffies_64() - diff_jiffies_1));*/ - - RTV_GUARD_FREE; - - return TRUE; - } - /* added 2011/12/27*/ - else if (ret == FIC_CRC_ERR) { - RTV_GUARD_FREE; - return FALSE; - } - } - - RTV_DELAY_MS(12); - } - - RTV_GUARD_FREE; - - diff_jiffies_1 = get_jiffies_64(); - RTV_DBGMSG2("[mtv] CNT: %u, FIC_read time ms (%u)\n\n", - read_cnt, jiffies_to_msecs(diff_jiffies_1 - diff_jiffies)); - - - return FALSE; -} - - -void rtvFICDEC_Stop(void) -{ - rtvTDMB_CloseFIC(); - - /* Set the flag.*/ - fic_decode_run = FALSE; -} - -struct ensemble_info_type *rtvFICDEC_GetEnsembleInfo(unsigned long freq) -{ - UINT i, j; - UINT Comp_Index = 0; - UINT nSubChIdx = 0; - - struct ENSEMBLE_DESC *desc = &ENS_DESC; - - ensble.ensem_freq = freq; - ensble.ensem_id = desc->id; - - strncpy(ensble.ensem_label, desc->Label, ENSEMBLE_LABEL_MAX); - - for (i = 0; i < desc->svr_num; i++) { - for (j = 0; j < desc->svr_desc[i].Num_ser_comp; j++) { - Comp_Index = desc->svr_desc[i].ser_comp_num[j]; - switch (desc->svr_comp[Comp_Index].TMID) { - case MSC_STREAM_AUDIO: - ensble.sub_ch[nSubChIdx].sub_ch_id - = desc->svr_comp[Comp_Index].SubChid; - ensble.sub_ch[nSubChIdx].start_addr - = desc->svr_comp[Comp_Index].START_Addr; - ensble.sub_ch[nSubChIdx].tmid - = desc->svr_comp[Comp_Index].TMID; - ensble.sub_ch[nSubChIdx].svc_type - = desc->svr_comp[Comp_Index].ASCTy; - ensble.sub_ch[nSubChIdx].svc_id - = desc->svr_desc[i].Sid; - memcpy(ensble.sub_ch[nSubChIdx].svc_label, - desc->svr_desc[i].Label, SVC_LABEL_MAX); - nSubChIdx++; - break; - - case MSC_STREAM_DATA: - ensble.sub_ch[nSubChIdx].sub_ch_id - = desc->svr_comp[Comp_Index].SubChid; - ensble.sub_ch[nSubChIdx].start_addr - = desc->svr_comp[Comp_Index].START_Addr; - ensble.sub_ch[nSubChIdx].tmid - = desc->svr_comp[Comp_Index].TMID; - ensble.sub_ch[nSubChIdx].svc_type - = desc->svr_comp[Comp_Index].DSCTy; - ensble.sub_ch[nSubChIdx].svc_id - = desc->svr_desc[i].Sid; - memcpy(ensble.sub_ch[nSubChIdx].svc_label, - desc->svr_desc[i].Label, SVC_LABEL_MAX); - nSubChIdx++; - break; - - case FIDC: /* No service */ -/* - ensble.sub_ch[nSubChIdx].tmid - = desc->svr_comp[Comp_Index].TMID; - ensble.sub_ch[nSubChIdx].svc_id - = desc->svr_desc[i].Sid; - memcpy(ensble.sub_ch[nSubChIdx].svc_label, - desc->svr_desc[i].Label, SVC_LABEL_MAX); -*/ - break; - - case MSC_PACKET_DATA: -/* - ensble.sub_ch[nSubChIdx].sub_ch_id - = desc->svr_comp[Comp_Index].SubChid; - ensble.sub_ch[nSubChIdx].start_addr - = desc->svr_comp[Comp_Index].START_Addr; - ensble.sub_ch[nSubChIdx].tmid - = desc->svr_comp[Comp_Index].TMID; - ensble.sub_ch[nSubChIdx].svc_type - = desc->svr_comp[Comp_Index].DSCTy; - ensble.sub_ch[nSubChIdx].svc_id - = desc->svr_desc[i].Sid; - memcpy(ensble.sub_ch[nSubChIdx].svc_label, - desc->svr_desc[i].Label, SVC_LABEL_MAX); -*/ - break; - default: - RTV_DBGMSG0("NO TMID\n"); - break; - } - -/* - RTV_DBGMSG2("ensble->sub_ch[%d].sub_ch_id: %d\n", - nSubChIdx, ensble->sub_ch[nSubChIdx].sub_ch_id); - RTV_DBGMSG2("ensble->sub_ch[%d].start_addr: %d\n", - nSubChIdx, ensble->sub_ch[nSubChIdx].start_addr); - RTV_DBGMSG2("ensble->sub_ch[%d].tmid: %d\n", - nSubChIdx, ensble->sub_ch[nSubChIdx].tmid); - RTV_DBGMSG2("ensble->sub_ch[%d].svc_type: %d\n", - nSubChIdx, ensble->sub_ch[nSubChIdx].svc_type); - RTV_DBGMSG2("ensble->sub_ch[%d].svc_id: 0x%lX\n", - nSubChIdx, ensble->sub_ch[nSubChIdx].svc_id); - - desc->svr_desc[i].Label[SVC_LABEL_MAX] = '\0'; - RTV_DBGMSG2("ensble->sub_ch[%d].ServiceLabel: %s\n\n", - nSubChIdx, desc->svr_desc[i].Label); -*/ - } - } - - ensble.tot_sub_ch = nSubChIdx; -/* - RTV_DBGMSG1("ensble->TotalSubChNumber: %d\n\n", ensble->tot_sub_ch); -*/ - - return &ensble; -} - diff --git a/drivers/media/tdmb/mtv318/raontv_ficdec.h b/drivers/media/tdmb/mtv318/raontv_ficdec.h deleted file mode 100644 index 07034b2..0000000 --- a/drivers/media/tdmb/mtv318/raontv_ficdec.h +++ /dev/null @@ -1,39 +0,0 @@ -/* - * - * File name: drivers/media/tdmb/mtv318/src/raontv_ficdec.h - * - * Description : RAONTECH FIC Decoder API header file. - * - * Copyright (C) (2011, RAONTECH) - * - * 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 version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef __RAONTV_FICDEC_H__ -#define __RAONTV_FICDEC_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "raontv.h" -#include "tdmb.h" - -struct ensemble_info_type *rtvFICDEC_GetEnsembleInfo(unsigned long freq); -void rtvFICDEC_Stop(void); -BOOL rtvFICDEC_Decode(U32 ch_freq_khz); - -#ifdef __cplusplus -} -#endif - -#endif /* __RAONTV_FICDEC_H__ */ - diff --git a/drivers/media/tdmb/mtv318/raontv_ficdec_internal.h b/drivers/media/tdmb/mtv318/raontv_ficdec_internal.h deleted file mode 100644 index 85d50ee..0000000 --- a/drivers/media/tdmb/mtv318/raontv_ficdec_internal.h +++ /dev/null @@ -1,699 +0,0 @@ -/* -* -* File name: drivers/media/tdmb/mtv318/src/raontv_ficdec_internal.h -* -* Description : RAONTECH TV FIC Decoder internal header file. -* -* Copyright (C) (2011, RAONTECH) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ -#ifndef __RAONTV_FICDEC_INTERNAL_H__ -#define __RAONTV_FICDEC_INTERNAL_H__ - -/********************/ -/* Header Files */ -/********************/ -#include <linux/string.h> - -#include "raontv_ficdec.h" - - -#define RTV_FAIL (-1) -#define RTV_UNLOCK (-10) -#define RTV_OK 0 -#define RTV_SCAN_OK 1 -#define RTV_LOCK_CHECK 10 -#define RTV_NOTHING 2 - - -#define FIC_GOING 0 -#define FIC_LABEL 0x01 -#define FIC_APP_TYPE 0x10 -#define FIC_DONE 0x11 -#define FIC_CRC_ERR 0x44 - - -/**************************/ -/* FIC Definition */ -/**************************/ -#define MSC_STREAM_AUDIO 0x00 -#define MSC_STREAM_DATA 0x01 -#define FIDC 0x02 -#define MSC_PACKET_DATA 0x03 - -/* Ensemble, service, service component label number */ -#define LABEL_NUM 17 - -/* maximum service component number in Ensemble channel */ -#define MAX_SERV_COMP 64 - -/* maximum service component number in one service */ -#define MAX_SUB_CH_NUM 12 - -/* maximum service number in one ensemble */ -#define MAX_SERVICE_NUM 20 - -/*maximum number of user applications */ -#define USER_APP_NUM 6 - -/* get FIC Time information complete */ -#define ALL_FLAG_MATCH 0x11 - -/* get FIC type0 extension10 complete */ -#define TIME_FLAG 0x01 - -/* get FIC type0 extension9 complete */ -#define LTO_FLAG 0x10 - -#define Unspec_DATA 0 -#define TMC_Type 1 -#define EWS_Type 2 -#define ITTS_Type 3 -#define Paging_Type 4 -#define TDC_Type 5 -#define KDMB_Type 24 -#define Em_IP_Type 59 -#define MOT_Type 60 -#define PS_noDSCTy 61 - -/****************************/ -/* FIC Data structure */ -/****************************/ -/*! Date and Time information for Application user */ -struct DATE_TIME_INFO { - U32 MJD; - U8 LSI; - U8 conf_ind; - U8 utc_flag; - U8 apm_flag; - U8 time_flag; - U8 get_flag; - U16 years; - U8 months_dec; - char months_ste[4]; - char weeks[4]; - U8 days; - U8 hours; - U8 minutes; - U8 seconds; - U16 milliseconds; - U8 LTO; /*Local Time Offset */ -}; - -/*! Service Component Descriptor for Application user */ -struct SVR_COM_DESP { - S32 BIT_RATE; - S32 P_L; - S32 START_Addr; - S32 SUB_CH_Size; - U8 TMID; - U8 ASCTy; - U8 SubChid; - U8 P_S; - U8 CA_flag; - U8 DSCTy; - U8 FIDCid; - U8 TCid; - U8 Ext; - U16 SCid; - U8 DG_flag; - U16 Packet_add; - U16 CA_Org; - U8 FEC_scheme; - U8 language; - U8 charset; - char Label[LABEL_NUM]; - U32 Sid; - U8 SCidS; - U8 Num_User_App; - U16 User_APP_Type[USER_APP_NUM]; - U8 User_APP_data_length[USER_APP_NUM]; - U8 User_APP_data[24]; -}; - -/*! Service Descriptor for Application user */ -struct SERVICE_DESC { - /*MCI Information*/ - U32 Sid; - U8 Country_id; - U32 Service_ref; - U8 ECC; - U8 Local_flag; - U8 CAID; - U8 Num_ser_comp; - U8 P_D; - /*SI Information */ - U8 label_flag; - U8 charset; - char Label[LABEL_NUM]; - /*Program type */ - U8 int_code; - U8 ser_comp_num[MAX_SUB_CH_NUM]; -}; - -/*! FIDC Descriptor for Application user */ -struct FIDC_EWS_Region { - U8 Sub_Region[11]; -}; - -struct FIDC_DESC { - U8 EWS_current_segmemt; - U8 EWS_total_segmemt; - U8 EWS_Message_ID; - S8 EWS_category[4]; - U8 EWS_priority; - U32 EWS_time_MJD; - U8 EWS_time_Hours; - U8 EWS_time_Minutes; - U8 EWS_region_form; - U8 EWS_region_num; - U8 EWS_Rev; - struct FIDC_EWS_Region EWS_Region[15]; - U8 EWS_short_sentence[409]; -}; - -/*! Ensemble Descriptor for Application user */ -struct ENSEMBLE_DESC { - /*COMMON Information*/ - U32 svr_num; - U32 svr_comp_num; - U32 label_num; - /*MCI Information*/ - U16 id; - U8 change_flag; - U8 Alarm_flag; - /*SI Information*/ - U8 charset; - char Label[LABEL_NUM]; - U32 freq; - U8 label_flag; - - struct DATE_TIME_INFO date_time_info; - struct SERVICE_DESC svr_desc[MAX_SERVICE_NUM]; - struct SVR_COM_DESP svr_comp[MAX_SERV_COMP]; - struct FIDC_DESC fidc_desc; - -}; - - -/*****************/ -/* EXTERNS */ -/*****************/ -extern char *PROGRAM_TYPE_CODE16[32]; -extern char *USER_APP_TYPE_CODE[11]; -extern char *FIDC_EXT_CODE[3]; -extern char *ASCTy[3]; -extern char *DSCTy[11]; -extern char *ANNOUNCEMENT_TYPE_CODE[12]; -extern S32 SUBCH_UEP_TABLE[64][3]; -extern char *WEEK_TABLE[8]; -extern char *MONTH_TABLE[12]; -extern struct ENSEMBLE_DESC ENS_DESC, NEXT_ENS_DESC; -extern struct ENSEMBLE_DESC ENS_DESC1, NEXT_ENS_DESC1; -extern struct ENSEMBLE_DESC ENS_DESC2, NEXT_ENS_DESC2; -extern char *EWS_CATEGORY[67][3]; -extern char *EWS_PRIORITY_TABLE[4]; -extern char *EWS_REGION_FORM_TABLE[4]; -extern char *EWS_OFFICIAL_ORGANIZATION_TABLE[4]; - - - -/********************/ -/* FIC Definition */ -/********************/ -#define PN_FIB_END_MARKER (0xFF) - -/****************************/ -/* FIC Parser function */ -/****************************/ -S32 FIB_Init_Dec(U8 *); -S32 MCI_SI_DEC(U8); -S32 SI_LABEL_DEC1(U8); -S32 SI_LABEL_DEC2(U8); -S32 FIDC_DEC(U8); -S32 CA_DEC(U8); -S32 RESERVED1(U8); -S32 RESERVED2(U8); -S32 RESERVED3(U8); - -/*****************************/ -/* FIG Data Type structure */ -/*****************************/ -struct FIG_DATA { - U8 type; - U8 length; - U8 *data; - U8 byte_cnt; - U8 bit_cnt; -}; - -/****************************/ -/* FIG type 0 data field */ -/****************************/ -struct FIG_TYPE0 { - U8 C_N; - U8 OE; - U8 P_D; - U8 Ext; -}; - -/* Ensemble Information */ -struct FIG_TYPE0_Ext0 { - U16 Eid; - U8 Country_ID; - U32 Ensemble_Ref; - U8 Change_flag; - U8 AI_flag; - U8 CIF_Count0; - U8 CIF_Count1; - U8 Occurence_Change; -}; - -/* Structure of the sub-channel organization field */ -struct FIG_TYPE0_Ext1 { - U8 SubChid; - U32 StartAdd; - U8 S_L_form; - U32 Size_Protection; - U8 Table_sw; - U8 Table_index; - U8 Option; - U8 Protection_Level; - U32 Sub_ch_size; -}; - -/* Structure of the service organization field */ -struct FIG_TYPE0_Ext2_ser_comp_des { - U8 TMID; - U8 ASCTy; - U8 SubChid; - U8 P_S; - U8 CA_flag; - U8 DSCTy; - U8 FIDCid; - U8 TCid; - U8 Ext; - U16 SCid; -}; - -/* Basic service and service component definition structure */ -struct FIG_TYPE0_Ext2 { - U32 Sid; - U8 Country_id; - U32 Service_ref; - U8 ECC; - U8 Local_flag; - U8 CAID; - U8 Num_ser_comp; - struct FIG_TYPE0_Ext2_ser_comp_des svr_comp_des[MAX_SERV_COMP]; -}; - -/* Structure of the service component in packet mode */ -struct FIG_TYPE0_Ext3 { - U16 SCid; - U8 CA_Org_flag; - U8 DG_flag; - U8 DSCTy; - U8 SubChid; - U16 Packet_add; - U16 CA_Org; -}; - -/* Structure of the service component field in Stream mode or FIC */ -struct FIG_TYPE0_Ext4 { - U8 M_F; - U8 SubChid; - U8 FIDCid; - U16 CA_Org; -}; - -/* Structure of the service component language field */ -struct FIG_TYPE0_Ext5 { - U8 L_S_flag; - U8 MSC_FIC_flag; - U8 SubChid; - U8 FIDCid; - U16 SCid; - U8 Language; -}; - -/* Service Linking Information */ -struct FIG_TYPE0_Ext6 { - U8 id_list_flag; - U8 LA; - U8 S_H; - U8 ILS; - U32 LSN; - U8 id_list_usage; - U8 idLQ; - U8 Shd; - U8 Num_ids; - U16 id[12]; - U8 ECC[12]; - U32 Sid[12]; -}; - -/* Structure of the service component global definition field */ -struct FIG_TYPE0_Ext8 { - U32 Sid; - U8 Ext_flag; - U8 SCidS; - U8 L_S_flag; - U8 MSC_FIC_flag; - U8 SubChid; - U8 FIDCid; - U32 SCid; -}; - -/* Structure of Country, LTO International field */ -struct FIG_TYPE0_Ext9 { - U8 Ext_flag; - U8 LTO_unique; - U8 Ensemble_LTO; - U8 Ensemble_ECC; - U8 Inter_Table_ID; - U8 Num_Ser; - U8 LTO; - U8 ECC; - U32 Sid[11]; -}; - -/* Structure of the data and time field */ -struct FIG_TYPE0_Ext10 { - U32 MJD; - U8 LSI; - U8 Conf_ind; - U8 UTC_flag; - U32 UTC; - U8 Hours; - U8 Minutes; - U8 Seconds; - U16 Milliseconds; -}; - -/* Structure of the Region Definition */ -struct FIG_TYPE0_Ext11 { - U8 GATy; - U8 G_E_flag; - U8 Upper_part; - U8 Lower_part; - U8 length_TII_list; - U8 Mainid[12]; - U8 Length_Subid_list; - U8 Subid[36]; - U32 Latitude_Coarse; - U32 Longitude_coarse; - U32 Extent_Latitude; - U32 Extent_Longitude; -}; - -/* Structure of the User Application Information */ -struct FIG_TYPE0_Ext13 { - U32 Sid; - U8 SCidS; - U8 Num_User_App; - U16 User_APP_Type[6]; - U8 User_APP_data_length[6]; - U8 CA_flag; - U8 CA_Org_flag; - U8 X_PAD_App_Ty; - U8 DG_flag; - U8 DSCTy; - U16 CA_Org; - U8 User_APP_data[24]; -}; - -/* FEC sub-channel organization */ -struct FIG_TYPE0_Ext14 { - U8 SubChid; - U8 FEC_scheme; -}; - -/* Program Number structure */ -struct FIG_TYPE0_Ext16 { - U16 Sid; - U16 PNum; - U8 Continuation_flag; - U8 Update_flag; - U16 New_Sid; - U16 New_PNum; -}; - -/* Program Type structure */ -struct FIG_TYPE0_Ext17 { - U16 Sid; - U8 S_D; - U8 P_S; - U8 L_flag; - U8 CC_flag; - U8 Language; - U8 Int_code; - U8 Comp_code; -}; - -/* Announcement support */ -struct FIG_TYPE0_Ext18 { - U16 Sid; - U16 ASU_flags; - U8 Num_clusters; - U8 Cluster_ID[23]; -}; - -/* Announcement switching */ -struct FIG_TYPE0_Ext19 { - U8 Cluster_ID; - U16 ASW_flags; - U8 New_flag; - U8 Region_flag; - U8 SubChid; - U8 Regionid_Lower_Part; -}; - -/* Frequency Information */ -struct FIG_TYPE0_Ext21 { - U16 ResionID; - U8 Length_of_FI_list; - U16 id_field; - U8 R_M; - U8 Continuity_flag; - U8 Length_Freq_list; - U8 Control_field[5]; - U8 id_field2[4]; - U32 Freq_a[5]; - U8 Freq_b[17]; - U16 Freq_c[8]; - U16 Freq_d[7]; -}; - -/* Transmitter Identification Information (TII) database */ -struct FIG_TYPE0_Ext22 { - U8 M_S; - U8 Mainid; - U32 Latitude_coarse; - U32 Longitude_coarse; - U8 Latitude_fine; - U8 Longitude_fine; - U8 Num_Subid_fields; - U8 Subid[4]; - U16 TD[4]; - U16 Latitude_offset[4]; - U16 Longitude_offset[4]; -}; - -/* Other Ensemble Service */ -struct FIG_TYPE0_Ext24 { - U32 Sid; - U8 CAid; - U8 Number_Eids; - U16 Eid[12]; -}; - -/* Other Ensemble Announcement support */ -struct FIG_TYPE0_Ext25 { - U32 Sid; - U32 ASU_flag; - U8 Number_Eids; - U8 Eid[12]; -}; - -/* Other Ensemble Announcement switching */ -struct FIG_TYPE0_Ext26 { - U8 Cluster_id_Current_Ensemble; - U32 Asw_flags; - U8 New_flag; - U8 Region_flag; - U8 Region_id_current_Ensemble; - U32 Eid_Other_Ensemble; - U8 Cluster_id_other_Ensemble; - U8 Region_id_Oter_Ensemble; -}; - -/* FM Announcement support */ -struct FIG_TYPE0_Ext27 { - U32 Sid; - U8 Number_PI_Code; - U32 PI[12]; -}; - -/* FM Announcement switching */ -struct FIG_TYPE0_Ext28 { - U8 Cluster_id_Current_Ensemble; - U8 New_flag; - U8 Region_id_Current_Ensemble; - U32 PI; -}; - -/* FIC re-direction */ -struct FIG_TYPE0_Ext31 { - U32 FIG0_flag_field; - U8 FIG1_flag_field; - U8 FIG2_flag_field; -}; - -/****************************/ -/* FIG type 5 data field */ -/****************************/ -struct FIG_TYPE5 { - U8 D1; - U8 D2; - U8 TCid; - U8 Ext; -}; - -/* Paging */ -struct FIG_TPE5_Ext0 { - U8 SubChid; - U16 Packet_add; - U8 F1; - U8 F2; - U16 LFN; - U8 F3; - U16 Time; - U8 CAid; - U16 CA_Org; - U32 Paging_user_group; -}; - -/* TMC */ -struct FIG_TYPE5_Ext1 { - U32 TMC_User_Message[30]; - U16 TMC_System_Message[30]; -}; - -/* EWS */ -struct FIG_EWS_Region { - U8 Sub_Region[11]; -}; - -struct FIG_TYPE5_Ext2 { - U8 current_segmemt; - U8 total_segmemt; - U8 Message_ID; - S8 category[4]; - U8 priority; - U32 time_MJD; - U8 time_Hours; - U8 time_Minutes; - U8 region_form; - U8 region_num; - U8 Rev; - struct FIG_EWS_Region Region[15]; - U8 data[409]; -}; - -/****************************/ -/* FIG type 6 data field */ -/****************************/ -struct FIG_TYPE6 { - U8 C_N; - U8 OE; - U8 P_D; - U8 LEF; - U8 ShortCASysId; - U32 Sid; - U16 CASysId; - U16 CAIntChar; -}; - -/***************************/ -/* Function declarations */ -/***************************/ - -/* FIG TYPE 0 function */ -S32 Get_FIG0_EXT0(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT1(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT2(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT3(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT4(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT5(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT6(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT7(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT8(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT9(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT10(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT11(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT12(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT13(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT14(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT15(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT16(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT17(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT18(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT19(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT20(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT21(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT22(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT23(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT24(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT25(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT26(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT27(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT28(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT29(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT30(U8 fic_cmd, U8 P_D, U8 C_N); -S32 Get_FIG0_EXT31(U8 fic_cmd, U8 P_D, U8 C_N); - -/* FIG TYPE 1 function */ -S32 Get_FIG1_EXT0(U8 fic_cmd, U8 Char_Set); -S32 Get_FIG1_EXT1(U8 fic_cmd, U8 Char_Set); -S32 Get_FIG1_EXT2(U8 fic_cmd, U8 Char_Set); -S32 Get_FIG1_EXT3(U8 fic_cmd, U8 Char_Set); -S32 Get_FIG1_EXT4(U8 fic_cmd, U8 Char_Set); -S32 Get_FIG1_EXT5(U8 fic_cmd, U8 Char_Set); -S32 Get_FIG1_EXT6(U8 fic_cmd, U8 Char_Set); -S32 Get_FIG1_EXT7(U8 fic_cmd, U8 Char_Set); - -/* FIG TYPE 2 function */ -S32 Get_FIG2_EXT0(U8 fic_cmd, U8 Seg_Index); -S32 Get_FIG2_EXT1(U8 fic_cmd, U8 Seg_Index); -S32 Get_FIG2_EXT2(U8 fic_cmd, U8 Seg_Index); -S32 Get_FIG2_EXT3(U8 fic_cmd, U8 Seg_Index); -S32 Get_FIG2_EXT4(U8 fic_cmd, U8 Seg_Index); -S32 Get_FIG2_EXT5(U8 fic_cmd, U8 Seg_Index); -S32 Get_FIG2_EXT6(U8 fic_cmd, U8 Seg_Index); -S32 Get_FIG2_EXT7(U8 fic_cmd, U8 Seg_Index); - -/* FIG TYPE 5 function */ -S32 Get_FIG5_EXT0(U8 D1, U8 D2, U8 fic_cmd, U8 TCid); -S32 Get_FIG5_EXT1(U8 D1, U8 D2, U8 fic_cmd, U8 TCid); -S32 Get_FIG5_EXT2(U8 D1, U8 D2, U8 fic_cmd, U8 TCid); - - - -U8 GET_SUBCH_INFO(struct FIG_TYPE0_Ext1 *type0_ext1 - , S32 *BIT_RATE, S32 *SUB_CH_Size, S32 *P_L); -U8 GET_DATE_TIME(struct DATE_TIME_INFO *time_desc); -U8 GET_EWS_TIME(struct DATE_TIME_INFO *time_desc); - - - -#endif /* __RAONTV_FICDEC_INTERNAL_H__ */ diff --git a/drivers/media/tdmb/mtv318/raontv_internal.h b/drivers/media/tdmb/mtv318/raontv_internal.h deleted file mode 100644 index 1e41350..0000000 --- a/drivers/media/tdmb/mtv318/raontv_internal.h +++ /dev/null @@ -1,796 +0,0 @@ -/* - * - * File name: drivers/media/tdmb/mtv318/src/raontv_internal.h - * - * Description : RAONTECH TV internal header file. - * - * Copyright (C) (2011, RAONTECH) - * - * 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 version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef __RAONTV_INTERNAL_H__ -#define __RAONTV_INTERNAL_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "raontv.h" - -/* Do not modify the order! */ -enum E_RTV_TV_MODE_TYPE { - RTV_TV_MODE_TDMB = 0, /* Band III Korea */ - RTV_TV_MODE_DAB_B3 = 1, /* Band III*/ - RTV_TV_MODE_DAB_L = 2, /* L-Band*/ - RTV_TV_MODE_1SEG = 3, /* UHF*/ - RTV_TV_MODE_FM = 4, /* FM*/ - MAX_NUM_RTV_MODE -}; - -struct RTV_REG_INIT_INFO { - U8 bReg; - U8 bVal; -}; - -struct RTV_REG_MASK_INFO { - U8 bReg; - U8 bMask; - U8 bVal; -}; - -#if defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) -#if defined(RTV_TSIF_CLK_SPEED_DIV_2) /* Host Clk/2*/ -#define RTV_COMM_CON47_CLK_SEL (0<<6) -#elif defined(RTV_TSIF_CLK_SPEED_DIV_4) /* Host Clk/4*/ -#define RTV_COMM_CON47_CLK_SEL (1<<6) -#elif defined(RTV_TSIF_CLK_SPEED_DIV_6) /* Host Clk/6*/ -#define RTV_COMM_CON47_CLK_SEL (2<<6) -#elif defined(RTV_TSIF_CLK_SPEED_DIV_8) /* Host Clk/8*/ -#define RTV_COMM_CON47_CLK_SEL (3<<6) -#else -#error "Code not present" -#endif -#endif - -#define MSC1_E_OVER_FLOW 0x40 -#define MSC1_E_UNDER_FLOW 0x20 -#define MSC1_E_INT 0x10 -#define MSC0_E_OVER_FLOW 0x08 -#define MSC0_E_UNDER_FLOW 0x04 -#define MSC0_E_INT 0x02 -#define FIC_E_INT 0x01 -#define RE_CONFIG_E_INT 0x04 - -#define MSC1_INTR_BITS (MSC1_E_INT|MSC1_E_UNDER_FLOW|MSC1_E_OVER_FLOW) -#define MSC0_INTR_BITS (MSC0_E_INT|MSC0_E_UNDER_FLOW|MSC0_E_OVER_FLOW) - -/* [2]MSC1 int clear [1]MSC0 int clear [0]FIC int clear */ -#define INT_E_UCLRL (0x35) - -/* [6]OFDM TII done clear */ -#define INT_E_UCLRH (0x36) - -/* [7]OFDM Lock status [6]MSC1 overrun [5]MSC1 underrun - * [4]MSC1 int [3]MSC0 overrun [2]MSC0 underrun [1]MSC0 int [0]FIC int */ -#define INT_E_STATL (0x33) - -/* [7]OFDM NIS [6]OFDM TII [5]OFDM scan [4]OFDM window position - * [3]OFDM unlock [2]FEC re-configuration [1]FEC CIF end [0]FEC soft reset*/ -#define INT_E_STATH (0x34) - -/* [7]Buf_en [6]PKT_CRC_MODE:enable (stored) [5]MPEG_HEAD [4]MPEG-2TS_EN - * [3]EPKT_MODE [2]CAS_MODE [1]FIDC_MODE [0]FIC_INIT_EN == 1:enable*/ -#define DD_E_TOPCON (0x45) - -/* [4]FIC_CRC stored- 1:enable [3]FIC uclear-1 - * [2]FIC_Update - 1:dependent by user - * [1]FIC_EN [0]FIG_EN - 1:only FIG 6 dump*/ -#define FIC_E_DDCON (0x46) - -/* [3]MSC0 uclear-1 - * [2]MSC0_en - * [1]MSC0 read length -1:user length, 0:interrupt length - * [0]MSC0 interrupt sel-1:user th, 0:CIF end*/ -#define MSC0_E_CON (0x47) - -/* [5]MSC1_length-0:subch+length [4]MSC1 header-0:disable [3]MSC1 uclear-1 - * [2]MSC1_en [1]MSC1 read length -1:user length, 0:interrupt length - * [0]MSC1 interrupt sel-1:user th, 0:CIF end*/ -#define MSC1_E_CON (0x48) - -/* [3]NIS uclear-1 [2]NIS_Update - 1:dependent by user - * [1]TII status clear -1:user set only, 0:user set & internal event - * [0]TII_Update - 1:dependent by user*/ -#define OFDM_E_DDCON (0x49) - -/* [11:8] setting in MSC0 read length for interrupt clear*/ -#define MSC0_E_RSIZE_H (0x4E) - -/* [7:0]*/ -#define MSC0_E_RSIZE_L (0x4F) - -/* [11:8] MSC0 interrupt threshold*/ -#define MSC0_E_INTTH_H (0x50) - -/* [7:0]*/ -#define MSC0_E_INTTH_L (0x51) - -/* [11:8]*/ -#define MSC0_E_TSIZE_L (0x52) - -/* [7:0] MSC0 total size which you can read*/ -#define MSC0_E_TSIZE_H (0x53) - -/* [11:8] setting in MSC1 read length for interrupt clear*/ -#define MSC1_E_RSIZE_H (0x54) -#define MSC1_E_RSIZE_L (0x55) /* [7:0]*/ -#define MSC1_E_INTTH_H (0x56) /* [11:8] MSC1 interrupt threshold*/ -#define MSC1_E_INTTH_L (0x57) /* [7:0]*/ -#define MSC1_E_TSIZE_L (0x58) /* [11:8]*/ -#define MSC1_E_TSIZE_H (0x59) /* [7:0] MSC1 read length*/ - -#define MODE1 2 -#define MODE2 1 -#define MODE3 0 - -#define MAP_SEL_REG 0x03 - -#define OFDM_PAGE 0x02 /* for 1seg */ -#define FEC_PAGE 0x03 /* for 1seg */ -#define COMM_PAGE 0x04 -#define FM_PAGE 0x06 /* T-DMB OFDM/FM */ -#define HOST_PAGE 0x07 -#define CAS_PAGE 0x08 -#define DD_PAGE 0x09 /* FEC for TDMB, DAB, FM */ -#define FIC_PAGE 0x0A -#define MSC0_PAGE 0x0B -#define MSC1_PAGE 0x0C -#define RF_PAGE 0x0F - -#define DEMOD_0SC_DIV2_ON 0x80 -#define DEMOD_0SC_DIV2_OFF 0x00 - -#if (RTV_SRC_CLK_FREQ_KHz >= 32000) -#define DEMOD_OSC_DIV2 DEMOD_0SC_DIV2_ON -#else -#define DEMOD_OSC_DIV2 DEMOD_0SC_DIV2_OFF -#endif - -#define MAP_SEL_VAL(page) (DEMOD_OSC_DIV2|page) -#define RTV_REG_MAP_SEL(page) RTV_REG_SET(MAP_SEL_REG, MAP_SEL_VAL(page)) - -#define RTV_TS_STREAM_DISABLE_DELAY 20 /* ms */ - -/* ISDB-T Channel */ -#define ISDBT_CH_NUM_START__JAPAN 13 -#define ISDBT_CH_NUM_END__JAPAN 62 -#define ISDBT_CH_FREQ_START__JAPAN 473143 -#define ISDBT_CH_FREQ_STEP__JAPAN 6000 - -#define ISDBT_CH_NUM_START__BRAZIL 14 -#define ISDBT_CH_NUM_END__BRAZIL 69 -#define ISDBT_CH_FREQ_START__BRAZIL 473143 -#define ISDBT_CH_FREQ_STEP__BRAZIL 6000 - -#define ISDBT_CH_NUM_START__ARGENTINA 14 -#define ISDBT_CH_NUM_END__ARGENTINA 69 -#define ISDBT_CH_FREQ_START__ARGENTINA 473143 -#define ISDBT_CH_FREQ_STEP__ARGENTINA 6000 - -/* T-DMB Channel */ -#define TDMB_CH_FREQ_START__KOREA 175280 -#define TDMB_CH_FREQ_STEP__KOREA 1728 /* about... */ -/* DAB Channel */ -#define DAB_CH_BAND3_START_FREQ_KHz 174928 -#define DAB_CH_BAND3_STEP_FREQ_KHz 1712 /* in KHz */ -#define DAB_CH_LBAND_START_FREQ_KHz 1452960 -#define DAB_CH_LBAND_STEP_STEP_FREQ_KHz 1712 /*in KHz */ - -extern enum E_RTV_ADC_CLK_FREQ_TYPE g_eRtvAdcClkFreqType; -extern enum E_RTV_COUNTRY_BAND_TYPE g_eRtvCountryBandType; - -#ifdef RTV_DAB_ENABLE -extern enum E_RTV_TV_MODE_TYPE g_curDabSetType; -#endif - -/* Use SPI/EBI2 interrupt handler to prevent the changing of register map. */ -extern BOOL g_fRtvChannelChange; -extern BOOL g_fRtvStreamEnabled; - -extern UINT g_nRtvMscThresholdSize; - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -extern U8 g_bRtvIntrMaskRegL; - -#else -#if !defined(RTV_CIF_MODE_ENABLED) || !defined(RTV_FIC_POLLING_MODE) -/* T-DMB: Single sub channel and Serial TSIF */ -extern U8 g_bRtvIntrMaskRegL; -#endif -#endif - -/*See PLL table in raontv_rf_pll_data_fm.h */ -#define FM_MIN_FREQ_KHz 75950 -#define FM_MAX_FREQ_KHz 108050 -#define FM_SCAN_STEP_FREQ_KHz (RTV_FM_CH_STEP_FREQ_KHz/2) - -#if (RTV_FM_CH_MIN_FREQ_KHz < FM_MIN_FREQ_KHz) \ - || (RTV_FM_CH_MAX_FREQ_KHz > FM_MAX_FREQ_KHz) -#error "Invalid FM freq range" -#endif - -/*============================================================================ - * - * Common inline functions. - * - *===========================================================================*/ - -/* Forward prototype. */ -static INLINE void rtv_SetupMemory_MSC1(U16 wThresholdSize); - -static INLINE enum E_RTV_TV_MODE_TYPE rtv_GetDabTvMode(U32 dwChFreqKHz) -{ - if (dwChFreqKHz >= DAB_CH_LBAND_START_FREQ_KHz) { - /*RTV_DBGMSG0("return RTV_TV_MODE_DAB_L;\n");*/ - return RTV_TV_MODE_DAB_L; /* L-Band */ - } else { - switch (dwChFreqKHz) { - case 175280/*7A*/: case 177008/*7B*/: case 178736/*7C*/: - case 181280/*8A*/: case 183008/*8B*/: case 184736/*8C*/: - case 187280/*9A*/: case 189008/*9B*/: case 190736/*9C*/: - case 193280/*10A*/: case 195008/*10B*/: case 196736/*10C*/: - case 199280/*11A*/: case 201008/*11B*/: case 202736/*11C*/: - case 205280/*12A*/: case 207008/*12B*/: case 208736/*12C*/: - case 211280/*13A*/: case 213008/*13B*/: case 214736/*13C*/: - /*RTV_DBGMSG0("return RTV_TV_MODE_TDMB;\n");*/ - return RTV_TV_MODE_TDMB; /*Korea TDMB.*/ - - default: - /*RTV_DBGMSG0("return RTV_TV_MODE_DAB_B3;\n"); */ - return RTV_TV_MODE_DAB_B3; /* DAB Band-III */ - } - } -} - -/* Pause straem */ -static INLINE void rtv_StreamDisable(enum E_RTV_TV_MODE_TYPE eTvMode) -{ -#ifndef RTV_IF_MPEG2_PARALLEL_TSIF - if (g_fRtvStreamEnabled == FALSE) - return; - - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(HOST_PAGE); - /* FIC, MSC0, MSC1 */ - RTV_REG_SET(0x62, - g_bRtvIntrMaskRegL|MSC0_INTR_BITS|MSC1_INTR_BITS); - -#elif defined(RTV_IF_MPEG2_SERIAL_TSIF) \ - || defined(RTV_IF_SPI_SLAVE)\ - || defined(RTV_IF_QUALCOMM_TSIF) - - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x29, 0x08); - RTV_DELAY_MS(RTV_TS_STREAM_DISABLE_DELAY); -#endif - break; -#endif /* RTV_ISDBT_ENABLE */ - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(HOST_PAGE); - /* FIC, MSC0, MSC1 */ - RTV_REG_SET(0x62, - g_bRtvIntrMaskRegL|MSC0_INTR_BITS|MSC1_INTR_BITS); - -#elif defined(RTV_IF_MPEG2_SERIAL_TSIF) \ - || defined(RTV_IF_SPI_SLAVE) \ - || defined(RTV_IF_QUALCOMM_TSIF) - - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x29, 0x08); - RTV_DELAY_MS(RTV_TS_STREAM_DISABLE_DELAY); -#endif - break; -#endif/* RTV_FM_ENABLE */ - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(HOST_PAGE); - - /* FIC, MSC0, MSC1 */ - RTV_REG_SET(0x62, - g_bRtvIntrMaskRegL|MSC0_INTR_BITS|MSC1_INTR_BITS|FIC_E_INT); -#elif defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x29, 0x08); - RTV_DELAY_MS(RTV_TS_STREAM_DISABLE_DELAY); - -#ifndef RTV_CIF_MODE_ENABLED /* Individual Mode */ -#ifndef RTV_FIC_POLLING_MODE - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL|FIC_E_INT); -#endif -#else /* CIF Mode. */ - -#endif -#endif - break; -#endif /* RTV_TDMB_ENABLE */ - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_DAB_L: - case RTV_TV_MODE_TDMB: -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x62, - g_bRtvIntrMaskRegL|MSC0_INTR_BITS|MSC1_INTR_BITS|FIC_E_INT); - -#elif defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x29, 0x08); - RTV_DELAY_MS(RTV_TS_STREAM_DISABLE_DELAY); - -#ifndef RTV_CIF_MODE_ENABLED /* Individual Mode */ -#ifndef RTV_FIC_POLLING_MODE - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL|FIC_E_INT); -#endif -#else /* Multi Sub Channel Mode. */ - -#endif -#endif - break; -#endif /* RTV_DAB_ENABLE */ - - default: - break; - } - - g_fRtvStreamEnabled = FALSE; -#endif -} - - -static INLINE void rtv_StreamRestore(enum E_RTV_TV_MODE_TYPE eTvMode) -{ -#ifndef RTV_IF_MPEG2_PARALLEL_TSIF - if (g_fRtvStreamEnabled == TRUE) - return; - - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x35, 0x04); /* MSC1 Interrupt status clear. */ - - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif - break; -#endif - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x35, 0x04); - - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#elif defined(RTV_IF_SERIAL_TSIF) || defined(RTV_IF_SPI_SLAVE) - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x29, 0x00); -#endif - break; -#endif - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x35, 0x07); - - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); - -#elif defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x29, 0x00); - -#ifndef RTV_CIF_MODE_ENABLED /* Individual Mode */ -#ifndef RTV_FIC_POLLING_MODE - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x35, 0x01); - - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif -#else /* Multi Sub Channel Mode. */ -#endif -#endif - break; -#endif - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_DAB_L: - case RTV_TV_MODE_TDMB: -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x35, 0x07); - - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL);/* FIC, MSC0, MSC1 */ - -#elif defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x29, 0x00); - -#ifndef RTV_CIF_MODE_ENABLED /* Individual Mode */ -#ifndef RTV_FIC_POLLING_MODE - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x35, 0x01); /* FIC Interrupt status clear. */ - - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif -#else /* Multi Sub Channel Mode. */ -#endif -#endif - break; -#endif /* RTV_DAB_ENABLE */ - default: - /* RTV_DBGMSG0("[rtv_StreamRestore] Invalid TV mode.\n"); */ - break; - } - - g_fRtvStreamEnabled = TRUE; -#endif -} - -/* Enable the stream path forcely for ISDB-T and FM only! */ -static INLINE void rtv_StreamEnable(void) -{ -#ifndef RTV_IF_MPEG2_PARALLEL_TSIF - if (g_fRtvStreamEnabled == TRUE) - return; - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x35, 0x04); /* MSC1 Interrupt status clear. */ - - RTV_REG_MAP_SEL(HOST_PAGE); - - /* [6] MSC1 over-run [5] MSC1 under-run [4] MSC1 interrupt */ - g_bRtvIntrMaskRegL = 0x8F; - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); - -#elif defined(RTV_IF_SERIAL_TSIF) || defined(RTV_IF_SPI_SLAVE) - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x29, 0x00); -#endif - - /* Restore MSC1 memory. */ - rtv_SetupMemory_MSC1(g_nRtvMscThresholdSize); - - g_fRtvStreamEnabled = TRUE; -#endif /* #ifndef RTV_IF_MPEG2_PARALLEL_TSIF */ -} - -static INLINE void rtv_ConfigureTsifFormat(void) -{ - RTV_REG_MAP_SEL(COMM_PAGE); - -#if defined(RTV_IF_MPEG2_SERIAL_TSIF) || defined(RTV_IF_SPI_SLAVE) -#if defined(RTV_TSIF_FORMAT_1) - RTV_REG_SET(0x45, 0x00); -#elif defined(RTV_TSIF_FORMAT_2) - RTV_REG_SET(0x45, 0x02); -#elif defined(RTV_TSIF_FORMAT_3) - RTV_REG_SET(0x45, 0x21); -#elif defined(RTV_TSIF_FORMAT_4) - RTV_REG_SET(0x45, 0x23); -#else -#error "Code not present" -#endif - -#elif defined(RTV_IF_QUALCOMM_TSIF) -#if defined(RTV_TSIF_FORMAT_1) - RTV_REG_SET(0x45, 0x00); -#elif defined(RTV_TSIF_FORMAT_2) - RTV_REG_SET(0x45, 0xE9); - -#elif defined(RTV_TSIF_FORMAT_3) - RTV_REG_SET(0x45, 0xE1); -#elif defined(RTV_TSIF_FORMAT_4) - RTV_REG_SET(0x45, 0x40); -#elif defined(RTV_TSIF_FORMAT_5) - RTV_REG_SET(0x45, 0x21); -#else -#error "Code not present" -#endif -#endif - -#if defined(RTV_IF_MPEG2_SERIAL_TSIF) - RTV_REG_SET(0x46, 0x80); -#elif defined(RTV_IF_QUALCOMM_TSIF) - RTV_REG_SET(0x46, 0xA0); -#elif defined(RTV_IF_SPI_SLAVE) - RTV_REG_SET(0x46, 0x82); -#endif -} - -static INLINE void rtv_ResetMemory_MSC0(void) -{ - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x47, 0x00); /* MSC0 memory control register clear. */ -} - -static INLINE void rtv_ResetMemory_MSC1(void) -{ -#ifndef RTV_IF_MPEG2_PARALLEL_TSIF - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x48, 0x00); /* MSC1 memory control register clear. */ -#endif -} - -/* Only for T-DMB and DAB. */ -static INLINE void rtv_ClearAndSetupMemory_MSC0(void) -{ -#ifndef RTV_IF_MPEG2_PARALLEL_TSIF - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -#ifdef RTV_MSC_INTR_ISTAUS_ACC_CLR_MODE - U8 msc0_int_usel = 0; /* 0: auto&uclr, 1: user set only */ -#else - U8 msc0_int_usel = 1; -#endif -#else - U8 msc0_int_usel = 0; -#endif - -#ifndef RTV_CIF_MODE_ENABLED /* Individual Mode */ - U8 int_type = 1; /* 0: CIF end, 1: Threshold */ -#else - U8 int_type = 0; -#endif - - RTV_REG_SET(0x47, 0x00); - RTV_REG_SET(0x47, (msc0_int_usel<<3) | (1/*msc0_en*/<<2) | int_type); -#endif /* #ifndef RTV_IF_MPEG2_PARALLEL_TSIF */ -} - -/* Only for T-DMB and DAB. */ -static INLINE void rtv_SetupMemory_MSC0(U16 wThresholdSize) -{ -#ifndef RTV_IF_MPEG2_PARALLEL_TSIF - RTV_REG_MAP_SEL(DD_PAGE); - - RTV_REG_SET(0x50, ((wThresholdSize>>8) & 0x0F)); - RTV_REG_SET(0x51, (wThresholdSize & 0xFF)); - - rtv_ClearAndSetupMemory_MSC0(); - - RTV_REG_SET(0x35, 0x02); /* MSC0 Interrupt clear. */ - -#endif /* #ifndef RTV_IF_MPEG2_PARALLEL_TSIF */ -} - -/* For SPI interface ISR. */ -static INLINE void rtv_ClearAndSetupMemory_MSC1(void) -{ -#ifndef RTV_IF_MPEG2_PARALLEL_TSIF -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -#ifdef RTV_MSC_INTR_ISTAUS_ACC_CLR_MODE - U8 msc1_int_usel = 0; /* 0: auto&uclr, 1: user set only */ -#else - U8 msc1_int_usel = 1; -#endif -#else - /* TSIF */ - U8 msc1_int_usel = 0; -#endif - - U8 int_type = 1; /* 0: CIF end, 1: Threshold (for SPI, Header OFF) */ - - RTV_REG_SET(0x48, 0x00); - RTV_REG_SET(0x48, - (0<<5) | (0<<4) | (msc1_int_usel<<3) | (1/*msc1_en*/<<2) | int_type); - -#endif /* #ifndef RTV_IF_MPEG2_PARALLEL_TSIF */ -} - -static INLINE void rtv_SetupMemory_MSC1(U16 wThresholdSize) -{ -#ifndef RTV_IF_MPEG2_PARALLEL_TSIF - RTV_REG_MAP_SEL(DD_PAGE); - - /* The below settings are not applied to CIF of TDMB/DAB. */ - RTV_REG_SET(0x56, ((wThresholdSize>>8) & 0x0F)); - RTV_REG_SET(0x57, (wThresholdSize & 0xFF)); - - rtv_ClearAndSetupMemory_MSC1(); -#endif /* #ifndef RTV_IF_MPEG2_PARALLEL_TSIF */ -} - -/* Only this sub channel contains the RS decoder. */ -static INLINE void rtv_Set_MSC1_SUBCH0(UINT nSubChID, - BOOL fSubChEnable, BOOL fRsEnable) -{ - RTV_REG_MAP_SEL(DD_PAGE); - -#if !defined(RTV_IF_MPEG2_PARALLEL_TSIF) - RTV_REG_SET(0x3A, (fSubChEnable << 7) | (fRsEnable << 6) | nSubChID); -#else - if (fRsEnable == TRUE) { - RTV_REG_SET(0xFF, 0x00); - RTV_REG_SET(0x3A, - (fSubChEnable << 7) | (fRsEnable << 6) | nSubChID); - - } else { - RTV_REG_SET(0x3A, 0x00); - RTV_REG_SET(0xFF, (fSubChEnable << 7) | nSubChID); - } -#endif -} - -static INLINE void rtv_Set_MSC1_SUBCH1(UINT nSubChID, BOOL fSubChEnable) -{ - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x3B, (fSubChEnable << 7) | nSubChID); -} - -static INLINE void rtv_Set_MSC1_SUBCH2(UINT nSubChID, BOOL fSubChEnable) -{ - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x3C, (fSubChEnable << 7) | nSubChID); -} - -static INLINE void rtv_Set_MSC0_SUBCH3(UINT nSubChID, BOOL fSubChEnable) -{ - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x3D, (fSubChEnable << 7) | nSubChID); -} - -static INLINE void rtv_Set_MSC0_SUBCH4(UINT nSubChID, BOOL fSubChEnable) -{ - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x3E, (fSubChEnable << 7) | nSubChID); -} - -static INLINE void rtv_Set_MSC0_SUBCH5(UINT nSubChID, BOOL fSubChEnable) -{ - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x3F, (fSubChEnable << 7) | nSubChID); -} - -static INLINE void rtv_Set_MSC0_SUBCH6(UINT nSubChID, BOOL fSubChEnable) -{ - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x42, (fSubChEnable << 7) | nSubChID); -} - -/*============================================================================= - * - * T-DMB inline functions. - * - *===========================================================================*/ -static INLINE void rtv_SetupMemory_FIC(void) -{ - RTV_REG_MAP_SEL(DD_PAGE); - /* auto user clr, get fic CRC 2byte including[4] */ - RTV_REG_SET(0x46, 0x10); - RTV_REG_SET(0x46, 0x16); /* FIC enable */ -} - -static INLINE void rtv_ResetMemory_FIC(void) -{ - - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x46, 0x00); -} - -/*============================================================================== - * - * Parallel TSIF inline functions. - * - *============================================================================*/ -#ifdef RTV_IF_MPEG2_PARALLEL_TSIF -#if defined(RTV_ISDBT_ENABLE) -static INLINE void rtv_SetParallelTsif_1SEG_Only(void) -{ - RTV_REG_MAP_SEL(FEC_PAGE); - -#if defined(RTV_TSIF_FORMAT_1) - RTV_REG_SET(0x6E, 0x11); -#elif defined(RTV_TSIF_FORMAT_2) - RTV_REG_SET(0x6E, 0x13); -#elif defined(RTV_TSIF_FORMAT_3) - RTV_REG_SET(0x6E, 0x10); -#elif defined(RTV_TSIF_FORMAT_4) - RTV_REG_SET(0x6E, 0x12); -#else -#error "Code not present" -#endif - RTV_REG_SET(0x6F, 0x02); - RTV_REG_SET(0x70, 0x88); -} - -#elif defined(RTV_TDMB_ENABLE) -static INLINE void rtv_SetParallelTsif_TDMB_Only(void) -{ - RTV_REG_MAP_SEL(0x09); - -#if defined(RTV_TSIF_FORMAT_1) - RTV_REG_SET(0xDD, 0xD0); -#elif defined(RTV_TSIF_FORMAT_2) - RTV_REG_SET(0xDD, 0xD2); -#elif defined(RTV_TSIF_FORMAT_3) - RTV_REG_SET(0xDD, 0xD1); -#elif defined(RTV_TSIF_FORMAT_4) - RTV_REG_SET(0xDD, 0xD3); -#else -#error "Code not present" -#endif - RTV_REG_SET(0xDE, 0x12); - RTV_REG_SET(0x45, 0xB0); -} -#else -#error "Code not present" -#endif -#endif - -/*============================================================================== - * External functions for RAONTV driver core. - *============================================================================*/ -void rtv_ConfigureHostIF(void); -INT rtv_InitSystem(enum E_RTV_TV_MODE_TYPE eTvMode, - enum E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType); - -#ifdef RTV_CIF_HEADER_INSERTED -void rtvCIFDEC_Init(void); -void rtvCIFDEC_Deinit(void); -void rtvCIFDEC_DeleteSubChannelID(UINT nSubChID); -void rtvCIFDEC_AddSubChannelID(UINT nSubChID); -#endif - -#ifdef __cplusplus -} -#endif - -#endif /* __RAONTV_INTERNAL_H__ */ - -/* - WINDOWS - #define INLINE __inline - #define FORCE_INLINE __forceinline - #define NAKED __declspec(naked) - - __GNUC__ - #define INLINE __inline__ - #define FORCE_INLINE __attribute__((always_inline)) __inline__ - #define NAKED __attribute__((naked)) - - ARM RVDS compiler - #define INLINE __inline - #define FORCE_INLINE __forceinline - #define NAKED __asm - */ - diff --git a/drivers/media/tdmb/mtv318/raontv_port.c b/drivers/media/tdmb/mtv318/raontv_port.c deleted file mode 100644 index 1251a8c..0000000 --- a/drivers/media/tdmb/mtv318/raontv_port.c +++ /dev/null @@ -1,169 +0,0 @@ -/* -* -* File name: drivers/media/tdmb/mtv318/src/raontv_port.c -* -* Description : RAONTECH TV OEM source driver. -* -* Copyright (C) (2011, RAONTECH) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include "raontv.h" -#include "raontv_internal.h" -#include <linux/spi/spi.h> - -#include "tdmb.h" - -/* Declares a variable of gurad object if neccessry. */ -#if defined(RTV_IF_SPI) || ((defined(RTV_TDMB_ENABLE) \ - || defined(RTV_DAB_ENABLE)) && !defined(RTV_FIC_POLLING_MODE)) - #if defined(__KERNEL__) - struct mutex raontv_guard; - #elif defined(WINCE) - CRITICAL_SECTION raontv_guard; - #else - /* non-OS and RTOS. */ - #endif -#endif - -void rtvOEM_ConfigureInterrupt(void) -{ -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) \ - || ((defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE)) \ - && !defined(RTV_FIC_POLLING_MODE)) - - RTV_REG_SET(0x09, 0x00); - /* [6]INT1 [5]INT0 - 1: Input mode, 0: Output mode */ - RTV_REG_SET(0x0B, 0x00); - /* [2]INT1 PAD disable [1]INT0 PAD disable */ - - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x28, 0x01); - /* [5:3]INT1 out sel [2:0] INI0 out sel - - 0:Toggle 1:Level,, 2:"0", 3:"1"*/ - - #if defined(RTV_MSC_INTR_ISTAUS_ACC_CLR_MODE) - RTV_REG_SET(0x29, 0x08); - /*[3] Interrupt status register clear condition - - 0:read data by memory access 1:status register access*/ - #else - RTV_REG_SET(0x29, 0x00); - /*[3] Interrupt status register clear condition - - 0:read data by memory access 1:status register access*/ - #endif - RTV_REG_SET(0x2A, 0x13); - /* [5]INT1 pol [4]INT0 pol - - 0:Active High, 1:Active Low [3:0] Period = (INT_TIME+1)/8MHz*/ -#endif -} - -#if defined(RTV_IF_SPI) -unsigned char mtv_spi_read(unsigned char reg) -{ - int ret; - u8 out_buf[2], read_out_buf[2]; - u8 in_buf[2]; - struct spi_message msg; - struct spi_transfer msg_xfer0 = { - .tx_buf = out_buf, - .len = 2, - .cs_change = 1, - }; - - struct spi_transfer msg_xfer1 = { - .tx_buf = read_out_buf, - .rx_buf = in_buf, - .len = 2, - .cs_change = 0, - }; - - spi_message_init(&msg); - - out_buf[0] = RAONTV_CHIP_ADDR; - out_buf[1] = reg; - spi_message_add_tail(&msg_xfer0, &msg); - - read_out_buf[0] = RAONTV_CHIP_ADDR|0x1; - read_out_buf[1] = 0xFF; - spi_message_add_tail(&msg_xfer1, &msg); - - ret = spi_sync(tdmb_get_spi_handle(), &msg); - if (ret) { - printk(KERN_ERR "[mtv818_spi_read] mtv818_spi_read() error: %d\n", - ret); - return 0xFF; - } - - /* printk(KERN_ERR - "[mtv818_spi_read] in_buf[0]: 0x%02X, in_buf[1]: 0x%02X\n", - in_buf[0], in_buf[1]); */ - - return in_buf[1]; -} - -void mtv_spi_read_burst(unsigned char reg, unsigned char *buf, int size) -{ - int ret; - u8 out_buf[2], read_out_buf[2]; - struct spi_message msg; - struct spi_transfer msg_xfer0 = { - .tx_buf = out_buf, - .len = 2, - .cs_change = 1, - }; - - struct spi_transfer msg_xfer1 = { - .tx_buf = read_out_buf, - .rx_buf = buf, - .len = size, - .cs_change = 0, - }; - - spi_message_init(&msg); - out_buf[0] = RAONTV_CHIP_ADDR; - out_buf[1] = reg; - spi_message_add_tail(&msg_xfer0, &msg); - - read_out_buf[0] = RAONTV_CHIP_ADDR|0x1; - spi_message_add_tail(&msg_xfer1, &msg); - - ret = spi_sync(tdmb_get_spi_handle(), &msg); - if (ret) - printk(KERN_ERR "[mtv818_spi_read_burst] error: %d\n", ret); -} - -void mtv_spi_write(unsigned char reg, unsigned char val) -{ - u8 out_buf[3]; - u8 in_buf[3]; - struct spi_message msg; - struct spi_transfer msg_xfer = { - .len = 3, - .cs_change = 0, - }; - int ret; - - spi_message_init(&msg); - - out_buf[0] = 0x86; - out_buf[1] = reg; - out_buf[2] = val; - - msg_xfer.tx_buf = out_buf; - msg_xfer.rx_buf = in_buf; - spi_message_add_tail(&msg_xfer, &msg); - - ret = spi_sync(tdmb_get_spi_handle(), &msg); - if (ret) - printk(KERN_ERR "[mtv818_spi_write] error: %d\n", ret); -} -#endif diff --git a/drivers/media/tdmb/mtv318/raontv_port.h b/drivers/media/tdmb/mtv318/raontv_port.h deleted file mode 100644 index 85b55d9..0000000 --- a/drivers/media/tdmb/mtv318/raontv_port.h +++ /dev/null @@ -1,432 +0,0 @@ -/* - * - * File name: drivers/media/tdmb/mtv318/src/raontv_port.h - * - * Description : RAONTECH TV configuration header file. - * - * Copyright (C) (2011, RAONTECH) - * - * 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 version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef __RAONTV_PORT_H__ -#define __RAONTV_PORT_H__ - -/*============================================================================== - * Includes the user header files if neccessry. - *============================================================================*/ -#if defined(__KERNEL__) /* Linux kernel */ -#include <linux/io.h> -#include <linux/kernel.h> -#include <linux/delay.h> -#include <linux/mm.h> -#include <linux/mutex.h> - -#elif defined(WINCE) -#include <windows.h> -#include <drvmsg.h> -#endif - -#ifdef __cplusplus -extern "C" { -#endif - -/*############################################################################## - # - # COMMON configurations - # - #############################################################################*/ -/*============================================================================== - * The slave address for I2C and SPI, the base address for EBI2. - *============================================================================*/ -#define RAONTV_CHIP_ADDR 0x86 - -/*============================================================================== - * Modifies the basic data types if neccessry. - *============================================================================*/ -#define BOOL int -#define S8 s8 -#define U8 u8 -#define S16 s16 -#define U16 u16 -#define S32 s32 -#define U32 u32 - -#define INT int -#define UINT unsigned int -#define LONG long -#define ULONG unsigned long - -#define INLINE inline - -/*============================================================================== - * Selects the TV mode(s) to target product. - *============================================================================*/ -/*#define RTV_ISDBT_ENABLE*/ -#define RTV_TDMB_ENABLE -/*#define RTV_FM_ENABLE*/ -/*#define RTV_DAB_ENABLE*/ - -/*============================================================================== - * Defines the package type of chip to target product. - *============================================================================*/ -#define RAONTV_CHIP_PKG_WLCSP /* MTV220/318*/ -/*#define RAONTV_CHIP_PKG_QFN // MTV818*/ -/* #define RAONTV_CHIP_PKG_LGA MTV250/350 */ -/*============================================================================== - * Defines the external source freqenecy in KHz. - * Ex> #define RTV_SRC_CLK_FREQ_KHz 36000 // 36MHz - *============================================================================== - * MTV250 : #define RTV_SRC_CLK_FREQ_KHz 32000 //must be defined - * MTV350 : #define RTV_SRC_CLK_FREQ_KHz 24576 //must be defined - *============================================================================*/ -#define RTV_SRC_CLK_FREQ_KHz 24576 - -/*============================================================================== - * Define the power type. - *============================================================================*/ -/*#define RTV_PWR_EXTERNAL*/ -#define RTV_PWR_LDO -/* #define RTV_PWR_DCDC */ - -/*============================================================================== - * Defines the I/O voltage. - *============================================================================*/ -#define RTV_IO_1_8V -/*#define RTV_IO_2_5V*/ -/*#define RTV_IO_3_3V*/ - -#if defined(RTV_IO_2_5V) || defined(RTV_IO_3_3V) -#error "If VDDIO pin is connected with IO voltage," - " RTV_IO_1_8V must be defined,please check the HW pin connection" -#error "If VDDIO pin is connected with GND," - " IO voltage must be defined same as AP IO voltage" -#endif - -/*============================================================================== - * Defines the Host interface. - *============================================================================*/ -/*#define RTV_IF_MPEG2_SERIAL_TSIF*/ /* I2C + TSIF Master Mode. */ -/*#define RTV_IF_MPEG2_PARALLEL_TSIF*/ /* I2C + TSIF Master Mode. - Support only 1seg &TDMB Application!*/ -/*#define RTV_IF_QUALCOMM_TSIF*/ /* I2C + TSIF Master Mode */ -#define RTV_IF_SPI /* AP: SPI Master Mode */ -/*#define RTV_IF_SPI_SLAVE*/ /* AP: SPI Slave Mode */ -/*#define RTV_IF_EBI2*/ /* External Bus Interface Slave Mode */ - -/*============================================================================== - * Defines the clear mode of interrupts for EBI/SPI in Individual mode . - *============================================================================*/ -#define RTV_MSC_INTR_ISTAUS_ACC_CLR_MODE /* for Nested ISR and TSIF. */ -/* #define RTV_MSC_INTR_MEM_ACC_CLR_MODE */ /* for NOT nested ISR.*/ - -/*============================================================================== - * Defines the delay macro in milliseconds. - *============================================================================*/ -#if defined(__KERNEL__)/* Linux kernel */ -#define RTV_DELAY_MS(ms) mdelay(ms) - -#elif defined(WINCE) -#define RTV_DELAY_MS(ms) Sleep(ms) - -#else -extern void mtv818_delay_ms(int ms); -#define RTV_DELAY_MS(ms) mtv818_delay_ms(ms) /* TODO */ -#endif - -/*============================================================================== - * Defines the debug message macro. - *============================================================================*/ -#if 1 -#define RTV_DBGMSG0(fmt) printk(fmt) -#define RTV_DBGMSG1(fmt, arg1) printk(fmt, arg1) -#define RTV_DBGMSG2(fmt, arg1, arg2) printk(fmt, arg1, arg2) -#define RTV_DBGMSG3(fmt, arg1, arg2, arg3) printk(fmt, arg1, arg2, arg3) -#else -/* To eliminates the debug messages. */ -#define RTV_DBGMSG0(fmt) ((void)0) -#define RTV_DBGMSG1(fmt, arg1) ((void)0) -#define RTV_DBGMSG2(fmt, arg1, arg2) ((void)0) -#define RTV_DBGMSG3(fmt, arg1, arg2, arg3) ((void)0) -#endif -/*#### End of Common ###########*/ - -/*############################################################################## - # - # ISDB-T specific configurations - # - #############################################################################*/ -/*============================================================================== - * Defines the NOTCH FILTER setting Enable. - * In order to reject GSM/CDMA blocker, NOTCH FILTER must be defined. - * This feature used for module company in the JAPAN. - *============================================================================*/ -/* -//#if defined(RTV_ISDBT_ENABLE) //Do not use -// #ifdef RAONTV_CHIP_PKG_WLCSP -// #define RTV_NOTCH_FILTER_ENABLE -// #endif -//#endif -*/ -/*############################################################################## - # - # T-DMB/DAB specific configurations - # - #############################################################################*/ -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) -#define RTV_FIC_POLLING_MODE - -/* Defines the maximum number of Sub Channel to be open simultaneously. */ -#define RTV_MAX_NUM_SUB_CHANNEL_USED 1 - -/* Defines CIF or Individual Mode for T-DMB/DAB BY RAONTECH. */ -/*#define RTV_CIF_MODE_ENABLED*/ -/*#define RTV_CIF_HEADER_INSERTED*/ -/* Select the copying method of CIF decoded data(FIC and MSC) - which copy_to_user() or memcpy() to fast operation for LINUX Kernel. */ -/*#define RTV_CIF_LINUX_USER_SPACE_COPY_USED*/ -#endif /* #if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) */ - -/*############################################################################## - # - # FM specific configurations - # - #############################################################################*/ -#define RTV_FM_CH_MIN_FREQ_KHz 76000 -#define RTV_FM_CH_MAX_FREQ_KHz 108000 -#define RTV_FM_CH_STEP_FREQ_KHz 100 /* in KHz */ -/*############################################################################## - # - # Host Interface specific configurations - # - #############################################################################*/ -#if defined(RTV_IF_MPEG2_SERIAL_TSIF) || defined(RTV_IF_QUALCOMM_TSIF) \ - || defined(RTV_IF_MPEG2_PARALLEL_TSIF) -#define RTV_IF_TSIF -#endif - -#if defined(RTV_IF_MPEG2_SERIAL_TSIF) || defined(RTV_IF_QUALCOMM_TSIF) - #define RTV_IF_SERIAL_TSIF -#endif - - -#if defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) -/*============================================================================== - * Defines the TSIF interface for MPEG2 or QUALCOMM TSIF. - *============================================================================*/ -/*#define RTV_TSIF_FORMAT_1*/ -/*#define RTV_TSIF_FORMAT_2*/ -#define RTV_TSIF_FORMAT_3 -/*#define RTV_TSIF_FORMAT_4*/ -/*#define RTV_TSIF_FORMAT_5*/ - -/*#define RTV_TSIF_CLK_SPEED_DIV_2 // Host Clk/2*/ -#define RTV_TSIF_CLK_SPEED_DIV_4 /* Host Clk/4 */ -/*#define RTV_TSIF_CLK_SPEED_DIV_6 // Host Clk/6*/ -/*#define RTV_TSIF_CLK_SPEED_DIV_8 // Host Clk/8*/ - -/*========================================================================== - * Defines the register I/O macros. - *========================================================================*/ -unsigned char mtv818_i2c_read(U8 reg); -void mtv818_i2c_read_burst(U8 reg, U8 *buf, int size); -void mtv818_i2c_write(U8 reg, U8 val); -#define RTV_REG_GET(reg) \ - mtv818_i2c_read((U8)(reg)) -#define RTV_REG_BURST_GET(reg, buf, size) \ - mtv818_i2c_read_burst((U8)(reg), buf, size) -#define RTV_REG_SET(reg, val) \ - mtv818_i2c_write((U8)(reg), (U8)(val)) -#define RTV_REG_MASK_SET(reg, mask, val)\ -do { \ - U8 tmp; \ - tmp = (RTV_REG_GET(reg)|(U8)(mask)) & (U8)((~(mask))|(val)); \ - RTV_REG_SET(reg, tmp); \ -} while (0) - -#elif defined(RTV_IF_SPI) -/*========================================================================= - * Defines the register I/O macros. - *========================================================================*/ -unsigned char mtv_spi_read(unsigned char reg); -void mtv_spi_read_burst(unsigned char reg, unsigned char *buf, int size); -void mtv_spi_write(unsigned char reg, unsigned char val); - -#define RTV_REG_GET(reg) \ - (U8)mtv_spi_read((U8)(reg)) -#define RTV_REG_BURST_GET(reg, buf, size) \ - mtv_spi_read_burst((U8)(reg), buf, size) -#define RTV_REG_SET(reg, val) \ - mtv_spi_write((U8)(reg), (U8)(val)) -#define RTV_REG_MASK_SET(reg, mask, val) \ -do { \ - U8 tmp; \ - tmp = (RTV_REG_GET(reg)|(U8)(mask)) & (U8)((~(mask))|(val)); \ - RTV_REG_SET(reg, tmp); \ -} while (0) - - - -#else -#error "Must define the interface definition !" -#endif - -#if defined(RTV_IF_SPI) \ - || ((defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE)) \ - && !defined(RTV_FIC_POLLING_MODE)) -#if defined(__KERNEL__) -extern struct mutex raontv_guard; -#define RTV_GUARD_INIT mutex_init(&raontv_guard) -#define RTV_GUARD_LOCK mutex_lock(&raontv_guard) -#define RTV_GUARD_FREE mutex_unlock(&raontv_guard) -#define RTV_GUARD_DEINIT ((void)0) - -#elif defined(WINCE) -extern CRITICAL_SECTION raontv_guard; -#define RTV_GUARD_INIT InitializeCriticalSection(&raontv_guard) -#define RTV_GUARD_LOCK EnterCriticalSection(&raontv_guard) -#define RTV_GUARD_FREE LeaveCriticalSection(&raontv_guard) -#define RTV_GUARD_DEINIT DeleteCriticalSection(&raontv_guard) -#else -/* temp: TODO */ -#define RTV_GUARD_INIT ((void)0) -#define RTV_GUARD_LOCK ((void)0) -#define RTV_GUARD_FREE ((void)0) -#define RTV_GUARD_DEINIT ((void)0) -#endif - -#else -#define RTV_GUARD_INIT ((void)0) -#define RTV_GUARD_LOCK ((void)0) -#define RTV_GUARD_FREE ((void)0) -#define RTV_GUARD_DEINIT ((void)0) -#endif - -#if defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE)\ -|| defined(__KERNEL__) || defined(WINCE) - #ifdef RTV_MSC_INTR_MEM_ACC_CLR_MODE - #undef RTV_MSC_INTR_MEM_ACC_CLR_MODE - #endif - - #ifndef RTV_MSC_INTR_ISTAUS_ACC_CLR_MODE - #define RTV_MSC_INTR_ISTAUS_ACC_CLR_MODE - #endif -#endif - - -/*============================================================================== - * Check erros - *============================================================================*/ -#if !defined(RAONTV_CHIP_PKG_WLCSP) \ - && !defined(RAONTV_CHIP_PKG_QFN) \ - && !defined(RAONTV_CHIP_PKG_LGA) -#error "Must define the package type !" -#endif - -#if !defined(RTV_PWR_EXTERNAL) \ - && !defined(RTV_PWR_LDO) \ - && !defined(RTV_PWR_DCDC) -#error "Must define the power type !" -#endif - -#if !defined(RTV_IO_1_8V) \ - && !defined(RTV_IO_2_5V) \ - && !defined(RTV_IO_3_3V) -#error "Must define I/O voltage!" -#endif - -#if defined(RTV_IF_MPEG2_SERIAL_TSIF) \ - || defined(RTV_IF_SPI_SLAVE) \ - || defined(RTV_IF_MPEG2_PARALLEL_TSIF) \ - || defined(RTV_IF_QUALCOMM_TSIF) \ - || defined(RTV_IF_SPI) -#if (RAONTV_CHIP_ADDR >= 0xFF) -#error "Invalid chip address" -#endif -#elif defined(RTV_IF_EBI2) -#if (RAONTV_CHIP_ADDR <= 0xFF) -#error "Invalid chip address" -#endif - -#else -#error "Must define the interface definition !" -#endif - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) -#ifndef RTV_MAX_NUM_SUB_CHANNEL_USED -#error "Should be define!" -#endif - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -#if (RTV_MAX_NUM_SUB_CHANNEL_USED < 0) || (RTV_MAX_NUM_SUB_CHANNEL_USED > 5) -#error "Must from 1 to 5" -#endif -#else -#if (RTV_MAX_NUM_SUB_CHANNEL_USED < 0) || (RTV_MAX_NUM_SUB_CHANNEL_USED > 4) -#error "Must from 1 to 4" -#endif -#endif -#else -#ifdef RTV_MAX_NUM_SUB_CHANNEL_USED -#undef RTV_MAX_NUM_SUB_CHANNEL_USED -#define RTV_MAX_NUM_SUB_CHANNEL_USED 1 /* To not make error. */ -#else -#define RTV_MAX_NUM_SUB_CHANNEL_USED 1 -#endif -#endif - -#ifdef RTV_IF_MPEG2_PARALLEL_TSIF -#if defined(RTV_FM_ENABLE) \ - || defined(RTV_DAB_ENABLE) \ - || defined(RAONTV_CHIP_PKG_WLCSP) \ - || defined(RAONTV_CHIP_PKG_LGA) -#error "Not support parallel TSIF!" -#endif - -#if defined(RTV_TDMB_ENABLE) && (RTV_MAX_NUM_SUB_CHANNEL_USED > 1) -#error "Not support T-DMB multi sub channel mode!" -#endif - -#if defined(RTV_DAB_ENABLE) && (RTV_MAX_NUM_SUB_CHANNEL_USED > 1) -#error "Not support DAB multi sub channel mode!" -#endif -#endif - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -#if !defined(RTV_MSC_INTR_MEM_ACC_CLR_MODE) \ - && !defined(RTV_MSC_INTR_ISTAUS_ACC_CLR_MODE) -#error " Should selects an interrupt clear mode" -#endif - -#if defined(RTV_MSC_INTR_MEM_ACC_CLR_MODE) \ - && defined(RTV_MSC_INTR_ISTAUS_ACC_CLR_MODE) -#error " Should selects an interrupt clear mode" -#endif -#endif - -#if defined(RTV_DAB_ENABLE) && defined(RTV_TDMB_ENABLE) -#error "Should select RTV_DAB_ENABLE(B3, L-BAND, B3-Korea) " - "or RTV_TDMB_ENABLE(B3-Korea)" -#endif - -#if defined(RTV_CIF_HEADER_INSERTED) && !defined(RTV_CIF_MODE_ENABLED) -#error "Should defines RTV_CIF_MODE_ENABLED" -#endif - -void rtvOEM_ConfigureInterrupt(void); -void rtvOEM_PowerOn(int on); - -#ifdef __cplusplus -} -#endif - -#endif /* __RAONTV_PORT_H__ */ - diff --git a/drivers/media/tdmb/mtv318/raontv_rf.c b/drivers/media/tdmb/mtv318/raontv_rf.c deleted file mode 100644 index d4e436a..0000000 --- a/drivers/media/tdmb/mtv318/raontv_rf.c +++ /dev/null @@ -1,1532 +0,0 @@ -/* - * - * File name: drivers/media/tdmb/mtv318/src/raontv_rf.c - * - * Description : RAONTECH TV RF services source driver. - * - * Copyright (C) (2011, RAONTECH) - * - * 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 version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include "raontv_rf.h" - -#if defined(RTV_ISDBT_ENABLE) -#include "raontv_rf_pll_data_isdbt.h" -#endif - -#if defined(RTV_TDMB_ENABLE) -#include "raontv_rf_pll_data_tdmb.h" -#endif - -#if defined(RTV_FM_ENABLE) -#include "raontv_rf_pll_data_fm.h" -#endif - -#if defined(RTV_DAB_ENABLE) -#include "raontv_rf_pll_data_dab.h" -#include "raontv_rf_pll_data_tdmb.h" -#endif - -#include "raontv_rf_adc_data.h" - -#ifdef RTV_ISDBT_ENABLE - -static const RTV_REG_INIT_INFO t_ISDBT_INIT[] = { - { 0x27, 0x6a}, - { 0x2a, 0x07}, - { 0x2B, 0x88}, - { 0x2d, 0xec}, - { 0x2e, 0xb0}, - { 0x31, 0x04}, - { 0x34, 0xc0}, - { 0x3a, 0x77}, - { 0x3b, 0xff}, - { 0x3c, 0x79}, - { 0x3e, 0x67}, - { 0x3f, 0x00}, - { 0x42, 0x14}, - { 0x44, 0x40}, - { 0x47, 0xc0}, - { 0x49, 0x4f}, - { 0x4a, 0x10}, - { 0x4b, 0x80}, - { 0x53, 0x20}, - { 0x55, 0xfc}, - { 0x57, 0x10}, - { 0x5a, 0x83}, - { 0x60, 0x13}, - { 0x6b, 0x85}, -#if defined(RAONTV_CHIP_PKG_QFN) - { 0x6c, 0x8d}, - { 0x6d, 0x7d}, - -#elif defined(RAONTV_CHIP_PKG_WLCSP) - { 0x6c, 0x80}, - { 0x6d, 0x70}, - -#elif defined(RAONTV_CHIP_PKG_LGA) - { 0x6c, 0x80}, - { 0x6d, 0x70}, -#else -#error "Code not present" -#endif - { 0x72, 0xb0}, - { 0x73, 0xca}, - { 0x77, 0x89}, - { 0x84, 0x87}, - { 0x85, 0x95}, - { 0x86, 0x42}, - { 0x87, 0x60}, - { 0x8a, 0xf6}, - { 0x8b, 0x89}, - { 0x8c, 0x78}, - { 0x90, 0x07}, - { 0x93, 0x2F}, - { 0xb5, 0x1b}, - { 0xae, 0x37}, - { 0xc0, 0x31}, - { 0xc1, 0xe8}, - { 0xc3, 0xa2}, - { 0xc4, 0xac}, - { 0xc6, 0xeb}, - { 0xca, 0x38}, - { 0xcb, 0x8c}, - { 0xcd, 0xa1}, - { 0xce, 0xfc}, - { 0xd0, 0x3f}, - { 0xd4, 0x13}, - { 0xd5, 0xf9}, - { 0xd7, 0xa6}, - { 0xd8, 0xac}, - { 0xd9, 0x16}, - { 0xda, 0x79}, - { 0xde, 0x37}, - { 0xdf, 0x3d}, - { 0xe1, 0xa0}, - { 0xe2, 0x0c}, - { 0xe4, 0x3a}, - { 0xa5, 0x00}, - { 0xe9, 0xc1}, - /*CKO_D24_EN = 0, CK_16M clock, SET_IIR clock disable*/ - { 0xae, 0x77}, - { 0xe9, 0xd1} - /*CKO_D24_EN = 1, CK_16M clock, SET_IIR clock enable*/ -}; -#endif /* RTV_ISDBT_ENABLE */ - -#ifdef RTV_FM_ENABLE -static const RTV_REG_INIT_INFO t_FM_INIT[] = { - { 0x27, 0xc2}, - { 0x2B, 0x88}, - { 0x2d, 0xec}, - { 0x2e, 0xb0}, - { 0x31, 0x04}, - { 0x34, 0xf8}, - { 0x3a, 0x55}, - { 0x3b, 0x73}, - { 0x3c, 0x00}, - { 0x3e, 0x00}, - { 0x3f, 0x00}, - { 0x40, 0x10}, - { 0x42, 0x40}, - { 0x44, 0x64}, - { 0x47, 0xb1}, - { 0x4b, 0x80}, - { 0x53, 0x20}, - { 0x55, 0xd6}, - { 0x5a, 0x83}, - { 0x57, 0x10}, - { 0x60, 0x11}, - { 0x6b, 0xc5}, - { 0x72, 0xf0}, - { 0x73, 0xc8}, - { 0x74, 0x70}, - { 0x77, 0x80}, - { 0x78, 0x47}, - { 0x86, 0x80}, - { 0x87, 0x98}, - { 0x8a, 0xf6}, - { 0x8b, 0x80}, - { 0x8c, 0x74}, - { 0xaf, 0x01}, - { 0xb5, 0x5b}, - { 0xae, 0x37}, - { 0xbd, 0x3f}, - { 0xbe, 0x37}, - { 0xbf, 0x3c}, - { 0xc0, 0x3f}, - { 0xc1, 0x39}, - { 0xc3, 0xdb}, - { 0xc4, 0x3c}, - { 0xc5, 0x1e}, - { 0xc6, 0x6c}, - { 0xc8, 0x7b}, - { 0xc9, 0xec}, - { 0xca, 0x39}, - { 0xcb, 0x03}, - { 0xcd, 0xb4}, - { 0xce, 0xec}, - { 0xcf, 0x1d}, - { 0xd0, 0xa6}, - { 0xd1, 0x41}, - { 0xd2, 0x16}, - { 0xd3, 0xec}, - { 0xd4, 0x3f}, - { 0xd5, 0xc3}, - { 0xd7, 0xbd}, - { 0xd8, 0xbc}, - { 0xd9, 0x1b}, - { 0xda, 0x4b}, - { 0xdb, 0x3b}, - { 0xdc, 0x55}, - { 0xdd, 0xdc}, - { 0xde, 0x1a}, - { 0xdf, 0xed}, - { 0xe1, 0xa7}, - { 0xe2, 0xcc}, - { 0xe3, 0x1a}, - { 0xe4, 0x55}, - { 0xe5, 0x43}, - { 0xe6, 0x00}, - { 0xe7, 0x0f}, - { 0xa5, 0x00}, - { 0xe9, 0x41}, - { 0xae, 0x77}, - { 0xe9, 0x51} -}; -#endif /* RTV_FM_ENABLE */ - -#ifdef RTV_DAB_ENABLE -static const RTV_REG_INIT_INFO t_DAB_INIT[] = { - { 0x27, 0x96}, - { 0x2B, 0x88}, - { 0x2d, 0xec}, - { 0x2e, 0xb0}, - { 0x31, 0x04}, - { 0x34, 0xf8}, - { 0x35, 0x14}, - { 0x3a, 0x62}, - { 0x3b, 0x74}, - { 0x3c, 0xa8}, - { 0x43, 0x36}, - { 0x44, 0x70}, - { 0x46, 0x07}, - { 0x49, 0x1f}, - { 0x4a, 0x50}, - { 0x4b, 0x80}, - { 0x53, 0x20}, - { 0x55, 0xd6}, - { 0x5a, 0x83}, - { 0x60, 0x13}, - { 0x6b, 0x85}, - { 0x6e, 0x88}, - { 0x6f, 0x78}, - { 0x72, 0xf0}, - { 0x73, 0xca}, - { 0x77, 0x80}, - { 0x78, 0x47}, - { 0x84, 0x80}, - { 0x85, 0x90}, - { 0x86, 0x80}, - { 0x87, 0x98}, - { 0x8a, 0xf6}, - { 0x8b, 0x80}, - { 0x8c, 0x75}, - { 0x8f, 0xf9}, - { 0x90, 0x91}, - { 0x93, 0x2d}, - { 0x94, 0x23}, - { 0x99, 0x77}, - { 0x9a, 0x2d}, - { 0x9b, 0x1e}, - { 0x9c, 0x47}, - { 0x9d, 0x3a}, - { 0x9e, 0x03}, - { 0x9f, 0x1e}, - { 0xa0, 0x22}, - { 0xa1, 0x33}, - { 0xa2, 0x51}, - { 0xa3, 0x36}, - { 0xa4, 0x0c}, - { 0xae, 0x37}, - { 0xb5, 0x9b}, - { 0xbd, 0x45}, - { 0xbe, 0x68}, - { 0xbf, 0x5c}, - { 0xc0, 0x33}, - { 0xc1, 0xca}, - { 0xc2, 0x43}, - { 0xc3, 0x90}, - { 0xc4, 0xec}, - { 0xc5, 0x17}, - { 0xc6, 0xda}, - { 0xc7, 0x41}, - { 0xc8, 0x49}, - { 0xc9, 0xbc}, - { 0xca, 0x3a}, - { 0xcb, 0x20}, - { 0xcc, 0x43}, - { 0xcd, 0xa6}, - { 0xce, 0x4c}, - { 0xcf, 0x1f}, - { 0xd0, 0x8d}, - { 0xd1, 0x3d}, - { 0xd2, 0xdf}, - { 0xd3, 0xa4}, - { 0xd4, 0x30}, - { 0xd5, 0x00}, - { 0xd6, 0x41}, - { 0xd7, 0x81}, - { 0xd8, 0xd0}, - { 0xd9, 0x00}, - { 0xda, 0x00}, - { 0xdb, 0x41}, - { 0xdc, 0x6d}, - { 0xdd, 0xac}, - { 0xde, 0x39}, - { 0xdf, 0x4e}, - { 0xe0, 0x43}, - { 0xe1, 0xa0}, - { 0xe2, 0x4c}, - { 0xe3, 0x1d}, - { 0xe4, 0x99}, - { 0xe5, 0x3b}, - { 0xe6, 0x00}, - { 0xe7, 0x0d}, - { 0xa5, 0x00}, - { 0xe9, 0x41}, - { 0xae, 0x77}, - { 0xe9, 0x51} -}; - -static const RTV_REG_INIT_INFO t_BAND3_INIT[] = { - { 0x27, 0x96}, - { 0x34, 0xf8}, - { 0x3b, 0x74}, - { 0x43, 0x36}, - { 0x44, 0x70}, - { 0x46, 0x07}, - { 0x49, 0x1f}, - { 0x4a, 0x50}, - { 0x55, 0xd6}, - { 0x60, 0x13}, - { 0x6e, 0x88}, - { 0x6f, 0x78}, - { 0x84, 0x80}, - { 0x85, 0x90}, - { 0x86, 0x80}, - { 0x87, 0x98}, - { 0x8b, 0x80}, - { 0x8c, 0x75}, - { 0x8f, 0xf9}, - { 0x90, 0x91}, - { 0x93, 0x2d}, - { 0x94, 0x23} -}; - -static const RTV_REG_INIT_INFO t_LBAND_INIT[] = { - { 0x27, 0x3e}, - { 0x34, 0x70}, - { 0x3b, 0xf7}, - { 0x43, 0x34}, - { 0x44, 0x00}, - { 0x46, 0x03}, - { 0x49, 0xbf}, - { 0x4a, 0x18}, - { 0x55, 0xfa}, - { 0x60, 0x43}, - { 0x6e, 0x80}, - { 0x6f, 0x70}, - { 0x84, 0x70}, - { 0x85, 0x98}, - { 0x86, 0x70}, - { 0x87, 0x88}, - { 0x8b, 0x86}, - { 0x8c, 0x7a}, - { 0x8f, 0xfa}, - { 0x90, 0x05}, - { 0x93, 0x2f}, - { 0x94, 0x26} - -}; - -static const RTV_REG_INIT_INFO t_DAB_TDMB_INIT[] = { - - { 0x27, 0x96}, - { 0x34, 0xf8}, - { 0x3a, 0x62}, - { 0x3b, 0x74}, - { 0x3c, 0x81}, - { 0x3d, 0x48}, - { 0x43, 0x36}, - { 0x44, 0x70}, - { 0x46, 0x07}, - { 0x49, 0x1f}, - { 0x4a, 0x50}, - { 0x55, 0xd6}, - { 0x60, 0x13}, - { 0x6e, 0x88}, - { 0x6f, 0x78}, - { 0x84, 0x80}, - { 0x85, 0x90}, - { 0x86, 0x80}, - { 0x87, 0x98}, - { 0x8b, 0x80}, - { 0x8c, 0x75}, - { 0x8f, 0xf9}, - { 0x90, 0x91}, - { 0x93, 0x2d}, - { 0x94, 0x23} - -}; -#endif /* RTV_DAB_ENABLE */ - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO t_TDMB_INIT[] = { - { 0x2B, 0x88 }, - { 0x2d, 0xec }, - { 0x2e, 0xb0 }, - { 0x31, 0x04 }, - { 0x34, 0xf8 }, - { 0x3a, 0x62 }, - { 0x3b, 0x74 }, - { 0x3c, 0x81 }, - { 0x3d, 0x48 }, - { 0x4b, 0x80 }, - { 0x53, 0x20 }, - { 0x55, 0xd6 }, - { 0x5a, 0x83 }, - { 0x60, 0x13 }, - { 0x6b, 0x85 }, - { 0x72, 0xf0 }, - { 0x73, 0xca }, - { 0x77, 0x80 }, - { 0x78, 0x47 }, - { 0x85, 0x90 }, - { 0x86, 0x80 }, - { 0x87, 0x98 }, - { 0x8a, 0xf6 }, - { 0x8b, 0x80 }, - { 0x8c, 0x75 }, - { 0x8f, 0xf9 }, - { 0x90, 0x91 }, - { 0x94, 0x23 }, - { 0x99, 0x77 }, - { 0x9a, 0x2d }, - { 0x9b, 0x1e }, - { 0x9c, 0x47 }, - { 0x9d, 0x3a }, - { 0x9e, 0x03 }, - { 0x9f, 0x1e }, - { 0xa0, 0x22 }, - { 0xa1, 0x33 }, - { 0xa2, 0x51 }, - { 0xa3, 0x36 }, - { 0xa4, 0x0c }, - { 0xae, 0x37 }, - { 0xb5, 0x9b }, - { 0xbd, 0x45 }, - { 0xbe, 0x68 }, - { 0xbf, 0x5c }, - { 0xc0, 0x33 }, - { 0xc1, 0xca }, - { 0xc2, 0x43 }, - { 0xc3, 0x90 }, - { 0xc4, 0xec }, - { 0xc5, 0x17 }, - { 0xc6, 0xda }, - { 0xc7, 0x41 }, - { 0xc8, 0x49 }, - { 0xc9, 0xbc }, - { 0xca, 0x3a }, - { 0xcb, 0x20 }, - { 0xcc, 0x43 }, - { 0xcd, 0xa6 }, - { 0xce, 0x4c }, - { 0xcf, 0x1f }, - { 0xd0, 0x8d }, - { 0xd1, 0x3d }, - { 0xd2, 0xdf }, - { 0xd3, 0xa4 }, - { 0xd4, 0x30 }, - { 0xd5, 0x00 }, - { 0xd6, 0x41 }, - { 0xd7, 0x81 }, - { 0xd8, 0xd0 }, - { 0xd9, 0x00 }, - { 0xda, 0x00 }, - { 0xdb, 0x41 }, - { 0xdc, 0x6d }, - { 0xdd, 0xac }, - { 0xde, 0x39 }, - { 0xdf, 0x4e }, - { 0xe0, 0x43 }, - { 0xe1, 0xa0 }, - { 0xe2, 0x4c }, - { 0xe3, 0x1d }, - { 0xe4, 0x99 }, - { 0xe5, 0x3b }, - { 0xe6, 0x00 }, - { 0xe7, 0x0d }, - { 0xa5, 0x00 }, - { 0xe9, 0x41 }, - { 0xae, 0x77 }, - { 0xe9, 0x51 } }; -#endif /* RTV_TDMB_ENABLE */ - -/*============================================================================== - * rtvRF_ConfigurePowerType - * - * DESCRIPTION : - * This function returns - * - * - * ARGUMENTS : none. - * RETURN VALUE : none. - *============================================================================*/ -void rtvRF_ConfigurePowerType(enum E_RTV_TV_MODE_TYPE eTvMode) -{ -#if defined(RTV_IO_2_5V) - U8 io_type = 0; -#elif defined(RTV_IO_3_3V) - U8 io_type = 1; -#elif defined(RTV_IO_1_8V) - U8 io_type = 2; -#else -#error "Code not present" -#endif - U8 REG2F = 0x61; /*DCDC_OUTSEL = 0x03,*/ - U8 REG30 = 0xF2 & 0xF0; /*IOLDOCON__REG*/ - U8 REG52 = 0x07; /*LDODIG_HT = 0x07;*/ - U8 REG54 = 0x0C; - - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - REG54 = 0x1C; - break; -#endif - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: - REG54 = 0x1C; - break; -#endif - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: - REG54 = 0x1C; - break; -#endif - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_DAB_L: - case RTV_TV_MODE_TDMB: - REG54 = 0x1C; - break; -#endif - default: - return; - } - - REG30 = REG30 | (io_type << 1); /*IO Type Select.*/ - -#if defined(RTV_PWR_EXTERNAL) - REG2F = REG2F | 0x14; /*PDDCDC_I2C = 1, PDLDO12_I2C = 1 ;*/ -#elif defined(RTV_PWR_LDO) - REG2F = REG2F | 0x10; /*PDDCDC_I2C = 1, PDLDO12_I2C = 0 ;*/ -#elif defined(RTV_PWR_DCDC) - REG2F = REG2F | 0x04; /*PDDCDC_I2C = 0, PDLDO12_I2C = 1 ;*/ -#else -#error "Code not present" -#endif - - /* Below Power Up sequence is very important.*/ - RTV_REG_MAP_SEL(RF_PAGE); - RTV_REG_SET(0x54, REG54); - RTV_REG_SET(0x52, REG52); - RTV_REG_SET(0x30, REG30); - RTV_REG_SET(0x2F, REG2F); -} - -#define REGE8 (0x46 & 0xC0) -#define REGEA (0x07 & 0xC0) -#define REGEB (0x27 & 0xC0) -#define REGEC (0x1E & 0xC0) -#define REGED (0x18 & 0x00) -#define REGEE (0xB8 & 0x00) - -INT rtvRF_ConfigureAdcClock( - enum E_RTV_TV_MODE_TYPE eTvMode, - enum E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType) -{ - U8 REGE9, RD15; - INT i; - const U8 *pbAdcClkSynTbl = - (const U8 *) &g_abAdcClkSynTbl[eAdcClkFreqType]; - - if (pbAdcClkSynTbl[0] == 0xFF) { - RTV_DBGMSG1("[rtvRF_ConfigureAdcClock] " - "Unsupport ADC clock type: %d\n", eAdcClkFreqType); - return RTV_UNSUPPORT_ADC_CLK; - } - - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - REGE9 = (0xD4 & 0xF0); - break; -#endif - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: - REGE9 = (0x54 & 0xF0); - break; -#endif - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: - REGE9 = (0x54 & 0xF0); - break; -#endif - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_TDMB: - case RTV_TV_MODE_DAB_L: - REGE9 = (0x54 & 0xF0); - break; -#endif - default: - return RTV_INVAILD_TV_MODE; - } - - RTV_REG_MAP_SEL(RF_PAGE); - RTV_REG_SET(0xE8, (REGE8 | pbAdcClkSynTbl[0])); - RTV_REG_SET(0xE9, (REGE9 | pbAdcClkSynTbl[1])); - RTV_REG_SET(0xEA, (REGEA | pbAdcClkSynTbl[2])); - RTV_REG_SET(0xEB, (REGEB | pbAdcClkSynTbl[3])); - RTV_REG_SET(0xEC, (REGEC | pbAdcClkSynTbl[4])); - RTV_REG_SET(0xED, (REGED | pbAdcClkSynTbl[5])); - RTV_REG_SET(0xEE, (REGEE | pbAdcClkSynTbl[6])); - - for (i = 0; i < 10; i++) { - RD15 = RTV_REG_GET(0x15) & 0x01; - if (RD15) { - break; - } else { - RTV_DBGMSG0("[rtvRF_ConfigureAdcClock] " - "CLOCK SYNTH 1st step UnLock..\n"); - } - RTV_DELAY_MS(1); - } - - if (i == 10) { - RTV_DBGMSG0("[rtvRF_ConfigureAdcClock] " - "ADC clock unlocked!Check the power supply.\n"); - return RTV_ADC_CLK_UNLOCKED; - } - -#ifdef RTV_ISDBT_ENABLE - if (eTvMode == RTV_TV_MODE_1SEG) { - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x1A, 0x8B); - RTV_REG_SET(0x18, 0xC0); - RTV_REG_SET(0x19, 0x03); - RTV_REG_SET(0x07, 0xF0); - } -#endif - - /* Save the ADC clock type.*/ - g_eRtvAdcClkFreqType = eAdcClkFreqType; - - /*RTV_DBGMSG1("[rtvRF_ConfigureAdcClock] " - "ADC clk Type: %d\n", g_eRtvAdcClkFreqType[RaonTvChipIdx]);*/ - - return RTV_SUCCESS; -} - -INT rtvRF_ChangeAdcClock( - enum E_RTV_TV_MODE_TYPE eTvMode, - enum E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType) -{ - U8 REGE9, RD15; -#ifdef RTV_PWR_DCDC - U8 RD2F; -#endif - INT i; - const U8 *pbAdcClkSynTbl = - (const U8 *) &g_abAdcClkSynTbl[eAdcClkFreqType]; - - if (eAdcClkFreqType == g_eRtvAdcClkFreqType) - return RTV_SUCCESS; - - if (pbAdcClkSynTbl[0] == 0xFF) { - RTV_DBGMSG1("[rtvRF_ChangeAdcClock] " - "Unsupport ADC clock type: %d\n", eAdcClkFreqType); - return RTV_UNSUPPORT_ADC_CLK; - } - - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - REGE9 = (0xD4 & 0xF0); - break; -#endif - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: - REGE9 = (0x54 & 0xF0); - break; -#endif - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: - REGE9 = (0x54 & 0xF0); - break; -#endif - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_DAB_L: - case RTV_TV_MODE_TDMB: - REGE9 = (0x54 & 0xF0); - break; -#endif - default: - return RTV_INVAILD_TV_MODE; - } - - RTV_REG_MAP_SEL(RF_PAGE); - -#ifdef RTV_PWR_DCDC - RD2F = RTV_REG_GET(0x2F); - RTV_REG_SET(0x2F, (RD2F & 0xF7)); -#endif - - RTV_REG_SET(0xE8, (REGE8 | pbAdcClkSynTbl[0])); - RTV_REG_SET(0xE9, (REGE9 | pbAdcClkSynTbl[1])); - RTV_REG_SET(0xEA, (REGEA | pbAdcClkSynTbl[2])); - RTV_REG_SET(0xEB, (REGEB | pbAdcClkSynTbl[3])); - RTV_REG_SET(0xEC, (REGEC | pbAdcClkSynTbl[4])); - RTV_REG_SET(0xED, (REGED | pbAdcClkSynTbl[5])); - RTV_REG_SET(0xEE, (REGEE | pbAdcClkSynTbl[6])); - - for (i = 0; i < 10; i++) { - RD15 = RTV_REG_GET(0x15) & 0x01; - if (RD15) { - break; - } else { - RTV_DBGMSG0("[rtvRF_ChangeAdcClock] " - "CLOCK SYNTH 1st step UnLock..\n"); - } - RTV_DELAY_MS(1); - } - - if (i == 10) { - RTV_DBGMSG0("[rtvRF_ChangeAdcClock] " - "ADC clock unlocked!Check the power supply.\n"); - return RTV_ADC_CLK_UNLOCKED; - } - - switch (eAdcClkFreqType) { - case RTV_ADC_CLK_FREQ_8_MHz: - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x19, 0xff); - RTV_REG_SET(0x1a, 0x08); - RTV_REG_SET(0x1b, 0x82); - RTV_REG_SET(0x1c, 0x20); - - RTV_REG_SET(0x45, 0x10); - RTV_REG_SET(0x46, 0x04); - RTV_REG_SET(0x47, 0x41); - RTV_REG_SET(0x48, 0x10); - - RTV_REG_SET(0x49, 0x00); - RTV_REG_SET(0x4a, 0x00); - RTV_REG_SET(0x4b, 0x00); - RTV_REG_SET(0x4c, 0xF0); - break; -#endif - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) - case RTV_TV_MODE_TDMB: - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_DAB_L: - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_SET(0x6A, 0x01); - - RTV_REG_MAP_SEL(0x06); - RTV_REG_SET(0x3c, 0x4B); - RTV_REG_SET(0x3d, 0x37); - RTV_REG_SET(0x3e, 0x89); - RTV_REG_SET(0x3f, 0x41); - RTV_REG_SET(0x54, 0x58); - break; -#endif - default: - break; - } /* End of switch(eTvMode) */ - break; - - case RTV_ADC_CLK_FREQ_8_192_MHz: - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x19, 0xfd); - RTV_REG_SET(0x1a, 0xfc); - RTV_REG_SET(0x1b, 0xbe); - RTV_REG_SET(0x1c, 0x1f); - - RTV_REG_SET(0x45, 0xF7); - RTV_REG_SET(0x46, 0x7D); - RTV_REG_SET(0x47, 0xDF); - RTV_REG_SET(0x48, 0x0F); - - RTV_REG_SET(0x49, 0x00); - RTV_REG_SET(0x4a, 0x00); - RTV_REG_SET(0x4b, 0x60); - RTV_REG_SET(0x4c, 0xF0); - break; -#endif - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) - case RTV_TV_MODE_TDMB: - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_DAB_L: - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_SET(0x6A, 0x01); - - RTV_REG_MAP_SEL(0x06); - RTV_REG_SET(0x3c, 0x00); - RTV_REG_SET(0x3d, 0x00); - RTV_REG_SET(0x3e, 0x00); - RTV_REG_SET(0x3f, 0x40); - RTV_REG_SET(0x54, 0x58); -#endif - default: - break; - } /* End of switch(eTvMode) */ - break; - - case RTV_ADC_CLK_FREQ_9_MHz: - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x19, 0xe4); - RTV_REG_SET(0x1a, 0x5c); - RTV_REG_SET(0x1b, 0xe5); - RTV_REG_SET(0x1c, 0x1c); - - RTV_REG_SET(0x45, 0x47); - RTV_REG_SET(0x46, 0xAE); - RTV_REG_SET(0x47, 0x72); - RTV_REG_SET(0x48, 0x0E); - - RTV_REG_SET(0x49, 0x72); - RTV_REG_SET(0x4a, 0x1C); - RTV_REG_SET(0x4b, 0xC7); - RTV_REG_SET(0x4c, 0xF1); - break; -#endif - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) - case RTV_TV_MODE_TDMB: - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_DAB_L: - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_SET(0x6A, 0x21); - - RTV_REG_MAP_SEL(0x06); - RTV_REG_SET(0x3c, 0xB5); - RTV_REG_SET(0x3d, 0x14); - RTV_REG_SET(0x3e, 0x41); - RTV_REG_SET(0x3f, 0x3A); - RTV_REG_SET(0x54, 0x58); - break; -#endif - default: - break; - } /* End of switch(eTvMode) */ - break; - - case RTV_ADC_CLK_FREQ_9_6_MHz: - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x19, 0xd7); - RTV_REG_SET(0x1a, 0x08); - RTV_REG_SET(0x1b, 0x17); - RTV_REG_SET(0x1c, 0x1b); - - RTV_REG_SET(0x45, 0x62); - RTV_REG_SET(0x46, 0x83); - RTV_REG_SET(0x47, 0x8B); - RTV_REG_SET(0x48, 0x0D); - - RTV_REG_SET(0x49, 0xAB); - RTV_REG_SET(0x4a, 0xAA); - RTV_REG_SET(0x4b, 0xAA); - RTV_REG_SET(0x4c, 0xF2); - break; -#endif - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) - case RTV_TV_MODE_TDMB: - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_DAB_L: - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_SET(0x6A, 0x31); - - RTV_REG_MAP_SEL(0x06); - RTV_REG_SET(0x3c, 0x69); - RTV_REG_SET(0x3d, 0x03); - RTV_REG_SET(0x3e, 0x9D); - RTV_REG_SET(0x3f, 0x36); - RTV_REG_SET(0x54, 0x58); - break; -#endif - default: - break; - } /* End of switch(eTvMode) */ - break; - - default: - break; - } /* End of switch(eAdcClkFreqType) */ - -#ifdef RTV_PWR_DCDC - RTV_REG_MAP_SEL(RF_PAGE); - RD15 = RTV_REG_GET(0x15) & 0x01; - if (RD15) { - RTV_REG_SET(0x2F, RD2F); - } else { - RTV_DBGMSG0("[rtvRF_ChangeAdcClock] " - "DCDC CLOCK SYNTH UnLock..\n"); - } -#endif - - /*Save the ADC clock type. */ - g_eRtvAdcClkFreqType = eAdcClkFreqType; - - /*RTV_DBGMSG1("[rtvRF_ChangeAdcClock] " - "ADC clk Type: %d\n", g_eRtvAdcClkFreqType[RaonTvChipIdx]);*/ - - return RTV_SUCCESS; -} - -INT rtvRF_SetFrequency(enum E_RTV_TV_MODE_TYPE eTvMode, - UINT nChNum, - U32 dwChFreqKHz) -{ -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) - int nIdx; -#endif - -#ifdef RTV_DAB_ENABLE - UINT nNumTblEntry = 0; - const RTV_REG_INIT_INFO *ptInitTbl = NULL; -#endif -#ifdef RTV_NOTCH_FILTER_ENABLE - U8 notch_nIdx; -#endif - INT nRet = RTV_SUCCESS; - enum E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType = RTV_ADC_CLK_FREQ_8_MHz; - U32 dwPllNF = 0, rd_dwPllNF_Verify_val, wr_dwPllNF_Verify_val; - U8 RD15; - U32 PLL_Verify_cnt = 10; - - /* Get the PLLNF and ADC clock type. */ - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - if ((g_eRtvCountryBandType == RTV_COUNTRY_BAND_BRAZIL) - || (g_eRtvCountryBandType == RTV_COUNTRY_BAND_ARGENTINA)) - nChNum -= 1; - - switch (nChNum) { - case 14: case 22: case 38: case 46: case 54: - eAdcClkFreqType = g_aeAdcClkTypeTbl_ISDBT[1]; - break; - /*case 30:*/ - case 30: - case 61: - eAdcClkFreqType = g_aeAdcClkTypeTbl_ISDBT[2]; - break; - default: - eAdcClkFreqType = g_aeAdcClkTypeTbl_ISDBT[0]; - break; - } - dwPllNF = ISDBT_AUTO_PLLNF; - -#ifdef RTV_NOTCH_FILTER_ENABLE /*=> RTV_1SEG_NOTCH_FILTER_ENABLE ??*/ - switch (nChNum) { - /*notch filter value need to tuning*/ - case 14: - notch_nIdx = 0; - break; - default: - notch_nIdx = 0; - } -#endif - break; -#endif - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: - dwPllNF = g_atPllNF_FM[ - (dwChFreqKHz - FM_MIN_FREQ_KHz)/FM_SCAN_STEP_FREQ_KHz]; - eAdcClkFreqType = g_eRtvAdcClkFreqType; /* Only init adc clock type. */ - break; -#endif - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: - if (g_eRtvCountryBandType == RTV_COUNTRY_BAND_KOREA) { - nIdx = (dwChFreqKHz - TDMB_CH_FREQ_START__KOREA) - / TDMB_CH_FREQ_STEP__KOREA; - - if (dwChFreqKHz >= 205280) - nIdx -= 2; - else if (dwChFreqKHz >= 193280) - nIdx -= 1; - - eAdcClkFreqType = g_aeAdcClkTypeTbl_TDMB[nIdx]; - dwPllNF = g_atPllNF_TDMB_Korea[nIdx]; - } - break; -#endif - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - if (g_curDabSetType != RTV_TV_MODE_DAB_B3) { - ptInitTbl = t_BAND3_INIT; - nNumTblEntry = sizeof(t_BAND3_INIT) - / sizeof(RTV_REG_INIT_INFO); - - RTV_REG_MAP_SEL(RF_PAGE); - do { - RTV_REG_SET(ptInitTbl->bReg, ptInitTbl->bVal); - ptInitTbl++; - } while (--nNumTblEntry); - - g_curDabSetType = RTV_TV_MODE_DAB_B3; - } - - nIdx = (dwChFreqKHz - DAB_CH_BAND3_START_FREQ_KHz) - / DAB_CH_BAND3_STEP_FREQ_KHz; - - if (dwChFreqKHz >= 224096) - nIdx += 3; - else if (dwChFreqKHz >= 217008) - nIdx += 2; - else if (dwChFreqKHz >= 210096) - nIdx += 1; - - eAdcClkFreqType = g_aeAdcClkTypeTbl_DAB_B3[nIdx]; - dwPllNF = g_atPllNF_DAB_BAND3[nIdx]; - break; - - case RTV_TV_MODE_TDMB: - if (g_curDabSetType != RTV_TV_MODE_TDMB) { - ptInitTbl = t_DAB_TDMB_INIT; - nNumTblEntry = sizeof(t_DAB_TDMB_INIT) - / sizeof(RTV_REG_INIT_INFO); - RTV_REG_MAP_SEL(RF_PAGE); - do { - RTV_REG_SET(ptInitTbl->bReg, ptInitTbl->bVal); - ptInitTbl++; - } while (--nNumTblEntry); - } - - /*if(g_eRtvCountryBandType == RTV_COUNTRY_BAND_KOREA)*/ - { - nIdx = (dwChFreqKHz - TDMB_CH_FREQ_START__KOREA) - / TDMB_CH_FREQ_STEP__KOREA; - - if (dwChFreqKHz >= 205280) - nIdx -= 2; - else if (dwChFreqKHz >= 193280) - nIdx -= 1; - - eAdcClkFreqType = g_aeAdcClkTypeTbl_TDMB[nIdx]; - dwPllNF = g_atPllNF_TDMB_Korea[nIdx]; - g_curDabSetType = RTV_TV_MODE_TDMB; - } - break; - - case RTV_TV_MODE_DAB_L: - if (g_curDabSetType != RTV_TV_MODE_DAB_L) { - ptInitTbl = t_LBAND_INIT; - nNumTblEntry = sizeof(t_LBAND_INIT) - / sizeof(RTV_REG_INIT_INFO); - RTV_REG_MAP_SEL(RF_PAGE); - do { - RTV_REG_SET(ptInitTbl->bReg, ptInitTbl->bVal); - ptInitTbl++; - } while (--nNumTblEntry); - - g_curDabSetType = RTV_TV_MODE_DAB_L; - } - - nIdx = (dwChFreqKHz - DAB_CH_LBAND_START_FREQ_KHz) - / DAB_CH_LBAND_STEP_STEP_FREQ_KHz; - - eAdcClkFreqType = g_aeAdcClkTypeTbl_DAB_L[nIdx]; - dwPllNF = g_atPllNF_DAB_LBAND[nIdx]; - break; -#endif - - default: - nRet = RTV_INVAILD_TV_MODE; - goto RF_SET_FREQ_EXIT; - } - - g_fRtvChannelChange = TRUE; - - nRet = rtvRF_ChangeAdcClock(eTvMode, eAdcClkFreqType); - if (nRet != RTV_SUCCESS) - goto RF_SET_FREQ_EXIT; - - RTV_REG_MAP_SEL(RF_PAGE); - - /* Set the PLLNF and channel. */ - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: -#ifdef RTV_NOTCH_FILTER_ENABLE - RTV_REG_SET(0x21, (notch_nIdx<<4) | 0x01); - /*notch filter value need to tuning*/ -#endif - - RTV_REG_SET(0x20, nChNum); - RTV_DELAY_MS(2); /*2ms Delay*/ - - wr_dwPllNF_Verify_val = ( - dwPllNF + (((ISDBT_AUTO_PLL_NFSTEP * 8) & 0xFFFFF0) - * (nChNum >> 3)) - + ((nChNum & 0x07) * (ISDBT_AUTO_PLL_NFSTEP & 0xFFFFF0)) - ) >> 1; - - do { - RD15 = RTV_REG_GET(0x15); - rd_dwPllNF_Verify_val = - (RTV_REG_GET(0x12) << 22) - + (RTV_REG_GET(0x13) << 14) - +(RTV_REG_GET(0x14) << 6) + (RD15 >> 2); - - if ((wr_dwPllNF_Verify_val == rd_dwPllNF_Verify_val) - || (wr_dwPllNF_Verify_val - == (U32)(rd_dwPllNF_Verify_val >> 1))) { - - if ((RD15 & 0x02) == 0x02) - break; - else { - RTV_REG_SET(0x20, nChNum); - RTV_DELAY_MS(2); /*2ms Delay*/ - } - } else { - RTV_REG_SET(0x20, nChNum); - RTV_DELAY_MS(2); /*2ms Delay*/ - /*RTV_DBGMSG3("[rtvRF_SetFrequency] " - "1SEG PLL verify Re-Try!!!" - "PLLNF_I2C = 0x%0x" - "RD_PLLNF = 0x%0x RD_PLLNF*2 = 0x%0x\n", - wr_dwPllNF_Verify_val, - rd_dwPllNF_Verify_val, - rd_dwPllNF_Verify_val>>1);*/ - } - } while (--PLL_Verify_cnt); - - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x11, 0x07); - RTV_REG_SET(0x11, 0x06); - RTV_REG_MAP_SEL(FEC_PAGE); - RTV_REG_SET(0x10, 0x01); - RTV_REG_SET(0x10, 0x00); - break; -#endif - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: - RTV_REG_SET(0x23, (dwPllNF>>22)&0xFF); - RTV_REG_SET(0x24, (dwPllNF>>14)&0xFF); - RTV_REG_SET(0x25, (dwPllNF>>6)&0xFF); - RTV_REG_SET(0x26, (((dwPllNF&0x0000003F)<<2)) | 0x00); - RTV_DELAY_MS(1); /*1ms Delay*/ - RTV_REG_SET(0x20, 0x00); - - RTV_DELAY_MS(2);/*2ms Delay*/ - wr_dwPllNF_Verify_val = dwPllNF>>1; - - do { - RD15 = RTV_REG_GET(0x15); - rd_dwPllNF_Verify_val = - (RTV_REG_GET(0x12) << 22) - + (RTV_REG_GET(0x13) << 14) - + (RTV_REG_GET(0x14) << 6) + (RD15 >> 2); - - if (((dwPllNF & ~0x1) == (rd_dwPllNF_Verify_val & ~0x1)) - || (wr_dwPllNF_Verify_val == rd_dwPllNF_Verify_val)) { - - if ((RD15 & 0x02) == 0x02) - break; - else { - RTV_REG_SET(0x20, 0x00); - RTV_DELAY_MS(2); /*2ms Delay*/ - } - } else { - RTV_REG_SET(0x20, 0x00); - RTV_DELAY_MS(2); /*2ms Delay*/ - /*RTV_DBGMSG3("[rtvRF_SetFrequency] " - "FM PLL verify Re-Try!!! " - "PLLNF_I2C = 0x%0x, " - "PLLNF_I2C/2 = 0x%0x, " - "RD_PLLNF = 0x%0x\n", - dwPllNF & ~0x1, - wr_dwPllNF_Verify_val, - rd_dwPllNF_Verify_val & ~0x1);*/ - } - } while (--PLL_Verify_cnt); - - RTV_REG_MAP_SEL(0x06); /* ofdm */ - RTV_REG_SET(0x10, 0x48); - RTV_REG_SET(0x10, 0xC9); - break; -#endif - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: - RTV_REG_SET(0x23, (dwPllNF >> 22) & 0xFF); - RTV_REG_SET(0x24, (dwPllNF >> 14) & 0xFF); - RTV_REG_SET(0x25, (dwPllNF >> 6) & 0xFF); - RTV_REG_SET(0x26, (((dwPllNF & 0x0000003F) << 2)) | 0x00); - RTV_DELAY_MS(1); - /*1ms Delay*/ - RTV_REG_SET(0x20, 0x00); - - RTV_DELAY_MS(2); - /*2ms Delay*/ - wr_dwPllNF_Verify_val = dwPllNF >> 1; - - do { - RD15 = - RTV_REG_GET(0x15); - rd_dwPllNF_Verify_val = (RTV_REG_GET(0x12) << 22) - + (RTV_REG_GET(0x13) << 14) - + (RTV_REG_GET(0x14) << 6) - + (RD15 >> 2); - - /*RTV_DBGMSG3("[rtvRF_SetFrequency] " - "TDMB PLL PLLNF_I2C = 0x%0x, " - "PLLNF_I2C/2 = 0x%0x, " - "RD_PLLNF = 0x%0x\n", - dwPllNF & ~0x1, - wr_dwPllNF_Verify_val, - rd_dwPllNF_Verify_val & ~0x1);*/ - - if (((dwPllNF & ~0x1) == (rd_dwPllNF_Verify_val & ~0x1)) - || (wr_dwPllNF_Verify_val - == rd_dwPllNF_Verify_val)) { - - if ((RD15 & 0x02) == 0x02) - break; - else { - RTV_REG_SET(0x20, 0x00); - RTV_DELAY_MS(2); - /*2ms Delay*/ - } - } else { - RTV_REG_SET(0x20, 0x00); - RTV_DELAY_MS(2); - /*2ms Delay*/ - RTV_DBGMSG3("[rtvRF_SetFrequency] " - "TDMB PLL verify Re-Try!!! " - "PLLNF_I2C = 0x%0x, " - "PLLNF_I2C/2 = 0x%0x, " - "RD_PLLNF = 0x%0x\n", - dwPllNF & ~0x1, - wr_dwPllNF_Verify_val, - rd_dwPllNF_Verify_val & ~0x1); - } - } while (--PLL_Verify_cnt); - - RTV_REG_MAP_SEL(0x06); - /*ofdm*/ - RTV_REG_SET(0x10, 0x48); - RTV_REG_SET(0x10, 0xC9); - break; -#endif - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - case RTV_TV_MODE_DAB_L: - case RTV_TV_MODE_TDMB: - RTV_REG_SET(0x23, (dwPllNF>>22)&0xFF); - RTV_REG_SET(0x24, (dwPllNF>>14)&0xFF); - RTV_REG_SET(0x25, (dwPllNF>>6)&0xFF); - RTV_REG_SET(0x26, (((dwPllNF&0x0000003F)<<2)) | eTvMode); - RTV_DELAY_MS(1); /*1ms Delay*/ - RTV_REG_SET(0x20, 0x00); - - RTV_DELAY_MS(2); /*2ms Delay*/ - wr_dwPllNF_Verify_val = dwPllNF>>1; - - do { - RD15 = RTV_REG_GET(0x15); - rd_dwPllNF_Verify_val = - (RTV_REG_GET(0x12) << 22) - + (RTV_REG_GET(0x13) << 14) - +(RTV_REG_GET(0x14) << 6) + (RD15 >> 2); - - if (((dwPllNF & ~0x1) == (rd_dwPllNF_Verify_val & ~0x1)) - || (wr_dwPllNF_Verify_val - == rd_dwPllNF_Verify_val)) { - if ((RD15 & 0x02) == 0x02) - break; - else { - RTV_REG_SET(0x20, 0x00); - RTV_DELAY_MS(2); /*2ms Delay*/ - } - } else { - RTV_REG_SET(0x20, 0x00); - RTV_DELAY_MS(2); /*2ms Delay*/ - /*RTV_DBGMSG3("[rtvRF_SetFrequency] " - "DAB PLL verify Re-Try!!! " - "PLLNF_I2C = 0x%0x, " - "PLLNF_I2C/2 = 0x%0x, " - "RD_PLLNF = 0x%0x\n", - dwPllNF & ~0x1, - wr_dwPllNF_Verify_val, - rd_dwPllNF_Verify_val & ~0x1);*/ - } - } while (--PLL_Verify_cnt); - - RTV_REG_MAP_SEL(0x06); /* ofdm */ - RTV_REG_SET(0x10, 0x48); - RTV_REG_SET(0x10, 0xC9); - break; -#endif - - default: - break; - } - - if (PLL_Verify_cnt == 0) { - RTV_DBGMSG0("[rtvRF_SetFrequency] PLL unlocked!\n"); - nRet = RTV_PLL_UNLOCKED; - goto RF_SET_FREQ_EXIT; - } - - RTV_DELAY_MS(1); - /*1ms Delay*/ - -RF_SET_FREQ_EXIT: - g_fRtvChannelChange = FALSE; - - return nRet; -} - -INT rtvRF_Initilize(enum E_RTV_TV_MODE_TYPE eTvMode) -{ - UINT nNumTblEntry = 0, nNumAutoInit = 0; - const struct RTV_REG_INIT_INFO *ptInitTbl = NULL; - const struct RTV_REG_INIT_INFO *ptLNA = NULL; - const struct RTV_REG_MASK_INFO *ptAutoCh = NULL; - U32 dwAutoPllNF = 0, dwAutoPllNFSTEP = 0; - - g_fRtvChannelChange = FALSE; - - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - ptInitTbl = t_ISDBT_INIT; - nNumTblEntry = sizeof(t_ISDBT_INIT) / sizeof(struct RTV_REG_INIT_INFO); - ptLNA = g_atAutoLnaInitData_ISDBT; - ptAutoCh = g_atAutoChInitData_ISDBT; - nNumAutoInit = sizeof(g_atAutoChInitData_ISDBT) - / sizeof(RTV_REG_MASK_INFO); - dwAutoPllNF = ISDBT_AUTO_PLLNF; - dwAutoPllNFSTEP = ISDBT_AUTO_PLL_NFSTEP; - break; -#endif - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: - ptInitTbl = t_FM_INIT; - nNumTblEntry = sizeof(t_FM_INIT) / sizeof(struct RTV_REG_INIT_INFO); - ptLNA = g_atAutoLnaInitData_FM; - break; -#endif - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: - ptInitTbl = t_TDMB_INIT; - nNumTblEntry = sizeof(t_TDMB_INIT) / sizeof(struct RTV_REG_INIT_INFO); - ptLNA = g_atAutoLnaInitData_TDMB; - break; -#endif - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - ptInitTbl = t_DAB_INIT; - nNumTblEntry = sizeof(t_DAB_INIT) / sizeof(struct RTV_REG_INIT_INFO); - ptLNA = g_atAutoLnaInitData_DAB; - g_curDabSetType = RTV_TV_MODE_DAB_B3; - break; -#endif - - default: - return RTV_INVAILD_TV_MODE; - } - - RTV_REG_MAP_SEL(RF_PAGE); - - do { - RTV_REG_SET(ptInitTbl->bReg, ptInitTbl->bVal); - ptInitTbl++; - } while (--nNumTblEntry); - - /* Auto LNA */ - RTV_REG_SET(ptLNA[0].bReg, ptLNA[0].bVal); - RTV_REG_SET(ptLNA[1].bReg, ptLNA[1].bVal); - - /* Auto channel setting. */ - if (eTvMode == RTV_TV_MODE_1SEG) { - do { - RTV_REG_MASK_SET( - ptAutoCh->bReg, - ptAutoCh->bMask, - ptAutoCh->bVal); - ptAutoCh++; - } while (--nNumAutoInit); - - RTV_REG_SET(0x23, (dwAutoPllNF>>22)&0xFF); - RTV_REG_SET(0x24, (dwAutoPllNF>>14)&0xFF); - RTV_REG_SET(0x25, (dwAutoPllNF>>6)&0xFF); - - RTV_REG_SET(0x26, ((dwAutoPllNF&0x0000003F) << 2) | eTvMode); - - RTV_REG_SET(0x62, (dwAutoPllNFSTEP >> 16) & 0xFF); - RTV_REG_SET(0x63, (dwAutoPllNFSTEP >> 8) & 0xFF); - RTV_REG_SET(0x64, (dwAutoPllNFSTEP & 0xFF)); - -#ifdef RAONTV_CHIP_PKG_WLCSP - if (RTV_REG_GET(0x01) == 0x09) - RTV_REG_SET(0x21, 0xF1); -#endif - } - -#ifdef RTV_PWR_DCDC - { - U8 RD15 = RTV_REG_GET(0x15) & 0x01; - U8 RD2F = RTV_REG_GET(0x2F); - if (RD15) { - RD2F |= 0x08; - RTV_REG_SET(0x2F, RD2F); - } else { - RTV_DBGMSG0("[rtvRF_Initilize] Clock Unlock\n"); - } - } -#endif -/****************CODE PATCH FOR OTP****************/ - if (((U16) (RTV_REG_GET(0x10) << 8) - | (U16) (RTV_REG_GET(0x11))) != 0xFFFF) { - - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - RTV_REG_SET(0x2C, 0x48); - RTV_REG_SET(0x47, 0xE0); - break; -#endif - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: - RTV_REG_SET(0x2C, 0x48); - RTV_REG_SET(0x47, 0xE1); - RTV_REG_SET(0x35, 0x14); - break; -#endif - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: - RTV_REG_SET(0x2C, 0x48); - RTV_REG_SET(0x47, 0xC0); - break; -#endif - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - RTV_REG_SET(0x2C, 0x48); - RTV_REG_SET(0x47, 0xE0); - RTV_REG_SET(0x35, 0x04); - break; -#endif - default: - return RTV_INVAILD_TV_MODE; - } - - RTV_REG_SET(0x2A, 0x05); - RTV_REG_SET(0x2D, 0x8c); - RTV_REG_SET(0x61, 0x25); - } else { - switch (eTvMode) { -#ifdef RTV_ISDBT_ENABLE - case RTV_TV_MODE_1SEG: - RTV_REG_SET(0x2C, 0xC8); - RTV_REG_SET(0x47, 0xC0); - break; -#endif - -#ifdef RTV_FM_ENABLE - case RTV_TV_MODE_FM: - RTV_REG_SET(0x2C, 0xC8); - RTV_REG_SET(0x47, 0xB1); - RTV_REG_SET(0x35, 0x14); - break; -#endif - -#ifdef RTV_TDMB_ENABLE - case RTV_TV_MODE_TDMB: - RTV_REG_SET(0x2C, 0xC8); - RTV_REG_SET(0x47, 0xB0); - break; -#endif - -#ifdef RTV_DAB_ENABLE - case RTV_TV_MODE_DAB_B3: - RTV_REG_SET(0x2C, 0xC8); - RTV_REG_SET(0x47, 0xB0); - RTV_REG_SET(0x35, 0x04); - break; -#endif - default: - return RTV_INVAILD_TV_MODE; - } - - RTV_REG_SET(0x2A, 0x07); - RTV_REG_SET(0x2D, 0xec); - RTV_REG_SET(0x61, 0x2a); - } -/****************CODE PATCH FOR OTP****************/ - - return RTV_SUCCESS; -} - diff --git a/drivers/media/tdmb/mtv318/raontv_rf.h b/drivers/media/tdmb/mtv318/raontv_rf.h deleted file mode 100644 index 9b20233..0000000 --- a/drivers/media/tdmb/mtv318/raontv_rf.h +++ /dev/null @@ -1,46 +0,0 @@ -/* - * - * File name: drivers/media/tdmb/mtv318/src/raontv_rf.h - * - * Description : RAONTECH TV RF services header file. - * - * Copyright (C) (2011, RAONTECH) - * - * 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 version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#ifndef __RAONTV_RF_H__ -#define __RAONTV_RF_H__ - -#ifdef __cplusplus -extern "C" { -#endif - -#include "raontv_internal.h" - -INT rtvRF_SetFrequency(enum E_RTV_TV_MODE_TYPE eTvMode, - UINT nChNum, - U32 dwFreqKHz); -INT rtvRF_ChangeAdcClock( - enum E_RTV_TV_MODE_TYPE eTvMode, - enum E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType); -INT rtvRF_ConfigureAdcClock( - enum E_RTV_TV_MODE_TYPE eTvMode, - enum E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType); -void rtvRF_ConfigurePowerType(enum E_RTV_TV_MODE_TYPE eTvMode); -INT rtvRF_Initilize(enum E_RTV_TV_MODE_TYPE eTvMode); - -#ifdef __cplusplus -} -#endif - -#endif /* __RAONTV_RF_H__ */ - diff --git a/drivers/media/tdmb/mtv318/raontv_rf_adc_data.h b/drivers/media/tdmb/mtv318/raontv_rf_adc_data.h deleted file mode 100644 index be21711..0000000 --- a/drivers/media/tdmb/mtv318/raontv_rf_adc_data.h +++ /dev/null @@ -1,1037 +0,0 @@ -/* - * - * File name: drivers/media/tdmb/mtv318/src/raontv_rf_adc_data.h - * - * Description : RAONTECH TV RF ADC data header file. - * - * Copyright (C) (2011, RAONTECH) - * - * 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 version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#if (RTV_SRC_CLK_FREQ_KHz == 13000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /*Based 13MHz, 8MHz*/ - {0x0D, 0x01, 0x1F, 0x27, 0x07, 0x80, 0xB9}, - /*Based 13MHz, 8.192MHz*/ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /*Based 13MHz, 9MHz*/ - {0x0D, 0x01, 0x1F, 0x27, 0x07, 0xB0, 0xB9}, - /*Based 13MHz, 9.6MHz*/ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x99}, {0x39, 0x9C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x70}, {0x39, 0x5C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x70}, {0x39, 0x5C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x70}, {0x39, 0x6C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 16000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 16MHz, 8MHz External Clock4 */ - {0x04, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 16MHz, 8.192MHz*/ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 16MHz, 9MHz External Clock5 */ - {0x04, 0x01, 0x0F, 0x27, 0x07, 0x6C, 0xB8}, - /* Based 16MHz, 9.6MHz External Clock6 */ - {0x05, 0x01, 0x1F, 0x27, 0x07, 0x90, 0xB8} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x7D}, {0x39, 0x7C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x5B}, {0x39, 0x4C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x5B}, {0x39, 0x4C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x5B}, {0x39, 0x5C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 16384) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 16.384MHz, 8MHz External Clock8 */ - {0x10, 0x01, 0x1F, 0x27, 0x07, 0x77, 0xB9}, - /* Based 16.384MHz, 8.192MHz External Clock7 */ - {0x04, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 16.384MHz, 9MHz */ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 16.384MHz, 9.6MHz External Clock9 */ - {0x08, 0x01, 0x1F, 0x27, 0x06, 0xE1, 0xB8} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x7A}, {0x39, 0x7C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz -}; -#endif - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x59}, {0x39, 0x4C} -}; - -static const enum E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_TDMB[] = { - RTV_ADC_CLK_FREQ_8_192_MHz/* 175280: 7A */, - RTV_ADC_CLK_FREQ_8_MHz/* 177008: 7B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 178736: 7C */, - RTV_ADC_CLK_FREQ_8_192_MHz/* 181280: 8A */, - RTV_ADC_CLK_FREQ_8_MHz/* 183008: 8B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 184736: 8C */, - RTV_ADC_CLK_FREQ_8_192_MHz/* 187280: 9A */, - RTV_ADC_CLK_FREQ_8_MHz/* 189008: 9B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 190736: 9C */, - RTV_ADC_CLK_FREQ_8_MHz/* 193280: 10A */, - RTV_ADC_CLK_FREQ_8_MHz/* 195008: 10B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 196736: 10C */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 199280: 11A */, - RTV_ADC_CLK_FREQ_8_MHz/* 201008: 11B */, - RTV_ADC_CLK_FREQ_8_MHz/* 202736: 11C */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 205280: 12A */, - RTV_ADC_CLK_FREQ_8_MHz/* 207008: 12B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 208736: 12C */, - RTV_ADC_CLK_FREQ_8_192_MHz/* 211280: 13A */, - RTV_ADC_CLK_FREQ_8_MHz/* 213008: 13B */, - RTV_ADC_CLK_FREQ_8_MHz/* 214736: 13C */ -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x59}, {0x39, 0x4C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_DAB_B3[] = { - RTV_ADC_CLK_FREQ_8_192_MHz/*5A : 174928*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*5B : 176640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*5C : 178352*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*5D : 180064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*6A : 181936*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*6B : 183648*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*6C : 185360*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*6D : 187072*/, - RTV_ADC_CLK_FREQ_8_MHz/*7A : 188928*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*7B : 190640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*7C : 192352*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*7D : 194064*/, - RTV_ADC_CLK_FREQ_8_MHz/*8A : 195936*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*8B : 197648*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*8C : 199360*/, - RTV_ADC_CLK_FREQ_8_MHz/*8D : 201072*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*9A : 202928*/, - RTV_ADC_CLK_FREQ_8_MHz/*9B : 204640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*9C : 206352*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*9D : 208064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10A: 209936*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10N: 210096*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10B: 211648*/, - RTV_ADC_CLK_FREQ_8_MHz/*10C: 213360*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10D: 215072*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*11A: 216928*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*11N: 217008*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*11B: 218640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*11C: 220352*/, - RTV_ADC_CLK_FREQ_8_MHz/*11D: 222064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*12A: 223936*/, - RTV_ADC_CLK_FREQ_8_MHz/*12N: 224096*/, - RTV_ADC_CLK_FREQ_8_MHz/*12B: 225648*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*12C: 227360*/, - RTV_ADC_CLK_FREQ_8_MHz/*12D: 229072*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13A: 230784*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13B: 232496*/, - RTV_ADC_CLK_FREQ_8_MHz/*13C: 234208*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13D: 235776*/, - RTV_ADC_CLK_FREQ_8_MHz/*13E: 237488*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13F: 239200*/ -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_DAB_L[] = { - RTV_ADC_CLK_FREQ_8_192_MHz/*LA: 1452960*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LB: 1454672*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LC: 1456384*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LD: 1458096*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LE: 1459808*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LF: 1461520*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LG: 1463232*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LH: 1464944*/, - RTV_ADC_CLK_FREQ_8_MHz/*LI: 1466656*/, - RTV_ADC_CLK_FREQ_8_MHz/*LJ: 1468368*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LK: 1470080*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LL: 1471792*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LM: 1473504*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LN: 1475216*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LO: 1476928*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LP: 1478640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LQ: 1480352*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LR: 1482064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LS: 1483776*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LT: 1485488*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LU: 1487200*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LV: 1488912*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LW: 1490624*/ - -}; - -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x59}, {0x39, 0x4C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 18000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 18MHz, 8MHz External Clock10 */ - {0x06, 0x01, 0x13, 0x25, 0x06, 0x80, 0xB4}, - /* Based 18MHz, 8.192MHz */ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 18MHz, 9MHz External Clock11*/ - {0x06, 0x01, 0x13, 0x25, 0x06, 0x90, 0xB4}, - /* Based 18MHz, 9.6MHz External Clock12*/ - {0x05, 0x01, 0x13, 0x25, 0x06, 0x80, 0xB4} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x6F}, {0x39, 0x6C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x51}, {0x39, 0x4C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x51}, {0x39, 0x4C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x51}, {0x39, 0x4C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 19200) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 19.2MHz, 8MHz */ - {0x04, 0x01, 0x0B, 0x23, 0x06, 0x50, 0xB0}, - /* Based 19.2MHz, 8.192MHz */ - {0x19, 0x01, 0x1F, 0x3A, 0x0A, 0x00, 0xA2}, - /* Based 19.2MHz, 9MHz */ - {0x04, 0x01, 0x0B, 0x23, 0x06, 0x5A, 0xB0}, - /* Based 19.2MHz, 9.6MHz */ - {0x04, 0x01, 0x0B, 0x23, 0x06, 0x60, 0xB0} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x68}, {0x39, 0x6C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x4C}, {0x39, 0x3C} -}; - -static const enum E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_TDMB[] = { - RTV_ADC_CLK_FREQ_8_192_MHz/* 175280: 7A */, - RTV_ADC_CLK_FREQ_8_MHz/* 177008: 7B */, - RTV_ADC_CLK_FREQ_9_MHz/* 178736: 7C */, - RTV_ADC_CLK_FREQ_9_MHz/* 181280: 8A */, - RTV_ADC_CLK_FREQ_8_MHz/* 183008: 8B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 184736: 8C */, - RTV_ADC_CLK_FREQ_9_MHz/* 187280: 9A */, - RTV_ADC_CLK_FREQ_8_MHz/* 189008: 9B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 190736: 9C */, - RTV_ADC_CLK_FREQ_8_192_MHz/* 193280: 10A */, - RTV_ADC_CLK_FREQ_8_MHz/* 195008: 10B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 196736: 10C */, - RTV_ADC_CLK_FREQ_9_MHz/* 199280: 11A */, - RTV_ADC_CLK_FREQ_8_MHz/* 201008: 11B */, - RTV_ADC_CLK_FREQ_8_MHz/* 202736: 11C */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 205280: 12A */, - RTV_ADC_CLK_FREQ_8_MHz/* 207008: 12B */, - RTV_ADC_CLK_FREQ_8_MHz/* 208736: 12C */, - RTV_ADC_CLK_FREQ_9_MHz/* 211280: 13A */, - RTV_ADC_CLK_FREQ_8_MHz/* 213008: 13B */, - RTV_ADC_CLK_FREQ_8_MHz/* 214736: 13C */ -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x4C}, {0x39, 0x3C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_DAB_B3[] = { - RTV_ADC_CLK_FREQ_8_192_MHz/*5A : 174928*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*5B : 176640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*5C : 178352*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*5D : 180064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*6A : 181936*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*6B : 183648*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*6C : 185360*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*6D : 187072*/, - RTV_ADC_CLK_FREQ_8_MHz/*7A : 188928*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*7B : 190640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*7C : 192352*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*7D : 194064*/, - RTV_ADC_CLK_FREQ_8_MHz/*8A : 195936*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*8B : 197648*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*8C : 199360*/, - RTV_ADC_CLK_FREQ_8_MHz/*8D : 201072*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*9A : 202928*/, - RTV_ADC_CLK_FREQ_8_MHz/*9B : 204640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*9C : 206352*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*9D : 208064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10A: 209936*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10N: 210096*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10B: 211648*/, - RTV_ADC_CLK_FREQ_8_MHz/*10C: 213360*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10D: 215072*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*11A: 216928*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*11N: 217008*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*11B: 218640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*11C: 220352*/, - RTV_ADC_CLK_FREQ_8_MHz/*11D: 222064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*12A: 223936*/, - RTV_ADC_CLK_FREQ_8_MHz/*12N: 224096*/, - RTV_ADC_CLK_FREQ_8_MHz/*12B: 225648*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*12C: 227360*/, - RTV_ADC_CLK_FREQ_8_MHz/*12D: 229072*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13A: 230784*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13B: 232496*/, - RTV_ADC_CLK_FREQ_8_MHz/*13C: 234208*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13D: 235776*/, - RTV_ADC_CLK_FREQ_8_MHz/*13E: 237488*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13F: 239200*/ -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_DAB_L[] = { - RTV_ADC_CLK_FREQ_8_192_MHz/*LA: 1452960*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LB: 1454672*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LC: 1456384*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LD: 1458096*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LE: 1459808*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LF: 1461520*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LG: 1463232*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LH: 1464944*/, - RTV_ADC_CLK_FREQ_8_MHz/*LI: 1466656*/, - RTV_ADC_CLK_FREQ_8_MHz/*LJ: 1468368*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LK: 1470080*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LL: 1471792*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LM: 1473504*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LN: 1475216*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LO: 1476928*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LP: 1478640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LQ: 1480352*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LR: 1482064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LS: 1483776*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LT: 1485488*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LU: 1487200*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LV: 1488912*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LW: 1490624*/ -}; - -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x4C}, {0x39, 0x4C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 24000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 24MHz, 8MHz External Clock17 */ - {0x06, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 24MHz, 8.192MHz */ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 24MHz, 9MHz External Clock18 */ - {0x06, 0x01, 0x0F, 0x27, 0x07, 0x6C, 0xB8}, - /* Based 24MHz, 9.6MHz External Clock19 */ - {0x05, 0x01, 0x0B, 0x23, 0x06, 0x60, 0xB0} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x53}, {0x39, 0x5C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x3D}, {0x39, 0x3C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x3D}, {0x39, 0x3C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x3D}, {0x39, 0x3C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 24576) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 24.576MHz, 8MHz External Clock21 */ - {0x08, 0x01, 0x13, 0x25, 0x06, 0x7D, 0xB4}, - /* Based 24.576MHz, 8.192MHz External Clock20 */ - {0x06, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 24.576MHz, 9MHz *//* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 24.576MHz, 9.6MHz External Clock22 */ - {0x0C, 0x01, 0x1F, 0x27, 0x06, 0xE1, 0xB8} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x51}, {0x39, 0x4C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_8_192_MHz -}; -#endif - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x3B}, {0x39, 0x2C} -}; - -static const enum E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_TDMB[] = { - RTV_ADC_CLK_FREQ_8_192_MHz/* 175280: 7A */, - RTV_ADC_CLK_FREQ_8_MHz/* 177008: 7B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 178736: 7C */, - RTV_ADC_CLK_FREQ_8_192_MHz/* 181280: 8A */, - RTV_ADC_CLK_FREQ_8_MHz/* 183008: 8B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 184736: 8C */, - RTV_ADC_CLK_FREQ_8_192_MHz/* 187280: 9A */, - RTV_ADC_CLK_FREQ_8_MHz/* 189008: 9B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 190736: 9C */, - RTV_ADC_CLK_FREQ_8_192_MHz/* 193280: 10A */, - RTV_ADC_CLK_FREQ_8_MHz/* 195008: 10B */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 196736: 10C */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 199280: 11A */, - RTV_ADC_CLK_FREQ_8_MHz/* 201008: 11B */, - RTV_ADC_CLK_FREQ_8_MHz/* 202736: 11C */, - RTV_ADC_CLK_FREQ_9_6_MHz/* 205280: 12A */, - RTV_ADC_CLK_FREQ_8_MHz/* 207008: 12B */, - RTV_ADC_CLK_FREQ_8_192_MHz/* 208736: 12C */, - RTV_ADC_CLK_FREQ_8_192_MHz/* 211280: 13A */, - RTV_ADC_CLK_FREQ_8_MHz/* 213008: 13B */, - RTV_ADC_CLK_FREQ_8_MHz/* 214736: 13C */ -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x3B}, {0x39, 0x2C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_DAB_B3[] = { - RTV_ADC_CLK_FREQ_8_192_MHz/*5A : 174928*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*5B : 176640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*5C : 178352*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*5D : 180064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*6A : 181936*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*6B : 183648*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*6C : 185360*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*6D : 187072*/, - RTV_ADC_CLK_FREQ_8_MHz/*7A : 188928*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*7B : 190640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*7C : 192352*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*7D : 194064*/, - RTV_ADC_CLK_FREQ_8_MHz/*8A : 195936*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*8B : 197648*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*8C : 199360*/, - RTV_ADC_CLK_FREQ_8_MHz/*8D : 201072*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*9A : 202928*/, - RTV_ADC_CLK_FREQ_8_MHz/*9B : 204640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*9C : 206352*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*9D : 208064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10A: 209936*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10N: 210096*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10B: 211648*/, - RTV_ADC_CLK_FREQ_8_MHz/*10C: 213360*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*10D: 215072*/, - RTV_ADC_CLK_FREQ_9_6_MHz/*11A: 216928*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*11N: 217008*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*11B: 218640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*11C: 220352*/, - RTV_ADC_CLK_FREQ_8_MHz/*11D: 222064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*12A: 223936*/, - RTV_ADC_CLK_FREQ_8_MHz/*12N: 224096*/, - RTV_ADC_CLK_FREQ_8_MHz/*12B: 225648*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*12C: 227360*/, - RTV_ADC_CLK_FREQ_8_MHz/*12D: 229072*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13A: 230784*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13B: 232496*/, - RTV_ADC_CLK_FREQ_8_MHz/*13C: 234208*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13D: 235776*/, - RTV_ADC_CLK_FREQ_8_MHz/*13E: 237488*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*13F: 239200*/ -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_DAB_L[] = { - RTV_ADC_CLK_FREQ_8_192_MHz/*LA: 1452960*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LB: 1454672*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LC: 1456384*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LD: 1458096*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LE: 1459808*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LF: 1461520*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LG: 1463232*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LH: 1464944*/, - RTV_ADC_CLK_FREQ_8_MHz/*LI: 1466656*/, - RTV_ADC_CLK_FREQ_8_MHz/*LJ: 1468368*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LK: 1470080*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LL: 1471792*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LM: 1473504*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LN: 1475216*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LO: 1476928*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LP: 1478640*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LQ: 1480352*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LR: 1482064*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LS: 1483776*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LT: 1485488*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LU: 1487200*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LV: 1488912*/, - RTV_ADC_CLK_FREQ_8_192_MHz/*LW: 1490624*/ -}; - -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x3B}, {0x39, 0x6C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 26000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 26MHz, 8MHz External Clock23*/ - {0x0D, 0x01, 0x1F, 0x27, 0x06, 0xC0, 0xB8}, - /* Based 26MHz, 8.192MHz */ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 26MHz, 9MHz External Clock24 */ - {0x0D, 0x01, 0x1F, 0x27, 0x06, 0xD8, 0xB8}, - /* Based 26MHz, 9.6MHz */ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x4C}, {0x39, 0x4C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x38}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x38}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x38}, {0x39, 0x3C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 27000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 27MHz, 8MHz External Clock25 */ - {0x09, 0x01, 0x13, 0x25, 0x06, 0x80, 0xB4}, - /* Based 27MHz, 8.192MHz */ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 27MHz, 9MHz External Clock26 */ - {0x06, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 27MHz, 9.6MHz */ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x4A}, {0x39, 0x4C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x36}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x36}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x36}, {0x39, 0x2C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 32000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 32MHz, 8MHz External Clock27 */ - {0x08, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 32MHz, 8.192MHz */ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 32MHz, 9MHz External Clock28 */ - {0x08, 0x01, 0x0F, 0x27, 0x07, 0x6C, 0xB8}, - /* Based 32MHz, 9.6MHz External Clock29 */ - {0x0A, 0x01, 0x1F, 0x27, 0x07, 0x90, 0xB8} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x3E}, {0x39, 0x3C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x2D}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x2D}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x2D}, {0x39, 0x2C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 32768) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 32.768MHz, 8MHz External Clock31 */ - {0x20, 0x01, 0x1F, 0x27, 0x07, 0x77, 0xB9}, - /* Based 32.768MHz, 8.192MHz External Clock30 */ - {0x08, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 32.768MHz, 9MHz */ /* Unsupport Clock */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 32.768MHz, 9.6MHz External Clock32 */ - {0x10, 0x01, 0x1F, 0x27, 0x06, 0xE1, 0xB8} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x3D}, {0x39, 0x3C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x2C}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x2C}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x2C}, {0x39, 0x2C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 36000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 36MHz, 8MHz External Clock33 */ - {0x09, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 36MHz, 8.192MHz */ /* Unsupport */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 36MHz, 9MHz External Clock34 */ - {0x09, 0x01, 0x0F, 0x27, 0x07, 0x6C, 0xB8}, - /* Based 36MHz, 9.6MHz External Clock35 */ - {0x0A, 0x01, 0x13, 0x25, 0x06, 0x80, 0xB4} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x37}, {0x39, 0x3C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#if defined(RTV_TDMB_ENABLE) || defined(RTV_DAB_ENABLE) -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x28}, {0x39, 0x2C} -}; - - -static const enum E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_TDMB[] = { - RTV_ADC_CLK_FREQ_8_MHz/* 175280: 7A */, - RTV_ADC_CLK_FREQ_8_MHz/* 177008: 7B */, - RTV_ADC_CLK_FREQ_8_MHz/* 178736: 7C */, - RTV_ADC_CLK_FREQ_8_MHz/* 181280: 8A */, - RTV_ADC_CLK_FREQ_8_MHz/* 183008: 8B */, - RTV_ADC_CLK_FREQ_8_MHz/* 184736: 8C */, - RTV_ADC_CLK_FREQ_8_MHz/* 187280: 9A */, - RTV_ADC_CLK_FREQ_8_MHz/* 189008: 9B */, - RTV_ADC_CLK_FREQ_8_MHz/* 190736: 9C */, - RTV_ADC_CLK_FREQ_8_MHz/* 193280: 10A */, - RTV_ADC_CLK_FREQ_8_MHz/* 195008: 10B */, - RTV_ADC_CLK_FREQ_8_MHz/* 196736: 10C */, - RTV_ADC_CLK_FREQ_8_MHz/* 199280: 11A */, - RTV_ADC_CLK_FREQ_8_MHz/* 201008: 11B */, - RTV_ADC_CLK_FREQ_8_MHz/* 202736: 11C */, - RTV_ADC_CLK_FREQ_8_MHz/* 205280: 12A */, - RTV_ADC_CLK_FREQ_8_MHz/* 207008: 12B */, - RTV_ADC_CLK_FREQ_8_MHz/* 208736: 12C */, - RTV_ADC_CLK_FREQ_8_MHz/* 211280: 13A */, - RTV_ADC_CLK_FREQ_8_MHz/* 213008: 13B */, - RTV_ADC_CLK_FREQ_8_MHz/* 214736: 13C */ -}; - -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x28}, {0x39, 0x2C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_DAB_B3[] = { - RTV_ADC_CLK_FREQ_8_MHz/*5A : 174928*/, - RTV_ADC_CLK_FREQ_8_MHz/*5B : 176640*/, - RTV_ADC_CLK_FREQ_8_MHz/*5C : 178352*/, - RTV_ADC_CLK_FREQ_8_MHz/*5D : 180064*/, - RTV_ADC_CLK_FREQ_8_MHz/*6A : 181936*/, - RTV_ADC_CLK_FREQ_8_MHz/*6B : 183648*/, - RTV_ADC_CLK_FREQ_8_MHz/*6C : 185360*/, - RTV_ADC_CLK_FREQ_8_MHz/*6D : 187072*/, - RTV_ADC_CLK_FREQ_8_MHz/*7A : 188928*/, - RTV_ADC_CLK_FREQ_8_MHz/*7B : 190640*/, - RTV_ADC_CLK_FREQ_8_MHz/*7C : 192352*/, - RTV_ADC_CLK_FREQ_8_MHz/*7D : 194064*/, - RTV_ADC_CLK_FREQ_8_MHz/*8A : 195936*/, - RTV_ADC_CLK_FREQ_8_MHz/*8B : 197648*/, - RTV_ADC_CLK_FREQ_8_MHz/*8C : 199360*/, - RTV_ADC_CLK_FREQ_8_MHz/*8D : 201072*/, - RTV_ADC_CLK_FREQ_8_MHz/*9A : 202928*/, - RTV_ADC_CLK_FREQ_8_MHz/*9B : 204640*/, - RTV_ADC_CLK_FREQ_8_MHz/*9C : 206352*/, - RTV_ADC_CLK_FREQ_8_MHz/*9D : 208064*/, - RTV_ADC_CLK_FREQ_8_MHz/*10A: 209936*/, - RTV_ADC_CLK_FREQ_8_MHz/*10N: 210096*/, - RTV_ADC_CLK_FREQ_8_MHz/*10B: 211648*/, - RTV_ADC_CLK_FREQ_8_MHz/*10C: 213360*/, - RTV_ADC_CLK_FREQ_8_MHz/*10D: 215072*/, - RTV_ADC_CLK_FREQ_8_MHz/*11A: 216928*/, - RTV_ADC_CLK_FREQ_8_MHz/*11N: 217008*/, - RTV_ADC_CLK_FREQ_8_MHz/*11B: 218640*/, - RTV_ADC_CLK_FREQ_8_MHz/*11C: 220352*/, - RTV_ADC_CLK_FREQ_8_MHz/*11D: 222064*/, - RTV_ADC_CLK_FREQ_8_MHz/*12A: 223936*/, - RTV_ADC_CLK_FREQ_8_MHz/*12N: 224096*/, - RTV_ADC_CLK_FREQ_8_MHz/*12B: 225648*/, - RTV_ADC_CLK_FREQ_8_MHz/*12C: 227360*/, - RTV_ADC_CLK_FREQ_8_MHz/*12D: 229072*/, - RTV_ADC_CLK_FREQ_8_MHz/*13A: 230784*/, - RTV_ADC_CLK_FREQ_8_MHz/*13B: 232496*/, - RTV_ADC_CLK_FREQ_8_MHz/*13C: 234208*/, - RTV_ADC_CLK_FREQ_8_MHz/*13D: 235776*/, - RTV_ADC_CLK_FREQ_8_MHz/*13E: 237488*/, - RTV_ADC_CLK_FREQ_8_MHz/*13F: 239200*/ -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_DAB_L[] = { - - RTV_ADC_CLK_FREQ_8_MHz/*LA: 1452960*/, - RTV_ADC_CLK_FREQ_8_MHz/*LB: 1454672*/, - RTV_ADC_CLK_FREQ_8_MHz/*LC: 1456384*/, - RTV_ADC_CLK_FREQ_8_MHz/*LD: 1458096*/, - RTV_ADC_CLK_FREQ_8_MHz/*LE: 1459808*/, - RTV_ADC_CLK_FREQ_8_MHz/*LF: 1461520*/, - RTV_ADC_CLK_FREQ_8_MHz/*LG: 1463232*/, - RTV_ADC_CLK_FREQ_8_MHz/*LH: 1464944*/, - RTV_ADC_CLK_FREQ_8_MHz/*LI: 1466656*/, - RTV_ADC_CLK_FREQ_8_MHz/*LJ: 1468368*/, - RTV_ADC_CLK_FREQ_8_MHz/*LK: 1470080*/, - RTV_ADC_CLK_FREQ_8_MHz/*LL: 1471792*/, - RTV_ADC_CLK_FREQ_8_MHz/*LM: 1473504*/, - RTV_ADC_CLK_FREQ_8_MHz/*LN: 1475216*/, - RTV_ADC_CLK_FREQ_8_MHz/*LO: 1476928*/, - RTV_ADC_CLK_FREQ_8_MHz/*LP: 1478640*/, - RTV_ADC_CLK_FREQ_8_MHz/*LQ: 1480352*/, - RTV_ADC_CLK_FREQ_8_MHz/*LR: 1482064*/, - RTV_ADC_CLK_FREQ_8_MHz/*LS: 1483776*/, - RTV_ADC_CLK_FREQ_8_MHz/*LT: 1485488*/, - RTV_ADC_CLK_FREQ_8_MHz/*LU: 1487200*/, - RTV_ADC_CLK_FREQ_8_MHz/*LV: 1488912*/, - RTV_ADC_CLK_FREQ_8_MHz/*LW: 1490624*/ -}; - -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x28}, {0x39, 0x2C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 38400) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 38.4MHz, 8MHz External Clock36 */ - {0x08, 0x01, 0x0B, 0x23, 0x06, 0x50, 0xB0}, - /* Based 38.4MHz, 8.192MHz External Clock37 */ - {0x19, 0x01, 0x1F, 0x27, 0x06, 0x00, 0xB9}, - /* Based 38.4MHz, 9MHz External Clock38 */ - {0x08, 0x01, 0x0B, 0x23, 0x06, 0x5A, 0xB0}, - /* Based 38.4MHz, 9.6MHz External Clock39 */ - {0x0A, 0x01, 0x0F, 0x27, 0x07, 0x78, 0xB8} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x34}, {0x39, 0x3C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x26}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x26}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x26}, {0x39, 0x2C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 40000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 40MHz, 8MHz External Clock40 */ - {0x0A, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 40MHz, 8.192MHz */ /* Unsupport */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 40MHz, 9MHz External Clock41 */ - {0x0A, 0x01, 0x0F, 0x27, 0x07, 0x6C, 0xB8}, - /* Based 40MHz, 9.6MHz External Clock42 */ - {0x19, 0x01, 0x1F, 0x27, 0x06, 0x20, 0xB9} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x32}, {0x39, 0x3C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x24}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x24}, {0x39, 0x2C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x24}, {0x39, 0x2C} -}; -#endif - -#elif (RTV_SRC_CLK_FREQ_KHz == 48000) -static const U8 g_abAdcClkSynTbl[MAX_NUM_RTV_ADC_CLK_FREQ_TYPE][7] = { - /* Based 48MHz, 8MHz External Clock43 */ - {0x0C, 0x01, 0x0F, 0x27, 0x07, 0x60, 0xB8}, - /* Based 48MHz, 8.192MHz */ /* Unsupport */ - {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF}, - /* Based 48MHz, 9MHz External Clock44 */ - {0x0C, 0x01, 0x0F, 0x27, 0x07, 0x6C, 0xB8}, - /* Based 48MHz, 9.6MHz External Clock45 */ - {0x0A, 0x01, 0x0B, 0x23, 0x06, 0x60, 0xB0} -}; - -#ifdef RTV_ISDBT_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_ISDBT[] = { - {0x37, 0x29}, {0x39, 0x2C} -}; - -static const E_RTV_ADC_CLK_FREQ_TYPE g_aeAdcClkTypeTbl_ISDBT[] = { - RTV_ADC_CLK_FREQ_8_MHz, - RTV_ADC_CLK_FREQ_9_6_MHz, - RTV_ADC_CLK_FREQ_9_MHz -}; -#endif - -#ifdef RTV_TDMB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_TDMB[] = { - {0x37, 0x1E}, {0x39, 0x1C} -}; -#endif - -#ifdef RTV_DAB_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_DAB[] = { - {0x37, 0x1E}, {0x39, 0x1C} -}; -#endif - -#ifdef RTV_FM_ENABLE -static const struct RTV_REG_INIT_INFO g_atAutoLnaInitData_FM[] = { - {0x37, 0x1E}, {0x39, 0x2C} -}; -#endif - -#else -#error "Unsupport external clock freqency!" -#endif - diff --git a/drivers/media/tdmb/mtv318/raontv_rf_pll_data_tdmb.h b/drivers/media/tdmb/mtv318/raontv_rf_pll_data_tdmb.h deleted file mode 100644 index 0f5e132..0000000 --- a/drivers/media/tdmb/mtv318/raontv_rf_pll_data_tdmb.h +++ /dev/null @@ -1,412 +0,0 @@ -/* - * - * File name: drivers/media/tdmb/mtv318/src/raontv_rf_pll_data_tdmb.h - * - * Description : RAONTECH TV RF PLL data header file. - * - * Copyright (C) (2011, RAONTECH) - * - * 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 version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#if (RTV_SRC_CLK_FREQ_KHz == 13000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x6BE2115/* 7A: 175280 */, - 0x6CF24B4/* 7B: 177008 */, - 0x6E02854/* 7C: 178736 */, - 0x6F934C6/* 8A: 181280 */, - 0x70A3866/* 8B: 183008 */, - 0x71B3C05/* 8C: 184736 */, - 0x7344877/* 9A: 187280 */, - 0x7454C17/* 9B: 189008 */, - 0x7564FB6/* 9C: 190736 */, - 0x76F5C28/* 10A: 193280 */, - 0x7805FC8/* 10B: 195008 */, - 0x7916368/* 10C: 196736 */, - 0x7AA6FDA/* 11A: 199280 */, - 0x7BB7379/* 11B: 201008 */, - 0x7CC7719/* 11C: 202736 */, - 0x7E5838B/* 12A: 205280 */, - 0x7F6872B/* 12B: 207008 */, - 0x8078ACA/* 12C: 208736 */, - 0x820973C/* 13A: 211280 */, - 0x8319ADC/* 13B: 213008 */, - 0x8429E7B/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 16000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x57A7AE1/* 7A: 175280 */, - 0x5884DD2/* 7B: 177008 */, - 0x59620C4/* 7C: 178736 */, - 0x5AA7AE1/* 8A: 181280 */, - 0x5B84DD2/* 8B: 183008 */, - 0x5C620C4/* 8C: 184736 */, - 0x5DA7AE1/* 9A: 187280 */, - 0x5E84DD2/* 9B: 189008 */, - 0x5F620C4/* 9C: 190736 */, - 0x60A7AE1/* 10A: 193280 */, - 0x6184DD2/* 10B: 195008 */, - 0x62620C4/* 10C: 196736 */, - 0x63A7AE1/* 11A: 199280 */, - 0x6484DD2/* 11B: 201008 */, - 0x65620C4/* 11C: 202736 */, - 0x66A7AE1/* 12A: 205280 */, - 0x6784DD2/* 12B: 207008 */, - 0x68620C4/* 12C: 208736 */, - 0x69A7AE1/* 13A: 211280 */, - 0x6A84DD2/* 13B: 213008 */, - 0x6B620C4/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 16384) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x5599C00/* 7A: 175280 */, - 0x5671C00/* 7B: 177008 */, - 0x5749C00/* 7C: 178736 */, - 0x5887C00/* 8A: 181280 */, - 0x595FC00/* 8B: 183008 */, - 0x5A37C00/* 8C: 184736 */, - 0x5B75C00/* 9A: 187280 */, - 0x5C4DC00/* 9B: 189008 */, - 0x5D25C00/* 9C: 190736 */, - 0x5E63C00/* 10A: 193280 */, - 0x5F3BC00/* 10B: 195008 */, - 0x6013C00/* 10C: 196736 */, - 0x6151C00/* 11A: 199280 */, - 0x6229C00/* 11B: 201008 */, - 0x6301C00/* 11C: 202736 */, - 0x643FC00/* 12A: 205280 */, - 0x6517C00/* 12B: 207008 */, - 0x65EFC00/* 12C: 208736 */, - 0x672DC00/* 13A: 211280 */, - 0x6805C00/* 13B: 213008 */, - 0x68DDC00/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 18000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x4DEA61D/* 7A: 175280 */, - 0x4EAEFD7/* 7B: 177008 */, - 0x4F73992/* 7C: 178736 */, - 0x50950C8/* 8A: 181280 */, - 0x5159A82/* 8B: 183008 */, - 0x521E43C/* 8C: 184736 */, - 0x533FB72/* 9A: 187280 */, - 0x540452D/* 9B: 189008 */, - 0x54C8EE7/* 9C: 190736 */, - 0x55EA61D/* 10A: 193280 */, - 0x56AEFD7/* 10B: 195008 */, - 0x5773992/* 10C: 196736 */, - 0x58950C8/* 11A: 199280 */, - 0x5959A82/* 11B: 201008 */, - 0x5A1E43C/* 11C: 202736 */, - 0x5B3FB72/* 12A: 205280 */, - 0x5C0452D/* 12B: 207008 */, - 0x5CC8EE7/* 12C: 208736 */, - 0x5DEA61D/* 13A: 211280 */, - 0x5EAEFD7/* 13B: 213008 */, - 0x5F73992/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 19200) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x490BBBB/* 7A: 175280 */, - 0x49C40DA/* 7B: 177008 */, - 0x4A7C5F9/* 7C: 178736 */, - 0x4B8BBBB/* 8A: 181280 */, - 0x4C440DA/* 8B: 183008 */, - 0x4CFC5F9/* 8C: 184736 */, - 0x4E0BBBB/* 9A: 187280 */, - 0x4EC40DA/* 9B: 189008 */, - 0x4F7C5F9/* 9C: 190736 */, - 0x508BBBB/* 10A: 193280 */, - 0x51440DA/* 10B: 195008 */, - 0x51FC5F9/* 10C: 196736 */, - 0x530BBBB/* 11A: 199280 */, - 0x53C40DA/* 11B: 201008 */, - 0x547C5F9/* 11C: 202736 */, - 0x558BBBB/* 12A: 205280 */, - 0x56440DA/* 12B: 207008 */, - 0x56FC5F9/* 12C: 208736 */, - 0x580BBBB/* 13A: 211280 */, - 0x58C40DA/* 13B: 213008 */, - 0x597C5F9/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 24000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x3A6FC96/* 7A: 175280 */, - 0x3B033E1/* 7B: 177008 */, - 0x3B96B2D/* 7C: 178736 */, - 0x3C6FC96/* 8A: 181280 */, - 0x3D033E1/* 8B: 183008 */, - 0x3D96B2D/* 8C: 184736 */, - 0x3E6FC96/* 9A: 187280 */, - 0x3F033E1/* 9B: 189008 */, - 0x3F96B2D/* 9C: 190736 */, - 0x406FC96/* 10A: 193280 */, - 0x41033E1/* 10B: 195008 */, - 0x4196B2D/* 10C: 196736 */, - 0x426FC96/* 11A: 199280 */, - 0x43033E1/* 11B: 201008 */, - 0x4396B2D/* 11C: 202736 */, - 0x446FC96/* 12A: 205280 */, - 0x45033E1/* 12B: 207008 */, - 0x4596B2D/* 12C: 208736 */, - 0x466FC96/* 13A: 211280 */, - 0x47033E1/* 13B: 213008 */, - 0x4796B2D/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 24576) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x39112AA/* 7A: 175280 */, - 0x39A12AA/* 7B: 177008 */, - 0x3A312AA/* 7C: 178736 */, - 0x3B052AA/* 8A: 181280 */, - 0x3B952AA/* 8B: 183008 */, - 0x3C252AA/* 8C: 184736 */, - 0x3CF92AA/* 9A: 187280 */, - 0x3D892AA/* 9B: 189008 */, - 0x3E192AA/* 9C: 190736 */, - 0x3EED2AA/* 10A: 193280 */, - 0x3F7D2AA/* 10B: 195008 */, - 0x400D2AA/* 10C: 196736 */, - 0x40E12AA/* 11A: 199280 */, - 0x41712AA/* 11B: 201008 */, - 0x42012AA/* 11C: 202736 */, - 0x42D52AA/* 12A: 205280 */, - 0x43652AA/* 12B: 207008 */, - 0x43F52AA/* 12C: 208736 */, - 0x44C92AA/* 13A: 211280 */, - 0x45592AA/* 13B: 213008 */, - 0x45E92AA/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 26000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x35F108A/* 7A: 175280 */, - 0x367925A/* 7B: 177008 */, - 0x370142A/* 7C: 178736 */, - 0x37C9A63/* 8A: 181280 */, - 0x3851C33/* 8B: 183008 */, - 0x38D9E02/* 8C: 184736 */, - 0x39A243B/* 9A: 187280 */, - 0x3A2A60B/* 9B: 189008 */, - 0x3AB27DB/* 9C: 190736 */, - 0x3B7AE14/* 10A: 193280 */, - 0x3C02FE4/* 10B: 195008 */, - 0x3C8B1B4/* 10C: 196736 */, - 0x3D537ED/* 11A: 199280 */, - 0x3DDB9BC/* 11B: 201008 */, - 0x3E63B8C/* 11C: 202736 */, - 0x3F2C1C5/* 12A: 205280 */, - 0x3FB4395/* 12B: 207008 */, - 0x403C565/* 12C: 208736 */, - 0x4104B9E/* 13A: 211280 */, - 0x418CD6E/* 13B: 213008 */, - 0x4214F3D/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 27000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x33F1969/* 7A: 175280 */, - 0x3474A8F/* 7B: 177008 */, - 0x34F7BB6/* 7C: 178736 */, - 0x35B8B30/* 8A: 181280 */, - 0x363BC57/* 8B: 183008 */, - 0x36BED7D/* 8C: 184736 */, - 0x377FCF7/* 9A: 187280 */, - 0x3802E1E/* 9B: 189008 */, - 0x3885F45/* 9C: 190736 */, - 0x3946EBE/* 10A: 193280 */, - 0x39C9FE5/* 10B: 195008 */, - 0x3A4D10C/* 10C: 196736 */, - 0x3B0E085/* 11A: 199280 */, - 0x3B911AC/* 11B: 201008 */, - 0x3C142D3/* 11C: 202736 */, - 0x3CD524C/* 12A: 205280 */, - 0x3D58373/* 12B: 207008 */, - 0x3DDB49A/* 12C: 208736 */, - 0x3E9C413/* 13A: 211280 */, - 0x3F1F53A/* 13B: 213008 */, - 0x3FA2661/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 32000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x2BD3D70/* 7A: 175280 */, - 0x2C426E9/* 7B: 177008 */, - 0x2CB1062/* 7C: 178736 */, - 0x2D53D70/* 8A: 181280 */, - 0x2DC26E9/* 8B: 183008 */, - 0x2E31062/* 8C: 184736 */, - 0x2ED3D70/* 9A: 187280 */, - 0x2F426E9/* 9B: 189008 */, - 0x2FB1062/* 9C: 190736 */, - 0x3053D70/* 10A: 193280 */, - 0x30C26E9/* 10B: 195008 */, - 0x3131062/* 10C: 196736 */, - 0x31D3D70/* 11A: 199280 */, - 0x32426E9/* 11B: 201008 */, - 0x32B1062/* 11C: 202736 */, - 0x3353D70/* 12A: 205280 */, - 0x33C26E9/* 12B: 207008 */, - 0x3431062/* 12C: 208736 */, - 0x34D3D70/* 13A: 211280 */, - 0x35426E9/* 13B: 213008 */, - 0x35B1062/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 32768) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x2ACCE00/* 7A: 175280 */, - 0x2B38E00/* 7B: 177008 */, - 0x2BA4E00/* 7C: 178736 */, - 0x2C43E00/* 8A: 181280 */, - 0x2CAFE00/* 8B: 183008 */, - 0x2D1BE00/* 8C: 184736 */, - 0x2DBAE00/* 9A: 187280 */, - 0x2E26E00/* 9B: 189008 */, - 0x2E92E00/* 9C: 190736 */, - 0x2F31E00/* 10A: 193280 */, - 0x2F9DE00/* 10B: 195008 */, - 0x3009E00/* 10C: 196736 */, - 0x30A8E00/* 11A: 199280 */, - 0x3114E00/* 11B: 201008 */, - 0x3180E00/* 11C: 202736 */, - 0x321FE00/* 12A: 205280 */, - 0x328BE00/* 12B: 207008 */, - 0x32F7E00/* 12C: 208736 */, - 0x3396E00/* 13A: 211280 */, - 0x3402E00/* 13B: 213008 */, - 0x346EE00/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 36000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x26F530E/* 7A: 175280 */, - 0x27577EB/* 7B: 177008 */, - 0x27B9CC9/* 7C: 178736 */, - 0x284A864/* 8A: 181280 */, - 0x28ACD41/* 8B: 183008 */, - 0x290F21E/* 8C: 184736 */, - 0x299FDB9/* 9A: 187280 */, - 0x2A02296/* 9B: 189008 */, - 0x2A64773/* 9C: 190736 */, - 0x2AF530E/* 10A: 193280 */, - 0x2B577EB/* 10B: 195008 */, - 0x2BB9CC9/* 10C: 196736 */, - 0x2C4A864/* 11A: 199280 */, - 0x2CACD41/* 11B: 201008 */, - 0x2D0F21E/* 11C: 202736 */, - 0x2D9FDB9/* 12A: 205280 */, - 0x2E02296/* 12B: 207008 */, - 0x2E64773/* 12C: 208736 */, - 0x2EF530E/* 13A: 211280 */, - 0x2F577EB/* 13B: 213008 */, - 0x2FB9CC9/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 38400) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x2485DDD/* 7A: 175280 */, - 0x24E206D/* 7B: 177008 */, - 0x253E2FC/* 7C: 178736 */, - 0x25C5DDD/* 8A: 181280 */, - 0x262206D/* 8B: 183008 */, - 0x267E2FC/* 8C: 184736 */, - 0x2705DDD/* 9A: 187280 */, - 0x276206D/* 9B: 189008 */, - 0x27BE2FC/* 9C: 190736 */, - 0x2845DDD/* 10A: 193280 */, - 0x28A206D/* 10B: 195008 */, - 0x28FE2FC/* 10C: 196736 */, - 0x2985DDD/* 11A: 199280 */, - 0x29E206D/* 11B: 201008 */, - 0x2A3E2FC/* 11C: 202736 */, - 0x2AC5DDD/* 12A: 205280 */, - 0x2B2206D/* 12B: 207008 */, - 0x2B7E2FC/* 12C: 208736 */, - 0x2C05DDD/* 13A: 211280 */, - 0x2C6206D/* 13B: 213008 */, - 0x2CBE2FC/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 40000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x230FDF3/* 7A: 175280 */, - 0x2368587/* 7B: 177008 */, - 0x23C0D1B/* 7C: 178736 */, - 0x2443126/* 8A: 181280 */, - 0x249B8BA/* 8B: 183008 */, - 0x24F404E/* 8C: 184736 */, - 0x257645A/* 9A: 187280 */, - 0x25CEBED/* 9B: 189008 */, - 0x2627381/* 9C: 190736 */, - 0x26A978D/* 10A: 193280 */, - 0x2701F21/* 10B: 195008 */, - 0x275A6B5/* 10C: 196736 */, - 0x27DCAC0/* 11A: 199280 */, - 0x2835254/* 11B: 201008 */, - 0x288D9E8/* 11C: 202736 */, - 0x290FDF3/* 12A: 205280 */, - 0x2968587/* 12B: 207008 */, - 0x29C0D1B/* 12C: 208736 */, - 0x2A43126/* 13A: 211280 */, - 0x2A9B8BA/* 13B: 213008 */, - 0x2AF404E/* 13C: 214736 */ - -}; - -#elif (RTV_SRC_CLK_FREQ_KHz == 48000) -static const U32 g_atPllNF_TDMB_Korea[] = { - 0x1D37E4B/* 7A: 175280 */, - 0x1D819F0/* 7B: 177008 */, - 0x1DCB596/* 7C: 178736 */, - 0x1E37E4B/* 8A: 181280 */, - 0x1E819F0/* 8B: 183008 */, - 0x1ECB596/* 8C: 184736 */, - 0x1F37E4B/* 9A: 187280 */, - 0x1F819F0/* 9B: 189008 */, - 0x1FCB596/* 9C: 190736 */, - 0x2037E4B/* 10A: 193280 */, - 0x20819F0/* 10B: 195008 */, - 0x20CB596/* 10C: 196736 */, - 0x2137E4B/* 11A: 199280 */, - 0x21819F0/* 11B: 201008 */, - 0x21CB596/* 11C: 202736 */, - 0x2237E4B/* 12A: 205280 */, - 0x22819F0/* 12B: 207008 */, - 0x22CB596/* 12C: 208736 */, - 0x2337E4B/* 13A: 211280 */, - 0x23819F0/* 13B: 213008 */, - 0x23CB596/* 13C: 214736 */ - -}; - -#else -#error "Code not present" -#endif diff --git a/drivers/media/tdmb/mtv318/raontv_tdmb.c b/drivers/media/tdmb/mtv318/raontv_tdmb.c deleted file mode 100644 index 4b20f7e..0000000 --- a/drivers/media/tdmb/mtv318/raontv_tdmb.c +++ /dev/null @@ -1,1987 +0,0 @@ -/* - * - * File name: drivers/media/tdmb/mtv318/src/raontv_tdmb.c - * - * Description : RAONTECH TV T-DMB services driver. - * - * Copyright (C) (2011, RAONTECH) - * - * 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 version 2. - * - * This program is distributed "as is" WITHOUT ANY WARRANTY of any - * kind, whether express or implied; without even the implied warranty - * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - */ - -#include "raontv_rf.h" - -#ifdef RTV_TDMB_ENABLE - -#undef OFDM_PAGE -#define OFDM_PAGE 0x6 - -#undef FEC_PAGE -#define FEC_PAGE 0x09 - -#define MAX_NUM_TDMB_SUB_CH 64 - -/* Registered sub channel Table. */ -struct RTV_TDMB_REG_SUBCH_INFO { - UINT nSubChID; - UINT nHwSubChIdx; - enum E_RTV_TDMB_SERVICE_TYPE eServiceType; - UINT nThresholdSize; -}; - -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1) /* Single Sub Channel */ -#define TDMB_MSC0_SUBCH_USE_MASK 0x00 /* NA */ -#define TDMB_MSC1_SUBCH_USE_MASK 0x01 /* SUBCH 0 */ - -#else /* Multi Sub Channel */ -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -#define TDMB_MSC0_SUBCH_USE_MASK 0x78 /* SUBCH 3,4,5,6 */ -#else -#define TDMB_MSC0_SUBCH_USE_MASK 0x70 /* SUBCH 3,4,5 */ -#endif -#define TDMB_MSC1_SUBCH_USE_MASK 0x01 /* SUBCH 0 */ -#endif - -static struct RTV_TDMB_REG_SUBCH_INFO - g_atTdmbRegSubchInfo[RTV_MAX_NUM_SUB_CHANNEL_USED]; -static UINT g_nRegSubChArrayIdxBits; -static UINT g_nRtvUsedHwSubChIdxBits; -static U32 g_dwTdmbPrevChFreqKHz; -static BOOL g_fRtvTdmbConfiguredFIC; - -#define SUBCH_GRP_IDX(sub_ch_id) (sub_ch_id >> 5) /* Divide by 32 */ -#define MOD32(x) (x & 31) -/* Used sub channel ID bits. [0]: 0 ~ 31, [1]: 32 ~ 63 */ -static U32 g_aRegSubChIdBits[2]; - -/*============================================================================== - * Replace the below code to eliminates the sqrt() and log10() functions. - * In addtion, to eliminates floating operation, - * we multiplied by RTV_TDMB_SNR_DIVIDER to the floating SNR. - * SNR = (double)(100/(sqrt((double)data) - * - log10((double)data)*log10((double)data)) -7); - *============================================================================*/ -static const U16 g_awSNR_15_160[] = { - 33163/* 15 */, - 32214/* 16 */, - 31327/* 17 */, - 30496/* 18 */, - 29714/* 19 */, - 28978/* 20 */, - 28281/* 21 */, - 27622/* 22 */, - 26995/* 23 */, - 26400/* 24 */, - 25832/* 25 */, - 25290/* 26 */, - 24772/* 27 */, - 24277/* 28 */, - 23801/* 29 */, - 23345/* 30 */, - 22907/* 31 */, - 22486/* 32 */, - 22080/* 33 */, - 21690/* 34 */, - 21313/* 35 */, - 20949/* 36 */, - 20597/* 37 */, - 20257/* 38 */, - 19928/* 39 */, - 19610/* 40 */, - 19301/* 41 */, - 19002/* 42 */, - 18712/* 43 */, - 18430/* 44 */, - 18156/* 45 */, - 17890/* 46 */, - 17632/* 47 */, - 17380/* 48 */, - 17135/* 49 */, - 16897/* 50 */, - 16665/* 51 */, - 16438/* 52 */, - 16218/* 53 */, - 16002/* 54 */, - 15792/* 55 */, - 15587/* 56 */, - 15387/* 57 */, - 15192/* 58 */, - 15001/* 59 */, - 14814/* 60 */, - 14631/* 61 */, - 14453/* 62 */, - 14278/* 63 */, - 14107/* 64 */, - 13939/* 65 */, - 13775/* 66 */, - 13615/* 67 */, - 13457/* 68 */, - 13303/* 69 */, - 13152/* 70 */, - 13004/* 71 */, - 12858/* 72 */, - 12715/* 73 */, - 12575/* 74 */, - 12438/* 75 */, - 12303/* 76 */, - 12171/* 77 */, - 12041/* 78 */, - 11913/* 79 */, - 11788/* 80 */, - 11664/* 81 */, - 11543/* 82 */, - 11424/* 83 */, - 11307/* 84 */, - 11192/* 85 */, - 11078/* 86 */, - 10967/* 87 */, - 10857/* 88 */, - 10749/* 89 */, - 10643/* 90 */, - 10539/* 91 */, - 10436/* 92 */, - 10334/* 93 */, - 10235/* 94 */, - 10136/* 95 */, - 10039/* 96 */, - 9944/* 97 */, - 9850/* 98 */, - 9757/* 99 */, - 9666/* 100 */, - 9576/* 101 */, - 9487/* 102 */, - 9400/* 103 */, - 9314/* 104 */, - 9229/* 105 */, - 9145/* 106 */, - 9062/* 107 */, - 8980/* 108 */, - 8900/* 109 */, - 8820/* 110 */, - 8742/* 111 */, - 8664/* 112 */, - 8588/* 113 */, - 8512/* 114 */, - 8438/* 115 */, - 8364/* 116 */, - 8292/* 117 */, - 8220/* 118 */, - 8149/* 119 */, - 8079/* 120 */, - 8010/* 121 */, - 7942/* 122 */, - 7874/* 123 */, - 7807/* 124 */, - 7742/* 125 */, - 7676/* 126 */, - 7612/* 127 */, - 7548/* 128 */, - 7485/* 129 */, - 7423/* 130 */, - 7362/* 131 */, - 7301/* 132 */, - 7241/* 133 */, - 7181/* 134 */, - 7123/* 135 */, - 7064/* 136 */, - 7007/* 137 */, - 6950/* 138 */, - 6894/* 139 */, - 6838/* 140 */, - 6783/* 141 */, - 6728/* 142 */, - 6674/* 143 */, - 6621/* 144 */, - 6568/* 145 */, - 6516/* 146 */, - 6464/* 147 */, - 6412/* 148 */, - 6362/* 149 */, - 6311/* 150 */, - 6262/* 151 */, - 6212/* 152 */, - 6164/* 153 */, - 6115/* 154 */, - 6067/* 155 */, - 6020/* 156 */, - 5973/* 157 */, - 5927/* 158 */, - 5881/* 159 */, - 5835 /* 160 */ -}; - -static void tdmb_InitTOP(void) -{ - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x07, 0x08); - RTV_REG_SET(0x05, 0x17); - RTV_REG_SET(0x06, 0x10); - RTV_REG_SET(0x0A, 0x00); -} - -/*============================================================================== - * Name : tdmb_InitCOMM - * Action : MAP SEL COMM Register Init - * Input : Chip Address - * Output : None - *============================================================================*/ -static void tdmb_InitCOMM(void) -{ - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_SET(0x10, 0x91); - RTV_REG_SET(0xE1, 0x00); - - RTV_REG_SET(0x35, 0X8B); - RTV_REG_SET(0x3B, 0x3C); - - RTV_REG_SET(0x36, 0x67); - RTV_REG_SET(0x3A, 0x0F); - - RTV_REG_SET(0x3C, 0x20); - RTV_REG_SET(0x3D, 0x0B); - RTV_REG_SET(0x3D, 0x09); - - RTV_REG_SET(0xA6, 0x30); - /*0x30 ==>NO TSOUT@Error packet, 0x10 ==> NULL PID PACKET@Error packet*/ - - RTV_REG_SET(0xAA, 0x01); - /* Enable 0x47 insertion to video frame. */ - - RTV_REG_SET(0xAF, 0x07); - /* FEC */ - -} - -/*============================================================================== - * Name : tdmb_InitHOST - * Action : MAP SEL HOST Register Init - * Input : Chip Address - * Output : None - *============================================================================*/ -static void tdmb_InitHOST(void) -{ - RTV_REG_MAP_SEL(HOST_PAGE); - RTV_REG_SET(0x10, 0x00); - RTV_REG_SET(0x13, 0x16); - RTV_REG_SET(0x14, 0x00); - RTV_REG_SET(0x19, 0x0A); - RTV_REG_SET(0xF0, 0x00); - RTV_REG_SET(0xF1, 0x00); - RTV_REG_SET(0xF2, 0x00); - RTV_REG_SET(0xF3, 0x00); - RTV_REG_SET(0xF4, 0x00); - RTV_REG_SET(0xF5, 0x00); - RTV_REG_SET(0xF6, 0x00); - RTV_REG_SET(0xF7, 0x00); - RTV_REG_SET(0xF8, 0x00); - RTV_REG_SET(0xFB, 0xFF); - -} - -/*============================================================================== - * Name : tdmb_InitOFDM - * Action : MAP SEL OFDM Register Init - * Input : Chip Address - * Output : None - *============================================================================*/ -static void tdmb_InitOFDM(void) -{ - U8 INV_MODE; - U8 PWM_COM; - U8 WAGC_COM; - U8 AGC_MODE; - U8 POST_INIT; - U8 AGC_CYCLE; - - INV_MODE = 1; - PWM_COM = 0x08; - WAGC_COM = 0x03; - AGC_MODE = 0x06; - POST_INIT = 0x09; - AGC_CYCLE = 0x10; - - RTV_REG_MAP_SEL(OFDM_PAGE); - - if (g_eRtvCountryBandType == RTV_COUNTRY_BAND_KOREA) - RTV_REG_SET(0x11, 0x8e); - - RTV_REG_SET(0x12, 0x04); - - RTV_REG_SET(0x13, 0x72); - RTV_REG_SET(0x14, 0x63); - RTV_REG_SET(0x15, 0x64); - - RTV_REG_SET(0x16, 0x6C); - - RTV_REG_SET(0x1a, 0xb4); - - RTV_REG_SET(0x38, 0x01); - - RTV_REG_SET(0x20, 0x5B); - - RTV_REG_SET(0x25, 0x09); - - RTV_REG_SET(0x44, 0x00 | (POST_INIT)); - - RTV_REG_SET(0x46, 0xA0); - RTV_REG_SET(0x47, 0x0F); - - RTV_REG_SET(0x48, 0xB8); - RTV_REG_SET(0x49, 0x0B); - RTV_REG_SET(0x54, 0x58); - - RTV_REG_SET(0x55, 0x06); - - RTV_REG_SET(0x56, 0x00 | (AGC_CYCLE)); - - RTV_REG_SET(0x59, 0x51); - - RTV_REG_SET(0x5A, 0x1C); - - RTV_REG_SET(0x6D, 0x00); - RTV_REG_SET(0x8B, 0x24); - - RTV_REG_SET(0x6B, 0x2D); - RTV_REG_SET(0x85, 0x32); - RTV_REG_SET(0x8E, 0x01); - - RTV_REG_SET(0x33, 0x00 | (INV_MODE<<1)); - RTV_REG_SET(0x53, 0x00 | (AGC_MODE)); - - RTV_REG_SET(0x6F, 0x00 | (WAGC_COM)); - - RTV_REG_SET(0xBA, PWM_COM); - - switch (g_eRtvAdcClkFreqType) { - case RTV_ADC_CLK_FREQ_8_MHz: - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_SET(0x6A, 0x01); - - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x3c, 0x4B); - RTV_REG_SET(0x3d, 0x37); - RTV_REG_SET(0x3e, 0x89); - RTV_REG_SET(0x3f, 0x41); - break; - - case RTV_ADC_CLK_FREQ_8_192_MHz: - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_SET(0x6A, 0x01); - - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x3c, 0x00); - RTV_REG_SET(0x3d, 0x00); - RTV_REG_SET(0x3e, 0x00); - RTV_REG_SET(0x3f, 0x40); - break; - - case RTV_ADC_CLK_FREQ_9_MHz: - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_SET(0x6A, 0x21); - - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x3c, 0xB5); - RTV_REG_SET(0x3d, 0x14); - RTV_REG_SET(0x3e, 0x41); - RTV_REG_SET(0x3f, 0x3A); - break; - - case RTV_ADC_CLK_FREQ_9_6_MHz: - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_SET(0x6A, 0x31); - - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x3c, 0x69); - RTV_REG_SET(0x3d, 0x03); - RTV_REG_SET(0x3e, 0x9D); - RTV_REG_SET(0x3f, 0x36); - break; - - default: - RTV_DBGMSG0("[tdmb_InitOFDM] Upsupport ADC clock type!\n"); - break; - } - - RTV_REG_SET(0x42, 0x00); - RTV_REG_SET(0x43, 0x00); - - RTV_REG_SET(0x94, 0x08); - - RTV_REG_SET(0x98, 0x05); - RTV_REG_SET(0x99, 0x03); - RTV_REG_SET(0x9B, 0xCF); - RTV_REG_SET(0x9C, 0x10); - RTV_REG_SET(0x9D, 0x1C); - RTV_REG_SET(0x9F, 0x32); - RTV_REG_SET(0xA0, 0x90); - - RTV_REG_SET(0xA4, 0x01); - - RTV_REG_SET(0xA8, 0xF6); - RTV_REG_SET(0xA9, 0x89); - RTV_REG_SET(0xAA, 0x0C); - RTV_REG_SET(0xAB, 0x32); - - RTV_REG_SET(0xAC, 0x14); - RTV_REG_SET(0xAD, 0x09); - - RTV_REG_SET(0xAE, 0xFF); - - RTV_REG_SET(0xEB, 0x6B); -} - -/*============================================================================== - * Name : tdmb_InitFEC - * Action : MAP SEL FEC Register Init - * Input : Chip Address - * Output : None - *============================================================================*/ -static void tdmb_InitFEC(void) -{ - RTV_REG_MAP_SEL(FEC_PAGE); - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1) - RTV_REG_MASK_SET(0x7D, 0x10, 0x10); - /* 7KB memory use. */ -#endif -#endif - - RTV_REG_SET(0x80, 0x80); - RTV_REG_SET(0x81, 0xFF); - RTV_REG_SET(0x87, 0x07); - RTV_REG_SET(0x45, 0xA0); - RTV_REG_SET(0xDD, 0xD0); - RTV_REG_SET(0x39, 0x07); - RTV_REG_SET(0xE6, 0x10); - RTV_REG_SET(0xA5, 0xA0); -} - -static void tdmb_InitDemod(void) -{ - tdmb_InitTOP(); - tdmb_InitCOMM(); - tdmb_InitHOST(); - tdmb_InitOFDM(); - tdmb_InitFEC(); - - rtv_ResetMemory_FIC(); /* Must disable before transmit con. */ - - /* Configure interrupt. */ -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - rtvOEM_ConfigureInterrupt(); - -#elif defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) -#ifndef RTV_FIC_POLLING_MODE - rtvOEM_ConfigureInterrupt(); /* FIC interrupt */ -#endif -#endif - - /* Configure CIF Header enable or disable for MSC0. */ -#ifndef RTV_CIF_HEADER_INSERTED - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_MASK_SET(0x31, 0x03, 0x00); - /* [0]:MSC0_HEAD_EN, [1]:MSC_HEAD_NBYTE : MSC0 Header OFF */ - -#else /* CIF Header Enable */ - RTV_REG_MAP_SEL(DD_PAGE); -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - /* [0]:MSC0_HEAD_EN, [1]:MSC_HEAD_NBYTE : MSC0 Header ON */ - RTV_REG_MASK_SET(0x31, 0x03, 0x03); -#else - /* [0]:MSC0_HEAD_EN, [1]:MSC_HEAD_NBYTE : MSC0 Header OFF */ - RTV_REG_MASK_SET(0x31, 0x03, 0x00); -#endif -#endif - - /* Configure TSIF. */ -#if defined(RTV_IF_MPEG2_SERIAL_TSIF) - || defined(RTV_IF_SPI_SLAVE) - || defined(RTV_IF_QUALCOMM_TSIF) - - rtv_ConfigureTsifFormat(); - - /* Configure TS memory and mode. */ - RTV_REG_MAP_SEL(COMM_PAGE); -#ifndef RTV_CIF_MODE_ENABLED /* Individual Mode */ - RTV_REG_SET(0x47, 0x13|RTV_COMM_CON47_CLK_SEL); /* MSC1 DD-TSI enable*/ -#else /* CIF Mode */ - /* - [5] CIF_MODE_EN: TSI CIF transmit mode enable. 1 = CIF, 0 = Individual - [4] MSC1_EN: MSC1 transmit enable - [3] MSC0_EN: MSC0 transmit enable - [2] FIC_EN: FIC transmit enable */ - - /* CIF/FIC/MSC0/MSC1 DD-TSI enable */ - RTV_REG_SET(0x47, 0x3F|RTV_COMM_CON47_CLK_SEL); - - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0xD6, 0xF4); -#endif - -#elif defined(RTV_IF_MPEG2_PARALLEL_TSIF) - rtv_SetParallelTsif_TDMB_Only(); -#endif - - rtv_ConfigureHostIF(); -} - -static void tdmb_SoftReset(void) -{ - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x10, 0x48); - /* FEC reset enable */ - RTV_DELAY_MS(1); - RTV_REG_SET(0x10, 0xC9); - /* OFDM & FEC Soft reset */ -} - -void rtvTDMB_StandbyMode(int on) -{ - RTV_GUARD_LOCK; - - if (on) { - RTV_REG_MAP_SEL(RF_PAGE); - RTV_REG_MASK_SET(0x57, 0x04, 0x04); - /* SW PD ALL */ - } else { - RTV_REG_MAP_SEL(RF_PAGE); - RTV_REG_MASK_SET(0x57, 0x04, 0x00); - /* SW PD ALL */ - } - - RTV_GUARD_FREE; -} - -UINT rtvTDMB_GetLockStatus(void) -{ - U8 lock_stat; - UINT lock_st = 0; - - if (g_fRtvChannelChange) { - RTV_DBGMSG0("[rtvTDMB_GetLockStatus] " - "RTV Freqency change state!\n"); - return 0x0; - } - - RTV_GUARD_LOCK; - - RTV_REG_MAP_SEL(DD_PAGE); - lock_stat = RTV_REG_GET(0x37); - if (lock_stat & 0x01) - lock_st = RTV_TDMB_OFDM_LOCK_MASK; - - RTV_REG_MAP_SEL(FEC_PAGE); - lock_stat = RTV_REG_GET(0xFB); - - RTV_GUARD_FREE; - - if ((lock_stat & 0x03) == 0x03) - lock_st |= RTV_TDMB_FEC_LOCK_MASK; - - return lock_st; -} - -U32 rtvTDMB_GetPER(void) -{ - U8 rdata0, rdata1, rs_sync; - - if (g_fRtvChannelChange) { - RTV_DBGMSG0("[rtvTDMB_GetPER] " - "RTV Freqency change state!\n"); - return 0; - } - - RTV_GUARD_LOCK; - - RTV_REG_MAP_SEL(FEC_PAGE); - rdata0 = RTV_REG_GET(0xD7); - rs_sync = (rdata0 & 0x08) >> 3; - if (rs_sync != 0x01) { - RTV_GUARD_FREE; - return 700; - } - - rdata1 = RTV_REG_GET(0xB4); - rdata0 = RTV_REG_GET(0xB5); - - RTV_GUARD_FREE; - - return (rdata1 << 8) | rdata0; -} - -S32 rtvTDMB_GetRSSI(void) -{ - U8 RD00, GVBB, LNAGAIN, RFAGC; - S32 nRssi = 0; - - if (g_fRtvChannelChange) { - RTV_DBGMSG0("[rtvTDMB_GetRSSI] RTV Freqency change state!\n"); - return 0; - } - - RTV_GUARD_LOCK; - - RTV_REG_MAP_SEL(RF_PAGE); - RD00 = RTV_REG_GET(0x00); - GVBB = RTV_REG_GET(0x05); - - RTV_GUARD_FREE; - - LNAGAIN = ((RD00 & 0x30) >> 4); - RFAGC = (RD00 & 0x0F); - - switch (LNAGAIN) { - case 0: - nRssi = -((RFAGC * (S32)(2.75*RTV_TDMB_RSSI_DIVIDER)) - + (GVBB * (S32)(0.36*RTV_TDMB_RSSI_DIVIDER)) - - (S32)(12*RTV_TDMB_RSSI_DIVIDER)); - break; - - case 1: - nRssi = -((RFAGC * (S32)(2.75*RTV_TDMB_RSSI_DIVIDER)) - + (GVBB * (S32)(0.36*RTV_TDMB_RSSI_DIVIDER)) - + (S32)(-2*RTV_TDMB_RSSI_DIVIDER)); - break; - - case 2: - nRssi = -((RFAGC * (S32)(3*RTV_TDMB_RSSI_DIVIDER)) - + (GVBB * (S32)(0.365*RTV_TDMB_RSSI_DIVIDER)) - + (S32)(3*RTV_TDMB_RSSI_DIVIDER)); - break; - - case 3: - nRssi = -((RFAGC * (S32)(3*RTV_TDMB_RSSI_DIVIDER)) - + (GVBB * (S32)(0.5*RTV_TDMB_RSSI_DIVIDER)) - + (S32)(0.5*RTV_TDMB_RSSI_DIVIDER)); - break; - - default: - break; - } - - if (((RD00&0xC0) == 0x40) && (GVBB > 123)) - nRssi -= (S32)(0*RTV_TDMB_RSSI_DIVIDER); - - return nRssi; -} - - -U32 rtvTDMB_GetCNR(void) -{ - U8 data1 = 0, data2 = 0; - U8 data = 0; - U32 SNR = 0; - - if (g_fRtvChannelChange) { - RTV_DBGMSG0("[rtvTDMB_GetCNR] RTV Freqency change state!\n"); - return 0; - } - - RTV_GUARD_LOCK; - - RTV_REG_MAP_SEL(OFDM_PAGE); - - RTV_REG_SET(0x82, 0x01); - data1 = RTV_REG_GET(0x7E); - data2 = RTV_REG_GET(0x7F); - - RTV_GUARD_FREE; - - data = ((data2 & 0x1f) << 8) + data1; - - if (data == 0) - return 0; - else if ((data > 0) && (data < 15)) - SNR = (S32) (33 * RTV_TDMB_CNR_DIVIDER); - else if ((data >= 15) && (data <= 160)) - SNR = g_awSNR_15_160[data - 15]; - else if (data > 160) - SNR = (S32) (5.44 * RTV_TDMB_CNR_DIVIDER); - - return SNR; -} - -/* MSC BER (0 ~ 140) */ -U32 rtvTDMB_GetCER(void) -{ - U8 lock_stat, rcnt3 = 0, rcnt2 = 0, rcnt1 = 0, rcnt0 = 0; - U32 cer_cnt, cer_period_cnt, ret_val; - - if (g_fRtvChannelChange) { - RTV_DBGMSG0("[rtvTDMB_GetBER] RTV Freqency change state!\n"); - return 2000; - } - - RTV_GUARD_LOCK; - - RTV_REG_MAP_SEL(FEC_PAGE); - - lock_stat = RTV_REG_GET(0x37); - if (lock_stat & 0x01) { - /* MSC CER period counter for accumulation */ - rcnt3 = RTV_REG_GET(0x88); - rcnt2 = RTV_REG_GET(0x89); - rcnt1 = RTV_REG_GET(0x8A); - rcnt0 = RTV_REG_GET(0x8B); - /* 442368 */ - cer_period_cnt = (rcnt3 << 24) | (rcnt2 << 16) - | (rcnt1 << 8) | rcnt0; - - rcnt3 = RTV_REG_GET(0x8C); - rcnt2 = RTV_REG_GET(0x8D); - rcnt1 = RTV_REG_GET(0x8E); - rcnt0 = RTV_REG_GET(0x8F); - } else - cer_period_cnt = 0; - - RTV_GUARD_FREE; - - if (cer_period_cnt == 0) - return 2000; /* No service */ - - cer_cnt = (rcnt3 << 24) | (rcnt2 << 16) | (rcnt1 << 8) | rcnt0; - - /*RTV_DBGMSG2("[rtvTDMB_GetCER] cer_cnt: %u, " - "cer_period_cnt: %u\n", - cer_cnt, cer_period_cnt);*/ - - if (cer_cnt <= 4000) - return 0; - else { - ret_val = ((cer_cnt * 1000)/cer_period_cnt) * 10; - if (ret_val <= 1200) - return ret_val; - else - return 2000; - } -} - -/* Pre BER */ -U32 rtvTDMB_GetBER(void) -{ - U8 rdata0 = 0, rdata1 = 0, rdata2 = 0; - U8 rcnt0, rcnt1, rcnt2; - U8 rs_sync; - U32 val; - U32 cnt; - - if (g_fRtvChannelChange) { - RTV_DBGMSG0("[rtvTDMB_GetBER] RTV Freqency change state!\n"); - return 2000; - } - - RTV_GUARD_LOCK; - - RTV_REG_MAP_SEL(FEC_PAGE); - rdata0 = RTV_REG_GET(0xD7); - - rs_sync = (rdata0 & 0x08) >> 3; - if (rs_sync != 0x01) { - RTV_GUARD_FREE; - return 2000; - } - - rcnt2 = RTV_REG_GET(0xA6); - rcnt1 = RTV_REG_GET(0xA7); - rcnt0 = RTV_REG_GET(0xA8); - cnt = (rcnt2 << 16) | (rcnt1 << 8) | rcnt0; - - rdata2 = RTV_REG_GET(0xA9); - rdata1 = RTV_REG_GET(0xAA); - rdata0 = RTV_REG_GET(0xAB); - val = (rdata2 << 16) | (rdata1 << 8) | rdata0; /* max 24 bit */ - - RTV_GUARD_FREE; - - if (cnt == 0) - return 2000; - else - return (val * (U32) RTV_TDMB_BER_DIVIDER) / cnt; -} - - -static UINT g_nTdmbPrevAntennaLevel; - -#define TDMB_MAX_NUM_ANTENNA_LEVEL 7 - -UINT rtvTDMB_GetAntennaLevel(U32 dwCER) -{ - UINT nCurLevel = 0; - UINT nPrevLevel = g_nTdmbPrevAntennaLevel; - static const UINT aAntLvlTbl[TDMB_MAX_NUM_ANTENNA_LEVEL] - = {810, 700, 490, 400, 250, 180, 0}; - - if (dwCER == 2000) - return 0; - - do { - if (dwCER >= aAntLvlTbl[nCurLevel]) /* Use equal for CER 0 */ - break; - } while (++nCurLevel != TDMB_MAX_NUM_ANTENNA_LEVEL); - - if (nCurLevel != nPrevLevel) { - if (nCurLevel < nPrevLevel) - nPrevLevel--; - else - nPrevLevel++; - - g_nTdmbPrevAntennaLevel = nPrevLevel; - } - - return nPrevLevel; -} - - -/* Because that TDMB has the sub channel, -we checks the freq which new or the same when the changsing of channel */ -U32 rtvTDMB_GetPreviousFrequency(void) -{ - return g_dwTdmbPrevChFreqKHz; -} - -/* Interrupts are disabled for SPI - TSIF stream disabled are for TSIF */ -static void tdmb_CloseSubChannel(UINT nRegSubChArrayIdx) -{ - UINT nSubChID; - INT nHwSubChIdx; - - if ((g_nRegSubChArrayIdxBits & (1 << nRegSubChArrayIdx)) == 0) - return; /* not opened! already closed! */ - - nSubChID = g_atTdmbRegSubchInfo[nRegSubChArrayIdx].nSubChID; - nHwSubChIdx = g_atTdmbRegSubchInfo[nRegSubChArrayIdx].nHwSubChIdx; - - /* Disable the specified SUB CH first. */ -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1) /* Single Sub Channel */ - rtv_Set_MSC1_SUBCH0(nSubChID, FALSE, FALSE); - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL |= MSC1_INTR_BITS; - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif - - rtv_ResetMemory_MSC1(); /* Disable MSC1 memory. */ - -#else /* Multi Sub Channel */ - switch (nHwSubChIdx) { - case 0: - rtv_Set_MSC1_SUBCH0(nSubChID, FALSE, FALSE); - break; - case 3: - rtv_Set_MSC0_SUBCH3(nSubChID, FALSE); - break; - case 4: - rtv_Set_MSC0_SUBCH4(nSubChID, FALSE); - break; - case 5: - rtv_Set_MSC0_SUBCH5(nSubChID, FALSE); - break; - case 6: - rtv_Set_MSC0_SUBCH6(nSubChID, FALSE); - break; - default: - break; - } - - if ((g_nRtvUsedHwSubChIdxBits & TDMB_MSC1_SUBCH_USE_MASK) == 0) { -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL |= MSC1_INTR_BITS; - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif - rtv_ResetMemory_MSC1(); /* Disable MSC1 memory */ - } - - if ((g_nRtvUsedHwSubChIdxBits & TDMB_MSC0_SUBCH_USE_MASK) == 0) { -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL |= MSC0_INTR_BITS; - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif - rtv_ResetMemory_MSC0(); /* Disable MSC0 memory */ - } -#endif - -#ifdef RTV_CIF_HEADER_INSERTED -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - if (nHwSubChIdx != 0) /* MSC0 only */ -#endif - rtvCIFDEC_DeleteSubChannelID(nSubChID); -#endif - - /* Delete a used sub channel index. */ - g_nRtvUsedHwSubChIdxBits &= ~(1 << nHwSubChIdx); - - /* Delete a registered subch array index. */ - g_nRegSubChArrayIdxBits &= ~(1 << nRegSubChArrayIdx); - - /* Deregister a sub channel ID Bit. */ - g_aRegSubChIdBits[SUBCH_GRP_IDX(nSubChID)] &= - ~(1 << MOD32(nSubChID)); -} - -#if (RTV_MAX_NUM_SUB_CHANNEL_USED > 1) -static void tdmb_CloseAllSubChannel(void) -{ - UINT i = 0; - UINT nRegSubChArrayIdxBits = g_nRegSubChArrayIdxBits; - - while (nRegSubChArrayIdxBits != 0) { - if (nRegSubChArrayIdxBits & 0x01) - tdmb_CloseSubChannel(i); - - nRegSubChArrayIdxBits >>= 1; - i++; - } -} -#endif - -void rtvTDMB_CloseAllSubChannels(void) -{ -#if (RTV_MAX_NUM_SUB_CHANNEL_USED > 1) - UINT i = 0; - UINT nRegSubChArrayIdxBits = g_nRegSubChArrayIdxBits; -#endif - - RTV_GUARD_LOCK; - -/* rtv_StreamDisable(RTV_TV_MODE_TDMB); */ - -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1) /* Single Sub Channel */ - tdmb_CloseSubChannel(0); -#else - - while (nRegSubChArrayIdxBits != 0) { - if (nRegSubChArrayIdxBits & 0x01) - tdmb_CloseSubChannel(i); - - nRegSubChArrayIdxBits >>= 1; - i++; - } -#endif - -/* rtv_StreamRestore(RTV_TV_MODE_TDMB); */ - - RTV_GUARD_FREE; -} - -INT rtvTDMB_CloseSubChannel(UINT nSubChID) -{ -#if (RTV_MAX_NUM_SUB_CHANNEL_USED > 1) - UINT i = 0; - UINT nRegSubChArrayIdxBits = g_nRegSubChArrayIdxBits; -#endif - - RTV_GUARD_LOCK; - -/* rtv_StreamDisable(RTV_TV_MODE_TDMB); */ - -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1) /* Single Sub Channel */ - tdmb_CloseSubChannel(0); -#else - - while (nRegSubChArrayIdxBits != 0) { - if (nRegSubChArrayIdxBits & 0x01) { - if (nSubChID == g_atTdmbRegSubchInfo[i].nSubChID) - tdmb_CloseSubChannel(i); - } - - nRegSubChArrayIdxBits >>= 1; - i++; - } -#endif - -/* rtv_StreamRestore(RTV_TV_MODE_TDMB); */ - - RTV_GUARD_FREE; - - return RTV_SUCCESS; -} - -static void tdmb_OpenSubChannel( - UINT nSubChID, - enum E_RTV_TDMB_SERVICE_TYPE eServiceType, - UINT nThresholdSize) -{ - INT nHwSubChIdx; - UINT i = 0; - -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1) /* Single Subchannel */ - nHwSubChIdx = 0; - - /* Set the sub-channel and enable MSC memory - with the specified sub ID. */ - if (eServiceType == RTV_TDMB_SERVICE_VIDEO) - rtv_Set_MSC1_SUBCH0(nSubChID, TRUE, TRUE); /* RS enable */ - else - rtv_Set_MSC1_SUBCH0(nSubChID, TRUE, FALSE); /* RS Disable */ - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(INT_E_UCLRL, 0x04); - /* MSC1 Interrupt status clear. */ - - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL &= ~(MSC1_INTR_BITS); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); - /* Enable MSC1 interrupts. */ -#endif - - rtv_SetupMemory_MSC1(nThresholdSize); - -#else - /* Multi sub channel enabled */ - if ((eServiceType == RTV_TDMB_SERVICE_VIDEO) - || (eServiceType == RTV_TDMB_SERVICE_AUDIO)) { - nHwSubChIdx = 0; - - if (eServiceType == RTV_TDMB_SERVICE_VIDEO) - /*RS enable*/ - rtv_Set_MSC1_SUBCH0(nSubChID, TRUE, TRUE); - else - /*RS disable*/ - rtv_Set_MSC1_SUBCH0(nSubChID, TRUE, FALSE); - - if ((g_nRtvUsedHwSubChIdxBits - & TDMB_MSC1_SUBCH_USE_MASK) == 0) { - /* First enabled. */ -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(DD_PAGE); - /* MSC1 Interrupt status clear.*/ - RTV_REG_SET(INT_E_UCLRL, 0x04); - - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL &= ~(MSC1_INTR_BITS); - /* Enable MSC1 interrupts and restore FIC . */ - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif - rtv_SetupMemory_MSC1(nThresholdSize); - } - } else { - /* Data */ -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - /* Search an available SUBCH index - for Audio/Data service. (3 ~ 6) */ - for (nHwSubChIdx = 3/* MSC0 base */; - nHwSubChIdx <= 6; - nHwSubChIdx++) { -#else - for (nHwSubChIdx = 3/* MSC0 base */; - nHwSubChIdx <= 5; - nHwSubChIdx++) { -#endif - if ((g_nRtvUsedHwSubChIdxBits & (1<<nHwSubChIdx)) == 0) - break; - } - - /* Set sub channel. */ - switch (nHwSubChIdx) { - case 3: - rtv_Set_MSC0_SUBCH3(nSubChID, TRUE); - break; - case 4: - rtv_Set_MSC0_SUBCH4(nSubChID, TRUE); - break; - case 5: - rtv_Set_MSC0_SUBCH5(nSubChID, TRUE); - break; -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - case 6: - rtv_Set_MSC0_SUBCH6(nSubChID, TRUE); - break; -#endif - default: - break; - } - - if ((g_nRtvUsedHwSubChIdxBits - & TDMB_MSC0_SUBCH_USE_MASK) == 0) { -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(DD_PAGE); - /* MSC0 Interrupt clear. */ - RTV_REG_SET(INT_E_UCLRL, 0x02); - - /* Enable MSC0 interrupts. */ - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL &= ~(MSC0_INTR_BITS); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); /* restore FIC */ -#endif - rtv_SetupMemory_MSC0(nThresholdSize); /* CIF mode. */ - } - } -#endif - -#ifdef RTV_CIF_HEADER_INSERTED -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - if (nHwSubChIdx != 0) /* MSC0 only */ -#endif - rtvCIFDEC_AddSubChannelID(nSubChID); -#endif - - /* To use when close .*/ -#if (RTV_MAX_NUM_SUB_CHANNEL_USED > 1) - for (i = 0; i < RTV_MAX_NUM_SUB_CHANNEL_USED; i++) { - if ((g_nRegSubChArrayIdxBits & (1<<i)) == 0) { -#else - i = 0; -#endif - /* Register a array index of sub channel */ - g_nRegSubChArrayIdxBits |= (1 << i); - - g_atTdmbRegSubchInfo[i].nSubChID = nSubChID; - - /* Add the new sub channel index. */ - g_atTdmbRegSubchInfo[i].nHwSubChIdx = nHwSubChIdx; - g_atTdmbRegSubchInfo[i].eServiceType = eServiceType; - g_atTdmbRegSubchInfo[i].nThresholdSize = nThresholdSize; -#if (RTV_MAX_NUM_SUB_CHANNEL_USED > 1) - break; -} -} -#endif - - /* Add the HW sub channel index. */ - g_nRtvUsedHwSubChIdxBits |= (1 << nHwSubChIdx); - - /* Register a new sub channel ID Bit. */ - g_aRegSubChIdBits[SUBCH_GRP_IDX(nSubChID)] - |= (1 << MOD32(nSubChID)); - - /*RTV_DBGMSG2("[tdmb_OpenSubChannel] " - "nSubChID(%d) use MSC_SUBCH%d\n", - nSubChID, - nHwSubChIdx);*/ -} - -INT rtvTDMB_OpenSubChannel( - U32 dwChFreqKHz, - UINT nSubChID, - enum E_RTV_TDMB_SERVICE_TYPE eServiceType, - UINT nThresholdSize) -{ - INT nRet = RTV_SUCCESS; - - if (nSubChID > (MAX_NUM_TDMB_SUB_CH - 1)) - return RTV_INVAILD_SUB_CHANNEL_ID; - - /* Check for threshold size. */ -#ifndef RTV_CIF_MODE_ENABLED /* Individual Mode */ -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - if (nThresholdSize > (188 * 18)) - return RTV_INVAILD_THRESHOLD_SIZE; -#endif -#endif - - /* Check the previous freq. */ - if (g_dwTdmbPrevChFreqKHz == dwChFreqKHz) { - /* Is registerd sub ch ID? */ - if (g_aRegSubChIdBits[SUBCH_GRP_IDX(nSubChID)] - & (1 << MOD32(nSubChID))) { - RTV_GUARD_LOCK; - /* To restore FIC stream. */ - rtv_StreamRestore(RTV_TV_MODE_TDMB); - RTV_GUARD_FREE; - - RTV_DBGMSG1("[rtvTDMB_OpenSubChannel] " - " Already opened sub channed ID(%d)\n", nSubChID); - - return RTV_SUCCESS; - } - -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1)/* Single Sub Channel Mode */ - RTV_GUARD_LOCK; - /* Max sub channel is 1. So, we close the previous sub ch. */ - tdmb_CloseSubChannel(0); -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x10, 0x48); - RTV_REG_SET(0x10, 0xC9); -#endif - tdmb_OpenSubChannel(nSubChID, eServiceType, nThresholdSize); - RTV_GUARD_FREE; -#else - /* Multi Sub Channel. */ - if ((eServiceType == RTV_TDMB_SERVICE_VIDEO) - || (eServiceType == RTV_TDMB_SERVICE_AUDIO)) { - /* Check if the SUBCH available for Video service ? */ - if ((g_nRtvUsedHwSubChIdxBits - & TDMB_MSC1_SUBCH_USE_MASK) - == TDMB_MSC1_SUBCH_USE_MASK) { - RTV_GUARD_LOCK; - /* To restore FIC stream. */ - rtv_StreamRestore(RTV_TV_MODE_TDMB); - RTV_GUARD_FREE; - /* Only 1 Video/Audio service. - Close other video service.*/ - return RTV_NO_MORE_SUB_CHANNEL; - } - } else { - /* Data */ - /* Check if the SUBCH available for - Audio/Data services for MSC0 ? */ - if ((g_nRtvUsedHwSubChIdxBits - & TDMB_MSC0_SUBCH_USE_MASK) - == TDMB_MSC0_SUBCH_USE_MASK) { - RTV_GUARD_LOCK; - /* To restore FIC stream. */ - rtv_StreamRestore(RTV_TV_MODE_TDMB); - RTV_GUARD_FREE; - - return RTV_NO_MORE_SUB_CHANNEL; - } - } - - RTV_GUARD_LOCK; - tdmb_OpenSubChannel(nSubChID, eServiceType, nThresholdSize); - /* To restore FIC stream. This is NOT the first time. */ - rtv_StreamRestore(RTV_TV_MODE_TDMB); - RTV_GUARD_FREE; -#endif - } else { - /* if(g_dwTdmbPrevChFreqKHz[RaonTvChipIdx] == dwChFreqKHz) */ - g_dwTdmbPrevChFreqKHz = dwChFreqKHz; - - g_fRtvChannelChange = TRUE; /* To prevent get ber, cnr ... */ - - RTV_GUARD_LOCK; - -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1) - /* Cloes the previous sub channel - because this channel is a new freq. */ - tdmb_CloseSubChannel(0); -#else - /* Cloes the all sub channel because this channel is a new freq. */ - tdmb_CloseAllSubChannel(); -#endif - - nRet = rtvRF_SetFrequency(RTV_TV_MODE_TDMB, 0, dwChFreqKHz); - - tdmb_OpenSubChannel(nSubChID, eServiceType, nThresholdSize); - - RTV_GUARD_FREE; - - g_fRtvChannelChange = FALSE; - } - - return nRet; -} - -/* - rtvTDMB_ReadFIC() - - This function reads a FIC data in manually. - */ -UINT rtvTDMB_ReadFIC(U8 *pbBuf) -{ -#ifdef RTV_FIC_POLLING_MODE - U8 int_type_val1; - UINT cnt = 0; - U8 tr_mode; - const UINT frame_dur[4] = { - (96) / 2, - (96 / 4) / 2, - (96 / 4) / 2, - (96 / 2) / 2 }; - - if (g_fRtvTdmbConfiguredFIC == FALSE) { - RTV_DBGMSG0("[rtvTDMB_ReadFIC] NOT OPEN FIC\n"); - return 0; - } - - RTV_GUARD_LOCK; - - RTV_REG_MAP_SEL(0x06); - tr_mode = RTV_REG_GET(0x27); /* DAB TX Mode monitoring */ - tr_mode = (tr_mode & 0x30) >> 4; - - RTV_REG_MAP_SEL(DD_PAGE); - while (++cnt <= 10) { - int_type_val1 = RTV_REG_GET(INT_E_STATL); - if (int_type_val1 & FIC_E_INT) /* FIC interrupt */ { - /*printk("FIC_E_INT occured!\n");*/ - - RTV_REG_MAP_SEL(FIC_PAGE); -#if defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) - RTV_REG_BURST_GET(0x10, pbBuf, 192); - RTV_REG_BURST_GET(0x10, pbBuf+192, 192); - -#elif defined(RTV_IF_SPI) -#if defined(__KERNEL__) || defined(WINCE) - RTV_REG_BURST_GET(0x10, pbBuf, 384+1); -#else - RTV_REG_BURST_GET(0x10, pbBuf, 384); -#endif -#endif - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(INT_E_UCLRL, 0x01); - /* FIC interrupt status clear */ - - RTV_GUARD_FREE; - - return 384; - - } - RTV_DELAY_MS(frame_dur[tr_mode]); - } /* while() */ - - RTV_GUARD_FREE; - - RTV_DBGMSG0("[rtvTDMB_ReadFIC] FIC read timeout\n"); - - return 0; - -#else - - RTV_REG_MAP_SEL(FIC_PAGE); -#if defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) - RTV_REG_BURST_GET(0x10, pbBuf, 192); - RTV_REG_BURST_GET(0x10, pbBuf+192, 192); - -#elif defined(RTV_IF_SPI) -#if defined(__KERNEL__) || defined(WINCE) - RTV_REG_BURST_GET(0x10, pbBuf, 384+1); -#else - RTV_REG_BURST_GET(0x10, pbBuf, 384); -#endif -#endif - - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(INT_E_UCLRL, 0x01); /* FIC interrupt status clear */ - - return 384; -#endif -} - -void rtvTDMB_CloseFIC(void) -{ - if (g_fRtvTdmbConfiguredFIC == FALSE) - return; - - RTV_GUARD_LOCK; - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -#ifndef RTV_FIC_POLLING_MODE - /* Disable the FIC interrupt. */ - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL |= FIC_E_INT; - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif - -#elif defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1) /* Single sub channel mode */ -#ifndef RTV_FIC_POLLING_MODE - /* Disable the FIC interrupt. */ - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL |= FIC_E_INT; - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif -#endif -#endif - - rtv_ResetMemory_FIC(); - - g_fRtvTdmbConfiguredFIC = FALSE; - - RTV_GUARD_FREE; -} - -void rtvTDMB_OpenFIC(void) -{ - if (g_fRtvTdmbConfiguredFIC == TRUE) - return; - - g_fRtvTdmbConfiguredFIC = TRUE; - - RTV_GUARD_LOCK; - -#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2) -#ifndef RTV_FIC_POLLING_MODE - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x35, 0x01); /* FIC Interrupt status clear. */ - - /* Enable the FIC interrupt. */ - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL &= ~(FIC_E_INT); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif - -#elif defined(RTV_IF_TSIF) || defined(RTV_IF_SPI_SLAVE) -#ifndef RTV_CIF_MODE_ENABLED /* Single sub channel mode */ -#ifndef RTV_FIC_POLLING_MODE - RTV_REG_MAP_SEL(DD_PAGE); - RTV_REG_SET(0x35, 0x01); /* FIC Interrupt status clear. */ - - /* Enable the FIC interrupt. - This mode only use FIC interrupt. - MSC used by TSIF. */ - RTV_REG_MAP_SEL(HOST_PAGE); - g_bRtvIntrMaskRegL &= ~(FIC_E_INT); - RTV_REG_SET(0x62, g_bRtvIntrMaskRegL); -#endif -#endif -#endif - - rtv_SetupMemory_FIC(); /* Enable FIC memory. */ - - RTV_GUARD_FREE; -} - -/* When this function was called, - all sub channel should closed to reduce scan-time !!!!! - FIC can enabled. Usally enabled. */ -INT rtvTDMB_ScanFrequency(U32 dwChFreqKHz) -{ - U8 scan_done, OFDM_L = 0, ccnt = 0, NULL_C = 0, SCV_C = 0; - U8 scan_pwr1 = 0, scan_pwr2 = 0, DAB_Mode = 0xFF, DAB_Mode_Chk = 0xFF; - U8 pre_agc1 = 0, pre_agc2 = 0, pre_agc_mon = 0, ASCV = 0; - INT scan_flag = 0; - U16 SPower = 0, PreGain = 0, PreGainTH = 0, PWR_TH = 0, ILoopTH = 0; - U8 Cfreq_HTH = 0, Cfreq_LTH = 0; - U8 i = 0, j = 0, m = 0, n = 0; - U8 varyLow = 0, varyHigh = 0; - U16 varyMon = 0; - U8 MON_FSM = 0, FsmCntChk = 0; - U8 test0 = 0, test1 = 0; - U16 NullLengthMon = 0; - U16 fail = 0; - U8 FecResetCh = 0xff; - U8 FEC_SYNC = 0xFF, CoarseFreq = 0xFF, NullTh = 0xFF, NullChCnt = 0; - U8 rdata0 = 0, rdata1 = 0; - U16 i_chk = 0, q_chk = 0; - UINT nReTryCnt = 0; - - g_fRtvChannelChange = TRUE; /* To prevent get ber, cnr ... */ - - RTV_GUARD_LOCK; - - /* NOTE: When this rountine executed, all sub channel should closed - and memory(MSC0, MSC1) interrupts are disabled. */ -#if (RTV_MAX_NUM_SUB_CHANNEL_USED == 1) - tdmb_CloseSubChannel(0); -#else - tdmb_CloseAllSubChannel(); -#endif - - scan_flag = rtvRF_SetFrequency(RTV_TV_MODE_TDMB, 0, dwChFreqKHz); - if (scan_flag != RTV_SUCCESS) - goto TDMB_SCAN_EXIT; - - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x54, 0x70); - - tdmb_SoftReset(); - - FecResetCh = 0xff; - fail = 0xFFFF; - - while (1) { - if (++nReTryCnt == 10000) { - /* Up to 400ms */ - RTV_DBGMSG0("[rtvTDMB_ScanFrequency] Scan Timeout!\n"); - scan_flag = RTV_CHANNEL_NOT_DETECTED; - break; - } - - RTV_REG_MAP_SEL(OFDM_PAGE); - /* Scan-done flag & scan-out flag check */ - scan_done = RTV_REG_GET(0xCF); - - RTV_REG_MAP_SEL(COMM_PAGE); - /* Scan-Power monitoring */ - scan_pwr1 = RTV_REG_GET(0x38); - scan_pwr2 = RTV_REG_GET(0x39); - SPower = (scan_pwr2 << 8) | scan_pwr1; - - RTV_REG_MAP_SEL(OFDM_PAGE); - - if (scan_done != 0xff) { - NULL_C = 0; - SCV_C = 0; - pre_agc_mon = - RTV_REG_GET(0x53); - RTV_REG_SET(0x53, (pre_agc_mon | 0x80)); - /* Pre-AGC Gain monitoring One-shot */ - pre_agc1 = RTV_REG_GET(0x66); - pre_agc2 = RTV_REG_GET(0x67); - PreGain = (pre_agc2 << 2) | (pre_agc1 & 0x03); - - /* DAB TX Mode monitoring */ - DAB_Mode = RTV_REG_GET(0x27); - DAB_Mode = (DAB_Mode & 0x30) >> 4; - - switch (g_eRtvAdcClkFreqType) { - case RTV_ADC_CLK_FREQ_8_MHz: - PreGainTH = 405; - /* tr mode */ - switch (DAB_Mode) { - case 0: - PWR_TH = 2400; - ILoopTH = 200; - Cfreq_HTH = 206; - Cfreq_LTH = 55; - break; - case 1: - PWR_TH = 2000; - ILoopTH = 180; - Cfreq_HTH = 242; - Cfreq_LTH = 14; - break; - case 2: - PWR_TH = 1300; - ILoopTH = 180; - Cfreq_HTH = 248; - Cfreq_LTH = 8; - break; - case 3: - PWR_TH = 280; - ILoopTH = 180; - Cfreq_HTH = 230; - Cfreq_LTH = 26; - break; - default: - PWR_TH = 2400; - ILoopTH = 200; - Cfreq_HTH = 206; - Cfreq_LTH = 55; - break; - } - break; - - case RTV_ADC_CLK_FREQ_8_192_MHz: - PreGainTH = 405; - - switch (DAB_Mode) { - case 0: - PWR_TH = 1700; - ILoopTH = 200; - Cfreq_HTH = 206; - Cfreq_LTH = 55; - break; - case 1: - PWR_TH = 1500; - ILoopTH = 180; - Cfreq_HTH = 242; - Cfreq_LTH = 14; - break; - case 2: - PWR_TH = 1200; - ILoopTH = 180; - Cfreq_HTH = 248; - Cfreq_LTH = 8; - break; - case 3: - PWR_TH = 1900; - ILoopTH = 180; - Cfreq_HTH = 230; - Cfreq_LTH = 26; - break; - default: - PWR_TH = 1700; - ILoopTH = 200; - Cfreq_HTH = 206; - Cfreq_LTH = 55; - break; - } - break; - - case RTV_ADC_CLK_FREQ_9_MHz: - PreGainTH = 380; - switch (DAB_Mode) { - case 0: - PWR_TH = 7000; - ILoopTH = 200; - Cfreq_HTH = 206; - Cfreq_LTH = 55; - break; - case 1: - PWR_TH = 5000; - ILoopTH = 180; - Cfreq_HTH = 242; - Cfreq_LTH = 14; - break; - case 2: - PWR_TH = 1300; - ILoopTH = 180; - Cfreq_HTH = 248; - Cfreq_LTH = 8; - break; - case 3: - PWR_TH = 8000; - ILoopTH = 180; - Cfreq_HTH = 230; - Cfreq_LTH = 26; - break; - default: - PWR_TH = 8000; - ILoopTH = 200; - Cfreq_HTH = 206; - Cfreq_LTH = 55; - break; - } - break; - - case RTV_ADC_CLK_FREQ_9_6_MHz: - PreGainTH = 380; - - switch (DAB_Mode) { - case 0: - PWR_TH = 7000; - ILoopTH = 200; - Cfreq_HTH = 206; - Cfreq_LTH = 55; - break; - case 1: - PWR_TH = 5000; - ILoopTH = 180; - Cfreq_HTH = 242; - Cfreq_LTH = 14; - break; - case 2: - PWR_TH = 1300; - ILoopTH = 180; - Cfreq_HTH = 248; - Cfreq_LTH = 8; - break; - case 3: - PWR_TH = 8000; - ILoopTH = 180; - Cfreq_HTH = 230; - Cfreq_LTH = 26; - break; - default: - PWR_TH = 8000; - ILoopTH = 200; - Cfreq_HTH = 206; - Cfreq_LTH = 55; - break; - } - - break; - - default: - scan_flag = RTV_UNSUPPORT_ADC_CLK; - goto TDMB_SCAN_EXIT; - } - -if (scan_done == 0x01) { - /* Not DAB signal channel */ - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xEF01; - - goto TDMB_SCAN_EXIT; - /* Auto-scan result return */ -} else if (scan_done == 0x03) { - /* DAB signal channel */ - RTV_REG_MAP_SEL(OFDM_PAGE); - /* coarse freq */ - CoarseFreq = RTV_REG_GET(0x18); - - if (g_eRtvCountryBandType == RTV_COUNTRY_BAND_KOREA) { - if (DAB_Mode > 0) { - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xE002; - - goto TDMB_SCAN_EXIT; - /*Auto-scan result return */ - } - } - - if ((CoarseFreq < Cfreq_HTH) && (CoarseFreq > Cfreq_LTH)) { - CoarseFreq = 0x33; - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xEF33; - goto TDMB_SCAN_EXIT; - } - - if (SPower < PWR_TH) { - /* Scan Power Threshold */ - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xEF03; - goto TDMB_SCAN_EXIT; - } else { - if ((PreGain < PreGainTH) || (PreGain == 0)) { - /*PreAGC Gain threshold check*/ - scan_flag = - RTV_CHANNEL_NOT_DETECTED; - fail = 0xEF04; - goto TDMB_SCAN_EXIT; - } else { - for (m = 0; m < 16; m++) { - NullTh = RTV_REG_GET(0x1C); - RTV_REG_SET(0x1C, (NullTh | 0x10)); - test0 = RTV_REG_GET(0x26); - test1 = RTV_REG_GET(0x27); - NullLengthMon = ((test1 & 0x0F) << 8) | test0; - - /* DAB TX Mode monitoring */ - DAB_Mode_Chk = RTV_REG_GET(0x27); - DAB_Mode_Chk = (DAB_Mode_Chk & 0x30) >> 4; - if (DAB_Mode != DAB_Mode_Chk) { - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xE000; - goto TDMB_SCAN_EXIT; - } - - if ((NullLengthMon == 0) - || (NullLengthMon > 3000)) { - NullChCnt++; - } - if ((NullChCnt > 10) && (m > 14) - && (PreGain < 400)) { - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xEF05; - goto TDMB_SCAN_EXIT; - } else if (m > 14) { - fail = 0x1111; - scan_flag = RTV_SUCCESS; - break; - } - RTV_DELAY_MS(10); - } - } - if (scan_flag == RTV_SUCCESS) { - for (i = 0; i < /*ILoopTH*/100; i++) { - RTV_DELAY_MS(10); - - RTV_REG_MAP_SEL(OFDM_PAGE); - ASCV = RTV_REG_GET(0x30); - ASCV = ASCV & 0x0F; - if ((SCV_C > 0) && (ASCV > 7)) { - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xFF08; - goto TDMB_SCAN_EXIT; - /* Auto-scan result return */ - } - if (ASCV > 7) - SCV_C++; - - /* DAB TX Mode monitoring */ - DAB_Mode_Chk = - RTV_REG_GET(0x27); - DAB_Mode_Chk = (DAB_Mode_Chk & 0x30) >> 4; - if (DAB_Mode != DAB_Mode_Chk) { - scan_flag = - RTV_CHANNEL_NOT_DETECTED; - fail = 0xF100; - goto TDMB_SCAN_EXIT; - } - - RTV_REG_MAP_SEL(COMM_PAGE); - RTV_REG_MASK_SET(0x4D, 0x04, 0x00); - RTV_REG_MASK_SET(0x4D, 0x04, 0x04); - rdata0 = RTV_REG_GET(0x4E); - rdata1 = RTV_REG_GET(0x4F); - i_chk = (rdata1 << 8) + rdata0; - - rdata0 = RTV_REG_GET(0x50); - rdata1 = RTV_REG_GET(0x51); - q_chk = (rdata1 << 8) + rdata0; - if ((((i_chk > 5) && (i_chk < 65530)) - || ((q_chk > 5) && (q_chk < 65530))) - && (PreGain < 500)) { - scan_flag = - RTV_CHANNEL_NOT_DETECTED; - fail = 0xF200; - goto TDMB_SCAN_EXIT; - } - - RTV_REG_MAP_SEL(OFDM_PAGE); - MON_FSM = RTV_REG_GET(0x37); - MON_FSM = MON_FSM & 0x07; - - if ((MON_FSM == 1) && (PreGain < 600)) { - FsmCntChk++; - if (NullChCnt > 14) - FsmCntChk += 3; - } - if ((MON_FSM == 1) && (FsmCntChk > 9) - && (ccnt < 2)) { - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xFF0A; - FsmCntChk = 0; - - goto TDMB_SCAN_EXIT; - /* Auto-scan result return */ - } -/* ///////////////////////////////////////////////////////////////// */ -/* //////////////// Coarse Freq. check////////////////////////////// */ -/* ///////////////////////////////////////////////////////////////// */ -/* Coarse count check */ -ccnt = RTV_REG_GET(0x17); -ccnt &= 0x1F; - if (ccnt > 1) { - for (j = 0; j < 50; j++) { - RTV_DELAY_MS(10); - RTV_REG_MAP_SEL(OFDM_PAGE); - OFDM_L = RTV_REG_GET(0x12); - RTV_REG_MASK_SET(0x82, 0x01, 0x01); - varyLow = RTV_REG_GET(0x7E); - varyHigh = RTV_REG_GET(0x7F); - varyMon = ((varyHigh & 0x1f) << 8) + varyLow; - if ((OFDM_L & 0x80) && (varyMon > 0)) { - RTV_REG_MAP_SEL(OFDM_PAGE); - RTV_REG_SET(0x54, 0x58); - break; - } - } - if (OFDM_L & 0x80) { - -#if 1 - /* OFDM_Lock & FEC_Sync OK */ - scan_flag = RTV_SUCCESS; - fail = 0xFF7F; - goto TDMB_SCAN_EXIT; - -#else - - RTV_REG_MAP_SEL(FEC_PAGE); - FEC_SYNC = RTV_REG_GET(0xFB); - FEC_SYNC = FEC_SYNC & 0x03; - if (FEC_SYNC == 0x03) { - /* OFDM_Lock & FEC_Sync OK */ - scan_flag = RTV_SUCCESS; - fail = 0xFF70; - goto TDMB_SCAN_EXIT; - } else if (FEC_SYNC == 0x02) { - for (n = 0; n < 20; n++) { - RTV_DELAY_MS(10); - RTV_REG_MAP_SEL(FEC_PAGE); - FEC_SYNC = RTV_REG_GET(0xFB); - FEC_SYNC = FEC_SYNC & 0x03; - RTV_REG_MAP_SEL(OFDM_PAGE); - OFDM_L = RTV_REG_GET(0x12); - OFDM_L = OFDM_L & 0x80; - if (OFDM_L == 0x80) { - if (FEC_SYNC == 0x03) { - scan_flag = RTV_SUCCESS; - fail = 0xFF71; /* FEC_Sync OK */ - goto TDMB_SCAN_EXIT; - } else if (FEC_SYNC == 0x02) { - scan_flag - = RTV_CHANNEL_NOT_DETECTED; - fail = 0xFF72; /* FEC_Sync miss */ - } else { - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xFF73; - } - } else { - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xFF74; - goto TDMB_SCAN_EXIT; - /* Auto-scan result return */ - } - } - } else { - fail = 0xFF75; - /* OFDM_Lock & FEC_Miss */ - scan_flag = RTV_CHANNEL_NOT_DETECTED; - } -#endif - } else { - /* OFDM_Unlock */ - scan_flag = RTV_CHANNEL_NOT_DETECTED; - fail = 0xFF0B; - } - goto TDMB_SCAN_EXIT; - /* Auto-scan result return */ - } else { - scan_flag = RTV_CHANNEL_NOT_DETECTED; - } - } - fail = 0xFF0C; - scan_flag = RTV_CHANNEL_NOT_DETECTED; - goto TDMB_SCAN_EXIT; -} - } - } - } else { - fail = 0xFF0C; - scan_flag = RTV_CHANNEL_NOT_DETECTED; - goto TDMB_SCAN_EXIT; - } - } - - fail = 0xFF0D; - -TDMB_SCAN_EXIT: - - RTV_GUARD_FREE; - - g_fRtvChannelChange = FALSE; - - g_dwTdmbPrevChFreqKHz = dwChFreqKHz; - - RTV_DBGMSG1("[rtvTDMB_ScanFrequency] 0x%04X\n", fail); - - return scan_flag; /* Auto-scan result return */ -} - -void rtvTDMB_DisableStreamOut(void) -{ - RTV_GUARD_LOCK; - - rtv_StreamDisable(RTV_TV_MODE_TDMB); - - RTV_GUARD_FREE; -} - -INT rtvTDMB_Initialize(enum E_RTV_COUNTRY_BAND_TYPE eRtvCountryBandType) -{ - INT nRet; - - switch (eRtvCountryBandType) { - case RTV_COUNTRY_BAND_KOREA: - break; - - default: - return RTV_INVAILD_COUNTRY_BAND; - } - g_eRtvCountryBandType = eRtvCountryBandType; - - g_dwTdmbPrevChFreqKHz = 0; - - g_nRtvUsedHwSubChIdxBits = 0x00; - - g_fRtvTdmbConfiguredFIC = FALSE; - - g_nRegSubChArrayIdxBits = 0x00; - - g_aRegSubChIdBits[0] = 0x00000000; - g_aRegSubChIdBits[1] = 0x00000000; - - nRet = rtv_InitSystem(RTV_TV_MODE_TDMB, RTV_ADC_CLK_FREQ_8_MHz); - if (nRet != RTV_SUCCESS) - return nRet; - - /* Must after rtv_InitSystem() to save ADC clock. */ - tdmb_InitDemod(); - - nRet = rtvRF_Initilize(RTV_TV_MODE_TDMB); - if (nRet != RTV_SUCCESS) - return nRet; - - RTV_DELAY_MS(100); - - RTV_REG_MAP_SEL(RF_PAGE); - RTV_REG_SET(0x6b, 0xC5); - -#ifdef RTV_CIF_HEADER_INSERTED/* CIF Mode */ - rtvCIFDEC_Init(); -#endif - - return RTV_SUCCESS; -} - -#endif /* #ifdef RTV_TDMB_ENABLE */ - diff --git a/drivers/media/tdmb/t3900/INC_FICDEC.c b/drivers/media/tdmb/t3900/INC_FICDEC.c deleted file mode 100644 index a0e779a..0000000 --- a/drivers/media/tdmb/t3900/INC_FICDEC.c +++ /dev/null @@ -1,1535 +0,0 @@ -/***************************************************************************** - Copyright(c) 2011 I&C Inc. All Rights Reserved - - File name : INC_FICDEC.c - - Description : - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*******************************************************************************/ - -#include "INC_INCLUDES.h" - - -struct ST_FICDB_LIST g_stFicDbList; -unsigned char INC_GET_BYTEDATA(struct ST_FIB_INFO *pFibInfo) -{ - return pFibInfo->aucBuff[pFibInfo->ucDataPos++] & 0xff; -} - -unsigned char INC_GETAT_BYTEDATA(struct ST_FIB_INFO *pFibInfo) -{ - return pFibInfo->aucBuff[pFibInfo->ucDataPos] & 0xff; -} - -unsigned short INC_GET_WORDDATA(struct ST_FIB_INFO *pFibInfo) -{ - unsigned short uiData, result; - uiData = - (((unsigned short) pFibInfo->aucBuff[pFibInfo->ucDataPos++] << 8) & - 0xff00); - uiData |= - ((unsigned short) pFibInfo->aucBuff[pFibInfo->ucDataPos++] & 0xff); - result = (uiData & 0xffff); - return result; -} - -unsigned short INC_GETAT_WORDDATA(struct ST_FIB_INFO *pFibInfo) -{ - unsigned short uiData, result; - uiData = - (((unsigned short) pFibInfo->aucBuff[pFibInfo->ucDataPos] << 8) - & 0xff00) | - ((unsigned short) pFibInfo->aucBuff[pFibInfo->ucDataPos + 1] - & 0xff); - result = (uiData & 0xffff); - return result; -} - -unsigned int INC_GET_LONGDATA(struct ST_FIB_INFO *pFibInfo) -{ - unsigned int ulMsb, ulLsb , result; - ulMsb = (unsigned int) INC_GET_WORDDATA(pFibInfo); - ulLsb = (unsigned int) INC_GET_WORDDATA(pFibInfo); - result = (ulMsb << 16 | ulLsb); - return result; -} - -unsigned int INC_GETAT_LONGDATA(struct ST_FIB_INFO *pFibInfo) -{ - unsigned int ulMsb, ulLsb, result; - ulMsb = (unsigned int) INC_GETAT_WORDDATA(pFibInfo); - pFibInfo->ucDataPos += 2; - ulLsb = (unsigned int) INC_GETAT_WORDDATA(pFibInfo); - pFibInfo->ucDataPos -= 2; - result = (ulMsb << 16 | ulLsb); - return result; -} - -unsigned char INC_GETAT_HEADER(struct ST_FIB_INFO *pInfo) -{ - return pInfo->aucBuff[pInfo->ucDataPos]; -} - -unsigned char INC_GETAT_TYPE(struct ST_FIB_INFO *pInfo) -{ - return pInfo->aucBuff[pInfo->ucDataPos + 1]; -} - -unsigned char INC_GET_NULL_BLOCK(union ST_FIG_HEAD *pInfo) -{ - if (pInfo->ucInfo == END_MARKER) - return INC_ERROR; - return INC_SUCCESS; -} - -unsigned char INC_GET_FIND_LENGTH(union ST_FIG_HEAD *pInfo) -{ - if (!pInfo->ITEM.bitLength || pInfo->ITEM.bitLength > FIB_SIZE - 3) - return INC_ERROR; - return INC_SUCCESS; -} - -unsigned short INC_CRC_CHECK(unsigned char *pBuf, unsigned char ucSize) -{ - unsigned char ucLoop; - unsigned short nCrc = 0xFFFF, result; - for (ucLoop = 0; ucLoop < ucSize; ucLoop++) { - nCrc = 0xFFFF & (((nCrc << 8) | (nCrc >> 8)) ^ - (0xFF & pBuf[ucLoop])); - nCrc = nCrc ^ ((0xFF & nCrc) >> 4); - nCrc = 0xFFFF & (nCrc ^ ((((((0xFF & nCrc)) << 8) | - (((0xFF & nCrc)) >> 8))) << 4) ^ - ((0xFF & nCrc) << 5)); - } - result = ((unsigned short) 0xFFFF & (nCrc ^ 0xFFFF)); - return result; -} - -unsigned short INC_FIND_SUB_CHANNEL_SIZE(unsigned char ucTableIndex) -{ - unsigned short wSubCHSize = 0; - switch (ucTableIndex) { - case 0: - wSubCHSize = 16; - break; - case 1: - wSubCHSize = 21; - break; - case 2: - wSubCHSize = 24; - break; - case 3: - wSubCHSize = 29; - break; - case 4: - wSubCHSize = 35; - break; - case 5: - wSubCHSize = 24; - break; - case 6: - wSubCHSize = 29; - break; - case 7: - wSubCHSize = 35; - break; - case 8: - wSubCHSize = 42; - break; - case 9: - wSubCHSize = 52; - break; - case 10: - wSubCHSize = 29; - break; - case 11: - wSubCHSize = 35; - break; - case 12: - wSubCHSize = 42; - break; - case 13: - wSubCHSize = 52; - break; - case 14: - wSubCHSize = 32; - break; - case 15: - wSubCHSize = 42; - break; - case 16: - wSubCHSize = 48; - break; - case 17: - wSubCHSize = 58; - break; - case 18: - wSubCHSize = 70; - break; - case 19: - wSubCHSize = 40; - break; - case 20: - wSubCHSize = 52; - break; - case 21: - wSubCHSize = 58; - break; - case 22: - wSubCHSize = 70; - break; - case 23: - wSubCHSize = 84; - break; - case 24: - wSubCHSize = 48; - break; - case 25: - wSubCHSize = 58; - break; - case 26: - wSubCHSize = 70; - break; - case 27: - wSubCHSize = 84; - break; - case 28: - wSubCHSize = 104; - break; - case 29: - wSubCHSize = 58; - break; - case 30: - wSubCHSize = 70; - break; - case 31: - wSubCHSize = 84; - break; - case 32: - wSubCHSize = 104; - break; - case 33: - wSubCHSize = 64; - break; - case 34: - wSubCHSize = 84; - break; - case 35: - wSubCHSize = 96; - break; - case 36: - wSubCHSize = 116; - break; - case 37: - wSubCHSize = 140; - break; - case 38: - wSubCHSize = 80; - break; - case 39: - wSubCHSize = 104; - break; - case 40: - wSubCHSize = 116; - break; - case 41: - wSubCHSize = 140; - break; - case 42: - wSubCHSize = 168; - break; - case 43: - wSubCHSize = 96; - break; - case 44: - wSubCHSize = 116; - break; - case 45: - wSubCHSize = 140; - break; - case 46: - wSubCHSize = 168; - break; - case 47: - wSubCHSize = 208; - break; - case 48: - wSubCHSize = 116; - break; - case 49: - wSubCHSize = 140; - break; - case 50: - wSubCHSize = 168; - break; - case 51: - wSubCHSize = 208; - break; - case 52: - wSubCHSize = 232; - break; - case 53: - wSubCHSize = 128; - break; - case 54: - wSubCHSize = 168; - break; - case 55: - wSubCHSize = 192; - break; - case 56: - wSubCHSize = 232; - break; - case 57: - wSubCHSize = 280; - break; - case 58: - wSubCHSize = 160; - break; - case 59: - wSubCHSize = 208; - break; - case 60: - wSubCHSize = 280; - break; - case 61: - wSubCHSize = 192; - break; - case 62: - wSubCHSize = 280; - break; - case 63: - wSubCHSize = 416; - break; - } - return wSubCHSize; -} - -void INC_EXTENSION_000(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pstHeader; - union ST_TYPE_0 *pstType; - union ST_TYPE0of0_INFO *pBitStarm; - unsigned int ulBitStram = 0; - pstHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pstType = (union ST_TYPE_0 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - ulBitStram = INC_GET_LONGDATA(pFibInfo); - pBitStarm = (union ST_TYPE0of0_INFO *) &ulBitStram; - INC_ADD_ENSEMBLE_ID(pBitStarm); - if (pBitStarm->ITEM.bitChangFlag) - pFibInfo->ucDataPos += 1; -} - -void INC_EXTENSION_001(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pstHeader; - union ST_TYPE_0 *pstType; - union ST_TYPE0of1Short_INFO *pShortInfo = INC_NULL; - union ST_TYPE0of1Long_INFO *pLongInfo = INC_NULL; - struct ST_FICDB_LIST *pList; - unsigned int ulTypeInfo; - unsigned short uiStartAddr; - unsigned char ucSubChId, ucIndex, ucShortLongFlag; - pList = INC_GET_FICDB_LIST(); - pstHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pstType = (union ST_TYPE_0 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - for (ucIndex = 0; ucIndex < pstHeader->ITEM.bitLength - 1;) { - ucShortLongFlag = - (pFibInfo->aucBuff[pFibInfo->ucDataPos + 2] - >> 7) & 0x01; - if (ucShortLongFlag == 0) { - ulTypeInfo = - INC_GET_LONGDATA(pFibInfo); - pShortInfo = - (union ST_TYPE0of1Short_INFO *) &ulTypeInfo; - pFibInfo->ucDataPos -= 1; - ucSubChId = pShortInfo->ITEM.bitSubChId; - uiStartAddr = pShortInfo->ITEM.bitStartAddr; - } - - else { - ulTypeInfo = INC_GET_LONGDATA(pFibInfo); - pLongInfo = (union ST_TYPE0of1Long_INFO *) &ulTypeInfo; - ucSubChId = pLongInfo->ITEM.bitSubChId; - uiStartAddr = pLongInfo->ITEM.bitStartAddr; - } - if (pList->ucIsSetSimple == SIMPLE_FIC_ENABLE) - INC_FIND_SIMPLE_ORGANIZAION_SUBCHANNEL_ID(ucSubChId, - uiStartAddr, ulTypeInfo); - else - INC_FIND_ORGANIZAION_SUBCHANNEL_ID(ucSubChId, - ulTypeInfo); - ucIndex += (!ucShortLongFlag) ? 3 : 4; - } - if (pList->ucIsSimpleCnt) - pList->ucIsSimpleFIC = 1; -} - -void INC_EXTENSION_002(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pstHeader; - union ST_TYPE_0 *pstType; - union ST_SERVICE_COMPONENT *pService; - unsigned int ulServiceId; - unsigned short uiData; - unsigned char ucService, ucLoop, ucFrame; - pstHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pstType = (union ST_TYPE_0 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - for (ucFrame = 0; ucFrame < pstHeader->ITEM.bitLength - 1;) { - if (pstType->ITEM.bitPD == 0) { - ulServiceId = (unsigned int) INC_GET_WORDDATA(pFibInfo); - ucFrame += 2; - } - - else { - ulServiceId = INC_GET_LONGDATA(pFibInfo); - ucFrame += 4; - } - ucService = INC_GET_BYTEDATA(pFibInfo); - ucFrame += 1; - pService = (union ST_SERVICE_COMPONENT *) &ucService; - for (ucLoop = 0; ucLoop < pService->ITEM.bitNumComponent; - ucLoop++, ucFrame += 2){ - uiData = INC_GET_WORDDATA(pFibInfo); - INC_FIND_BASIC_SERVICE(ulServiceId, uiData); - } - } -} - -void INC_EXTENSION_003(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pstHeader; - union ST_TYPE_0 *pstType; - union ST_TYPE0of3_INFO *pTypeInfo; - union ST_TYPE0of3Id_INFO *pIdInfo; - unsigned int uiId, uiTypeInfo; - unsigned char ucIndex; - pstHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pstType = (union ST_TYPE_0 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - for (ucIndex = 0; ucIndex < pstHeader->ITEM.bitLength - 1;) { - uiTypeInfo = INC_GET_WORDDATA(pFibInfo); - pTypeInfo = (union ST_TYPE0of3_INFO *) &uiTypeInfo; - uiId = INC_GET_WORDDATA(pFibInfo); - uiId = (uiId << 16) | (INC_GET_BYTEDATA(pFibInfo) << 8); - pIdInfo = (union ST_TYPE0of3Id_INFO *) &uiId; - INC_FIND_PACKET_MODE(pTypeInfo, pIdInfo); - ucIndex += 5; - if (pTypeInfo->ITEM.bitCAOrgFlag == 1) { - ucIndex += 2; - pFibInfo->ucDataPos += 2; - } - } -} - -void INC_EXTENSION_008(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pstHeader; - union ST_TYPE_0 *pstType; - union ST_MSC_BIT *pstMsc; - union ST_MSC_SHORT *pstMscShort; - union ST_MSC_LONG *pstMscLong; - unsigned short uiMsgBit; - unsigned int ulSerId = 0; - unsigned char ucMscInfo, ucIndex, ucLSFlag; - pstHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pstType = (union ST_TYPE_0 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - for (ucIndex = 0; ucIndex < pstHeader->ITEM.bitLength - 1;) { - if (!pstType->ITEM.bitPD) { - ulSerId = (unsigned int) INC_GET_WORDDATA(pFibInfo); - ucIndex += 2; - } - - else { - ulSerId = INC_GET_LONGDATA(pFibInfo); - ucIndex += 4; - } - ucMscInfo = INC_GET_BYTEDATA(pFibInfo); - pstMsc = (union ST_MSC_BIT *) &ucMscInfo; - ucIndex += 1; - ucLSFlag = (INC_GETAT_BYTEDATA(pFibInfo) >> 7) & 0x01; - if (ucLSFlag) { - uiMsgBit = INC_GET_WORDDATA(pFibInfo); - ucIndex += 2; - pstMscLong = (union ST_MSC_LONG *) &uiMsgBit; - INC_FIND_GLOBAL_SERVICE_COMPONENT_LONG( - ulSerId, pstMscLong, pstMsc); - } else { - uiMsgBit = (unsigned short) INC_GET_BYTEDATA(pFibInfo); - ucIndex += 1; - pstMscShort = (union ST_MSC_SHORT *) &uiMsgBit; - INC_FIND_GLOBAL_SERVICE_COMPONENT_SHORT( - ulSerId, pstMscShort, pstMsc); - } - if (pstMsc->ITEM.bitExtFlag) { - ucIndex += 1; - pFibInfo->ucDataPos += 1; - } - } -} - -void INC_EXTENSION_010(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pstHeader; - union ST_TYPE_0 *pstType; - union ST_UTC_SHORT_INFO *pstUTC_Short_Info; - union ST_UTC_LONG_INFO *pstUTC_Long_Info; - unsigned int ulUtcInfo; - unsigned short uiUtcLongForm; - struct ST_FICDB_LIST *pList; - pList = INC_GET_FICDB_LIST(); - pstHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pstType = (union ST_TYPE_0 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - ulUtcInfo = INC_GET_LONGDATA(pFibInfo); - pstUTC_Short_Info = (union ST_UTC_SHORT_INFO *) &ulUtcInfo; - MJDtoYMD(pstUTC_Short_Info->ITEM.bitMJD, &pList->stDate); - pList->stDate.ucHour = (pstUTC_Short_Info->ITEM.bitHours + 9) % 24; - pList->stDate.ucMinutes = pstUTC_Short_Info->ITEM.bitMinutes; - if (pstUTC_Short_Info->ITEM.bitUTC_Flag) { - uiUtcLongForm = INC_GET_WORDDATA(pFibInfo); - pstUTC_Long_Info = (union ST_UTC_LONG_INFO *) &uiUtcLongForm; - pList->stDate.ucSeconds = - pstUTC_Long_Info->ITEM.bitSeconds; - pList->stDate.uiMilliseconds = - pstUTC_Long_Info->ITEM.bitMilliseconds; - } -#ifdef INC_FIC_DEBUG_MESSAGE - INC_MSG_PRINTF(1, "\r\n UTC %.4d-%.2d-%.2d: %.2d.%.2d.%.2d[%dms]", - pList->stDate.usYear, pList->stDate.ucMonth, - pList->stDate.ucDay, pList->stDate.ucHour, - pList->stDate.ucMinutes, pList->stDate.ucSeconds, - pList->stDate.uiMilliseconds); -#endif /*
*/ -} - -#ifdef USER_APPLICATION_TYPE -void INC_EXTENSION_013(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pstHeader; - union ST_TYPE_0 *pstType; - union ST_USER_APP_IDnNUM *pUserAppIdNum; - union ST_USER_APPTYPE *pUserAppType; - union ST_USERAPP_GROUP_INFO stUserApp; - unsigned int ulSid; - unsigned char ucUserAppIdNum; - unsigned char ucFrame, ucIndex, ucDataCnt; - unsigned short uiUserAppType; - pstHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pstType = (union ST_TYPE_0 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - for (ucFrame = 0; ucFrame < pstHeader->ITEM.bitLength - 1;) { - if (pstType->ITEM.bitPD) { - ulSid = INC_GET_LONGDATA(pFibInfo); - ucFrame += 4; - } else { - ulSid = INC_GET_WORDDATA(pFibInfo); - ucFrame += 2; - } - ucUserAppIdNum = INC_GET_BYTEDATA(pFibInfo); - pUserAppIdNum = (union ST_USER_APP_IDnNUM *) &ucUserAppIdNum; - ucFrame += 1; - stUserApp.ucUAppSCId = - pUserAppIdNum->ITEM.bitSCIdS; - stUserApp.ucUAppCount = - pUserAppIdNum->ITEM.bitNomUserApp; - - for (ucIndex = 0; ucIndex < stUserApp.ucUAppCount; - ucIndex++, ucFrame += 2) { - uiUserAppType = - INC_GET_WORDDATA(pFibInfo); - pUserAppType = - (union ST_USER_APPTYPE *) &uiUserAppType; - stUserApp.astUserApp[ucIndex].ucDataLength = - pUserAppType->ITEM.bitUserDataLength; - stUserApp.astUserApp[ucIndex].unUserAppType = - pUserAppType->ITEM.bitUserAppType; - for (ucDataCnt = 0; ucDataCnt < - pUserAppType->ITEM.bitUserDataLength; - ucDataCnt++) { - stUserApp.astUserApp[ucIndex].aucData[ucDataCnt] - = INC_GET_BYTEDATA(pFibInfo); - ucFrame += 1; - } - INC_FIND_USERAPP_TYPE(ulSid, &stUserApp); - } - } -} -#endif /*
*/ - -unsigned char INC_ADD_USERAPP_TYPE(unsigned int ulSID, - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - short nCnt, struct ST_USERAPP_GROUP_INFO *pstData) -{ - short nLoop; - for (nLoop = 0; nLoop < nCnt; nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulSID - && pSvcComponent->ucIsAppData == INC_ERROR) { - pSvcComponent->stUApp = *pstData; - pSvcComponent->ucIsAppData = INC_SUCCESS; -#ifdef INC_FIC_DEBUG_MESSAGE - INC_MSG_PRINTF(1, - "\r\n TYPE[0/13]User Application Type file SID:0x%.8X ", - ulSID); -#endif /*
*/ - return INC_SUCCESS; - } - } - return INC_ERROR; -} - -void INC_FIND_USERAPP_TYPE(unsigned int ulSID, - struct ST_USERAPP_GROUP_INFO *pstData) -{ - struct ST_FICDB_LIST *pList; - struct ST_STREAM_INFO *pStreamInfo; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - pList = INC_GET_FICDB_LIST(); - pStreamInfo = &pList->stDMB; - pSvcComponent = pStreamInfo->astPrimary; - INC_ADD_USERAPP_TYPE(ulSID, pSvcComponent, pStreamInfo->nPrimaryCnt, - pstData); - pSvcComponent = pStreamInfo->astSecondary; - INC_ADD_USERAPP_TYPE(ulSID, pSvcComponent, pStreamInfo->nSecondaryCnt, - pstData); - pStreamInfo = &pList->stDATA; - pSvcComponent = pStreamInfo->astPrimary; - if (INC_ADD_USERAPP_TYPE - (ulSID, pSvcComponent, pStreamInfo->nPrimaryCnt, - pstData) == INC_SUCCESS) - pList->nUserAppCnt++; - pSvcComponent = pStreamInfo->astSecondary; - if (INC_ADD_USERAPP_TYPE - (ulSID, pSvcComponent, pStreamInfo->nSecondaryCnt, - pstData) == INC_SUCCESS) - pList->nUserAppCnt++; -} - -void INC_EXTENSION_110(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pHeader; - union ST_TYPE_1 *pType; - unsigned char ucLoop; - unsigned short uiEId; - unsigned char acBuff[MAX_LABEL_CHAR]; - pHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pType = (union ST_TYPE_1 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - uiEId = INC_GET_WORDDATA(pFibInfo); - for (ucLoop = 0; ucLoop < MAX_LABEL_CHAR; ucLoop++) - acBuff[ucLoop] = INC_GET_BYTEDATA(pFibInfo); - pFibInfo->ucDataPos += 2; - INC_ADD_ENSEMBLE_NAME(uiEId, acBuff); -} - -void INC_EXTENSION_111(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pHeader; - union ST_TYPE_1 *pType; - unsigned short uiSId, ucIndex; - unsigned char acBuff[MAX_LABEL_CHAR]; - - pHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pType = (union ST_TYPE_1 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - uiSId = INC_GET_WORDDATA(pFibInfo); - for (ucIndex = 0; ucIndex < MAX_LABEL_CHAR; ucIndex++) - acBuff[ucIndex] = INC_GET_BYTEDATA(pFibInfo); - - pFibInfo->ucDataPos += 2; - INC_FIND_DATA_SERVICE_COMPONENT_LABEL(uiSId, acBuff); -} - -void INC_EXTENSION_112(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pHeader; - union ST_TYPE_1 *pType; - union ST_EXTENSION_TYPE12 *pType12; - unsigned char ucData; - pHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pType = (union ST_TYPE_1 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - ucData = INC_GET_BYTEDATA(pFibInfo); - pType12 = (union ST_EXTENSION_TYPE12 *) &ucData; - if (pType12->ITEM.bitCF_flag) - pFibInfo->ucDataPos += 1; - pFibInfo->ucDataPos += 19; - if (pType12->ITEM.bitCountry == 1) - pFibInfo->ucDataPos += 2; -} - -void INC_EXTENSION_113(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pHeader; - union ST_TYPE_1 *pType; - pHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pType = (union ST_TYPE_1 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pFibInfo->ucDataPos += 19; -} - -void INC_EXTENSION_114(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pHeader; - union ST_TYPE_1 *pType; - union ST_EXTENSION_TYPE14 *pExtenType; - unsigned int ulSId; - unsigned char ucData, ucIndex; - unsigned char acBuff[MAX_LABEL_CHAR]; - pHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pType = (union ST_TYPE_1 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - ucData = INC_GET_BYTEDATA(pFibInfo); - pExtenType = (union ST_EXTENSION_TYPE14 *) &ucData; - if (!pExtenType->ITEM.bitPD) - ulSId = (unsigned int) INC_GET_WORDDATA(pFibInfo); - - else - ulSId = INC_GET_LONGDATA(pFibInfo); - for (ucIndex = 0; ucIndex < MAX_LABEL_CHAR; ucIndex++) - acBuff[ucIndex] = INC_GET_BYTEDATA(pFibInfo); - pFibInfo->ucDataPos += 2; - INC_FIND_SERVICE_COMPONENT_LABEL(ulSId, acBuff); -} - -void INC_EXTENSION_115(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pHeader; - union ST_TYPE_1 *pType; - unsigned int ulSId; - unsigned char ucIndex, acBuff[MAX_LABEL_CHAR]; - pHeader = - (union ST_FIG_HEAD *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - pType = (union ST_TYPE_1 *) &pFibInfo->aucBuff[pFibInfo->ucDataPos++]; - ulSId = INC_GET_LONGDATA(pFibInfo); - for (ucIndex = 0; ucIndex < MAX_LABEL_CHAR; ucIndex++) - acBuff[ucIndex] = INC_GET_BYTEDATA(pFibInfo); - pFibInfo->ucDataPos += 2; - INC_FIND_DATA_SERVICE_COMPONENT_LABEL(ulSId, acBuff); -} - -void INC_SET_UPDATEFIC(struct ST_FIB_INFO *pstDestData, - unsigned char *pSourData) -{ - unsigned char cuIndex; - unsigned short wCRC, wCRCData; - for (cuIndex = 0; cuIndex < FIB_SIZE; cuIndex++) - pstDestData->aucBuff[cuIndex] = pSourData[cuIndex]; - wCRC = - INC_CRC_CHECK((unsigned char *) pstDestData->aucBuff, - FIB_SIZE - 2); - wCRCData = - ((unsigned short) pstDestData->aucBuff[30] << 8) | - pstDestData->aucBuff[31]; - pstDestData->ucDataPos = 0; - pstDestData->uiIsCRC = wCRC == wCRCData; -} - -unsigned char INC_GET_FIND_TYPE(union ST_FIG_HEAD *pInfo) -{ - if (pInfo->ITEM.bitType <= FIG_IN_HOUSE) - return INC_SUCCESS; - return INC_ERROR; -} - - -void INC_SET_FICTYPE_1(struct ST_FIB_INFO *pFibInfo) -{ - union ST_TYPE_1 *pExtern; - union ST_FIG_HEAD *pHeader; - unsigned char ucType, ucHeader; - ucHeader = INC_GETAT_HEADER(pFibInfo); - ucType = INC_GETAT_TYPE(pFibInfo); - pHeader = (union ST_FIG_HEAD *) &ucHeader; - pExtern = (union ST_TYPE_1 *) &ucType; - switch (pExtern->ITEM.bitExtension) { - case EXTENSION_0: - INC_EXTENSION_110(pFibInfo); - break; - case EXTENSION_1: - INC_EXTENSION_111(pFibInfo); - break; - case EXTENSION_2: - INC_EXTENSION_112(pFibInfo); - break; - case EXTENSION_3: - INC_EXTENSION_113(pFibInfo); - break; - case EXTENSION_4: - INC_EXTENSION_114(pFibInfo); - break; - case EXTENSION_5: - INC_EXTENSION_115(pFibInfo); - break; - default: - pFibInfo->ucDataPos += (pHeader->ITEM.bitLength + 1); - break; - } -} - -unsigned short INC_SET_FICTYPE_0(struct ST_FIB_INFO *pFibInfo) -{ - union ST_FIG_HEAD *pHeader; - union ST_TYPE_0 *pExtern; - unsigned char ucHeader, ucType; - ucHeader = INC_GETAT_HEADER(pFibInfo); - pHeader = (union ST_FIG_HEAD *) &ucHeader; - ucType = INC_GETAT_TYPE(pFibInfo); - pExtern = (union ST_TYPE_0 *) &ucType; - switch (pExtern->ITEM.bitExtension) { - case EXTENSION_0: - INC_EXTENSION_000(pFibInfo); - break; - case EXTENSION_1: - INC_EXTENSION_001(pFibInfo); - break; - case EXTENSION_2: - INC_EXTENSION_002(pFibInfo); - break; - case EXTENSION_3: - INC_EXTENSION_003(pFibInfo); - break; - case EXTENSION_10: - INC_EXTENSION_010(pFibInfo); - break; - -#ifdef USER_APPLICATION_TYPE - case EXTENSION_13: - INC_EXTENSION_013(pFibInfo); - break; - -#endif /*
*/ - default: - pFibInfo->ucDataPos += pHeader->ITEM.bitLength + 1; - break; - } - return INC_SUCCESS; -} - -unsigned char INC_FICPARSING(unsigned char ucI2CID, unsigned char *pucFicBuff, - int uFicLength, enum ST_SIMPLE_FIC bSimpleFIC) -{ - struct ST_FIC stFIC; - struct ST_FIB_INFO *pstFib; - union ST_FIG_HEAD *pHeader; - struct ST_FICDB_LIST *pList; - unsigned char ucLoop, ucHeader; - pList = INC_GET_FICDB_LIST(); - stFIC.ucBlockNum = uFicLength / FIB_SIZE; - pstFib = &stFIC.stBlock; - pList->ucIsSetSimple = bSimpleFIC; - for (ucLoop = 0; ucLoop < stFIC.ucBlockNum; ucLoop++) { - INC_SET_UPDATEFIC(pstFib, - &pucFicBuff[ucLoop * FIB_SIZE]); - if (!pstFib->uiIsCRC) - continue; - while (pstFib->ucDataPos < FIB_SIZE - 2) { - ucHeader = INC_GETAT_HEADER(pstFib); - pHeader = (union ST_FIG_HEAD *) &ucHeader; - if (!INC_GET_FIND_TYPE(pHeader) - || !INC_GET_NULL_BLOCK(pHeader) - || !INC_GET_FIND_LENGTH(pHeader)) - break; - switch (pHeader->ITEM.bitType) { - case FIG_MCI_SI: - INC_SET_FICTYPE_0(pstFib); - break; - case FIG_LABEL: - INC_SET_FICTYPE_1(pstFib); - break; - case FIG_RESERVED_0: - case FIG_RESERVED_1: - case FIG_RESERVED_2: - case FIG_FICDATA_CHANNEL: - case FIG_CONDITION_ACCESS: - case FIG_IN_HOUSE: - default: - pstFib->ucDataPos += - pHeader->ITEM.bitLength + 1; - break; - } - if (pstFib->ucDataPos == (FIB_SIZE - 1)) - break; - } - } - if (bSimpleFIC == SIMPLE_FIC_ENABLE && pList->ucIsSimpleFIC) - return INC_SUCCESS; - if (pList->nLabelCnt && - pList->nSubChannelCnt && - pList->nEmsembleLabelFlag) { - #ifdef USER_APPLICATION_TYPE - if (pList->nLabelCnt == pList->nSubChannelCnt - && pList->nPacketCnt == pList->nPacketModeCnt - && pList->nUserAppCnt == pList->nPacketCnt - && bSimpleFIC == SIMPLE_FIC_DISABLE) - return INC_SUCCESS; - - #else /*
*/ - if (pList->nLabelCnt == pList->nSubChannelCnt - && pList->nPacketCnt == pList->nPacketModeCnt - && bSimpleFIC == SIMPLE_FIC_DISABLE) - return INC_SUCCESS; - #endif /*
*/ - } - return INC_ERROR; -} - -void INC_LABEL_FILTER(unsigned char *pData, short nSize) -{ - short nLoop; - for (nLoop = nSize - 1; nLoop >= 0; nLoop--) { - if (pData[nLoop] == 0x20) - pData[nLoop] = INC_NULL; - else - break; - } -} - -void INC_ADD_SERVICE_LABEL(struct ST_STREAM_INFO *pStreamInfo, - unsigned int ulSID, unsigned char *pcLabel) -{ - struct ST_FICDB_LIST *pList; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - short nLoop; - pList = INC_GET_FICDB_LIST(); - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulSID && - !pSvcComponent->ucIsLable) { - memcpy(pSvcComponent->aucLabels, pcLabel, - MAX_LABEL_CHAR); - INC_LABEL_FILTER(pSvcComponent->aucLabels, - MAX_LABEL_CHAR); - pSvcComponent->ucIsLable = 1; - pList->nLabelCnt++; -#ifdef INC_FIC_DEBUG_MESSAGE - INC_MSG_PRINTF(1, - "\r\n TYPE[1/11] SID[0x%.8X] Service label[ %s ] ", - ulSID, pSvcComponent->aucLabels); -#endif /*
*/ - } - } - - pSvcComponent = pStreamInfo->astSecondary; - for (nLoop = 0; nLoop < pStreamInfo->nSecondaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulSID && - !pSvcComponent->ucIsLable) { - memcpy(pSvcComponent->aucLabels, pcLabel, - MAX_LABEL_CHAR); - INC_LABEL_FILTER(pSvcComponent->aucLabels, - MAX_LABEL_CHAR); - pSvcComponent->ucIsLable = 1; - pList->nLabelCnt++; - -#ifdef INC_FIC_DEBUG_MESSAGE - INC_MSG_PRINTF(1, - "\r\n TYPE[1/11] SID[0x%.8X] Service label[ %s ] ", - ulSID, pSvcComponent->aucLabels); -#endif /*
*/ - } - } -} - -void INC_ADD_SERVICE_COMPONENT_LABEL( - struct ST_STREAM_INFO *pStreamInfo, unsigned int ulSID, - unsigned char *pcLabel) -{ - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - short nLoop; - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulSID && - !pSvcComponent->ucIsComponentLabel) { - memcpy(pSvcComponent->aucComponentLabels, pcLabel, - MAX_LABEL_CHAR); - INC_LABEL_FILTER(pSvcComponent->aucComponentLabels, - MAX_LABEL_CHAR); - pSvcComponent->ucIsComponentLabel = 1; - -#ifdef INC_FIC_DEBUG_MESSAGE - INC_MSG_PRINTF(1, - "\r\nSID[0x%.8X] Service Component label[ %s ] ", - ulSID, - pSvcComponent->aucComponentLabels); -#endif /*
*/ - } - } - pSvcComponent = pStreamInfo->astSecondary; - for (nLoop = 0; nLoop < pStreamInfo->nSecondaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulSID && - !pSvcComponent->ucIsComponentLabel) { - memcpy(pSvcComponent->aucComponentLabels, pcLabel, - MAX_LABEL_CHAR); - INC_LABEL_FILTER(pSvcComponent->aucComponentLabels, - MAX_LABEL_CHAR); - pSvcComponent->ucIsComponentLabel = 1; - -#ifdef INC_FIC_DEBUG_MESSAGE - INC_MSG_PRINTF(1, - "\r\nSID[0x%.8X] Service Component label[ %s ] ", - ulSID, - pSvcComponent->aucComponentLabels); - -#endif /*
*/ - } - } -} - -void INC_FIND_DATA_SERVICE_COMPONENT_LABEL(unsigned int ulSID, - unsigned char *pcLabel) -{ - struct ST_FICDB_LIST *pList; - struct ST_STREAM_INFO *pStreamInfo; - pList = INC_GET_FICDB_LIST(); - pStreamInfo = &pList->stDAB; - INC_ADD_SERVICE_LABEL(pStreamInfo, ulSID, pcLabel); - pStreamInfo = &pList->stDMB; - INC_ADD_SERVICE_LABEL(pStreamInfo, ulSID, pcLabel); - pStreamInfo = &pList->stDATA; - INC_ADD_SERVICE_LABEL(pStreamInfo, ulSID, pcLabel); -} - -void INC_FIND_SERVICE_COMPONENT_LABEL(unsigned int ulSID, - unsigned char *pcLabel) -{ - struct ST_FICDB_LIST *pList; - struct ST_STREAM_INFO *pStreamInfo; - pList = INC_GET_FICDB_LIST(); - pStreamInfo = &pList->stDAB; - INC_ADD_SERVICE_COMPONENT_LABEL(pStreamInfo, ulSID, pcLabel); - pStreamInfo = &pList->stDMB; - INC_ADD_SERVICE_COMPONENT_LABEL(pStreamInfo, ulSID, pcLabel); - - pStreamInfo = &pList->stDATA; - INC_ADD_SERVICE_COMPONENT_LABEL(pStreamInfo, ulSID, pcLabel); -} - -void INC_ADD_GLOBAL_SERVICE_COMPONENT_SHORT(struct ST_STREAM_INFO *pStreamInfo, - unsigned int ulSvcID, - union ST_MSC_SHORT *pstMscShort, - union ST_MSC_BIT *pstMsc) -{ - short nLoop; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - - if (!pstMscShort->ITEM.bitMscFicFlag) { - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulSvcID) - pSvcComponent->ucSCidS = pstMsc->ITEM.bitScIds; - } - pSvcComponent = pStreamInfo->astSecondary; - for (nLoop = 0; nLoop < pStreamInfo->nSecondaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulSvcID) - pSvcComponent->ucSCidS = pstMsc->ITEM.bitScIds; - } - } -} - -void INC_FIND_GLOBAL_SERVICE_COMPONENT_SHORT(unsigned int ulSvcID, - union ST_MSC_SHORT *pstMscShort, - union ST_MSC_BIT *pstMsc) -{ - struct ST_FICDB_LIST *pList; - struct ST_STREAM_INFO *pStreamInfo; - pList = INC_GET_FICDB_LIST(); - pStreamInfo = &pList->stDMB; - INC_ADD_GLOBAL_SERVICE_COMPONENT_SHORT(pStreamInfo, ulSvcID, - pstMscShort, pstMsc); - pStreamInfo = &pList->stDAB; - INC_ADD_GLOBAL_SERVICE_COMPONENT_SHORT(pStreamInfo, ulSvcID, - pstMscShort, pstMsc); - pStreamInfo = &pList->stDATA; - INC_ADD_GLOBAL_SERVICE_COMPONENT_SHORT(pStreamInfo, ulSvcID, - pstMscShort, pstMsc); -} - -void INC_ADD_GLOBAL_SERVICE_COMPONENT_LONG(struct ST_STREAM_INFO *pStreamInfo, - unsigned int ulSvcID, - union ST_MSC_LONG *pstMscLong, - union ST_MSC_BIT *pstMsc) -{ - short nLoop; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulSvcID) - pSvcComponent->ucSubChid = pstMscLong->ITEM.bitScId; - } - pSvcComponent = pStreamInfo->astSecondary; - for (nLoop = 0; nLoop < pStreamInfo->nSecondaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulSvcID) - pSvcComponent->ucSubChid = pstMscLong->ITEM.bitScId; - } -} - -void INC_FIND_GLOBAL_SERVICE_COMPONENT_LONG(unsigned int ulSvcID, - union ST_MSC_LONG *pstMscLong, - union ST_MSC_BIT *pstMsc) -{ - struct ST_FICDB_LIST *pList; - struct ST_STREAM_INFO *pStreamInfo; - pList = INC_GET_FICDB_LIST(); - pStreamInfo = &pList->stDMB; - INC_ADD_GLOBAL_SERVICE_COMPONENT_LONG(pStreamInfo, ulSvcID, pstMscLong, - pstMsc); - pStreamInfo = &pList->stDAB; - INC_ADD_GLOBAL_SERVICE_COMPONENT_LONG(pStreamInfo, ulSvcID, pstMscLong, - pstMsc); - pStreamInfo = &pList->stDATA; - INC_ADD_GLOBAL_SERVICE_COMPONENT_LONG(pStreamInfo, ulSvcID, pstMscLong, - pstMsc); -} - -void INC_FIND_PACKET_MODE(union ST_TYPE0of3_INFO *pTypeInfo, - union ST_TYPE0of3Id_INFO *pIdInfo) -{ - struct ST_FICDB_LIST *pList; - struct ST_STREAM_INFO *pStreamInfo; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - short nLoop; - pList = INC_GET_FICDB_LIST(); - pStreamInfo = &pList->stDATA; - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ucSCidS == pTypeInfo->ITEM.bitScid - && !pSvcComponent->IsPacketMode) { - pSvcComponent->ucDSCType = pIdInfo->ITEM.bitDScType; - pSvcComponent->ucSubChid = pIdInfo->ITEM.bitSubChId; - pSvcComponent->unPacketAddr = - pIdInfo->ITEM.bitPacketAddr; - pSvcComponent->IsPacketMode = 1; - pList->nPacketModeCnt++; - } - } - pSvcComponent = pStreamInfo->astSecondary; - for (nLoop = 0; nLoop < pStreamInfo->nSecondaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ucSCidS == pTypeInfo->ITEM.bitScid - && !pSvcComponent->IsPacketMode) { - pSvcComponent->ucDSCType = pIdInfo->ITEM.bitDScType; - pSvcComponent->ucSubChid = pIdInfo->ITEM.bitSubChId; - pSvcComponent->unPacketAddr = - pIdInfo->ITEM.bitPacketAddr; - pSvcComponent->IsPacketMode = 1; - pList->nPacketModeCnt++; - } - } -} - -void INC_GET_SHORT_FORM(struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - union ST_TYPE0of1Short_INFO *pShort) -{ - pSvcComponent->ucShortLong = pShort->ITEM.bitShortLong; - pSvcComponent->ucTableSW = pShort->ITEM.bitTableSw; - pSvcComponent->ucTableIndex = pShort->ITEM.bitTableIndex; - pSvcComponent->ucOption = 0; - pSvcComponent->ucProtectionLevel = 0; - pSvcComponent->uiSubChSize = - INC_FIND_SUB_CHANNEL_SIZE(pSvcComponent->ucTableIndex); - pSvcComponent->uiDifferentRate = 0; - pSvcComponent->uiBitRate = INC_GET_BITRATE(pSvcComponent); -} - -void INC_GET_LONG_FORM(struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - union ST_TYPE0of1Long_INFO *pLong) -{ - pSvcComponent->ucShortLong = pLong->ITEM.bitShortLong; - pSvcComponent->ucTableSW = 0; - pSvcComponent->ucTableIndex = 0; - pSvcComponent->ucOption = pLong->ITEM.bitOption; - pSvcComponent->ucProtectionLevel = pLong->ITEM.bitProtecLevel; - pSvcComponent->uiSubChSize = pLong->ITEM.bitSubChanSize; - - if (pSvcComponent->ucOption == 0) { - switch (pSvcComponent->ucProtectionLevel) { - case 0: - pSvcComponent->uiDifferentRate = - (pSvcComponent->uiSubChSize / 12); - break; - case 1: - pSvcComponent->uiDifferentRate = - (pSvcComponent->uiSubChSize / 8); - break; - case 2: - pSvcComponent->uiDifferentRate = - (pSvcComponent->uiSubChSize / 6); - break; - case 3: - pSvcComponent->uiDifferentRate = - (pSvcComponent->uiSubChSize / 4); - break; - default: - pSvcComponent->uiDifferentRate = 0; - break; - } - } - - else { - switch (pSvcComponent->ucProtectionLevel) { - case 0: - pSvcComponent->uiDifferentRate = - (pSvcComponent->uiSubChSize / 27); - break; - case 1: - pSvcComponent->uiDifferentRate = - (pSvcComponent->uiSubChSize / 21); - break; - case 2: - pSvcComponent->uiDifferentRate = - (pSvcComponent->uiSubChSize / 18); - break; - case 3: - pSvcComponent->uiDifferentRate = - (pSvcComponent->uiSubChSize / 15); - break; - default: - pSvcComponent->uiDifferentRate = 0; - break; - } - } - pSvcComponent->uiBitRate = INC_GET_BITRATE(pSvcComponent); -} - -unsigned short INC_GET_BITRATE(struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent) -{ - unsigned short uiBitRate = 0; - if (!pSvcComponent->ucShortLong) { - if (pSvcComponent->ucTableIndex <= 4) - uiBitRate = 32; - - else if (pSvcComponent->ucTableIndex >= 5 - && pSvcComponent->ucTableIndex <= 9) - uiBitRate = 48; - - else if (pSvcComponent->ucTableIndex >= 10 - && pSvcComponent->ucTableIndex <= 13) - uiBitRate = 56; - - else if (pSvcComponent->ucTableIndex >= 14 - && pSvcComponent->ucTableIndex <= 18) - uiBitRate = 64; - - else if (pSvcComponent->ucTableIndex >= 19 - && pSvcComponent->ucTableIndex <= 23) - uiBitRate = 80; - - else if (pSvcComponent->ucTableIndex >= 24 - && pSvcComponent->ucTableIndex <= 28) - uiBitRate = 96; - - else if (pSvcComponent->ucTableIndex >= 29 - && pSvcComponent->ucTableIndex <= 32) - uiBitRate = 112; - - else if (pSvcComponent->ucTableIndex >= 33 - && pSvcComponent->ucTableIndex <= 37) - uiBitRate = 128; - - else if (pSvcComponent->ucTableIndex >= 38 - && pSvcComponent->ucTableIndex <= 42) - uiBitRate = 160; - - else if (pSvcComponent->ucTableIndex >= 43 - && pSvcComponent->ucTableIndex <= 47) - uiBitRate = 192; - - else if (pSvcComponent->ucTableIndex >= 48 - && pSvcComponent->ucTableIndex <= 52) - uiBitRate = 224; - - else if (pSvcComponent->ucTableIndex >= 53 - && pSvcComponent->ucTableIndex <= 57) - uiBitRate = 256; - - else if (pSvcComponent->ucTableIndex >= 58 - && pSvcComponent->ucTableIndex <= 60) - uiBitRate = 320; - - else if (pSvcComponent->ucTableIndex >= 61 - && pSvcComponent->ucTableIndex <= 63) - uiBitRate = 384; - - else - uiBitRate = 0; - } else { - if (pSvcComponent->ucOption == OPTION_INDICATE0) { - switch (pSvcComponent->ucProtectionLevel) { - case PROTECTION_LEVEL0: - uiBitRate = - (pSvcComponent->uiSubChSize / 12) * 8; - break; - case PROTECTION_LEVEL1: - uiBitRate = - (pSvcComponent->uiSubChSize / 8) * 8; - break; - case PROTECTION_LEVEL2: - uiBitRate = - (pSvcComponent->uiSubChSize / 6) * 8; - break; - case PROTECTION_LEVEL3: - uiBitRate = - (pSvcComponent->uiSubChSize / 4) * 8; - break; - } - } - - else if (pSvcComponent->ucOption == OPTION_INDICATE1) { - switch (pSvcComponent->ucProtectionLevel) { - case PROTECTION_LEVEL0: - uiBitRate = - (pSvcComponent->uiSubChSize / 27) * 32; - break; - case PROTECTION_LEVEL1: - uiBitRate = - (pSvcComponent->uiSubChSize / 21) * 32; - break; - case PROTECTION_LEVEL2: - uiBitRate = - (pSvcComponent->uiSubChSize / 18) * 32; - break; - case PROTECTION_LEVEL3: - uiBitRate = - (pSvcComponent->uiSubChSize / 15) * 32; - break; - } - } - } - return uiBitRate; -} - -void INC_ADD_ORGANIZAION_SUBCHANNEL_ID( - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - unsigned int ulTypeInfo) -{ - union ST_TYPE0of1Long_INFO *pLongInfo; - union ST_TYPE0of1Short_INFO *pShortInfo; - pShortInfo = (union ST_TYPE0of1Short_INFO *) &ulTypeInfo; - pLongInfo = (union ST_TYPE0of1Long_INFO *) &ulTypeInfo; - pSvcComponent->unStartAddr = pShortInfo->ITEM.bitStartAddr; - if (pShortInfo->ITEM.bitShortLong) - INC_GET_LONG_FORM(pSvcComponent, pLongInfo); - else - INC_GET_SHORT_FORM(pSvcComponent, pShortInfo); -} - -void INC_SORT_ORGANIZAION_SUBCHANNEL_ID( - struct ST_STREAM_INFO *pStreamInfo, - unsigned char ucSubChID, - unsigned int ulTypeInfo) -{ - short nLoop; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ucSubChid == ucSubChID - && !pSvcComponent->IsOrganiza) { - INC_ADD_ORGANIZAION_SUBCHANNEL_ID( - pSvcComponent, ulTypeInfo); - pSvcComponent->IsOrganiza = INC_SUCCESS; -#ifdef INC_FIC_DEBUG_MESSAGE - INC_MSG_PRINTF(1, "\r\n TYPE[0/1] SUB CH ID %x", - ucSubChID); -#endif /*
*/ - } - } - pSvcComponent = pStreamInfo->astSecondary; - for (nLoop = 0; nLoop < pStreamInfo->nSecondaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ucSubChid == ucSubChID - && !pSvcComponent->IsOrganiza) { - INC_ADD_ORGANIZAION_SUBCHANNEL_ID( - pSvcComponent, ulTypeInfo); - pSvcComponent->IsOrganiza = INC_SUCCESS; - -#ifdef INC_FIC_DEBUG_MESSAGE - INC_MSG_PRINTF(1, "\r\n TYPE[0/1] SUB CH ID %x", - ucSubChID); -#endif /*
*/ - } - } -} - -unsigned char INC_SORT_SIMPLE_ORGANIZAION_SUBCHANNEL_ID( - struct ST_STREAM_INFO *pStreamInfo, unsigned char ucSubChID, - unsigned short unStartAddr, unsigned int ulTypeInfo) -{ - short nLoop; - struct ST_FICDB_LIST *pList; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - pList = INC_GET_FICDB_LIST(); - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pSvcComponent->ucSubChid == ucSubChID - && pSvcComponent->unStartAddr == unStartAddr) { - return INC_ERROR; - } - } - pSvcComponent = - &pStreamInfo->astPrimary[pStreamInfo->nPrimaryCnt]; - pSvcComponent->ucSubChid = ucSubChID; - pSvcComponent->unStartAddr = unStartAddr; - INC_ADD_ORGANIZAION_SUBCHANNEL_ID(pSvcComponent, ulTypeInfo); - pStreamInfo->nPrimaryCnt++; - pList->ucIsSimpleCnt++; - return INC_SUCCESS; -} - -void INC_FIND_SIMPLE_ORGANIZAION_SUBCHANNEL_ID( - unsigned char ucSubChID, - unsigned short unStartAddr, - unsigned int ulTypeInfo) -{ - struct ST_FICDB_LIST *pList; - struct ST_STREAM_INFO *pStreamInfo; - pList = INC_GET_FICDB_LIST(); - pStreamInfo = &pList->stDMB; - INC_SORT_SIMPLE_ORGANIZAION_SUBCHANNEL_ID( - pStreamInfo, ucSubChID, unStartAddr, ulTypeInfo); -} - -void INC_FIND_ORGANIZAION_SUBCHANNEL_ID( - unsigned char ucSubChID, unsigned int ulTypeInfo) -{ - struct ST_FICDB_LIST *pList; - struct ST_STREAM_INFO *pStreamInfo; - pList = INC_GET_FICDB_LIST(); - pStreamInfo = &pList->stDMB; - INC_SORT_ORGANIZAION_SUBCHANNEL_ID(pStreamInfo, ucSubChID, ulTypeInfo); - pStreamInfo = &pList->stDAB; - INC_SORT_ORGANIZAION_SUBCHANNEL_ID(pStreamInfo, ucSubChID, ulTypeInfo); - pStreamInfo = &pList->stDATA; - INC_SORT_ORGANIZAION_SUBCHANNEL_ID(pStreamInfo, ucSubChID, ulTypeInfo); -} - -void INC_ADD_BASIC_SERVICE( - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - unsigned int ulServiceId, unsigned short unData) -{ - union ST_TMId_MSCnFIDC *pMscnFidc; - union ST_MSC_PACKET_INFO *pMscPacket; - pMscnFidc = (union ST_TMId_MSCnFIDC *) &unData; - pMscPacket = (union ST_MSC_PACKET_INFO *) &unData; - pSvcComponent->ulSid = ulServiceId; - pSvcComponent->ucTmID = pMscnFidc->ITEM.bitTMId; - pSvcComponent->ucCAFlag = pMscnFidc->ITEM.bitCAflag; - pSvcComponent->ucPS = pMscnFidc->ITEM.bitPS; - if (pMscnFidc->ITEM.bitTMId == 0x03) - pSvcComponent->ucSCidS = pMscPacket->ITEM.bitSCId; - else { - pSvcComponent->ucSubChid = pMscnFidc->ITEM.bitSubChld; - pSvcComponent->ucDSCType = pMscnFidc->ITEM.bitAscDscTy; - } -} - -void INC_FIND_BASIC_SERVICE(unsigned int ulServiceId, unsigned short unData) -{ - short nLoop, nDataCnt; - struct ST_FICDB_LIST *pList; - struct ST_STREAM_INFO *pStreamInfo; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - union ST_TMId_MSCnFIDC *pMscnFidc; - union ST_MSC_PACKET_INFO *pMscPacket; - pList = INC_GET_FICDB_LIST(); - if (pList->ucIsSetSimple == SIMPLE_FIC_ENABLE) - return; - pMscnFidc = (union ST_TMId_MSCnFIDC *) &unData; - pMscPacket = (union ST_MSC_PACKET_INFO *) &unData; - if (pMscnFidc->ITEM.bitTMId == 0x00) - pStreamInfo = &pList->stDAB; - - else if (pMscnFidc->ITEM.bitTMId == 0x01) - pStreamInfo = &pList->stDMB; - - else if (pMscnFidc->ITEM.bitTMId == 0x02) - pStreamInfo = &pList->stFIDC; - - else - pStreamInfo = &pList->stDATA; - pSvcComponent = (pMscnFidc->ITEM.bitPS) ? pStreamInfo->astPrimary : - pStreamInfo->astSecondary; - nDataCnt = (pMscnFidc->ITEM.bitPS) ? pStreamInfo->nPrimaryCnt : - pStreamInfo->nSecondaryCnt; - - for (nLoop = 0; nLoop < nDataCnt; nLoop++, pSvcComponent++) { - if (pSvcComponent->ulSid == ulServiceId) - return; - } - - if (pMscnFidc->ITEM.bitTMId == 0x03) - pList->nPacketCnt++; - if (pMscnFidc->ITEM.bitTMId != 0x02) { - pList->nSubChannelCnt++; - INC_ADD_BASIC_SERVICE(pSvcComponent, ulServiceId, unData); - if (pMscnFidc->ITEM.bitPS) - pStreamInfo->nPrimaryCnt++; - else - pStreamInfo->nSecondaryCnt++; - } -} - -void INC_ADD_ENSEMBLE_ID(union ST_TYPE0of0_INFO *pIdInfo) -{ - struct ST_FICDB_LIST *pList; - pList = INC_GET_FICDB_LIST(); - pList->unEnsembleID = pIdInfo->ITEM.bitEld; - pList->ucChangeFlag = pIdInfo->ITEM.bitChangFlag; -} - -unsigned char INC_ADD_ENSEMBLE_NAME(unsigned short unEnID, - unsigned char *pcLabel) -{ - struct ST_FICDB_LIST *pList; - pList = INC_GET_FICDB_LIST(); - if (pList->ucIsEnsembleName == INC_SUCCESS) - return INC_ERROR; - pList->unEnsembleID = unEnID; - pList->nEmsembleLabelFlag = 1; - memcpy(pList->aucEnsembleName, pcLabel, MAX_LABEL_CHAR); - INC_LABEL_FILTER(pList->aucEnsembleName, MAX_LABEL_CHAR); - pList->ucIsEnsembleName = INC_SUCCESS; - return INC_SUCCESS; -} - -struct ST_FICDB_LIST *INC_GET_FICDB_LIST() -{ - return &g_stFicDbList; -} - -void INC_INITDB(unsigned char ucI2CID) -{ - struct ST_FICDB_LIST *pList; - pList = INC_GET_FICDB_LIST(); - if (pList == 0) - return; - memset(pList, 0, sizeof(struct ST_FICDB_LIST)); -} diff --git a/drivers/media/tdmb/t3900/INC_INCLUDES.h b/drivers/media/tdmb/t3900/INC_INCLUDES.h deleted file mode 100644 index 18c21f0..0000000 --- a/drivers/media/tdmb/t3900/INC_INCLUDES.h +++ /dev/null @@ -1,1060 +0,0 @@ -/***************************************************************************** - Copyright(c) 2011 I&C Inc. All Rights Reserved - - File name : INC_INCLUDES.h.c - - Description : - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*******************************************************************************/ - -#ifndef _INC_T3700_INCLUDES_H_ -#define _INC_T3700_INCLUDES_H_ - -#include <linux/kernel.h> -#include <linux/string.h> -#include <mach/hardware.h> -#include <mach/gpio.h> -#include <linux/io.h> -#include <linux/delay.h> -#include <linux/slab.h> -#include <linux/module.h> - -#include <linux/hwmon.h> -#include <linux/init.h> -#include <linux/err.h> -#include <linux/input.h> -#include <linux/interrupt.h> -#include <linux/spi/spi.h> -#include <linux/proc_fs.h> -#include <linux/sched.h> -#include <linux/irq.h> -#include <linux/err.h> -#include <linux/clk.h> -#include <linux/fs.h> -#include <linux/fcntl.h> -#include <linux/stat.h> -#include <asm/system.h> -#include <asm/mach-types.h> -#include <linux/uaccess.h> -#include <asm/irq.h> -#include <asm/mach/map.h> -#include <linux/timer.h> -#include <asm/mach/time.h> -#include <linux/dma-mapping.h> - -enum { - FALSE = 0, - TRUE = 1 -}; -#define INC_DEBUG_LEVEL 0 - -#ifdef INC_MULTI_CHANNEL_ENABLE -#define INC_MULTI_CHANNEL_FIC_UPLOAD -#define INC_MULTI_HEADER_ENABLE -#endif - -#define INC_MULTI_MAX_CHANNEL 3 -/*************************************************/ -/* FIFO Source »ç¿ë½Ã */ -/*************************************************/ -#define INC_FIFO_SOURCE_ENABLE - -/******************************************/ -/* USer Application type »ç¿ë½Ã */ -/******************************************/ - -#define INC_MPI_INTERRUPT_ENABLE 0x0001 -#define INC_I2C_INTERRUPT_ENABLE 0x0002 -#define INC_EWS_INTERRUPT_ENABLE 0x0040 -#define INC_REC_INTERRUPT_ENABLE 0x0080 -#define INC_TII_INTERRUPT_ENABLE 0x0100 -#define INC_FIC_INTERRUPT_ENABLE 0x0200 -#define INC_CIFS_INTERRUPT_ENABLE 0x0400 -#define INC_FS_INTERRUPT_ENABLE 0x0800 -#define INC_EXT_INTERRUPT_ENABLE 0x1000 -#define INC_MS_INTERRUPT_ENABLE 0x2000 -#define INC_DPLLU_INTERRUPT_ENABLE 0x4000 -#define INC_SSI_INTERRUPT_ENABLE 0x8000 -#define INC_DISABLE_INTERRUPT 0x0000 - -#define INC_INTERRUPT_POLARITY_HIGH 0x0000 -#define INC_INTERRUPT_POLARITY_LOW 0x8000 -#define INC_INTERRUPT_PULSE 0x0000 -#define INC_INTERRUPT_LEVEL 0x4000 -#define INC_INTERRUPT_AUTOCLEAR_DISABLE 0x0000 -#define INC_INTERRUPT_AUTOCLEAR_ENABLE 0x2000 -#define INC_EXT_INTERRUPT_POLARITY_HIGH 0x0000 -#define INC_EXT_INTERRUPT_POLARITY_LOW 0x1000 -#define INC_INTERRUPT_PULSE_COUNT 0x00FF -#define INC_INTERRUPT_PULSE_COUNT_MASK 0x03FF - -#define T3900_SCAN_IF_DELAY 1500 -#define T3900_SCAN_RF_DELAY 1500 -#define T3900_PLAY_IF_DELAY 1000 -#define T3900_PLAY_RF_DELAY 1100 - -#define WORD_SWAP(X) (((X)>>8&0xff)|(((X)<<8)&0xff00)) -#define DWORD_SWAP(X) (((X)>>24&0xff)|(((X)>>8)&0xff00)|\ -(((X)<<8)&0xff0000)|(((X)<<24)&0xff000000)) - -#define INC_REGISTER_CTRL(X) ((X)*0x1000) -#define STREAM_PARALLEL_ADDRESS (0x40000000) -#define STREAM_PARALLEL_ADDRESS_CS (0x50000000) - -#define FIC_REF_TIME_OUT 2500 -#define INC_SUCCESS 1 -#define INC_ERROR 0 -#define INC_NULL 0 -#define INC_RETRY 0xff - -#define INC_CER_PERIOD_TIME 1000 -#define INC_CER_PERIOD (3000 / INC_CER_PERIOD_TIME) -#define INC_BIT_PERIOD (2000 / INC_CER_PERIOD_TIME) - -#define INC_TDMB_LENGTH_MASK 0xFFF -#define TDMB_I2C_ID80 0x80 -#define TDMB_I2C_ID82 0x82 - -#define MPI_CS_SIZE (188*8) -#define INC_MPI_MAX_BUFF (1024*8) -#define INC_INTERRUPT_SIZE (188*20) -#define MAX_SUBCH_SIZE 32 -#define MAX_SUBCHANNEL 64 -#define MAX_LABEL_CHAR 16 -#define SPI_INTERRUPT_SIZE (188*8) - -#define MAX_KOREABAND_FULL_CHANNEL 21 -#define MAX_KOREABAND_NORMAL_CHANNEL 6 -#define MAX_BAND_III_CHANNEL 41 -#define MAX_L_BAND_CHANNEL 23 -#define MAX_CHINA_CHANNEL 31 -#define MAX_ROAMING_CHANNEL 12 - -#define RF500_REG_CTRL 200 - -#define APB_INT_BASE 0x0100 -#define APB_GEN_BASE 0x0200 -#define APB_PHY_BASE 0x0500 -#define APB_DEINT_BASE 0x0600 -#define APB_VTB_BASE 0x0700 -#define APB_I2S_BASE 0x0800 -#define APB_RDI_BASE 0x0900 -#define APB_MPI_BASE 0x0A00 -#define APB_RS_BASE 0x0B00 -#define APB_SPI_BASE 0x0C00 -#define APB_I2C_BASE 0x0D00 -#define APB_RF_BASE 0x0E00 - -#define APB_FIC_BASE 0x1000 -#define APB_STREAM_BASE 0x2000 - -#define TS_ERR_THRESHOLD 0x014C - -#define END_MARKER 0xff -#define FIB_SIZE 32 -#define FIB_WORD_SIZE (FIB_SIZE/2) -#define MAX_FIB_NUM 12 -#define MAX_FIC_SIZE (MAX_FIB_NUM*FIB_SIZE) -#define MAX_FRAME_DURATION 96 -#define MAX_USER_APP_DATA 32 - -enum ST_TRANSMISSION { - TRANSMISSION_MODE1 = 1, - TRANSMISSION_MODE2, - TRANSMISSION_MODE3, - TRANSMISSION_MODE4, - TRANSMISSION_AUTO, - TRANSMISSION_AUTOFAST, -} ; - -enum INC_DPD_MODE { - INC_DPD_OFF = 0, - INC_DPD_ON, -} ; - -enum PLL_MODE { - INPUT_CLOCK_24576KHZ = 0, - INPUT_CLOCK_12000KHZ, - INPUT_CLOCK_19200KHZ, - INPUT_CLOCK_27000KHZ, - INPUT_CLOCK_27120KHZ, -} ; - - -enum ST_EXTENSION_TYPE { - EXTENSION_0 = 0, - EXTENSION_1, - EXTENSION_2, - EXTENSION_3, - EXTENSION_4, - EXTENSION_5, - EXTENSION_6, - EXTENSION_7, - EXTENSION_8, - EXTENSION_9, - EXTENSION_10, - EXTENSION_11, - EXTENSION_12, - EXTENSION_13, - EXTENSION_14, - EXTENSION_15, - EXTENSION_16, - EXTENSION_17, - EXTENSION_18, - EXTENSION_19, - EXTENSION_20, - EXTENSION_21, - EXTENSION_22, - EXTENSION_23, - EXTENSION_24, -} ; - -enum ST_SPI_CONTROL { - SPI_REGREAD_CMD = 0, - SPI_REGWRITE_CMD, - SPI_MEMREAD_CMD, - SPI_MEMWRITE_CMD, -} ; - -enum ST_TMID { - TMID_0 = 0, - TMID_1, - TMID_2, - TMID_3, -} ; - -enum ST_PROTECTION_LEVEL { - PROTECTION_LEVEL0 = 0, - PROTECTION_LEVEL1, - PROTECTION_LEVEL2, - PROTECTION_LEVEL3, -} ; - -enum ST_INDICATE { - OPTION_INDICATE0 = 0, - OPTION_INDICATE1, -} ; - - -enum ST_FICHEADER_TYPE { - FIG_MCI_SI = 0, - FIG_LABEL, - FIG_RESERVED_0, - FIG_RESERVED_1, - FIG_RESERVED_2, - FIG_FICDATA_CHANNEL, - FIG_CONDITION_ACCESS, - FIG_IN_HOUSE, -} ; - -enum ST_SIMPLE_FIC { - SIMPLE_FIC_ENABLE = 1, - SIMPLE_FIC_DISABLE, -} ; - -enum INC_CTRL { - INC_DMB = 1, - INC_DAB, - INC_DATA, - INC_MULTI, - INC_SINGLE, - - FREQ_FREE = 0, - FREQ_LOCK, - FIC_OK = 1, -} ; - -enum INC_ERROR_INFO { - ERROR_NON = 0x0000, - ERROR_PLL = 0xE000, - ERROR_STOP = 0xF000, - ERROR_READY = 0xFF00, - ERROR_SYNC_NO_SIGNAL = 0xFC01, - ERROR_SYNC_LOW_SIGNAL = 0xFD01, - ERROR_SYNC_NULL = 0xFE01, - ERROR_SYNC_TIMEOUT = 0xFF01, - ERROR_FICDECODER = 0xFF02, - ERROR_START_MODEM_CLEAR = 0xFF05, - ERROR_USER_STOP = 0xFA00, - ERROR_MULTI_CHANNEL_COUNT_OVER = 0x8000, - ERROR_MULTI_CHANNEL_COUNT_NON = 0x8001, - ERROR_MULTI_CHANNEL_NULL = 0x8002, - ERROR_MULTI_CHANNEL_FREQ = 0x8003, - ERROR_MULTI_CHANNEL_DMB_MAX = 0x8004, -} ; - - -#define INC_ENSEMBLE_LABLE_MAX 17 -#define INC_SERVICE_MAX 32 -#define INC_USER_APPLICATION_TYPE_LENGTH 32 - -struct ST_USER_APPLICATION_TYPE { - unsigned char ucDataLength; - unsigned short unUserAppType; - unsigned char aucData[MAX_USER_APP_DATA]; -} ; - -struct ST_USERAPP_GROUP_INFO { - unsigned char ucUAppSCId; - unsigned char ucUAppCount; - struct ST_USER_APPLICATION_TYPE - astUserApp[INC_USER_APPLICATION_TYPE_LENGTH]; -} ; - -struct INC_CHANNEL_INFO { - unsigned int ulRFFreq; - unsigned short uiEnsembleID; - unsigned short uiBitRate; - unsigned char uiTmID; - char aucLabel[MAX_LABEL_CHAR+1]; - char aucEnsembleLabel[MAX_LABEL_CHAR+1]; - - unsigned char ucSubChID; - unsigned char ucServiceType; - unsigned short uiStarAddr; - unsigned char ucSlFlag; - unsigned char ucTableIndex; - unsigned char ucOption; - unsigned char ucProtectionLevel; - unsigned short uiDifferentRate; - unsigned short uiSchSize; - - unsigned int ulServiceID; - unsigned short uiPacketAddr; - -#ifdef USER_APPLICATION_TYPE - ST_USERAPP_GROUP_INFO stUsrApp; -#endif -} ; - -struct ST_SUBCH_INFO { - short nSetCnt; - struct INC_CHANNEL_INFO astSubChInfo[MAX_SUBCH_SIZE]; -} ; - -enum UPLOAD_MODE_INFO { - STREAM_UPLOAD_MASTER_SERIAL = 0, - STREAM_UPLOAD_MASTER_PARALLEL, - STREAM_UPLOAD_SLAVE_SERIAL, - STREAM_UPLOAD_SLAVE_PARALLEL, - STREAM_UPLOAD_SPI, - STREAM_UPLOAD_TS, - -} ; - -enum CLOCK_SPEED { - INC_OUTPUT_CLOCK_4096 = 1, - INC_OUTPUT_CLOCK_2048, - INC_OUTPUT_CLOCK_1024, - -} ; - -enum ENSEMBLE_BAND { - KOREA_BAND_ENABLE = 0, - BANDIII_ENABLE, - LBAND_ENABLE, - CHINA_ENABLE, - ROAMING_ENABLE, - EXTERNAL_ENABLE, - -} ; - -enum FREQ_LOCKINFO { - INC_FREQUENCY_UNLOCK = 0, - INC_FREQUENCY_LOCK, -} ; - -enum CTRL_MODE { - INC_I2C_CTRL = 0, - INC_SPI_CTRL, - INC_EBI_CTRL, -} ; - -enum INC_ACTIVE_MODE { - INC_ACTIVE_LOW = 0, - INC_ACTIVE_HIGH, -} ; - -struct INC_TDMB_MODE { - enum ENSEMBLE_BAND m_ucRfBand; - enum UPLOAD_MODE_INFO m_ucUploadMode; - enum CLOCK_SPEED m_ucClockSpeed; - enum INC_ACTIVE_MODE m_ucMPI_CS_Active; - enum INC_ACTIVE_MODE m_ucMPI_CLK_Active; - enum CTRL_MODE m_ucCommandMode; - enum ST_TRANSMISSION m_ucTransMode; - enum PLL_MODE m_ucPLL_Mode; - enum INC_DPD_MODE m_ucDPD_Mode; - unsigned short m_unIntCtrl; -} ; - -#define BER_BUFFER_MAX 3 -#define BER_REF_VALUE 35 - -struct ST_BBPINFO { - unsigned int ulFreq; - enum INC_ERROR_INFO nBbpStatus; - unsigned char ucStop; - enum ST_TRANSMISSION ucTransMode; - - unsigned char ucAntLevel; - unsigned char ucSnr; - unsigned char ucVber; - unsigned short uiCER; - unsigned short wRssi; - unsigned int dPreBER; - unsigned int uiPostBER; - - unsigned int ulReConfigTime; - - unsigned short uiInCAntTick; - unsigned short uiInCERAvg; - unsigned short uiIncPostBER; - unsigned short auiANTBuff[BER_BUFFER_MAX]; - - unsigned char ucProtectionLevel; - unsigned short uiInCBERTick; - unsigned short uiBerSum; - unsigned short auiBERBuff[BER_BUFFER_MAX]; - - unsigned char ucCERCnt; -} ; - -struct ST_FIB_INFO { - unsigned short uiIsCRC; - unsigned char ucDataPos; - unsigned char aucBuff[FIB_SIZE]; -} ; - -struct ST_FIC { - unsigned char ucBlockNum; - struct ST_FIB_INFO stBlock; -} ; - -union ST_FIG_HEAD { - unsigned char ucInfo; - struct { - unsigned char bitLength:5; - unsigned char bitType:3; - } ITEM; -} ; - -union ST_TYPE_0 { - unsigned char ucInfo; - struct { - unsigned char bitExtension:5; - unsigned char bitPD:1; - unsigned char bitOE:1; - unsigned char bitCN:1; - } ITEM; -} ; - -union ST_TYPE_1 { - unsigned char ucInfo; - struct { - unsigned char bitExtension:3; - unsigned char bitOE:1; - unsigned char bitCharset:4; - } ITEM; -} ; - -union ST_USER_APPSERID_16 { - unsigned short uiInfo; - struct { - unsigned short bitServiceID:16; - } ITEM; - -} ; - -union ST_USER_APPSERID_32 { - unsigned int ulInfo; - struct { - unsigned int bitServiceID:32; - } ITEM; - -} ; - -union ST_USER_APP_IDnNUM { - unsigned char ucInfo; - struct { - unsigned char bitNomUserApp:4; - unsigned char bitSCIdS:4; - } ITEM; -} ; - -union ST_USER_APPTYPE { - unsigned short uiInfo; - struct { - unsigned short bitUserDataLength:5; - unsigned short bitUserAppType:11; - } ITEM; -} ; - - -union ST_TYPE0of0_INFO { - unsigned int ulBuff; - struct { - unsigned int bitLow_CIFCnt:8; - unsigned int bitHigh_CIFCnt:5; - unsigned int bitAlFlag:1; - unsigned int bitChangFlag:2; - unsigned int bitEld:16; - } ITEM; -} ; - -union ST_TYPE0of1Short_INFO { - unsigned int nBuff; - struct { - unsigned int bitReserved:8; - unsigned int bitTableIndex:6; - unsigned int bitTableSw:1; - unsigned int bitShortLong:1; - unsigned int bitStartAddr:10; - unsigned int bitSubChId:6; - } ITEM; -} ; - -union ST_TYPE0of1Long_INFO { - unsigned int nBuff; - struct { - unsigned int bitSubChanSize:10; - unsigned int bitProtecLevel:2; - unsigned int bitOption:3; - unsigned int bitShortLong:1; - unsigned int bitStartAddr:10; - unsigned int bitSubChId:6; - } ITEM; -} ; - -union ST_TYPE0of3Id_INFO { - unsigned int ulData; - struct { - unsigned int bitReserved:8; - unsigned int bitPacketAddr:10; - unsigned int bitSubChId:6; - unsigned int bitDScType:6; - unsigned int bitRfu:1; - unsigned int bitFlag:1; - } ITEM; -} ; - -union ST_TYPE0of3_INFO { - unsigned short nData; - struct { - unsigned short bitCAOrgFlag:1; - unsigned short bitReserved:3; - unsigned short bitScid:12; - } ITEM; -} ; - -union ST_SERVICE_COMPONENT { - unsigned char ucData; - struct { - unsigned char bitNumComponent:4; - unsigned char bitCAId:3; - unsigned char bitLocalFlag:1; - } ITEM; -} ; - -union ST_TMId_MSCnFIDC { - unsigned short uiData; - struct { - unsigned short bitCAflag:1; - unsigned short bitPS:1; - unsigned short bitSubChld:6; - unsigned short bitAscDscTy:6; - unsigned short bitTMId:2; - } ITEM; -} ; - -union ST_MSC_PACKET_INFO { - unsigned short usData; - struct { - unsigned short bitCAflag:1; - unsigned short bitPS:1; - unsigned short bitSCId:12; - unsigned short bitTMId:2; - } ITEM; -} ; - -union ST_MSC_BIT { - unsigned char ucData; - struct { - unsigned char bitScIds:4; - unsigned char bitRfa:3; - unsigned char bitExtFlag:1; - } ITEM; -} ; - -union ST_MSC_LONG { - unsigned short usData; - struct { - unsigned short bitScId:12; - unsigned short bitDummy:3; - unsigned short bitLsFlag:1; - } ITEM; -} ; - -union ST_MSC_SHORT { - unsigned char ucData; - struct { - unsigned char bitSUBnFIDCId:6; - unsigned char bitMscFicFlag:1; - unsigned char bitLsFlag:1; - } ITEM; -} ; - -union ST_EXTENSION_TYPE14 { - unsigned char ucData; - struct { - unsigned char bitSCidS:4; - unsigned char bitRfa:3; - unsigned char bitPD:1; - } ITEM; -} ; - -union ST_EXTENSION_TYPE12 { - unsigned char ucData; - struct { - unsigned char bitReserved1:6; - unsigned char bitCF_flag:1; - unsigned char bitCountry:1; - } ITEM; -} ; - -union ST_UTC_SHORT_INFO { - unsigned int ulBuff; - struct { - unsigned int bitMinutes:6; - unsigned int bitHours:5; - unsigned int bitUTC_Flag:1; - unsigned int bitConf_Ind:1; - unsigned int bitLSI:1; - unsigned int bitMJD:17; - unsigned int bitRfu:1; - } ITEM; -} ; - -union ST_UTC_LONG_INFO { - unsigned short unBuff; - struct { - unsigned short bitMilliseconds:10; - unsigned short bitSeconds:6; - } ITEM; -} ; - -struct ST_DATE_T { - unsigned short usYear; - unsigned char ucMonth; - unsigned char ucDay; - unsigned char ucHour; - unsigned char ucMinutes; - unsigned char ucSeconds; - unsigned short uiMilliseconds; - -} ; - - -struct ST_FICDB_SERVICE_COMPONENT { - unsigned int ulSid; - unsigned char ucSCidS; - unsigned char ucSubChid; - unsigned char ucTmID; - unsigned char ucCAFlag; - unsigned char ucPS; - unsigned char ucDSCType; - unsigned char aucComponentLabels[INC_ENSEMBLE_LABLE_MAX]; - unsigned char ucIsComponentLabel; - unsigned char aucLabels[INC_ENSEMBLE_LABLE_MAX]; - unsigned short unEnsembleFlag; - unsigned char ucIsLable; - unsigned short unPacketAddr; - unsigned char ucCAOrgFlag; - unsigned char ucDGFlag; - unsigned short unCAOrg; - unsigned short unStartAddr; - unsigned char ucShortLong; - unsigned char ucTableSW; - unsigned char ucTableIndex; - unsigned char ucOption; - unsigned char ucProtectionLevel; - unsigned short uiSubChSize; - unsigned short uiBitRate; - unsigned short uiDifferentRate; - unsigned char IsOrganiza; - unsigned char IsPacketMode; - unsigned char ucIsAppData; - struct ST_USERAPP_GROUP_INFO stUApp; - -} ; - -struct ST_STREAM_INFO { - short nPrimaryCnt; - short nSecondaryCnt; - struct ST_FICDB_SERVICE_COMPONENT astPrimary[INC_SERVICE_MAX]; - struct ST_FICDB_SERVICE_COMPONENT astSecondary[INC_SERVICE_MAX]; - -} ; - - -struct ST_FICDB_LIST { - short nLabelCnt; - short nEmsembleLabelFlag; - short nSubChannelCnt; - short nPacketCnt; - short nPacketModeCnt; - unsigned char ucIsSimpleFIC; - unsigned char ucIsSimpleCnt; - enum ST_SIMPLE_FIC ucIsSetSimple; - unsigned short unEnsembleID; - unsigned char ucChangeFlag; - unsigned short unCIFCount; - unsigned char ucOccurrence; - - unsigned char aucEnsembleName[INC_ENSEMBLE_LABLE_MAX]; - unsigned short unEnsembleFlag; - unsigned char ucIsEnsembleName; - - struct ST_STREAM_INFO stDMB; - struct ST_STREAM_INFO stDAB; - struct ST_STREAM_INFO stFIDC; - struct ST_STREAM_INFO stDATA; - - struct ST_DATE_T stDate; - short nUserAppCnt; -} ; - -#ifdef INC_FIFO_SOURCE_ENABLE -#define INC_CIF_MAX_SIZE (188*8) -#define INC_FIFO_DEPTH (1024*5) -#define MAX_CHANNEL_FIFO 5 -#define MAX_HEADER_SIZE 16 -#define HEADER_SERACH_SIZE (INC_CIF_MAX_SIZE + MAX_HEADER_SIZE) -#define HEADER_ID_0x33 0x33 -#define HEADER_ID_0x00 0x00 -#define HEADER_SIZE_BITMASK 0x3FF -#define INC_HEADER_CHECK_BUFF (INC_CIF_MAX_SIZE*4) - -enum MULTI_CHANNEL_INFO { - MAIN_INPUT_DATA = 0, - FIC_STREAM_DATA, - CHANNEL1_STREAM_DATA, - CHANNEL2_STREAM_DATA, - CHANNEL3_STREAM_DATA, -} ; - -enum ST_HEADER_INFO { - INC_HEADER_SIZE_ERROR = 0, - INC_HEADER_NOT_SEARACH, - INC_HEADER_GOOD, -} ; - -#define INC_SUB_CHANNEL_ID_MASK 0xFFFF -struct ST_FIFO { - unsigned int ulDepth; - unsigned int ulFront; - unsigned int ulRear; - unsigned short unSubChID; - unsigned char acBuff[INC_FIFO_DEPTH+1]; -} ; - -void INC_MULTI_SORT_INIT(void); -unsigned char INC_QFIFO_INIT(struct ST_FIFO *pFF, unsigned int ulDepth); -unsigned char INC_QFIFO_ADD(struct ST_FIFO *pFF, - unsigned char *pData, unsigned int ulSize); -unsigned char INC_QFIFO_AT(struct ST_FIFO *pFF, - unsigned char *pData, unsigned int ulSize); -unsigned char INC_QFIFO_BRING(struct ST_FIFO *pFF, - unsigned char *pData, unsigned int ulSize); -unsigned char INC_GET_ID_BRINGUP(unsigned short unID, - unsigned char *pData, unsigned int ulSize); -unsigned char INC_MULTI_FIFO_PROCESS( - unsigned char *pData, unsigned int ulSize); - -unsigned int INC_QFIFO_FREE_SIZE(struct ST_FIFO *pFF); -unsigned int INC_QFIFO_GET_SIZE(struct ST_FIFO *pFF); -unsigned int INC_GET_IDS_SIZE(unsigned short unID); - -struct ST_FIFO *INC_GET_CHANNEL_FIFO(enum MULTI_CHANNEL_INFO ucIndex); -enum ST_HEADER_INFO INC_HEADER_CHECK(struct ST_FIFO *pMainFifo); -#endif - - -enum INC_SORT_OPTION { - INC_SUB_CHANNEL_ID = 0, - INC_START_ADDRESS, - INC_BIRRATE, - INC_FREQUENCY, -} ; - -void INC_MSG_PRINTF(char nFlag, char *pFormat, ...); -void INC_SCAN_SETTING(unsigned char ucI2CID); -void INC_AIRPLAY_SETTING(unsigned char ucI2CID); -void INC_DELAY(unsigned short uiDelay); -void INC_MPICLOCK_SET(unsigned char ucI2CID); -void INC_UPLOAD_MODE(unsigned char ucI2CID); -void INC_INTERRUPT_CLEAR(unsigned char ucI2CID, unsigned short uiClrInt); -void INC_INTERRUPT_CTRL(unsigned char ucI2CID); -void INC_INTERRUPT_SET(unsigned char ucI2CID, unsigned short uiSetInt); -void INC_SET_CHANNEL(unsigned char ucI2CID, struct ST_SUBCH_INFO *pChInfo); -void INC_BUBBLE_SORT(struct ST_SUBCH_INFO *pMainInfo, enum INC_SORT_OPTION Opt); -void INC_SWAP(struct ST_SUBCH_INFO *pMainInfo, - unsigned short nNo1, unsigned short nNo2); -void INTERFACE_USER_STOP(unsigned char ucI2CID); -void INTERFACE_USER_STOP_CLEAR(unsigned char ucI2CID); -void INTERFACE_INT_ENABLE(unsigned char ucI2CID, unsigned short unSet); -void INTERFACE_INT_CLEAR(unsigned char ucI2CID, unsigned short unClr); -void INC_INITDB(unsigned char ucI2CID); -void INC_EXTENSION_000(struct ST_FIB_INFO *pFibInfo); -void INC_EXTENSION_001(struct ST_FIB_INFO *pFibInfo); -void INC_EXTENSION_002(struct ST_FIB_INFO *pFibInfo); -void INC_EXTENSION_003(struct ST_FIB_INFO *pFibInfo); -void INC_EXTENSION_008(struct ST_FIB_INFO *pFibInfo); -void INC_INIT_MPI(unsigned char ucI2CID); -#ifdef USER_APPLICATION_TYPE -void INC_EXTENSION_013(struct ST_FIB_INFO *pFibInfo); -#endif -void INC_EXTENSION_110(struct ST_FIB_INFO *pFibInfo); -void INC_EXTENSION_111(struct ST_FIB_INFO *pFibInfo); -void INC_EXTENSION_112(struct ST_FIB_INFO *pFibInfo); -void INC_EXTENSION_113(struct ST_FIB_INFO *pFibInfo); -void INC_EXTENSION_114(struct ST_FIB_INFO *pFibInfo); -void INC_EXTENSION_115(struct ST_FIB_INFO *pFibInfo); -void INC_SET_FICTYPE_1(struct ST_FIB_INFO *pFibInfo); - -void INC_SET_FICTYPE_5(struct ST_FIB_INFO *pFibInfo); -void INC_SET_UPDATEFIC(struct ST_FIB_INFO *pstDestData, - unsigned char *pSourData); -void INTERFACE_UPLOAD_MODE(unsigned char ucI2CID, - enum UPLOAD_MODE_INFO ucUploadMode); -void INC_UPDATE_LIST(struct INC_CHANNEL_INFO *pUpDateCh, - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent); - -unsigned char INC_GET_FIND_TYPE(union ST_FIG_HEAD *pInfo); -unsigned char INTERFACE_PLL_MODE(unsigned char ucI2CID, - enum PLL_MODE ucPllMode); -unsigned char INTERFACE_DBINIT(void); -unsigned char INTERFACE_INIT(unsigned char ucI2CID); -unsigned char INTERFACE_RECONFIG(unsigned char ucI2CID); -unsigned char INTERFACE_STATUS_CHECK(unsigned char ucI2CID); -unsigned char INTERFACE_START(unsigned char ucI2CID, - struct ST_SUBCH_INFO *pChInfo); -unsigned char INTERFACE_START_TEST( - unsigned char ucI2CID, struct ST_SUBCH_INFO *pChInfo); -unsigned char INTERFACE_INT_CHECK(unsigned char ucI2CID); -unsigned char INC_BUBBLE_SORT_by_TYPE(struct ST_SUBCH_INFO *pMainInfo); -unsigned char INTERFACE_SCAN(unsigned char ucI2CID, unsigned int ulFreq); -unsigned char INTERFACE_GET_SNR(unsigned char ucI2CID); -unsigned char INTERFACE_ISR(unsigned char ucI2CID, unsigned char *pBuff); -unsigned char INC_CHECK_SERVICE_DB16(unsigned short *ptr, unsigned short wVal, - unsigned short wNum); -unsigned char INC_CHECK_SERVICE_DB8(unsigned char *ptr, unsigned char cVal, - unsigned char cNum); - -unsigned char INC_GET_BYTEDATA(struct ST_FIB_INFO *pFibInfo); -unsigned char INC_GETAT_BYTEDATA(struct ST_FIB_INFO *pFibInfo); -unsigned char INC_GET_HEADER(struct ST_FIB_INFO *pInfo); - -unsigned char INC_GET_TYPE(struct ST_FIB_INFO *pInfo); -unsigned char INC_GETAT_HEADER(struct ST_FIB_INFO *pInfo); -unsigned char INC_GETAT_TYPE(struct ST_FIB_INFO *pInfo); -unsigned char INC_INIT(unsigned char ucI2CID); -unsigned char INC_READY(unsigned char ucI2CID, unsigned int ulFreq); -unsigned char INC_SYNCDETECTOR(unsigned char ucI2CID, unsigned int ulFreq, - unsigned char ucScanMode); -unsigned char INC_FICDECODER(unsigned char ucI2CID, - enum ST_SIMPLE_FIC bSimpleFIC); -unsigned char INC_FIC_UPDATE(unsigned char ucI2CID, - struct ST_SUBCH_INFO *pChInfo, - enum ST_SIMPLE_FIC bSimpleFIC); -unsigned char INC_START(unsigned char ucI2CID, struct ST_SUBCH_INFO *pChInfo, - unsigned short IsEnsembleSame); -unsigned char INC_STOP(unsigned char ucI2CID); -unsigned char INC_CHANNEL_START(unsigned char ucI2CID, - struct ST_SUBCH_INFO *pChInfo); -unsigned char INC_CHANNEL_START_TEST( - unsigned char ucI2CID, struct ST_SUBCH_INFO *pChInfo); -unsigned char INC_ENSEMBLE_SCAN(unsigned char ucI2CID, unsigned int ulFreq); -unsigned char INC_FIC_RECONFIGURATION_HW_CHECK(unsigned char ucI2CID); -unsigned char INC_STATUS_CHECK(unsigned char ucI2CID); -unsigned char INC_GET_ANT_LEVEL(unsigned char ucI2CID); -unsigned char INC_GET_SNR(unsigned char ucI2CID); -unsigned char INC_GET_VBER(unsigned char ucI2CID); -unsigned char INC_GET_NULLBLOCK(union ST_FIG_HEAD *pInfo); -unsigned char INC_GET_FINDLENGTH(union ST_FIG_HEAD *pInfo); -unsigned char INC_SET_TRANSMIT_MODE(unsigned char ucMode); -unsigned char INC_GET_FINDTYPE(union ST_FIG_HEAD *pInfo); -unsigned char INC_GET_NULL_BLOCK(union ST_FIG_HEAD *pInfo); -unsigned char INC_GET_FIND_LENGTH(union ST_FIG_HEAD *pInfo); -unsigned char INC_FICPARSING(unsigned char ucI2CID, unsigned char *pucFicBuff, - int uFicLength, enum ST_SIMPLE_FIC bSimpleFIC); -unsigned char INC_CMD_WRITE(unsigned char ucI2CID, unsigned short uiAddr, - unsigned short uiData); -unsigned char INC_I2C_WRITE(unsigned char ucI2CID, unsigned short uiAddr, - unsigned short uiData); -unsigned char INC_EBI_WRITE(unsigned char ucI2CID, unsigned short uiAddr, - unsigned short uiData); -unsigned char INC_RE_SYNC(unsigned char ucI2CID); -unsigned char INC_PLL_SET(unsigned char ucI2CID); -unsigned char SAVE_CHANNEL_INFO(char *pStr); -unsigned char LOAD_CHANNEL_INFO(char *pStr); -unsigned char INC_I2C_READ_BURST(unsigned char ucI2CID, unsigned short uiAddr, - unsigned char *pData, unsigned short nSize); -unsigned char INC_SPI_REG_WRITE(unsigned char ucI2CID, unsigned short uiAddr, - unsigned short uiData); -unsigned char INC_CMD_READ_BURST(unsigned char ucI2CID, unsigned short uiAddr, - unsigned char *pData, unsigned short nSize); -unsigned char INC_SPI_READ_BURST(unsigned char ucI2CID, unsigned short uiAddr, - unsigned char *pBuff, unsigned short wSize); -unsigned char INC_CHIP_STATUS(unsigned char ucI2CID); -unsigned char INC_RF500_START(unsigned char ucI2CID, unsigned int ulRFChannel, - enum ENSEMBLE_BAND ucBand, enum PLL_MODE ucPLL); -unsigned char INC_RF500_I2C_WRITE(unsigned char ucI2CID, unsigned char *pucData, - unsigned int uLength); -unsigned char INC_GET_FIB_CNT(enum ST_TRANSMISSION ucMode); -unsigned char INC_EBI_READ_BURST(unsigned char ucI2CID, unsigned short uiAddr, - unsigned char *pData, unsigned short nSize); -unsigned char *INTERFACE_GETENSEMBLE_LABEL(unsigned char ucI2CID); -struct INC_TDMB_MODE *INC_GET_TDMBMODE(unsigned char ucI2CID); -void INC_SET_TDMBMODE(unsigned char ucI2CID, struct INC_TDMB_MODE *stMode); - -short INC_CHECK_SERVICE_CNT16(unsigned short *ptr, unsigned short wVal, - unsigned char cNum, unsigned short wMask); -short INC_CHECK_SERVICE_CNT8(unsigned char *ptr, unsigned char cVal, - unsigned char cNum, unsigned char cMask); -short INC_CHECK_SERVICE_CNT32(unsigned int *ptr, unsigned int wVal, - unsigned char cNum); -short INC_GET_RSSI(unsigned char ucI2CID); -unsigned short INC_EBI_READ(unsigned char ucI2CID, unsigned short uiAddr); -unsigned short INC_FIND_KOR_FREQ(unsigned int ulFreq); -unsigned short INC_CRC_CHECK(unsigned char *pBuf, unsigned char ucSize); -unsigned short INC_SET_FICTYPE_0(struct ST_FIB_INFO *pFibInfo); -unsigned short INC_GET_WORDDATA(struct ST_FIB_INFO *pFibInfo); -unsigned short INC_GETAT_WORDDATA(struct ST_FIB_INFO *pFibInfo); -unsigned short INC_FIND_SUBCH_SIZE(unsigned char ucTableIndex); -unsigned short INTERFACE_GET_CER(unsigned char ucI2CID); -unsigned short INTERFACE_GETDMB_CNT(void); -unsigned short INTERFACE_GETDAB_CNT(void); -unsigned short INTERFACE_GETDATA_CNT(void); -unsigned short INC_CMD_READ(unsigned char ucI2CID, unsigned short uiAddr); -unsigned short INC_I2C_READ(unsigned char ucI2CID, unsigned short ulAddr); -unsigned short INC_SPI_REG_READ(unsigned char ucI2CID, unsigned short uiAddr); -unsigned short INC_GET_FRAME_DURATION(enum ST_TRANSMISSION cTrnsMode); -unsigned short INC_GET_CER(unsigned char ucI2CID); -unsigned short INC_RESYNC_CER(unsigned char ucI2CID); - -unsigned int INC_GET_KOREABAND_FULL_TABLE(unsigned short uiIndex); -unsigned int INC_GET_KOREABAND_NORMAL_TABLE(unsigned short uiIndex); -unsigned int INC_GET_LONGDATA(struct ST_FIB_INFO *pFibInfo); -unsigned int INC_GETAT_LONGDATA(struct ST_FIB_INFO *pFibInfo); -unsigned int YMDtoMJD(struct ST_DATE_T stDate); -void MJDtoYMD(unsigned short wMJD, struct ST_DATE_T *pstDate); - -unsigned int INTERFACE_GET_POSTBER(unsigned char ucI2CID); -unsigned int INTERFACE_GET_PREBER(unsigned char ucI2CID); -unsigned int INC_GET_PREBER(unsigned char ucI2CID); -unsigned int INC_GET_POSTBER(unsigned char ucI2CID); - -struct ST_BBPINFO *INC_GET_STRINFO(unsigned char ucI2CID); -enum INC_ERROR_INFO INTERFACE_ERROR_STATUS(unsigned char ucI2CID); -struct INC_CHANNEL_INFO *INTERFACE_GETDB_DMB(short uiPos); -struct INC_CHANNEL_INFO *INTERFACE_GETDB_DAB(short uiPos); -struct INC_CHANNEL_INFO *INTERFACE_GETDB_DATA(short uiPos); - -unsigned char INC_ADD_ENSEMBLE_NAME( - unsigned short unEnID, unsigned char *pcLabel); -struct ST_FICDB_LIST *INC_GET_FICDB_LIST(void); -void INC_FIND_BASIC_SERVICE(unsigned int ulServiceId, unsigned short unData); -void INC_ADD_BASIC_SERVICE( - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - unsigned int ulServiceId, unsigned short unData); - -void INC_ADD_ORGANIZAION_SUBCHANNEL_ID( - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - unsigned int ulTypeInfo); -void INC_SORT_ORGANIZAION_SUBCHANNEL_ID( - struct ST_STREAM_INFO *pStreamInfo, - unsigned char ucSubChID, unsigned int ulTypeInfo); -unsigned char INC_SORT_SIMPLE_ORGANIZAION_SUBCHANNEL_ID( - struct ST_STREAM_INFO *pStreamInfo, unsigned char ucSubChID, - unsigned short unStartAddr, unsigned int ulTypeInfo); -void INC_FIND_ORGANIZAION_SUBCHANNEL_ID(unsigned char ucSubChID, - unsigned int ulTypeInfo); - -void INC_FIND_SIMPLE_ORGANIZAION_SUBCHANNEL_ID( - unsigned char ucSubChID, - unsigned short unStartAddr, - unsigned int ulTypeInfo); - -unsigned short INC_GET_BITRATE( - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent); -void INC_GET_LONG_FORM( - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - union ST_TYPE0of1Long_INFO *pLong); -void INC_GET_SHORT_FORM( - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - union ST_TYPE0of1Short_INFO *pShort); - -void INC_ADD_ENSEMBLE_ID(union ST_TYPE0of0_INFO *pIdInfo); -void INC_FIND_PACKET_MODE( - union ST_TYPE0of3_INFO *pTypeInfo, - union ST_TYPE0of3Id_INFO *pIdInfo); - -void INC_FIND_GLOBAL_SERVICE_COMPONENT_LONG( - unsigned int ulSvcID, - union ST_MSC_LONG *pstMscLong, union ST_MSC_BIT *pstMsc); -void INC_ADD_GLOBAL_SERVICE_COMPONENT_LONG( - struct ST_STREAM_INFO *pStreamInfo, - unsigned int ulSvcID, - union ST_MSC_LONG *pstMscLong, union ST_MSC_BIT *pstMsc); -void INC_FIND_GLOBAL_SERVICE_COMPONENT_SHORT(unsigned int ulSvcID, - union ST_MSC_SHORT *pstMscShort, union ST_MSC_BIT *pstMsc); -void INC_ADD_GLOBAL_SERVICE_COMPONENT_SHORT( - struct ST_STREAM_INFO *pStreamInfo, unsigned int ulSvcID, - union ST_MSC_SHORT *pstMscShort, union ST_MSC_BIT *pstMsc); -void INC_FIND_SERVICE_COMPONENT_LABEL( - unsigned int ulSID, unsigned char *pcLabel); -void INC_FIND_DATA_SERVICE_COMPONENT_LABEL( - unsigned int ulSID, unsigned char *pcLabel); -unsigned short INC_FIND_SUB_CHANNEL_SIZE(unsigned char ucTableIndex); -void INC_LABEL_FILTER(unsigned char *pData, short nSize); -void INC_ADD_SERVICE_LABEL(struct ST_STREAM_INFO *pStreamInfo, - unsigned int ulSID, unsigned char *pcLabel); -void INC_FIND_USERAPP_TYPE(unsigned int ulSID, - struct ST_USERAPP_GROUP_INFO *pstData); -unsigned char INC_ADD_USERAPP_TYPE(unsigned int ulSID, - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent, - short nCnt, struct ST_USERAPP_GROUP_INFO *pstData); - -unsigned char INC_DB_UPDATE(unsigned int ulFreq, struct ST_SUBCH_INFO *pDMB, - struct ST_SUBCH_INFO *pDAB, struct ST_SUBCH_INFO *pDATA, - struct ST_SUBCH_INFO *pFIDC); -void INC_ADD_SERVICE_COMPONENT_LABEL( - struct ST_STREAM_INFO *pStreamInfo, - unsigned int ulSID, - unsigned char *pcLabel); -void INC_DB_COPY(unsigned int ulFreq, short nCnt, - struct INC_CHANNEL_INFO *pChInfo, - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent); - -unsigned short INC_GET_SAMSUNG_BER(unsigned char ucI2CID); -unsigned char INC_GET_SAMSUNG_ANT_LEVEL(unsigned char ucI2CID); -unsigned short INC_GET_SAMSUNG_BER_FOR_FACTORY_MODE(unsigned char ucI2CID); - -extern struct spi_device *spi_dmb; - -#endif diff --git a/drivers/media/tdmb/t3900/INC_INTERFACE.c b/drivers/media/tdmb/t3900/INC_INTERFACE.c deleted file mode 100644 index bb74397..0000000 --- a/drivers/media/tdmb/t3900/INC_INTERFACE.c +++ /dev/null @@ -1,530 +0,0 @@ -/***************************************************************************** - Copyright(c) 2011 I&C Inc. All Rights Reserved - - File name : INC_INTERFACE.c - - Description : - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*******************************************************************************/ - -#include "INC_INCLUDES.h" -#include "tdmb.h" -#include <linux/mutex.h> - -/********************** Comment****************/ -/* Operating Chip set : T3900 */ -/* Software version : version 1.22 */ -/* Software Update : 2011.04.21 */ -/************************************************/ -static DEFINE_MUTEX(tdmb_mutex); - -#define INC_MUTEX_LOCK() mutex_lock(&tdmb_mutex) -#define INC_MUTEX_FREE() mutex_unlock(&tdmb_mutex) -struct ST_SUBCH_INFO g_stDmbInfo; -struct ST_SUBCH_INFO g_stDabInfo; -struct ST_SUBCH_INFO g_stDataInfo; -struct ST_SUBCH_INFO g_stFIDCInfo; - - -void INC_DELAY(unsigned short uiDelay) -{ - msleep(uiDelay); -} - -void INC_MSG_PRINTF(char nFlag, char *pFormat, ...) -{ - va_list Ap; - unsigned short nSize; - char acTmpBuff[1012] = {0}; - va_start(Ap, pFormat); - nSize = vsprintf(acTmpBuff, pFormat, Ap); - va_end(Ap); -} - -unsigned short INC_I2C_READ(unsigned char ucI2CID, unsigned short uiAddr) -{ - unsigned short uiRcvData = 0; - return uiRcvData; -} - -unsigned char INC_I2C_WRITE(unsigned char ucI2CID, unsigned short uiAddr, - unsigned short uiData) -{ - return INC_SUCCESS; -} - -unsigned char INC_I2C_READ_BURST(unsigned char ucI2CID, unsigned short uiAddr, - unsigned char *pData, unsigned short nSize) -{ - return INC_SUCCESS; -} - -unsigned char INC_EBI_WRITE(unsigned char ucI2CID, unsigned short uiAddr, - unsigned short uiData) -{ - unsigned short uiCMD = INC_REGISTER_CTRL(SPI_REGWRITE_CMD) | 1; - unsigned short uiNewAddr = - (ucI2CID == TDMB_I2C_ID82) ? (uiAddr | 0x8000) : uiAddr; - INC_MUTEX_LOCK(); - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiNewAddr >> 8; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiNewAddr & 0xff; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiCMD >> 8; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiCMD & 0xff; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = - (uiData >> 8) & 0xff; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiData & 0xff; - INC_MUTEX_FREE(); - return INC_SUCCESS; -} - -unsigned short INC_EBI_READ(unsigned char ucI2CID, unsigned short uiAddr) -{ - unsigned short uiRcvData = 0; - unsigned short uiCMD = INC_REGISTER_CTRL(SPI_REGREAD_CMD) | 1; - unsigned short uiNewAddr = - (ucI2CID == TDMB_I2C_ID82) ? (uiAddr | 0x8000) : uiAddr; - INC_MUTEX_LOCK(); - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiNewAddr >> 8; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiNewAddr & 0xff; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiCMD >> 8; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiCMD & 0xff; - uiRcvData = - (*(unsigned char *)STREAM_PARALLEL_ADDRESS & 0xff) << 8; - uiRcvData |= (*(unsigned char *)STREAM_PARALLEL_ADDRESS & 0xff); - INC_MUTEX_FREE(); - return uiRcvData; -} - -unsigned char INC_EBI_READ_BURST(unsigned char ucI2CID, unsigned short uiAddr, - unsigned char *pData, unsigned short nSize) -{ - unsigned short uiLoop, nIndex = 0, anLength[2], uiCMD, unDataCnt; - unsigned short uiNewAddr = - (ucI2CID == TDMB_I2C_ID82) ? (uiAddr | 0x8000) : uiAddr; - if (nSize > INC_MPI_MAX_BUFF) - return INC_ERROR; - memset((char *) anLength, 0, sizeof(anLength)); - if (nSize > INC_TDMB_LENGTH_MASK) { - anLength[nIndex++] = INC_TDMB_LENGTH_MASK; - anLength[nIndex++] = nSize - INC_TDMB_LENGTH_MASK; - } else - anLength[nIndex++] = nSize; - - INC_MUTEX_LOCK(); - for (uiLoop = 0; uiLoop < nIndex; uiLoop++) { - uiCMD = - INC_REGISTER_CTRL(SPI_MEMREAD_CMD) | (anLength[uiLoop] & - INC_TDMB_LENGTH_MASK); - *(unsigned char *)STREAM_PARALLEL_ADDRESS = - uiNewAddr >> 8; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = - uiNewAddr & 0xff; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiCMD >> 8; - *(unsigned char *)STREAM_PARALLEL_ADDRESS = uiCMD & 0xff; - for (unDataCnt = 0; unDataCnt < anLength[uiLoop]; - unDataCnt++) { - *pData++ = - *(unsigned char *)STREAM_PARALLEL_ADDRESS & 0xff; - } - } - INC_MUTEX_FREE(); - return INC_SUCCESS; -} - -unsigned short INC_SPI_REG_READ(unsigned char ucI2CID, unsigned short uiAddr) -{ - unsigned short uiRcvData = 0; - unsigned short uiNewAddr = - (ucI2CID == TDMB_I2C_ID82) ? (uiAddr | 0x8000) : uiAddr; - unsigned short uiCMD = INC_REGISTER_CTRL(SPI_REGREAD_CMD) | 1; - unsigned char auiBuff[6]; - unsigned char cCnt = 0; - unsigned char acRxBuff[2]; - struct spi_message msg; - struct spi_transfer transfer[2]; - struct spi_device *_device; - int status; - - _device = tdmb_get_spi_handle(); - - INC_MUTEX_LOCK(); - auiBuff[cCnt++] = uiNewAddr >> 8; - auiBuff[cCnt++] = uiNewAddr & 0xff; - auiBuff[cCnt++] = uiCMD >> 8; - auiBuff[cCnt++] = uiCMD & 0xff; - - memset(&msg, 0, sizeof(msg)); - memset(transfer, 0, sizeof(transfer)); - spi_message_init(&msg); - msg.spi = _device; - transfer[0].tx_buf = (u8 *) auiBuff; - transfer[0].rx_buf = (u8 *) NULL; - transfer[0].len = 4; - transfer[0].bits_per_word = 8; - transfer[0].delay_usecs = 0; - spi_message_add_tail(&(transfer[0]), &msg); - transfer[1].tx_buf = (u8 *) NULL; - transfer[1].rx_buf = (u8 *) acRxBuff; - transfer[1].len = 2; - transfer[1].bits_per_word = 8; - transfer[1].delay_usecs = 0; - spi_message_add_tail(&(transfer[1]), &msg); - status = spi_sync(_device, &msg); - uiRcvData = (unsigned short) (acRxBuff[0] << 8) | - (unsigned short) acRxBuff[1]; - - /* TODO SPI Read code here... */ - INC_MUTEX_FREE(); - return uiRcvData; -} - -unsigned char INC_SPI_REG_WRITE(unsigned char ucI2CID, unsigned short uiAddr, - unsigned short uiData) -{ - unsigned short uiNewAddr = - (ucI2CID == TDMB_I2C_ID82) ? (uiAddr | 0x8000) : uiAddr; - unsigned short uiCMD = INC_REGISTER_CTRL(SPI_REGWRITE_CMD) | 1; - unsigned char auiBuff[6]; - unsigned char cCnt = 0; - - struct spi_message msg; - struct spi_transfer transfer; - struct spi_device *_device; - int status; - - _device = tdmb_get_spi_handle(); - - INC_MUTEX_LOCK(); - auiBuff[cCnt++] = uiNewAddr >> 8; - auiBuff[cCnt++] = uiNewAddr & 0xff; - auiBuff[cCnt++] = uiCMD >> 8; - auiBuff[cCnt++] = uiCMD & 0xff; - auiBuff[cCnt++] = uiData >> 8; - auiBuff[cCnt++] = uiData & 0xff; - memset(&msg, 0, sizeof(msg)); - memset(&transfer, 0, sizeof(transfer)); - spi_message_init(&msg); - msg.spi = _device; - transfer.tx_buf = (u8 *) auiBuff; - transfer.rx_buf = NULL; - transfer.len = 6; - transfer.bits_per_word = 8; - transfer.delay_usecs = 0; - spi_message_add_tail(&transfer, &msg); - status = spi_sync(_device, &msg); - INC_MUTEX_FREE(); - return INC_SUCCESS; -} - -unsigned char INC_SPI_READ_BURST(unsigned char ucI2CID, unsigned short uiAddr, - unsigned char *pBuff, unsigned short wSize) -{ - unsigned short uiNewAddr = - (ucI2CID == TDMB_I2C_ID82) ? (uiAddr | 0x8000) : uiAddr; - unsigned short uiCMD; - unsigned char auiBuff[6]; - - struct spi_message msg; - struct spi_transfer transfer[2]; - struct spi_device *_device; - int status; - - _device = tdmb_get_spi_handle(); - - INC_MUTEX_LOCK(); - auiBuff[0] = uiNewAddr >> 8; - auiBuff[1] = uiNewAddr & 0xff; - uiCMD = INC_REGISTER_CTRL(SPI_MEMREAD_CMD) | (wSize & 0xFFF); - auiBuff[2] = uiCMD >> 8; - auiBuff[3] = uiCMD & 0xff; - memset(&msg, 0, sizeof(msg)); - memset(transfer, 0, sizeof(transfer)); - spi_message_init(&msg); - msg.spi = _device; - transfer[0].tx_buf = (u8 *) auiBuff; - transfer[0].rx_buf = (u8 *) NULL; - transfer[0].len = 4; - transfer[0].bits_per_word = 8; - transfer[0].delay_usecs = 0; - spi_message_add_tail(&(transfer[0]), &msg); - transfer[1].tx_buf = (u8 *) NULL; - transfer[1].rx_buf = (u8 *) pBuff; - transfer[1].len = wSize; - transfer[1].bits_per_word = 8; - transfer[1].delay_usecs = 0; - spi_message_add_tail(&(transfer[1]), &msg); - status = spi_sync(_device, &msg); - INC_MUTEX_FREE(); - return INC_SUCCESS; -} - -unsigned char INTERFACE_DBINIT(void) -{ - memset(&g_stDmbInfo, 0, sizeof(struct ST_SUBCH_INFO)); - memset(&g_stDabInfo, 0, sizeof(struct ST_SUBCH_INFO)); - memset(&g_stDataInfo, 0, sizeof(struct ST_SUBCH_INFO)); - memset(&g_stFIDCInfo, 0, sizeof(struct ST_SUBCH_INFO)); - return INC_SUCCESS; -} - -void INTERFACE_UPLOAD_MODE(unsigned char ucI2CID, - enum UPLOAD_MODE_INFO ucUploadMode) -{ - struct INC_TDMB_MODE *stMode; - stMode = INC_GET_TDMBMODE(ucI2CID); - stMode->m_ucUploadMode = ucUploadMode; - INC_SET_TDMBMODE(ucI2CID, stMode); - - INC_UPLOAD_MODE(ucI2CID); -} - -unsigned char INTERFACE_PLL_MODE(unsigned char ucI2CID, enum PLL_MODE ucPllMode) -{ - struct INC_TDMB_MODE *stMode; - stMode = INC_GET_TDMBMODE(ucI2CID); - stMode->m_ucPLL_Mode = ucPllMode; - INC_SET_TDMBMODE(ucI2CID, stMode); - return INC_PLL_SET(ucI2CID); -} - -unsigned char INTERFACE_INIT(unsigned char ucI2CID) -{ - return INC_INIT(ucI2CID); -} - -enum INC_ERROR_INFO INTERFACE_ERROR_STATUS(unsigned char ucI2CID) -{ - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - return pInfo->nBbpStatus; -} - -/*************************************************/ -/* when Single Channel Select.... */ -/* pChInfo->ucServiceType, pChInfo->ucSubChID, */ -/* pChInfo->ulRFFreq */ -/* pChInfo->nSetCnt must be defined */ -/* When DMB Channel Select */ -/* pChInfo->ucServiceType = 0x18 */ -/* When DAB, DATA Channel Select muse be */ -/* pChInfo->ucServiceType = 0 */ -/*************************************************/ - -unsigned char INTERFACE_START(unsigned char ucI2CID, - struct ST_SUBCH_INFO *pChInfo) -{ - return INC_CHANNEL_START(ucI2CID, pChInfo); -} - - -/* For Factory */ -unsigned char INTERFACE_START_TEST( - unsigned char ucI2CID, struct ST_SUBCH_INFO *pChInfo) -{ - return INC_CHANNEL_START_TEST(ucI2CID, pChInfo); -} - -/************************************************/ -/* Multi Channel Select .. */ -/* pChInfo->ucServiceType, pChInfo->ucSubChID, */ -/*pChInfo->ulRFFreq is muse be */ -/* defined */ -/* When DMB Channel Select */ -/* pChInfo->ucServiceType = 0x18 */ -/* When DAB, DATA Channel Select must be */ -/* pChInfo->ucServiceType = 0 */ -/* pMultiInfo->nSetCnt is count of subChannel */ -/************************************************/ -unsigned char INTERFACE_SCAN(unsigned char ucI2CID, unsigned int ulFreq) -{ - INTERFACE_DBINIT(); - if (!INC_ENSEMBLE_SCAN(ucI2CID, ulFreq)) - return INC_ERROR; - INC_DB_UPDATE(ulFreq, &g_stDmbInfo, &g_stDabInfo, &g_stDataInfo, - &g_stFIDCInfo); - INC_BUBBLE_SORT(&g_stDmbInfo, INC_SUB_CHANNEL_ID); - INC_BUBBLE_SORT(&g_stDabInfo, INC_SUB_CHANNEL_ID); - INC_BUBBLE_SORT(&g_stDataInfo, INC_SUB_CHANNEL_ID); - INC_BUBBLE_SORT(&g_stFIDCInfo, INC_SUB_CHANNEL_ID); - return INC_SUCCESS; -} - - -/**********************************************/ -/* DMB Channel count return when single */ -/* channel scan is finished */ -/**********************************************/ -unsigned short INTERFACE_GETDMB_CNT(void) -{ - return (unsigned short) g_stDmbInfo.nSetCnt; -} - - -/***********************************************/ -/* DAB Channel count return when single channel */ -/* scan is finished */ -/************************************************/ -unsigned short INTERFACE_GETDAB_CNT(void) -{ - return (unsigned short) g_stDabInfo.nSetCnt; -} - - -/************************************************/ -/* DATA Channel count return when single */ -/* channel scan is finished */ -/************************************************/ -unsigned short INTERFACE_GETDATA_CNT(void) -{ - return (unsigned short) g_stDataInfo.nSetCnt; -} - - -/************************************************/ -/* Ensemble Label return when single channel */ -/* scan is finished */ -/************************************************/ - -unsigned char *INTERFACE_GETENSEMBLE_LABEL(unsigned char ucI2CID) -{ - struct ST_FICDB_LIST *pList; - pList = INC_GET_FICDB_LIST(); - return pList->aucEnsembleName; -} - - -/************************************************/ -/* Return the DMB Channel Information */ -/************************************************/ -struct INC_CHANNEL_INFO *INTERFACE_GETDB_DMB(short uiPos) -{ - if (uiPos >= MAX_SUBCH_SIZE) - return INC_NULL; - if (uiPos >= g_stDmbInfo.nSetCnt) - return INC_NULL; - return &g_stDmbInfo.astSubChInfo[uiPos]; -} - - -/************************************************/ -/* REturn the DAB Channel Information */ -/************************************************/ -struct INC_CHANNEL_INFO *INTERFACE_GETDB_DAB(short uiPos) -{ - if (uiPos >= MAX_SUBCH_SIZE) - return INC_NULL; - if (uiPos >= g_stDabInfo.nSetCnt) - return INC_NULL; - return &g_stDabInfo.astSubChInfo[uiPos]; -} - -/************************************************/ -/* REturn the DATA Channel Information */ -/************************************************/ -struct INC_CHANNEL_INFO *INTERFACE_GETDB_DATA(short uiPos) -{ - if (uiPos >= MAX_SUBCH_SIZE) - return INC_NULL; - if (uiPos >= g_stDataInfo.nSetCnt) - return INC_NULL; - return &g_stDataInfo.astSubChInfo[uiPos]; -} - -/* Chech the change of FIC info when watching tv */ -unsigned char INTERFACE_RECONFIG(unsigned char ucI2CID) -{ - return INC_FIC_RECONFIGURATION_HW_CHECK(ucI2CID); -} - -unsigned char INTERFACE_STATUS_CHECK(unsigned char ucI2CID) -{ - return INC_STATUS_CHECK(ucI2CID); -} - -unsigned short INTERFACE_GET_CER(unsigned char ucI2CID) -{ - return INC_GET_CER(ucI2CID); -} - -unsigned char INTERFACE_GET_SNR(unsigned char ucI2CID) -{ - return INC_GET_SNR(ucI2CID); -} - -unsigned int INTERFACE_GET_POSTBER(unsigned char ucI2CID) -{ - return INC_GET_POSTBER(ucI2CID); -} - -unsigned int INTERFACE_GET_PREBER(unsigned char ucI2CID) -{ - return INC_GET_PREBER(ucI2CID); -} - -/***************************************************/ -/* Be Called when Scan, start channel, force stop. */ -/***************************************************/ -void INTERFACE_USER_STOP(unsigned char ucI2CID) -{ - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - pInfo->ucStop = 1; -} - -void INTERFACE_USER_STOP_CLEAR(unsigned char ucI2CID) -{ - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - pInfo->ucStop = 0; -} - -/* Interrupt Enable... */ -void INTERFACE_INT_ENABLE(unsigned char ucI2CID, unsigned short unSet) -{ - INC_INTERRUPT_SET(ucI2CID, unSet); -} - -/* Use when polling mode */ -unsigned char INTERFACE_INT_CHECK(unsigned char ucI2CID) -{ - unsigned short nValue = 0; - nValue = INC_CMD_READ(ucI2CID, APB_INT_BASE + 0x01); - if (!(nValue & INC_MPI_INTERRUPT_ENABLE)) - return INC_ERROR; - - return INC_SUCCESS; -} - -/* Interrupt Clear */ -void INTERFACE_INT_CLEAR(unsigned char ucI2CID, unsigned short unClr) -{ - INC_INTERRUPT_CLEAR(ucI2CID, unClr); -} - -/* Interrupt Service Routine... // SPI Slave Mode or MPI Slave Mode */ -unsigned char INTERFACE_ISR(unsigned char ucI2CID, unsigned char *pBuff) -{ - unsigned short unDataLength; - unDataLength = INC_CMD_READ(ucI2CID, APB_MPI_BASE + 0x6); - if (unDataLength < INC_INTERRUPT_SIZE) - return INC_ERROR; - - INC_CMD_READ_BURST(ucI2CID, APB_STREAM_BASE, pBuff, - INC_INTERRUPT_SIZE); - INTERFACE_INT_CLEAR(ucI2CID, INC_MPI_INTERRUPT_ENABLE); - return INC_SUCCESS; -} diff --git a/drivers/media/tdmb/t3900/INC_PROCESS.c b/drivers/media/tdmb/t3900/INC_PROCESS.c deleted file mode 100644 index ea12eb2..0000000 --- a/drivers/media/tdmb/t3900/INC_PROCESS.c +++ /dev/null @@ -1,1893 +0,0 @@ -/***************************************************************************** - Copyright(c) 2011 I&C Inc. All Rights Reserved - - File name : INC_PROCESS.c - - Description : - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*******************************************************************************/ - -#include "INC_INCLUDES.h" -#include <linux/fs.h> -#include <linux/uaccess.h> - -static struct ST_BBPINFO g_astBBPRun[2]; -enum ENSEMBLE_BAND m_ucRfBand = KOREA_BAND_ENABLE; -enum CTRL_MODE m_ucCommandMode = INC_SPI_CTRL; -enum ST_TRANSMISSION m_ucTransMode = TRANSMISSION_MODE1; -enum UPLOAD_MODE_INFO m_ucUploadMode = STREAM_UPLOAD_SPI; -enum CLOCK_SPEED m_ucClockSpeed = INC_OUTPUT_CLOCK_4096; -enum INC_ACTIVE_MODE m_ucMPI_CS_Active = INC_ACTIVE_LOW; -enum INC_ACTIVE_MODE m_ucMPI_CLK_Active = INC_ACTIVE_HIGH; -enum PLL_MODE m_ucPLL_Mode = INPUT_CLOCK_19200KHZ; -enum INC_DPD_MODE m_ucDPD_Mode = INC_DPD_OFF; -unsigned short m_unIntCtrl = \ - (INC_INTERRUPT_POLARITY_HIGH \ - | INC_INTERRUPT_PULSE \ - |INC_INTERRUPT_AUTOCLEAR_ENABLE \ - |(INC_INTERRUPT_PULSE_COUNT & INC_INTERRUPT_PULSE_COUNT_MASK)); - -static struct INC_TDMB_MODE g_stMode; - -struct INC_TDMB_MODE *INC_GET_TDMBMODE(unsigned char ucI2CID) -{ - g_stMode.m_ucRfBand = m_ucRfBand; - g_stMode.m_ucCommandMode = m_ucCommandMode; - g_stMode.m_ucTransMode = m_ucTransMode; - g_stMode.m_ucUploadMode = m_ucUploadMode; - g_stMode.m_ucClockSpeed = m_ucClockSpeed; - g_stMode.m_ucMPI_CS_Active = m_ucMPI_CS_Active; - g_stMode.m_ucMPI_CLK_Active = m_ucMPI_CLK_Active; - g_stMode.m_ucPLL_Mode = m_ucPLL_Mode; - g_stMode.m_ucDPD_Mode = m_ucDPD_Mode; - g_stMode.m_unIntCtrl = m_unIntCtrl; - return &g_stMode; -} - -void INC_SET_TDMBMODE(unsigned char ucI2CID, struct INC_TDMB_MODE *stMode) -{ - m_ucRfBand = stMode->m_ucRfBand; - m_ucCommandMode = stMode->m_ucCommandMode; - m_ucTransMode = stMode->m_ucTransMode; - m_ucUploadMode = stMode->m_ucUploadMode; - m_ucClockSpeed = stMode->m_ucClockSpeed; - m_ucMPI_CS_Active = stMode->m_ucMPI_CS_Active; - m_ucMPI_CLK_Active = stMode->m_ucMPI_CLK_Active; - m_ucPLL_Mode = stMode->m_ucPLL_Mode; - m_ucDPD_Mode = stMode->m_ucDPD_Mode; - m_unIntCtrl = stMode->m_unIntCtrl; -} - - -unsigned char INC_CMD_WRITE(unsigned char ucI2CID, - unsigned short uiAddr, unsigned short uiData) -{ - if (m_ucCommandMode == INC_SPI_CTRL) - return INC_SPI_REG_WRITE(ucI2CID, uiAddr, uiData); - else if (m_ucCommandMode == INC_I2C_CTRL) - return INC_I2C_WRITE(ucI2CID, uiAddr, uiData); - else if (m_ucCommandMode == INC_EBI_CTRL) - return INC_EBI_WRITE(ucI2CID, uiAddr, uiData); - return INC_I2C_WRITE(ucI2CID, uiAddr, uiData); -} - -unsigned short INC_CMD_READ(unsigned char ucI2CID, unsigned short uiAddr) -{ - if (m_ucCommandMode == INC_SPI_CTRL) - return INC_SPI_REG_READ(ucI2CID, uiAddr); - else if (m_ucCommandMode == INC_I2C_CTRL) - return INC_I2C_READ(ucI2CID, uiAddr); - else if (m_ucCommandMode == INC_EBI_CTRL) - return INC_EBI_READ(ucI2CID, uiAddr); - return INC_I2C_READ(ucI2CID, uiAddr); -} - -unsigned char INC_CMD_READ_BURST(unsigned char ucI2CID, unsigned short uiAddr, - unsigned char *pData, unsigned short nSize) -{ - if (m_ucCommandMode == INC_SPI_CTRL) - return INC_SPI_READ_BURST(ucI2CID, uiAddr, pData, nSize); - else if (m_ucCommandMode == INC_I2C_CTRL) - return INC_I2C_READ_BURST(ucI2CID, uiAddr, pData, nSize); - else if (m_ucCommandMode == INC_EBI_CTRL) - return INC_EBI_READ_BURST(ucI2CID, uiAddr, pData, nSize); - return INC_I2C_READ_BURST(ucI2CID, uiAddr, pData, nSize); -} - -void INC_INIT_MPI(unsigned char ucI2CID) -{ - unsigned short uiMpiStatus, uiRsStatus; - uiRsStatus = INC_CMD_READ(ucI2CID, APB_RS_BASE + 0); - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0, 0x0000); - INC_DELAY(50); - uiMpiStatus = INC_CMD_READ(ucI2CID, APB_MPI_BASE + 0); - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0, uiMpiStatus | 0x8000); - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0, uiRsStatus | 0x8000); -} - -void INC_MPICLOCK_SET(unsigned char ucI2CID) -{ - if (m_ucUploadMode == STREAM_UPLOAD_TS) { - if (m_ucClockSpeed == INC_OUTPUT_CLOCK_1024) - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x01, 0x9918); - else if (m_ucClockSpeed == INC_OUTPUT_CLOCK_2048) - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x01, 0x440C); - else if (m_ucClockSpeed == INC_OUTPUT_CLOCK_4096) - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x01, 0x3308); - else - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x01, 0x3308); - return; - } - - if (m_ucClockSpeed == INC_OUTPUT_CLOCK_1024) - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x01, 0x9918); - else if (m_ucClockSpeed == INC_OUTPUT_CLOCK_2048) - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x01, 0x440C); - else if (m_ucClockSpeed == INC_OUTPUT_CLOCK_4096) - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x01, 0x2206); - else - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x01, 0x2206); -} - -void INC_UPLOAD_MODE(unsigned char ucI2CID) -{ - unsigned short uiStatus = 0x01; - - if (m_ucCommandMode != INC_EBI_CTRL) { - if (m_ucUploadMode == STREAM_UPLOAD_SPI) - uiStatus = 0x05; - if (m_ucUploadMode == STREAM_UPLOAD_SLAVE_PARALLEL) - uiStatus = 0x04; - if (m_ucUploadMode == STREAM_UPLOAD_TS) - uiStatus = 0x101; - if (m_ucMPI_CS_Active == INC_ACTIVE_HIGH) - uiStatus |= 0x10; - if (m_ucMPI_CLK_Active == INC_ACTIVE_HIGH) - uiStatus |= 0x20; - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x00, uiStatus); - } else { - INC_CMD_WRITE(ucI2CID, APB_I2C_BASE + 0x00, 0x0001); - INC_CMD_WRITE(ucI2CID, APB_SPI_BASE + 0x00, 0x0011); - } - - if (m_ucUploadMode == STREAM_UPLOAD_TS) { - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x02, 188); - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x03, 8); - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x04, 188); - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x05, 0); - } else { - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x02, MPI_CS_SIZE); - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x04, INC_INTERRUPT_SIZE); - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0x05, - INC_INTERRUPT_SIZE - 188); - } -} - -void INC_SWAP(struct ST_SUBCH_INFO *pMainInfo, - unsigned short nNo1, unsigned short nNo2) -{ - struct INC_CHANNEL_INFO stChInfo; - stChInfo = pMainInfo->astSubChInfo[nNo1]; - pMainInfo->astSubChInfo[nNo1] = pMainInfo->astSubChInfo[nNo2]; - pMainInfo->astSubChInfo[nNo2] = stChInfo; -} - -void INC_BUBBLE_SORT(struct ST_SUBCH_INFO *pMainInfo, enum INC_SORT_OPTION Opt) -{ - short nIndex, nLoop; - struct INC_CHANNEL_INFO *pDest; - struct INC_CHANNEL_INFO *pSour; - - if (pMainInfo->nSetCnt <= 1) - return; - - for (nIndex = 0; nIndex < pMainInfo->nSetCnt - 1; nIndex++) { - pSour = &pMainInfo->astSubChInfo[nIndex]; - - for (nLoop = nIndex + 1; nLoop < pMainInfo->nSetCnt; nLoop++) { - pDest = &pMainInfo->astSubChInfo[nLoop]; - - if (Opt == INC_SUB_CHANNEL_ID) { - if (pSour->ucSubChID > pDest->ucSubChID - && pSour->ulRFFreq == pDest->ulRFFreq) { - INC_SWAP(pMainInfo, nIndex, nLoop); - } - } else if (Opt == INC_START_ADDRESS) { - if (pSour->uiStarAddr > pDest->uiStarAddr - && pSour->ulRFFreq == pDest->ulRFFreq) - INC_SWAP(pMainInfo, nIndex, nLoop); - } else if (Opt == INC_BIRRATE) { - if (pSour->uiBitRate > pDest->uiBitRate - && pSour->ulRFFreq == pDest->ulRFFreq) - INC_SWAP(pMainInfo, nIndex, nLoop); - } else if (Opt == INC_FREQUENCY) { - if (pSour->ulRFFreq > pDest->ulRFFreq - && pSour->ulRFFreq == pDest->ulRFFreq) - INC_SWAP(pMainInfo, nIndex, nLoop); - } else { - if (pSour->uiStarAddr > pDest->uiStarAddr - && pSour->ulRFFreq == pDest->ulRFFreq) - INC_SWAP(pMainInfo, nIndex, nLoop); - } - } - } -} - -unsigned char INC_BUBBLE_SORT_by_TYPE(struct ST_SUBCH_INFO *pMainInfo) -{ - short nIndex, nLoop; - struct INC_CHANNEL_INFO *pDest; - struct INC_CHANNEL_INFO *pSour; - - if (pMainInfo->nSetCnt <= 1) - return INC_ERROR; - - for (nIndex = 0; nIndex < pMainInfo->nSetCnt - 1; nIndex++) { - if (pMainInfo->astSubChInfo[nIndex].uiTmID != TMID_1) - continue; - - pSour = &pMainInfo->astSubChInfo[nIndex]; - - for (nLoop = nIndex + 1; nLoop < pMainInfo->nSetCnt; nLoop++) { - if (pMainInfo->astSubChInfo[nLoop].uiTmID == TMID_1) - continue; - pDest = &pMainInfo->astSubChInfo[nLoop]; - INC_SWAP(pMainInfo, nIndex, nLoop); - return INC_SUCCESS; - } - } - return INC_ERROR; -} - -struct ST_BBPINFO *INC_GET_STRINFO(unsigned char ucI2CID) -{ - if (ucI2CID == TDMB_I2C_ID80) - return &g_astBBPRun[0]; - return &g_astBBPRun[1]; -} - -unsigned short INC_GET_FRAME_DURATION(enum ST_TRANSMISSION cTrnsMode) -{ - unsigned short uPeriodFrame; - switch (cTrnsMode) { - case TRANSMISSION_MODE1: - uPeriodFrame = MAX_FRAME_DURATION; - break; - case TRANSMISSION_MODE2: - case TRANSMISSION_MODE3: - uPeriodFrame = MAX_FRAME_DURATION / 4; - break; - case TRANSMISSION_MODE4: - uPeriodFrame = MAX_FRAME_DURATION / 2; - break; - default: - uPeriodFrame = MAX_FRAME_DURATION; - break; - } - return uPeriodFrame; -} - -unsigned char INC_GET_FIB_CNT(enum ST_TRANSMISSION ucMode) -{ - unsigned char ucResult = 0; - switch (ucMode) { - case TRANSMISSION_MODE1: - ucResult = 12; - break; - case TRANSMISSION_MODE2: - ucResult = 3; - break; - case TRANSMISSION_MODE3: - ucResult = 4; - break; - case TRANSMISSION_MODE4: - ucResult = 6; - break; - default: - ucResult = 12; - break; - } - return ucResult; -} - -void INC_INTERRUPT_CTRL(unsigned char ucI2CID) -{ - INC_CMD_WRITE(ucI2CID, APB_INT_BASE + 0x00, m_unIntCtrl); -} - -void INC_INTERRUPT_CLEAR(unsigned char ucI2CID, unsigned short uiClrInt) -{ - INC_CMD_WRITE(ucI2CID, APB_INT_BASE + 0x03, uiClrInt); -} - -void INC_INTERRUPT_SET(unsigned char ucI2CID, unsigned short uiSetInt) -{ - unsigned short uiIntSet; - uiIntSet = ~uiSetInt; - INC_CMD_WRITE(ucI2CID, APB_INT_BASE + 0x02, uiIntSet); -} - -unsigned char INC_CHIP_STATUS(unsigned char ucI2CID) -{ - unsigned short uiChipID; - uiChipID = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x10) & 0xF00; - if (uiChipID != 0xD00 && uiChipID != 0xC00) { - printk(KERN_DEBUG"[TDMB_3900] Chip ID Error : 0x%X\r\n", - uiChipID); - return INC_ERROR; - } - printk(KERN_DEBUG"[TDMB_T3900] Chip ID good : 0x%X\r\n", uiChipID); - return INC_SUCCESS; -} - -unsigned char INC_PLL_SET(unsigned char ucI2CID) -{ - unsigned short wData; - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - - wData = INC_CMD_READ(ucI2CID, APB_GEN_BASE + 0x02) & 0xFE00; - - switch (m_ucPLL_Mode) { - case INPUT_CLOCK_24576KHZ: - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x00, 0x0000); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x06, 0x0002); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x21, 0x3FFF); - break; - - case INPUT_CLOCK_27000KHZ: - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x02, wData | 0x41BE); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x03, 0x310A); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x00, 0x7FFF); - break; - - case INPUT_CLOCK_19200KHZ: - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x01, 0x0003); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x02, 0x0086); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x03, 0x0066); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x04, 0x6666); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x05, 0x0075); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x06, 0x0000); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x07, 0x0000); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x00, 0x0001); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x21, 0x3FFF); - break; - - case INPUT_CLOCK_27120KHZ: - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x01, 0x0001); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x02, 0x001F); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x03, 0x00B7); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x04, 0x8122); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x05, 0x0075); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x06, 0x0000); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x07, 0x0000); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x00, 0x0001); - break; - - case INPUT_CLOCK_12000KHZ: - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x02, wData | 0x4200); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x03, 0x190A); - INC_CMD_WRITE(ucI2CID, APB_GEN_BASE + 0x00, 0x7FFF); - break; - } - - if (m_ucPLL_Mode == INPUT_CLOCK_24576KHZ) - return INC_SUCCESS; - INC_DELAY(10); - - if (!(INC_CMD_READ(ucI2CID, APB_GEN_BASE + 0x09) & 0x0001)) { - pInfo->nBbpStatus = ERROR_PLL; - return INC_ERROR; - } - - return INC_SUCCESS; -} - -void INC_SET_CHANNEL(unsigned char ucI2CID, struct ST_SUBCH_INFO *pMultiInfo) -{ - struct INC_CHANNEL_INFO *pChInfo; - unsigned short uiLoop, wData; - enum INC_CTRL wDmbMode; - -#ifdef INC_MULTI_HEADER_ENABLE - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x00, 0x800); -#endif - - for (uiLoop = 0; uiLoop < pMultiInfo->nSetCnt; uiLoop++) { - pChInfo = &pMultiInfo->astSubChInfo[uiLoop]; - wDmbMode = (pChInfo->ucServiceType == 0x18) ? INC_DMB : INC_DAB; - wData = - INC_CMD_READ(ucI2CID, - APB_VTB_BASE + 0x01) & (~(0x3 << uiLoop * 2)); - - if (wDmbMode == INC_DMB) - INC_CMD_WRITE(ucI2CID, APB_VTB_BASE + 0x01, - wData | 0x02 << (uiLoop * 2)); - else - INC_CMD_WRITE(ucI2CID, APB_VTB_BASE + 0x01, - wData | 0x01 << (uiLoop * 2)); - - wData = INC_CMD_READ(ucI2CID, APB_RS_BASE + 0x00); - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x00, - wData | (0x40 >> uiLoop)); - } - - wData = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x00); - INC_CMD_WRITE(ucI2CID, APB_VTB_BASE + 0x00, wData | 0x0001); - - wData = INC_CMD_READ(ucI2CID, APB_RS_BASE + 0x00); -#ifdef INC_MULTI_CHANNEL_FIC_UPLOAD - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x00, wData | 0x8080); -#else - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x00, wData | 0x8000); -#endif -} - -unsigned char INC_INIT(unsigned char ucI2CID) -{ - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - memset(pInfo, 0, sizeof(struct ST_BBPINFO)); - - if (m_ucTransMode < TRANSMISSION_MODE1 - || m_ucTransMode > TRANSMISSION_AUTOFAST) - return INC_ERROR; - - pInfo->ucTransMode = m_ucTransMode; - - if (INC_PLL_SET(ucI2CID) != INC_SUCCESS) { - printk(KERN_DEBUG"[TDMB_T3900] INC_INIT\n"); - return INC_ERROR; - } - - if (INC_CHIP_STATUS(ucI2CID) != INC_SUCCESS) { - printk(KERN_DEBUG"[TDMB_T3900] INC_CHIP_STATUS\n"); - return INC_ERROR; - } - - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x3B, 0xFFFF); - INC_DELAY(10); - - INC_INTERRUPT_CTRL(ucI2CID); - INC_CMD_WRITE(ucI2CID, APB_VTB_BASE + 0x00, 0x8000); - INC_CMD_WRITE(ucI2CID, APB_VTB_BASE + 0x01, 0x01C1); - INC_CMD_WRITE(ucI2CID, APB_VTB_BASE + 0x05, 0x0008); - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x01, TS_ERR_THRESHOLD); - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x09, 0x000C); - - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x00, 0xF0FF); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x88, 0x2210); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x98, 0x0000); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x41, 0x0CCC); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xB0, 0x8320); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xB4, 0x4C01); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xBC, 0x4088); - - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x40, 0xD05C); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x8C, 0x0183); - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x0A, 0x80F0); - - INC_CMD_WRITE(ucI2CID, APB_DEINT_BASE + 0x01, 0x0001); - switch (m_ucTransMode) { - case TRANSMISSION_AUTO: - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x98, 0x8000); - break; - - case TRANSMISSION_AUTOFAST: - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x98, 0xC000); - break; - - case TRANSMISSION_MODE1: - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xD0, 0x7F1F); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x80, 0x4082); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x90, 0x0430); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xC8, 0x3F31); - break; - - case TRANSMISSION_MODE2: - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xD0, 0x1F07); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x80, 0x4182); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x90, 0x0415); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xC8, 0x1F31); - break; - - case TRANSMISSION_MODE3: - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xD0, 0x0F03); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x80, 0x4282); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x90, 0x0408); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xC8, 0x0331); - break; - - case TRANSMISSION_MODE4: - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xD0, 0x3F0F); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x80, 0x4382); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x90, 0x0420); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xC8, 0x3F31); - break; - } - - INC_MPICLOCK_SET(ucI2CID); - INC_UPLOAD_MODE(ucI2CID); - - switch (m_ucRfBand) { - case KOREA_BAND_ENABLE: - INC_READY(ucI2CID, 175280); - break; - case BANDIII_ENABLE: - INC_READY(ucI2CID, 174928); - break; - case LBAND_ENABLE: - INC_READY(ucI2CID, 1452960); - break; - case CHINA_ENABLE: - INC_READY(ucI2CID, 168160); - break; - case ROAMING_ENABLE: - INC_READY(ucI2CID, 217280); - break; - case EXTERNAL_ENABLE: - break; - } - - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0x0F, 0x40); - if (m_ucPLL_Mode == INPUT_CLOCK_19200KHZ) - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0x10, 0x6A); - if (m_ucPLL_Mode == INPUT_CLOCK_24576KHZ) - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0x10, 0x88); - if (m_ucPLL_Mode == INPUT_CLOCK_27000KHZ) - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0x10, 0x96); - if (m_ucPLL_Mode == INPUT_CLOCK_27120KHZ) - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0x10, 0x96); - - INC_DELAY(100); - printk(KERN_DEBUG"[TDMB_T3900] INC_INIT START GOOD\n"); - return INC_SUCCESS; -} - -unsigned char INC_READY(unsigned char ucI2CID, unsigned int ulFreq) -{ - unsigned short uStatus = 0; - unsigned char bModeFlag = 0; - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - - if (ulFreq == 189008 || ulFreq == 196736 || ulFreq == 205280 - || ulFreq == 213008 || ulFreq == 180064 || ulFreq == 188928 - || ulFreq == 195936 || ulFreq == 204640 || ulFreq == 213360 - || ulFreq == 220352 || ulFreq == 222064 || ulFreq == 229072 - || ulFreq == 237488 || ulFreq == 180144 || ulFreq == 196144 - || ulFreq == 205296 || ulFreq == 212144 || ulFreq == 213856 - || ulFreq == 1466656 || ulFreq == 1475216 || ulFreq == 1482064 - || ulFreq == 1490624) { - bModeFlag = 1; - } - if (m_ucRfBand == ROAMING_ENABLE) - bModeFlag = 1; - - if (bModeFlag) { - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0xC6); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xC6, uStatus | 0x0008); - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x41) & 0xFC00; - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x41, uStatus | 0x111); - } else { - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0xC6); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xC6, uStatus & 0xFFF7); - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x41) & 0xFC00; - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x41, uStatus | 0xCC); - - if (ulFreq == 1461520 || ulFreq == 1463232 || ulFreq == 1475216 - || ulFreq == 1485488) { - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x40); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x40, - uStatus | (1 << 10)); - } else { - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x40); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x40, - uStatus & ~(1 << 10)); - } - } - - if (INC_RF500_START(ucI2CID, ulFreq, m_ucRfBand, m_ucPLL_Mode) - != INC_SUCCESS) { - pInfo->nBbpStatus = ERROR_READY; - return INC_ERROR; - } - - if (m_ucDPD_Mode == INC_DPD_OFF) { - uStatus = INC_CMD_READ(ucI2CID, APB_RF_BASE + 0x03); - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0x03, uStatus | 0x80); - } - - return INC_SUCCESS; -} - -unsigned char INC_SYNCDETECTOR(unsigned char ucI2CID, unsigned int ulFreq, - unsigned char ucScanMode) -{ - unsigned short wOperState, wIsNullSync = 0, wSyncRefTime = 800; - unsigned short uiTimeOutCnt = 0, uiRefSleep = 30; - struct ST_BBPINFO *pInfo; - unsigned short awData[2], uiRfNullTime = 240, wFftCnt = 0; - - pInfo = INC_GET_STRINFO(ucI2CID); - INC_SCAN_SETTING(ucI2CID); - if (m_ucDPD_Mode == INC_DPD_ON) { - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xA8, 0x3000); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xAA, 0x0000); - } - - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xBC, 0x4088); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x3A, 0x1); - INC_DELAY(200); - while (1) { - if (pInfo->ucStop) { - pInfo->nBbpStatus = ERROR_USER_STOP; - break; - } - - INC_DELAY(uiRefSleep); - - wOperState = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x10); - wOperState = ((wOperState & 0x7000) >> 12); - - if (!wIsNullSync && wOperState >= 0x2) - wIsNullSync = 1; - - if (!wIsNullSync && wSyncRefTime != 1500) { - awData[0] = - INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x14) & 0x0F00; - awData[1] = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x16); - - if (!awData[0] || !awData[1]) { - pInfo->nBbpStatus = ERROR_SYNC_NO_SIGNAL; - printk(KERN_DEBUG"TDMB Point 1\n"); - break; - } else if (awData[0] <= 0x200 && awData[1] <= 0x4000) { - pInfo->nBbpStatus = ERROR_SYNC_NO_SIGNAL; - printk(KERN_DEBUG"TDMB Point 2\n"); - break; - } else if (awData[0] >= 0x300) { - if (++wFftCnt >= (uiRfNullTime / uiRefSleep)) { - pInfo->nBbpStatus = - ERROR_SYNC_NO_SIGNAL; - printk(KERN_DEBUG"TDMB Point 3\n"); - break; - } else if (awData[1] <= 0x4000) { - if (++wFftCnt >= - (uiRfNullTime / uiRefSleep)) { - pInfo->nBbpStatus = - ERROR_SYNC_NO_SIGNAL; - printk(KERN_DEBUG"TDMB Point 4\n"); - break; - } - } - } - } - - if (wOperState >= 0x5) { - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xBC, 0x4008); - return INC_SUCCESS; - } - - uiTimeOutCnt++; - if (uiTimeOutCnt >= (2500 / uiRefSleep)) { - pInfo->nBbpStatus = ERROR_SYNC_TIMEOUT; - break; - } - } - - return INC_ERROR; -} - -void FILE_SAVE_FUNCTION(char *fname, unsigned char *pData, - unsigned long dwDataSize) -{ -#define DUMP_FILE_NAME "/data/ts_data.ts" - mm_segment_t oldfs; - int ret; - static struct file *fp_ts_data; - - if (fp_ts_data == NULL) { - fp_ts_data = filp_open(DUMP_FILE_NAME, O_APPEND | O_CREAT, 0); - if (fp_ts_data == NULL) { - printk(KERN_DEBUG"file open error!\n"); - return; - } - } - - oldfs = get_fs(); - set_fs(KERNEL_DS); - - if (fp_ts_data != NULL && dwDataSize == 0) { - filp_close(fp_ts_data, current->files); - fp_ts_data = NULL; - return; - } - ret = fp_ts_data->f_op->write(fp_ts_data, - pData, dwDataSize, &fp_ts_data->f_pos); - set_fs(oldfs); -} - -unsigned char INC_FICDECODER(unsigned char ucI2CID, - enum ST_SIMPLE_FIC bSimpleFIC) -{ - unsigned short wFicLen, uPeriodFrame, uFIBCnt, uiRefSleep; - unsigned short nLoop, nFicCnt; - unsigned char abyBuff[MAX_FIC_SIZE]; - struct ST_BBPINFO *pInfo; - -#ifdef USER_APPLICATION_TYPE - unsigned char ucIsUserApp = INC_ERROR; - struct ST_FICDB_LIST *pList; - unsigned char ucTimeOutCnt = 0; - pList = INC_GET_FICDB_LIST(); -#endif - - pInfo = INC_GET_STRINFO(ucI2CID); - - INC_INITDB(ucI2CID); - uFIBCnt = INC_GET_FIB_CNT(m_ucTransMode); - uPeriodFrame = INC_GET_FRAME_DURATION(m_ucTransMode); - uiRefSleep = uPeriodFrame >> 2; - nFicCnt = FIC_REF_TIME_OUT / uiRefSleep; - -#ifdef USER_APPLICATION_TYPE - nFicCnt = (FIC_REF_TIME_OUT + 1000) / uiRefSleep; -#endif - - for (nLoop = 0; nLoop < nFicCnt; nLoop++) { - if (pInfo->ucStop == 1) { - pInfo->nBbpStatus = ERROR_USER_STOP; - break; - } - - INC_DELAY(uiRefSleep); - - if (!(INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x00) & 0x4000)) - continue; - - wFicLen = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x09); - if (!wFicLen) - continue; - wFicLen++; - - if (wFicLen != (uFIBCnt * FIB_SIZE)) - continue; - INC_CMD_READ_BURST(ucI2CID, APB_FIC_BASE, abyBuff, wFicLen); - if (INC_FICPARSING(ucI2CID, abyBuff, wFicLen, bSimpleFIC)) { - if (bSimpleFIC == SIMPLE_FIC_ENABLE) - return INC_SUCCESS; - -#ifdef USER_APPLICATION_TYPE - ucTimeOutCnt++; - - if (ucTimeOutCnt >= 10 && pList->nPacketCnt - && (pList->nPacketCnt == pList->nUserAppCnt)) { - return INC_SUCCESS; - } - ucIsUserApp = INC_SUCCESS; -#else - - return INC_SUCCESS; -#endif - } - } - -#ifdef USER_APPLICATION_TYPE - if (ucIsUserApp == INC_SUCCESS) - return INC_SUCCESS; -#endif - pInfo->nBbpStatus = ERROR_FICDECODER; - - return INC_ERROR; -} - -unsigned char INC_START(unsigned char ucI2CID, struct ST_SUBCH_INFO *pChInfo, - unsigned short IsEnsembleSame) -{ - short nLoop, nSchID; - unsigned short wData; - struct ST_BBPINFO *pInfo; - struct INC_CHANNEL_INFO *pTempChInfo; - - unsigned short wCeil = 0, wIndex = 0, wStartAddr, wEndAddr; - - pInfo = INC_GET_STRINFO(ucI2CID); - INC_BUBBLE_SORT(pChInfo, INC_START_ADDRESS); - - INC_CMD_WRITE(ucI2CID, APB_DEINT_BASE + 0x01, 0x0000); - wData = INC_CMD_READ(ucI2CID, APB_MPI_BASE + 0); - INC_CMD_WRITE(ucI2CID, APB_MPI_BASE + 0, 0x8000 | wData); - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x00, 0x0000); - - for (nLoop = 0; nLoop < 3; nLoop++) { - if (nLoop >= pChInfo->nSetCnt) { - INC_CMD_WRITE(ucI2CID, - APB_DEINT_BASE + 0x02 + (nLoop * 2), - 0x00); - INC_CMD_WRITE(ucI2CID, - APB_DEINT_BASE + 0x03 + (nLoop * 2), - 0x00); - INC_CMD_WRITE(ucI2CID, APB_VTB_BASE + 0x02 + nLoop, - 0x00); - continue; - } - pTempChInfo = &pChInfo->astSubChInfo[nLoop]; - - nSchID = (unsigned short) pTempChInfo->ucSubChID & 0x3f; - INC_CMD_WRITE(ucI2CID, APB_DEINT_BASE + 0x02 + (nLoop * 2), - (unsigned short) (((unsigned short) nSchID << 10) + - pTempChInfo->uiStarAddr)); - - if (pTempChInfo->ucSlFlag == 0) { - INC_CMD_WRITE(ucI2CID, - APB_DEINT_BASE + 0x03 + (nLoop * 2), - 0x8000 + - (pTempChInfo->ucTableIndex & 0x3f)); - INC_CMD_WRITE(ucI2CID, APB_VTB_BASE + 0x02 + nLoop, - (pTempChInfo->ucTableIndex & 0x3f)); - } else { - INC_CMD_WRITE(ucI2CID, - APB_DEINT_BASE + 0x03 + (nLoop * 2), - 0x8000 + 0x400 + pTempChInfo->uiSchSize); - wData = 0x8000 + ((pTempChInfo->ucOption & 0x7) << 12) - + ((pTempChInfo->ucProtectionLevel & 0x3) << 10) - + pTempChInfo->uiDifferentRate; - INC_CMD_WRITE(ucI2CID, APB_VTB_BASE + 0x02 + nLoop, - wData); - } - - if (m_ucDPD_Mode == INC_DPD_ON) { - switch (pInfo->ucTransMode) { - case TRANSMISSION_MODE1: - wCeil = 3072; - wIndex = 4; - break; - case TRANSMISSION_MODE2: - wCeil = 768; - wIndex = 4; - break; - case TRANSMISSION_MODE3: - wCeil = 384; - wIndex = 9; - break; - case TRANSMISSION_MODE4: - wCeil = 1536; - wIndex = 4; - break; - default: - wCeil = 3072; - break; - } - - wStartAddr = - ((pTempChInfo->uiStarAddr * 64) / wCeil) + wIndex - - 0; - wEndAddr = - (unsigned short) (((pTempChInfo->uiStarAddr + - pTempChInfo->uiSchSize) * 64) / - wCeil) + wIndex + 1; - wData = (wStartAddr & 0xFF) << 8 | (wEndAddr & 0xFF); - - INC_CMD_WRITE(ucI2CID, - APB_PHY_BASE + 0xAA + (nLoop * 2), wData); - wData = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0xA8); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xA8, - wData | (1 << nLoop)); - } else { - INC_CMD_WRITE(ucI2CID, - APB_PHY_BASE + 0xAA + (nLoop * 2), - 0x0000); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0xA8, 0x3000); - } - - wData = INC_CMD_READ(ucI2CID, APB_RS_BASE + 0x00); - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x00, - wData | (0x1 << (6 - nLoop))); - } - - INC_SET_CHANNEL(ucI2CID, pChInfo); - INC_CMD_WRITE(ucI2CID, APB_DEINT_BASE + 0x0, 0x0001); - INC_CMD_WRITE(ucI2CID, APB_DEINT_BASE + 0x1, 0x0001); - - return INC_SUCCESS; -} - -unsigned char INC_STOP(unsigned char ucI2CID) -{ - short nLoop; - unsigned short uStatus; - enum ST_TRANSMISSION ucTransMode; - struct ST_BBPINFO *pInfo; - - pInfo = INC_GET_STRINFO(ucI2CID); - ucTransMode = pInfo->ucTransMode; - memset(pInfo, 0, sizeof(struct ST_BBPINFO)); - pInfo->ucTransMode = ucTransMode; - - INC_CMD_WRITE(ucI2CID, APB_RS_BASE + 0x00, 0x0000); - - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x10) & 0x7000; - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x3B, 0x4000); - - INC_DELAY(25); - - for (nLoop = 0; nLoop < 10; nLoop++) { - INC_DELAY(2); - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x3B) & 0xFFFF; - if (uStatus == 0x8000) - break; - } - - if (nLoop >= 10) { - pInfo->nBbpStatus = ERROR_STOP; - return INC_ERROR; - } - - return INC_SUCCESS; -} - -void INC_SCAN_SETTING(unsigned char ucI2CID) -{ - unsigned short uStatus; - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x41) & 0xFFF; - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x41, uStatus | 0xC000); - - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB6, T3900_SCAN_IF_DELAY & 0xff); - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB5, - (T3900_SCAN_IF_DELAY >> 8) & 0xff); - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB4, - (T3900_SCAN_IF_DELAY >> 16) & 0xff); - - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB3, T3900_SCAN_RF_DELAY & 0xff); - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB2, - (T3900_SCAN_RF_DELAY >> 8) & 0xff); - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB1, - (T3900_SCAN_RF_DELAY >> 16) & 0xff); -} - -void INC_AIRPLAY_SETTING(unsigned char ucI2CID) -{ - unsigned short uStatus; - uStatus = INC_CMD_READ(ucI2CID, APB_PHY_BASE + 0x41) & 0xFFF; - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x41, uStatus | 0x4000); - - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB6, T3900_PLAY_IF_DELAY & 0xff); - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB5, - (T3900_PLAY_IF_DELAY >> 8) & 0xff); - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB4, - (T3900_PLAY_IF_DELAY >> 16) & 0xff); - - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB3, T3900_PLAY_RF_DELAY & 0xff); - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB2, - (T3900_PLAY_RF_DELAY >> 8) & 0xff); - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + 0xB1, - (T3900_PLAY_RF_DELAY >> 16) & 0xff); -} - -unsigned char INC_CHANNEL_START(unsigned char ucI2CID, - struct ST_SUBCH_INFO *pChInfo) -{ - unsigned short wEnsemble; - unsigned int ulRFFreq; - struct ST_BBPINFO *pInfo; - - INC_INTERRUPT_SET(ucI2CID, INC_MPI_INTERRUPT_ENABLE); - INC_INTERRUPT_CLEAR(ucI2CID, INC_MPI_INTERRUPT_ENABLE); - pInfo = INC_GET_STRINFO(ucI2CID); - - pInfo->ucStop = 0; - pInfo->nBbpStatus = ERROR_NON; - ulRFFreq = pChInfo->astSubChInfo[0].ulRFFreq; - wEnsemble = pInfo->ulFreq == ulRFFreq; - - printk - (KERN_DEBUG"=== T3900 INC_CHANNEL_START ===\r\n"); - printk - (KERN_DEBUG"== :: Frequency %6d[Khz] ==\r\n", - pChInfo->astSubChInfo[0].ulRFFreq); - printk - (KERN_DEBUG"== :: stChInfo.ucSubChID 0x%.4X ==\r\n", - pChInfo->astSubChInfo[0].ucSubChID); - printk - (KERN_DEBUG"== :: stChInfo.ucServiceType 0x%.4X ==\r\n", - pChInfo->astSubChInfo[0].ucServiceType); - printk - (KERN_DEBUG"======================================\r\n"); - - if (!wEnsemble) { - if (INC_STOP(ucI2CID) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG" T3900 INC_STOP GOOD \r\n"); - if (INC_READY(ucI2CID, ulRFFreq) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG" T3900 INC_READY GOOD \r\n"); - if (INC_SYNCDETECTOR(ucI2CID, ulRFFreq, 0) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG" T3900 INC_SYNCDETECTOR GOOD \r\n"); - if (INC_FICDECODER(ucI2CID, SIMPLE_FIC_ENABLE) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG" T3900 INC_FICDECODER GOOD \r\n"); - if (INC_FIC_UPDATE(ucI2CID, pChInfo, SIMPLE_FIC_ENABLE) != - INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG" T3900 INC_FIC_UPDATE GOOD \r\n"); - if (INC_START(ucI2CID, pChInfo, wEnsemble) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG" T3900 INC_START GOOD \r\n"); - } else { - if (INC_SYNCDETECTOR(ucI2CID, ulRFFreq, 0) != INC_SUCCESS) { - pInfo->ulFreq = 0; - return INC_ERROR; - } - printk(KERN_DEBUG" T3900 INC_SYNCDETECTOR GOOD \r\n"); - if (INC_FIC_UPDATE(ucI2CID, pChInfo, SIMPLE_FIC_ENABLE) != - INC_SUCCESS) - return INC_ERROR; - - printk(KERN_DEBUG"T3900 INC_FIC_UPDATE GOOD \r\n"); - if (INC_START(ucI2CID, pChInfo, wEnsemble) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG"T3900 INC_START GOOD \r\n"); - } - - INC_AIRPLAY_SETTING(ucI2CID); - - pInfo->ucProtectionLevel = pChInfo->astSubChInfo[0].ucProtectionLevel; - pInfo->ulFreq = ulRFFreq; - return INC_SUCCESS; -} - -unsigned char INC_CHANNEL_START_TEST(unsigned char ucI2CID, - struct ST_SUBCH_INFO *pChInfo) -{ - unsigned short wEnsemble; - unsigned int ulRFFreq; - struct ST_BBPINFO *pInfo; - - INC_INTERRUPT_SET(ucI2CID, INC_MPI_INTERRUPT_ENABLE); - INC_INTERRUPT_CLEAR(ucI2CID, INC_MPI_INTERRUPT_ENABLE); - pInfo = INC_GET_STRINFO(ucI2CID); - - pInfo->ucStop = 0; - pInfo->nBbpStatus = ERROR_NON; - ulRFFreq = pChInfo->astSubChInfo[0].ulRFFreq; - - wEnsemble = pInfo->ulFreq == ulRFFreq; - - INC_MSG_PRINTF(1, - "================= T3900 INC_CHANNEL_START_TEST =================\r\n"); - INC_MSG_PRINTF(1, - "== :: Frequency %6d[Khz] ==\r\n", - pChInfo->astSubChInfo[0].ulRFFreq); - INC_MSG_PRINTF(1, - "== :: stChInfo.ucSubChID 0x%.4X ==\r\n", - pChInfo->astSubChInfo[0].ucSubChID); - INC_MSG_PRINTF(1, - "== :: stChInfo.ucServiceType 0x%.4X ==\r\n", - pChInfo->astSubChInfo[0].ucServiceType); - INC_MSG_PRINTF(1, - "===========================================================\r\n"); - - if (!wEnsemble) { - if (INC_STOP(ucI2CID) != INC_SUCCESS) - return INC_ERROR; - INC_MSG_PRINTF(1, " T3900 INC_STOP GOOD \r\n"); - if (INC_READY(ucI2CID, ulRFFreq) != INC_SUCCESS) - return INC_ERROR; - INC_MSG_PRINTF(1, " T3900 INC_READY GOOD \r\n"); - if (INC_SYNCDETECTOR(ucI2CID, ulRFFreq, 0) != INC_SUCCESS) - return INC_ERROR; - INC_MSG_PRINTF(1, " T3900 INC_SYNCDETECTOR GOOD \r\n"); - if (INC_FICDECODER(ucI2CID, SIMPLE_FIC_DISABLE) != INC_SUCCESS) - return INC_ERROR; - INC_MSG_PRINTF(1, " T3900 INC_FICDECODER GOOD \r\n"); - if (INC_FIC_UPDATE(ucI2CID, pChInfo, SIMPLE_FIC_ENABLE) != - INC_SUCCESS) - return INC_ERROR; - INC_MSG_PRINTF(1, " T3900 INC_FIC_UPDATE GOOD \r\n"); - if (INC_START(ucI2CID, pChInfo, wEnsemble) != INC_SUCCESS) - return INC_ERROR; - INC_MSG_PRINTF(1, " T3900 INC_START GOOD \r\n"); - } else { - - if (INC_SYNCDETECTOR(ucI2CID, ulRFFreq, 0) != INC_SUCCESS) { - pInfo->ulFreq = 0; - return INC_ERROR; - } - INC_MSG_PRINTF(1, " T3900 INC_SYNCDETECTOR GOOD \r\n"); - if (INC_FIC_UPDATE(ucI2CID, pChInfo, SIMPLE_FIC_ENABLE) != - INC_SUCCESS) - return INC_ERROR; - INC_MSG_PRINTF(1, " T3900 INC_FIC_UPDATE GOOD \r\n"); - if (INC_START(ucI2CID, pChInfo, wEnsemble) != INC_SUCCESS) - return INC_ERROR; - INC_MSG_PRINTF(1, " T3900 INC_START GOOD \r\n"); - } - - INC_AIRPLAY_SETTING(ucI2CID); - - pInfo->ucProtectionLevel = pChInfo->astSubChInfo[0].ucProtectionLevel; - pInfo->ulFreq = ulRFFreq; - return INC_SUCCESS; -} - -unsigned char INC_ENSEMBLE_SCAN(unsigned char ucI2CID, unsigned int ulFreq) -{ - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - pInfo->nBbpStatus = ERROR_NON; - pInfo->ucStop = 0; - - printk(KERN_DEBUG"[TDMB_T3900] INC_ENSEMBLE_SCAN (%d)\n", ulFreq); - - if (INC_STOP(ucI2CID) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG"[TDMB_T3900] INC_STOP GOOD\n"); - - if (INC_READY(ucI2CID, ulFreq) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG"[TDMB_T3900] INC_READY GOOD\n"); - - if (INC_SYNCDETECTOR(ucI2CID, ulFreq, 1) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG" [TDMB_T3900]INC_SYNCDETECTOR GOOD\n"); - - if (INC_FICDECODER(ucI2CID, SIMPLE_FIC_DISABLE) != INC_SUCCESS) - return INC_ERROR; - printk(KERN_DEBUG"[TDMB_T3900]INC_FICDECODER GOOD\n"); - - return INC_SUCCESS; -} - -unsigned char INC_FIC_RECONFIGURATION_HW_CHECK(unsigned char ucI2CID) -{ - unsigned short wStatus, uiFicLen, wReconf; - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - - wStatus = (unsigned short) INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x00); - if (!(wStatus & 0x4000)) - return INC_ERROR; - uiFicLen = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x09) + 1; - - if (uiFicLen != MAX_FIC_SIZE) - return INC_ERROR; - wReconf = (unsigned short) INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x0A); - - if (wReconf & 0xC0) { - pInfo->ulReConfigTime = - (unsigned short) (INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x0B) & - 0xff) * 24; - return INC_SUCCESS; - } - return INC_ERROR; -} - -unsigned char INC_RE_SYNC(unsigned char ucI2CID) -{ - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x3B, 0x4000); - INC_DELAY(24); - INC_CMD_WRITE(ucI2CID, APB_PHY_BASE + 0x3A, 0x1); - - printk(KERN_DEBUG"[T3900]INC_RE_SYNC\n"); - return INC_SUCCESS; -} - -unsigned short INC_RESYNC_CER(unsigned char ucI2CID) -{ - unsigned short uiVtbErr, unCER; - unsigned short uiVtbData; - - uiVtbErr = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x06); - uiVtbData = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x08); - unCER = - (!uiVtbData) ? 0 : (unsigned short) ((unsigned int) (uiVtbErr * 10000) / - (uiVtbData * 64)); - if (uiVtbErr == 0) - unCER = 2000; - - printk(KERN_DEBUG"[T3900]INC_RESYNC_CER : %d\n", unCER); - return unCER; -} - -unsigned char INC_STATUS_CHECK(unsigned char ucI2CID) -{ - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - - if (INC_RESYNC_CER(ucI2CID) >= 1200) - pInfo->ucCERCnt++; - else - pInfo->ucCERCnt = 0; - - if (pInfo->ucCERCnt >= INC_CER_PERIOD) { - INC_RE_SYNC(ucI2CID); - pInfo->ucCERCnt = 0; - return INC_ERROR; - } - - return INC_SUCCESS; -} - -unsigned short INC_GET_CER(unsigned char ucI2CID) -{ - short nBER, nLoop; - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - - if (pInfo->ucProtectionLevel == 0) - nBER = - (short) ((int) - INC_CMD_READ(ucI2CID, - APB_VTB_BASE + 0x07) * 77 / 100); - else - nBER = (short) INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x07); - if (nBER == 0) - nBER = 2000; - - if (nBER <= BER_REF_VALUE) - pInfo->auiANTBuff[pInfo->uiInCAntTick++ % BER_BUFFER_MAX] = 0; - else - pInfo->auiANTBuff[pInfo->uiInCAntTick++ % BER_BUFFER_MAX] = - (nBER - BER_REF_VALUE); - - for (nLoop = 0, pInfo->uiInCERAvg = 0; nLoop < BER_BUFFER_MAX; nLoop++) - pInfo->uiInCERAvg += pInfo->auiANTBuff[nLoop]; - - pInfo->uiInCERAvg /= BER_BUFFER_MAX; - - pInfo->uiCER = pInfo->uiInCERAvg; - return pInfo->uiCER; -} - -unsigned char INC_GET_ANT_LEVEL(unsigned char ucI2CID) -{ - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - INC_GET_SNR(ucI2CID); - - if (pInfo->ucSnr > 16) - pInfo->ucAntLevel = 6; - else if (pInfo->ucSnr > 13) - pInfo->ucAntLevel = 5; - else if (pInfo->ucSnr > 10) - pInfo->ucAntLevel = 4; - else if (pInfo->ucSnr > 7) - pInfo->ucAntLevel = 3; - else if (pInfo->ucSnr > 5) - pInfo->ucAntLevel = 2; - else if (pInfo->ucSnr > 3) - pInfo->ucAntLevel = 1; - else - pInfo->ucAntLevel = 0; - - return pInfo->ucAntLevel; -} - -unsigned int INC_GET_PREBER(unsigned char ucI2CID) -{ - unsigned short uiVtbErr; - unsigned int uiVtbData; - unsigned int uiPreBER; - - uiVtbErr = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x06); - uiVtbData = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x08); - - uiPreBER = - (!uiVtbData) ? 0 : ((unsigned int) uiVtbErr / (uiVtbData * 64)); - - return uiPreBER; -} - -unsigned int INC_GET_POSTBER(unsigned char ucI2CID) -{ - unsigned short uiRSErrBit; - unsigned short uiRSErrTS; - unsigned short uiError, uiRef; - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - - uiRSErrBit = INC_CMD_READ(ucI2CID, APB_RS_BASE + 0x02); - uiRSErrTS = INC_CMD_READ(ucI2CID, APB_RS_BASE + 0x03); - uiRSErrBit += (uiRSErrTS * 8); - - if (uiRSErrTS == 0) { - uiError = ((uiRSErrBit * 50) / 1000); - uiRef = 0; - if (uiError > 50) - uiError = 50; - } else if ((uiRSErrTS > 0) && (uiRSErrTS < 10)) { - uiError = ((uiRSErrBit * 10) / 2400); - uiRef = 50; - if (uiError > 50) - uiError = 50; - } else if ((uiRSErrTS >= 10) && (uiRSErrTS < 30)) { - uiError = ((uiRSErrBit * 10) / 2400); - uiRef = 60; - if (uiError > 40) - uiError = 40; - } else if ((uiRSErrTS >= 30) && (uiRSErrTS < 80)) { - uiError = ((uiRSErrBit * 10) / 2400); - uiRef = 70; - if (uiError > 30) - uiError = 30; - } else if ((uiRSErrTS >= 80) && (uiRSErrTS < 100)) { - uiError = ((uiRSErrBit * 10) / 2400); - uiRef = 80; - if (uiError > 20) - uiError = 20; - } else { - uiError = ((uiRSErrBit * 10) / 2400); - uiRef = 90; - if (uiError > 10) - uiError = 10; - } - - pInfo->ucVber = 100 - (uiError + uiRef); - pInfo->uiPostBER = (unsigned int) uiRSErrTS / TS_ERR_THRESHOLD; - - return pInfo->uiPostBER; -} - -unsigned char INC_GET_SNR(unsigned char ucI2CID) -{ - unsigned short uiFftVal; - struct ST_BBPINFO *pInfo; - pInfo = INC_GET_STRINFO(ucI2CID); - uiFftVal = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x07); - - if (uiFftVal == 0) - pInfo->ucSnr = 0; - else if (uiFftVal < 11) - pInfo->ucSnr = 20; - else if (uiFftVal < 15) - pInfo->ucSnr = 19; - else if (uiFftVal < 20) - pInfo->ucSnr = 18; - else if (uiFftVal < 30) - pInfo->ucSnr = 17; - else if (uiFftVal < 45) - pInfo->ucSnr = 16; - else if (uiFftVal < 60) - pInfo->ucSnr = 15; - else if (uiFftVal < 75) - pInfo->ucSnr = 14; - else if (uiFftVal < 90) - pInfo->ucSnr = 13; - else if (uiFftVal < 110) - pInfo->ucSnr = 12; - else if (uiFftVal < 130) - pInfo->ucSnr = 11; - else if (uiFftVal < 150) - pInfo->ucSnr = 10; - else if (uiFftVal < 200) - pInfo->ucSnr = 9; - else if (uiFftVal < 300) - pInfo->ucSnr = 8; - else if (uiFftVal < 400) - pInfo->ucSnr = 7; - else if (uiFftVal < 500) - pInfo->ucSnr = 6; - else if (uiFftVal < 600) - pInfo->ucSnr = 5; - else if (uiFftVal < 700) - pInfo->ucSnr = 4; - else if (uiFftVal < 800) - pInfo->ucSnr = 3; - else if (uiFftVal < 900) - pInfo->ucSnr = 2; - else if (uiFftVal < 1000) - pInfo->ucSnr = 1; - else - pInfo->ucSnr = 0; - - return pInfo->ucSnr; -} - -#define INC_RSSI_STEP 5 -#define INC_ADC_STEP_MAX 18 -short INC_GET_RSSI(unsigned char ucI2CID) -{ - short nLoop, nRSSI = 0; - short nResolution, nGapVal; - unsigned int uiAdcValue; - unsigned short aRFAGCTable[INC_ADC_STEP_MAX][2] = { - - {100, 1199} - , - {95, 1160} - , - {90, 1085} - , - {85, 1018} - , - - {80, 953} - , - {75, 875} - , - {70, 805} - , - {65, 720} - , - {60, 655} - , - - {55, 625} - , - {50, 565} - , - {45, 500} - , - {40, 465} - , - {35, 405} - , - - {30, 340} - , - {25, 270} - , - {20, 200} - , - }; - - uiAdcValue = (INC_CMD_READ(ucI2CID, APB_RF_BASE + 0xD4) >> 5) & 0x3FF; - uiAdcValue = (short) ((117302 * (unsigned int) uiAdcValue) / 100000); - - if (!uiAdcValue) - nRSSI = 0; - else if (uiAdcValue >= aRFAGCTable[0][1]) - nRSSI = (short) aRFAGCTable[0][0]; - else if (uiAdcValue <= aRFAGCTable[INC_ADC_STEP_MAX - 1][1]) - nRSSI = (short) aRFAGCTable[INC_ADC_STEP_MAX - 1][0]; - else { - for (nLoop = 1; nLoop < INC_ADC_STEP_MAX; nLoop++) { - if (uiAdcValue < aRFAGCTable[nLoop][1] - || uiAdcValue >= aRFAGCTable[nLoop - 1][1]) - continue; - - nResolution = - (aRFAGCTable[nLoop - 1][1] - - aRFAGCTable[nLoop][1]) / INC_RSSI_STEP; - nGapVal = uiAdcValue - aRFAGCTable[nLoop][1]; - if (nResolution) - nRSSI = - (aRFAGCTable[nLoop][0]) + - (nGapVal / nResolution); - else - nRSSI = (aRFAGCTable[nLoop][0]) + nGapVal; - break; - } - } - return nRSSI; -} - -unsigned int YMDtoMJD(struct ST_DATE_T stDate) -{ - unsigned short wMJD; - unsigned int lYear, lMouth, lDay, L; - unsigned int lTemp1, lTemp2; - - lYear = (unsigned int) stDate.usYear - (unsigned int) 1900; - lMouth = stDate.ucMonth; - lDay = stDate.ucDay; - - if (lMouth == 1 || lMouth == 2) - L = 1; - else - L = 0; - - lTemp1 = (lYear - L) * 36525L / 100L; - lTemp2 = (lMouth + 1L + L * 12L) * 306001L / 10000L; - - wMJD = (unsigned short) (14956 + lDay + lTemp1 + lTemp2); - - return wMJD; -} - -void MJDtoYMD(unsigned short wMJD, struct ST_DATE_T *pstDate) -{ - unsigned int lYear, lMouth, lTemp; - - lYear = (wMJD * 100L - 1507820L) / 36525L; - lMouth = - ((wMJD * 10000L - 149561000L) - - (lYear * 36525L / 100L) * 10000L) / 306001L; - - pstDate->ucDay = - (unsigned char) (wMJD - 14956L - (lYear * 36525L / 100L) - - (lMouth * 306001L / 10000L)); - - if (lMouth == 14 || lMouth == 15) - lTemp = 1; - else - lTemp = 0; - - pstDate->usYear = (unsigned short) (lYear + lTemp + 1900); - pstDate->ucMonth = (unsigned char) (lMouth - 1 - lTemp * 12); -} - -void INC_DB_COPY(unsigned int ulFreq, short nCnt, - struct INC_CHANNEL_INFO *pChInfo, - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent) -{ - short nIndex; - struct ST_FICDB_LIST *pList; - pList = INC_GET_FICDB_LIST(); - - for (nIndex = 0; nIndex < nCnt; nIndex++, pSvcComponent++, pChInfo++) { - - pChInfo->ulRFFreq = ulFreq; - pChInfo->uiEnsembleID = pList->unEnsembleID; - pChInfo->ucSubChID = pSvcComponent->ucSubChid; - pChInfo->ucServiceType = pSvcComponent->ucDSCType; - pChInfo->uiStarAddr = pSvcComponent->unStartAddr; - pChInfo->uiTmID = pSvcComponent->ucTmID; - pChInfo->ulServiceID = pSvcComponent->ulSid; - pChInfo->uiPacketAddr = pSvcComponent->unPacketAddr; - pChInfo->uiBitRate = pSvcComponent->uiBitRate; - pChInfo->ucSlFlag = pSvcComponent->ucShortLong; - pChInfo->ucTableIndex = pSvcComponent->ucTableIndex; - pChInfo->ucOption = pSvcComponent->ucOption; - pChInfo->ucProtectionLevel = pSvcComponent->ucProtectionLevel; - pChInfo->uiDifferentRate = pSvcComponent->uiDifferentRate; - pChInfo->uiSchSize = pSvcComponent->uiSubChSize; - memcpy(pChInfo->aucEnsembleLabel, pList->aucEnsembleName, - MAX_LABEL_CHAR); - memcpy(pChInfo->aucLabel, pSvcComponent->aucLabels, - MAX_LABEL_CHAR); - -#ifdef USER_APPLICATION_TYPE - pChInfo->stUsrApp = pSvcComponent->stUApp; -#endif - } -} - -unsigned char INC_DB_UPDATE(unsigned int ulFreq, struct ST_SUBCH_INFO *pDMB, - struct ST_SUBCH_INFO *pDAB, struct ST_SUBCH_INFO *pDATA, - struct ST_SUBCH_INFO *pFIDC) -{ - struct INC_CHANNEL_INFO *pChInfo; - struct ST_STREAM_INFO *pStreamInfo; - struct ST_FICDB_LIST *pList; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - - pList = INC_GET_FICDB_LIST(); - - /**********************************************/ - /* DMB channel list update */ - /**********************************************/ - pStreamInfo = &pList->stDMB; - pChInfo = &pDMB->astSubChInfo[pDMB->nSetCnt]; - pSvcComponent = pStreamInfo->astPrimary; - - if ((pStreamInfo->nPrimaryCnt + pDMB->nSetCnt) < MAX_SUBCH_SIZE) { - INC_DB_COPY(ulFreq, pStreamInfo->nPrimaryCnt, pChInfo, - pSvcComponent); - pDMB->nSetCnt += pStreamInfo->nPrimaryCnt; - } - - pSvcComponent = pStreamInfo->astSecondary; - if ((pStreamInfo->nSecondaryCnt + pDMB->nSetCnt) < MAX_SUBCH_SIZE) { - INC_DB_COPY(ulFreq, pStreamInfo->nSecondaryCnt, pChInfo, - pSvcComponent); - pDMB->nSetCnt += pStreamInfo->nSecondaryCnt; - } - - /**********************************************/ - /* DAB channel list update */ - /**********************************************/ - pStreamInfo = &pList->stDAB; - pChInfo = &pDAB->astSubChInfo[pDAB->nSetCnt]; - pSvcComponent = pStreamInfo->astPrimary; - if ((pStreamInfo->nPrimaryCnt + pDAB->nSetCnt) < MAX_SUBCH_SIZE) { - INC_DB_COPY(ulFreq, pStreamInfo->nPrimaryCnt, pChInfo, - pSvcComponent); - pDAB->nSetCnt += pStreamInfo->nPrimaryCnt; - } - - pSvcComponent = pStreamInfo->astSecondary; - if ((pStreamInfo->nSecondaryCnt + pDAB->nSetCnt) < MAX_SUBCH_SIZE) { - INC_DB_COPY(ulFreq, pStreamInfo->nSecondaryCnt, pChInfo, - pSvcComponent); - pDAB->nSetCnt += pStreamInfo->nSecondaryCnt; - } - - /**********************************************/ - /* DATA channel list update */ - /**********************************************/ - pStreamInfo = &pList->stDATA; - pChInfo = &pDATA->astSubChInfo[pDATA->nSetCnt]; - pSvcComponent = pStreamInfo->astPrimary; - if ((pStreamInfo->nPrimaryCnt + pDATA->nSetCnt) < MAX_SUBCH_SIZE) { - INC_DB_COPY(ulFreq, pStreamInfo->nPrimaryCnt, pChInfo, - pSvcComponent); - pDATA->nSetCnt += pStreamInfo->nPrimaryCnt; - } - - pSvcComponent = pStreamInfo->astSecondary; - if ((pStreamInfo->nSecondaryCnt + pDATA->nSetCnt) < MAX_SUBCH_SIZE) { - INC_DB_COPY(ulFreq, pStreamInfo->nSecondaryCnt, pChInfo, - pSvcComponent); - pDATA->nSetCnt += pStreamInfo->nSecondaryCnt; - } - - /**********************************************/ - /* FIDC channel list update */ - /***********************************************/ - pStreamInfo = &pList->stFIDC; - pChInfo = &pFIDC->astSubChInfo[pFIDC->nSetCnt]; - pSvcComponent = pStreamInfo->astPrimary; - if ((pStreamInfo->nPrimaryCnt + pFIDC->nSetCnt) < MAX_SUBCH_SIZE) { - INC_DB_COPY(ulFreq, pStreamInfo->nPrimaryCnt, pChInfo, - pSvcComponent); - pFIDC->nSetCnt += pStreamInfo->nPrimaryCnt; - } - - pSvcComponent = pStreamInfo->astSecondary; - if ((pStreamInfo->nSecondaryCnt + pFIDC->nSetCnt) < MAX_SUBCH_SIZE) { - INC_DB_COPY(ulFreq, pStreamInfo->nSecondaryCnt, pChInfo, - pSvcComponent); - pFIDC->nSetCnt += pStreamInfo->nSecondaryCnt; - } - - return INC_SUCCESS; -} - -void INC_UPDATE_LIST(struct INC_CHANNEL_INFO *pUpDateCh, - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent) -{ - pUpDateCh->uiStarAddr = pSvcComponent->unStartAddr; - pUpDateCh->uiBitRate = pSvcComponent->uiBitRate; - pUpDateCh->ucSlFlag = pSvcComponent->ucShortLong; - pUpDateCh->ucTableIndex = pSvcComponent->ucTableIndex; - pUpDateCh->ucOption = pSvcComponent->ucOption; - pUpDateCh->ucProtectionLevel = pSvcComponent->ucProtectionLevel; - pUpDateCh->uiDifferentRate = pSvcComponent->uiDifferentRate; - pUpDateCh->uiSchSize = pSvcComponent->uiSubChSize; -} - -unsigned char INC_FIC_UPDATE(unsigned char ucI2CID, - struct ST_SUBCH_INFO *pChInfo, - enum ST_SIMPLE_FIC bSimpleFIC) -{ - short nLoop = 0, nIndex, nGetChCnt = 0; - struct INC_CHANNEL_INFO *pUpDateCh; - struct ST_STREAM_INFO *pStreamInfo; - struct ST_FICDB_SERVICE_COMPONENT *pSvcComponent; - - for (nIndex = 0; nIndex < pChInfo->nSetCnt; nIndex++) { - if (bSimpleFIC == SIMPLE_FIC_ENABLE) { - pUpDateCh = &pChInfo->astSubChInfo[nIndex]; - pStreamInfo = &INC_GET_FICDB_LIST()->stDMB; - pSvcComponent = pStreamInfo->astPrimary; - - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pUpDateCh->ucSubChID != - pSvcComponent->ucSubChid) - continue; - INC_UPDATE_LIST(pUpDateCh, pSvcComponent); - nGetChCnt++; - if (pChInfo->nSetCnt == nGetChCnt) - return INC_SUCCESS; - } - } - } - - for (nIndex = 0; nIndex < pChInfo->nSetCnt; nIndex++) { - pUpDateCh = &pChInfo->astSubChInfo[nIndex]; - - if (pUpDateCh->ucServiceType == 0x18) { - pStreamInfo = &INC_GET_FICDB_LIST()->stDMB; - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pUpDateCh->ucSubChID != - pSvcComponent->ucSubChid) - continue; - INC_UPDATE_LIST(pUpDateCh, pSvcComponent); - nGetChCnt++; - if (pChInfo->nSetCnt == nGetChCnt) - return INC_SUCCESS; - } - - pSvcComponent = pStreamInfo->astSecondary; - for (nLoop = 0; nLoop < pStreamInfo->nSecondaryCnt; - nLoop++, pSvcComponent++) { - if (pUpDateCh->ucSubChID != - pSvcComponent->ucSubChid) - continue; - INC_UPDATE_LIST(pUpDateCh, pSvcComponent); - nGetChCnt++; - if (pChInfo->nSetCnt == nGetChCnt) - return INC_SUCCESS; - } - } else { - pStreamInfo = &INC_GET_FICDB_LIST()->stDAB; - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pUpDateCh->ucSubChID != - pSvcComponent->ucSubChid) - continue; - INC_UPDATE_LIST(pUpDateCh, pSvcComponent); - nGetChCnt++; - if (pChInfo->nSetCnt == nGetChCnt) - return INC_SUCCESS; - } - - pSvcComponent = pStreamInfo->astSecondary; - for (nLoop = 0; nLoop < pStreamInfo->nSecondaryCnt; - nLoop++, pSvcComponent++) { - if (pUpDateCh->ucSubChID != - pSvcComponent->ucSubChid) - continue; - INC_UPDATE_LIST(pUpDateCh, pSvcComponent); - nGetChCnt++; - if (pChInfo->nSetCnt == nGetChCnt) - return INC_SUCCESS; - } - - pStreamInfo = &INC_GET_FICDB_LIST()->stDATA; - pSvcComponent = pStreamInfo->astPrimary; - for (nLoop = 0; nLoop < pStreamInfo->nPrimaryCnt; - nLoop++, pSvcComponent++) { - if (pUpDateCh->ucSubChID != - pSvcComponent->ucSubChid) - continue; - INC_UPDATE_LIST(pUpDateCh, pSvcComponent); - nGetChCnt++; - if (pChInfo->nSetCnt == nGetChCnt) - return INC_SUCCESS; - } - - pSvcComponent = pStreamInfo->astSecondary; - for (nLoop = 0; nLoop < pStreamInfo->nSecondaryCnt; - nLoop++, pSvcComponent++) { - if (pUpDateCh->ucSubChID != - pSvcComponent->ucSubChid) - continue; - INC_UPDATE_LIST(pUpDateCh, pSvcComponent); - nGetChCnt++; - if (pChInfo->nSetCnt == nGetChCnt) - return INC_SUCCESS; - } - } - } - - return INC_ERROR; -} - -/* Samsung */ -unsigned short INC_GET_SAMSUNG_BER(unsigned char ucI2CID) -{ - unsigned int uiVtbErr, uiVtbData; - short nLoop, nCER; - struct ST_BBPINFO *pInfo; - - pInfo = INC_GET_STRINFO(ucI2CID); - - uiVtbErr = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x06); - uiVtbData = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x08); - - if (pInfo->ucProtectionLevel != 0) - nCER = (short) ((((unsigned int) uiVtbErr * 89) / 1000) - 30); - else - nCER = - (!uiVtbData) ? 0 - : (int) ((((unsigned int) uiVtbErr * 3394) / - (uiVtbData * 32)) - 35); - if (uiVtbData == 0) - nCER = 2000; - else { - if (nCER <= 0) - nCER = 0; - } - - pInfo->auiBERBuff[pInfo->uiInCBERTick++ % BER_BUFFER_MAX] = nCER; - pInfo->uiBerSum = 0; - for (nLoop = 0; nLoop < BER_BUFFER_MAX; nLoop++) - pInfo->uiBerSum += pInfo->auiBERBuff[nLoop]; - - pInfo->uiBerSum /= BER_BUFFER_MAX; - return pInfo->uiBerSum; -} - -unsigned char INC_GET_SAMSUNG_ANT_LEVEL(unsigned char ucI2CID) -{ - struct ST_BBPINFO *pInfo; - unsigned short unCER, unLoop, unRefAntLevel = 0; - unsigned short aunAntTable[7][2] = { - {6, 400} - , - {5, 550} - , - {4, 700} - , - {3, 850} - , - {2, 900} - , - {1, 1050} - , - {0, 10000} - , - }; - pInfo = INC_GET_STRINFO(ucI2CID); - INC_GET_CER(ucI2CID); - unCER = pInfo->uiInCERAvg; - for (unLoop = 0; unLoop < 6; unLoop++) { - if (unCER <= aunAntTable[unLoop][1]) { - unRefAntLevel = aunAntTable[unLoop][0]; - break; - } - } - - if (pInfo->ucAntLevel == unRefAntLevel) - pInfo->ucAntLevel = unRefAntLevel; - else if (pInfo->ucAntLevel >= unRefAntLevel) { - if ((pInfo->ucAntLevel - unRefAntLevel) >= 3) - pInfo->ucAntLevel -= 2; - else - pInfo->ucAntLevel--; - } else { - if ((unRefAntLevel - pInfo->ucAntLevel) >= 3) - pInfo->ucAntLevel += 2; - else - pInfo->ucAntLevel++; - } - - printk(KERN_DEBUG"[T3900]ANT LEVEL %d BER AVG[%d]\n", pInfo->ucAntLevel, - pInfo->uiInCERAvg); - return pInfo->ucAntLevel; -} - -unsigned short INC_GET_SAMSUNG_BER_FOR_FACTORY_MODE(unsigned char ucI2CID) -{ - unsigned int uiVtbErr, uiVtbData; - short nCER; - short nBERValue; - struct ST_BBPINFO *pInfo; - - pInfo = INC_GET_STRINFO(ucI2CID); - uiVtbErr = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x06); - uiVtbData = INC_CMD_READ(ucI2CID, APB_VTB_BASE + 0x08); - - if (pInfo->ucProtectionLevel != 0) { - nBERValue = - (short) ((((unsigned int) uiVtbErr * 89) / 1000) - 30); - if (uiVtbData == 0) - nBERValue = 2000; - if (nBERValue <= 0) - nBERValue = 0; - } else { - nCER = (!uiVtbData) ? 0 : - (int) ((((unsigned int) uiVtbErr * 3394) / - (uiVtbData * 32)) - 35); - if (uiVtbData == 0) - nCER = 2000; - else { - if (nCER <= 0) - nCER = 0; - } - nBERValue = nCER; - } - return nBERValue; -} diff --git a/drivers/media/tdmb/t3900/INC_RF_CTRL500.c b/drivers/media/tdmb/t3900/INC_RF_CTRL500.c deleted file mode 100644 index cb5c43a..0000000 --- a/drivers/media/tdmb/t3900/INC_RF_CTRL500.c +++ /dev/null @@ -1,2544 +0,0 @@ -/***************************************************************************** - Copyright(c) 2011 I&C Inc. All Rights Reserved - - File name : INC_RF_CTRL500.c - - Description : - - 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. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -*******************************************************************************/ - -#include "INC_INCLUDES.h" -static unsigned int g_uiKOREnsembleFullFreq[MAX_KOREABAND_FULL_CHANNEL] = { -175280, 177008, 178736, -181280, 183008, 184736, -187280, 189008, 190736, -193280, 195008, 196736, -199280, 201008, 202736, -205280, 207008, 208736, -211280, 213008, 214736 -}; - -static unsigned int g_uiKOREnsembleNormalFreq[MAX_KOREABAND_NORMAL_CHANNEL] = { - 181280, 183008, 184736, 205280, 207008, 208736 -}; -static unsigned char g_acT3900KorI2CValue_12000 - [MAX_KOREABAND_FULL_CHANNEL][RF500_REG_CTRL] = { - { 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x43, 0x4D, 0x04, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x46, 0x4D, 0x10, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x49, 0x4D, 0x1C, 0x9F, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x80, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x4E, 0x4D, 0x1B, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x42, 0x4D, 0x07, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xBB, 0xB0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x45, 0x4D, 0x13, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x4A, 0x4D, 0x12, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x4D, 0x4D, 0x1E, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x41, 0x4D, 0x0A, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x46, 0x4D, 0x09, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x49, 0x4D, 0x15, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x4D, 0x4D, 0x01, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x42, 0x4D, 0x00, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x45, 0x4D, 0x0C, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x77, 0x70, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x48, 0x4D, 0x18, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x4D, 0x4D, 0x17, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x07, 0xD0, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x41, 0x4D, 0x03, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x44, 0x4D, 0x0F, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x4C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x49, 0x4D, 0x0E, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x4C, 0x4D, 0x1A, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x1A, 0x40, 0x4D, 0x06, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, -}; - -static unsigned char g_acT3900KorI2CValue_19200 - [MAX_KOREABAND_FULL_CHANNEL][RF500_REG_CTRL] = { - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x12, 0x41, 0x4D, 0x0C, 0xE8, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x12, 0x44, 0x4D, 0x09, 0x11, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x12, 0x47, 0x4D, 0x05, 0x3A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x80, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x12, 0x4B, 0x4D, 0x0C, 0xE8, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x1C, 0x45, 0x4D, 0x0D, 0x9A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xBB, 0xB0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x13, 0x41, 0x4D, 0x05, 0x3A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x13, 0x45, 0x4D, 0x0C, 0xE8, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x13, 0x48, 0x4D, 0x09, 0x11, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x13, 0x4B, 0x4D, 0x05, 0x3A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x13, 0x4F, 0x4D, 0x0C, 0xE8, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x14, 0x42, 0x4D, 0x09, 0x12, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x14, 0x45, 0x4D, 0x05, 0x3A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x14, 0x49, 0x4D, 0x0C, 0xE8, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x1F, 0x42, 0x4D, 0x0D, 0x9A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x77, 0x70, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x14, 0x4F, 0x4D, 0x05, 0x3A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x15, 0x43, 0x4D, 0x0C, 0xE8, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x04, 0x00, - 0x2A, 0x4C, 0x4D, 0x12, 0x22, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x15, 0x49, 0x4D, 0x05, 0x3A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x4C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x15, 0x4D, 0x4D, 0x0C, 0xE8, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x16, 0x40, 0x4D, 0x09, 0x11, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x5A, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x16, 0x43, 0x4D, 0x05, 0x3A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, -}; - -static unsigned char g_acT3900KorI2CValue_24576 - [MAX_KOREABAND_FULL_CHANNEL][RF500_REG_CTRL] = { - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x43, 0x4D, 0x04, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x46, 0x4D, 0x10, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x49, 0x4D, 0x1C, 0x9F, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x80, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x4E, 0x4D, 0x1B, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x42, 0x4D, 0x07, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xBB, 0xB0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x45, 0x4D, 0x13, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x4A, 0x4D, 0x12, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x0F, 0x43, 0x4D, 0x1F, 0x15, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x41, 0x4D, 0x0A, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x46, 0x4D, 0x09, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x49, 0x4D, 0x15, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x04, 0x00, - 0x1F, 0x4C, 0x4D, 0x02, 0x2A, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x42, 0x4D, 0x00, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x45, 0x4D, 0x0C, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x77, 0x70, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x48, 0x4D, 0x18, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x10, 0x49, 0x4D, 0x05, 0x15, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x41, 0x4D, 0x03, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x44, 0x4D, 0x0F, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x4C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x49, 0x4D, 0x0E, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x02, 0x00, - 0x11, 0x43, 0x4D, 0x07, 0x15, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x73, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x1A, 0x40, 0x4D, 0x06, 0xA0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, -}; - -static unsigned char - g_acT3900KorI2CValue_27000 - [MAX_KOREABAND_FULL_CHANNEL][RF500_REG_CTRL] = { - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x43, 0x4D, 0x04, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x46, 0x4D, 0x10, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x49, 0x4D, 0x1C, 0x9F, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x80, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x4E, 0x4D, 0x1B, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x42, 0x4D, 0x07, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xBB, 0xB0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x45, 0x4D, 0x13, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x4A, 0x4D, 0x12, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x4D, 0x4D, 0x1E, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x41, 0x4D, 0x0A, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x46, 0x4D, 0x09, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x49, 0x4D, 0x15, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x4D, 0x4D, 0x01, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x42, 0x4D, 0x00, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x45, 0x4D, 0x0C, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x77, 0x70, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x48, 0x4D, 0x18, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x18, 0x4D, 0x4D, 0x17, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x07, 0xD0, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x41, 0x4D, 0x03, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x44, 0x4D, 0x0F, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x4C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x49, 0x4D, 0x0E, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x19, 0x4C, 0x4D, 0x1A, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x00, 0x1F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x72, 0xC0, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x1A, 0x40, 0x4D, 0x06, 0xA0, 0x01, 0xF4, 0xC1, 0x88, 0xEC, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0xFF, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xB0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x44, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x17, - 0x17, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xE0, 0x00, 0x10, 0x00, 0x0F, 0x0C, - 0x00, 0xF3, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x07, 0x80, - 0x00, 0x60, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x02, 0x00, - 0x01, 0x00, 0x00, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x80, 0x10, 0xC0, 0x10, 0x00, 0x08, 0x1C, 0xC0, 0x22, 0x96, - 0xA5, 0xE0, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x27, 0x10, - 0x00, 0x03, 0xE8, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, -}; - -static unsigned char - g_acT3900KorI2CValue_27120 - [MAX_KOREABAND_FULL_CHANNEL][RF500_REG_CTRL] = { - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x13, 0x43, 0x4D, 0x0A, 0x97, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x13, 0x46, 0x4D, 0x0C, 0x75, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x70, - 0x70, 0x80, 0x10, 0x00, 0xEE, 0xE0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xFF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x13, 0x49, 0x4D, 0x0E, 0x54, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x80, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x04, 0x00, - 0x1A, 0x47, 0x4D, 0x1D, 0xE2, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xCC, 0xC0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x14, 0x41, 0x4D, 0x00, 0x48, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xBB, 0xB0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x14, 0x44, 0x4D, 0x02, 0x26, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x14, 0x48, 0x4D, 0x12, 0x3C, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x60, - 0x60, 0x80, 0x10, 0x00, 0xAA, 0xA0, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x14, 0x4B, 0x4D, 0x14, 0x1B, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x14, 0x4E, 0x4D, 0x15, 0xF9, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x43, 0x4D, 0x06, 0x0F, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x50, - 0x50, 0x80, 0x10, 0x00, 0x99, 0x90, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x46, 0x4D, 0x07, 0xEE, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x15, 0x49, 0x4D, 0x09, 0xCC, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xFF, 0xC0, 0x50, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x04, 0x00, - 0x1D, 0x42, 0x4D, 0x0D, 0x2D, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x88, 0x80, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x40, 0x4D, 0x1B, 0xC0, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x77, 0x70, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x43, 0x4D, 0x1D, 0x9F, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x48, 0x4D, 0x0D, 0xB4, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x40, - 0x40, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x04, 0x00, - 0x1E, 0x44, 0x4D, 0x14, 0xC4, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x16, 0x4E, 0x4D, 0x11, 0x71, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x4C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x43, 0x4D, 0x01, 0x87, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x46, 0x4D, 0x03, 0x65, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, - - { - 0x55, 0x9F, 0xF1, 0xF8, 0x02, 0x41, 0xFC, 0x00, 0x00, 0xC0, - 0x00, 0x0C, 0xC3, 0x00, 0xC0, 0x40, 0x7F, 0x80, 0x03, 0xE8, - 0x0C, 0xC0, 0x88, 0x33, 0x08, 0xF0, 0xF0, 0xD0, 0x03, 0x00, - 0x17, 0x49, 0x4D, 0x05, 0x44, 0x03, 0xE8, 0xC1, 0x88, 0x08, - 0xE0, 0x10, 0x40, 0xFC, 0x00, 0x00, 0x00, 0x00, 0x0F, 0x01, - 0x00, 0x70, 0x4C, 0xF0, 0x8C, 0xF0, 0x80, 0xC0, 0xC0, 0x20, - 0x20, 0x80, 0x10, 0x00, 0x66, 0x60, 0x33, 0x44, 0x48, 0x33, - 0x6E, 0x68, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0x0B, 0x2B, - 0x00, 0x80, 0x60, 0x00, 0x00, 0x00, 0x94, 0x44, 0x00, 0x15, - 0x0F, 0x18, 0x18, 0x0E, 0x04, 0x00, 0x00, 0x00, 0xFB, 0xB0, - 0x68, 0x20, 0x00, 0x08, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xFF, 0xFF, 0x00, 0x00, 0xC0, 0x00, 0x20, 0x00, 0x10, 0x54, - 0x0F, 0xAB, 0x00, 0x00, 0xF8, 0x00, 0x04, 0x00, 0x03, 0x80, - 0x00, 0x60, 0x00, 0x00, 0x80, 0x00, 0x78, 0x00, 0x06, 0x00, - 0x01, 0x00, 0x00, 0xF8, 0x00, 0x00, 0x00, 0x00, 0x80, 0x00, - 0x80, 0x00, 0xF8, 0x18, 0x07, 0x80, 0x04, 0x00, 0xF8, 0xFE, - 0xFE, 0x00, 0xF0, 0xBF, 0xC0, 0x80, 0x03, 0x00, 0x05, 0xDC, - 0x00, 0x05, 0xDC, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x01, 0x00, 0xE0, 0x00, 0x00, 0x00, 0x00, - }, -}; - -unsigned int INC_GET_KOREABAND_FULL_TABLE(unsigned short uiIndex) -{ - if (uiIndex >= MAX_KOREABAND_FULL_CHANNEL) - return 0xFFFF; - return g_uiKOREnsembleFullFreq[uiIndex]; -} - -unsigned int INC_GET_KOREABAND_NORMAL_TABLE(unsigned short uiIndex) -{ - if (uiIndex >= MAX_KOREABAND_NORMAL_CHANNEL) - return 0xFFFF; - return g_uiKOREnsembleNormalFreq[uiIndex]; -} - -unsigned short INC_FIND_KOR_FREQ(unsigned int ulFreq) -{ - unsigned short uiLoop; - for (uiLoop = 0; uiLoop < MAX_KOREABAND_FULL_CHANNEL; uiLoop++) { - if (g_uiKOREnsembleFullFreq[uiLoop] == ulFreq) - return uiLoop; - } - return 0xFFFF; -} - -unsigned char INC_RF500_I2C_WRITE(unsigned char ucI2CID, unsigned char *pucData, - unsigned int uLength) -{ - short nLoop; - for (nLoop = 0; nLoop < (short) uLength; nLoop++) { - INC_CMD_WRITE(ucI2CID, APB_RF_BASE + nLoop, - (unsigned short) pucData[nLoop]); - } - return INC_SUCCESS; -} - -unsigned char INC_RF500_START(unsigned char ucI2CID, unsigned int ulRFChannel, - enum ENSEMBLE_BAND ucBand, enum PLL_MODE ucPLL) -{ - unsigned short uiPos; - unsigned char *pDataBuff = INC_NULL; - if (ucBand == KOREA_BAND_ENABLE) { - uiPos = INC_FIND_KOR_FREQ(ulRFChannel); - if (uiPos == 0xFFFF) - return INC_ERROR; - switch (ucPLL) { - case INPUT_CLOCK_12000KHZ: - pDataBuff = g_acT3900KorI2CValue_12000[uiPos]; - break; - case INPUT_CLOCK_19200KHZ: - pDataBuff = g_acT3900KorI2CValue_19200[uiPos]; - break; - case INPUT_CLOCK_24576KHZ: - pDataBuff = g_acT3900KorI2CValue_24576[uiPos]; - break; - case INPUT_CLOCK_27000KHZ: - pDataBuff = g_acT3900KorI2CValue_27000[uiPos]; - break; - case INPUT_CLOCK_27120KHZ: - pDataBuff = g_acT3900KorI2CValue_27120[uiPos]; - break; - default: - pDataBuff = g_acT3900KorI2CValue_19200[uiPos]; - break; - } - } else if (ucBand == EXTERNAL_ENABLE) - return INC_SUCCESS; - - else - return INC_ERROR; - - if (pDataBuff == INC_NULL) - return INC_ERROR; - if (INC_RF500_I2C_WRITE(ucI2CID, pDataBuff, RF500_REG_CTRL) == - INC_ERROR) - return INC_ERROR; - return INC_SUCCESS; -} diff --git a/drivers/media/tdmb/t3900/Makefile b/drivers/media/tdmb/t3900/Makefile deleted file mode 100644 index 2483ed5..0000000 --- a/drivers/media/tdmb/t3900/Makefile +++ /dev/null @@ -1,6 +0,0 @@ -obj-y += INC_FICDEC.o -obj-y += INC_INTERFACE.o -obj-y += INC_PROCESS.o -obj-y += INC_RF_CTRL500.o - -ccflags-y += -Idrivers/media/tdmb diff --git a/drivers/media/tdmb/tcc3170/Makefile b/drivers/media/tdmb/tcc3170/Makefile deleted file mode 100644 index ba12099..0000000 --- a/drivers/media/tdmb/tcc3170/Makefile +++ /dev/null @@ -1,8 +0,0 @@ -obj-y += src/ -#obj-y += tcbd.o - -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcpal -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcbd_diagnosis -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcbd_stream_parser - diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_api_common.h b/drivers/media/tdmb/tcc3170/inc/tcbd_api_common.h deleted file mode 100644 index f798610..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_api_common.h +++ /dev/null @@ -1,365 +0,0 @@ -/* - * tcbd_api_common.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_API_COMMON_H__ -#define __TCBD_API_COMMON_H__ -#include "tcbd_drv_register.h" -#include "tcbd_diagnosis.h" - -/** - * @defgroup ProtectionType - */ -/**@{*/ -#define PROTECTION_TYPE_UEP 0 -#define PROTECTION_TYPE_EEP 1 -/**@}*/ - -/** - * @defgroup ProtectionLevel - * Protection type UEP - * <table> - * <tr><td>UEP1</td><td>UEP2</td><td>UEP3</td><td>UEP4</td></tr> - * <tr><td>0x00</td><td>0x01</td><td>0x02</td><td>0x03</td></tr></table> - * - * Protection type EEP - * <table> - * <tr><td>EEP1A</td><td>EEP2A</td><td>EEP3A</td><td>EEP4A</td> - * <td>EEP1B</td><td>EEP2B</td><td>EEP3B</td><td>EEP4B</td></tr> - * <tr><td>0x00</td><td>0x01</td><td>0x02</td><td>0x03</td> - * <td>0x04</td><td>0x05</td><td>0x06</td><td>0x07</td></tr> - */ - -/* - * @defgroup ServiceType - * Service type for each sub-channel. - */ -/** @{*/ -#define SERVICE_TYPE_DAB 0x01 -#define SERVICE_TYPE_DABPLUS 0x02 -#define SERVICE_TYPE_DATA 0x03 -#define SERVICE_TYPE_DMB 0x04 -#define SERVICE_TYPE_FIC 0x07 -#define SERVICE_TYPE_FIC_WITH_ERR 0x08 -#define SERVICE_TYPE_EWS 0x09 -/**@}*/ - - - -/** - * @defgroup Bitrate - * If protection type is UEP, the values of bitrate are as following. - * <table> - * <tr><td>Kbps</td> - * <td>32</td><td>48</td><td>56</td><td>64</td><td>80</td> - * <td>96</td><td>112</td><td>128</td><td>160</td><td>192</td> - * <td>224</td><td>256</td><td>320</td><td>384</td></tr> - * <tr><td>value</td> - * <td>0x00</td><td>0x01</td><td>0x02</td><td>0x03</td><td>0x04</td> - * <td>0x05</td><td>0x06</td><td>0x07</td><td>0x08</td><td>0x09</td> - * <td>0x0A</td><td>0x0B</td><td>0x0C</td><td>0x0D</td></tr> - * </table> - * - * If protection type is EEP, the values of bitrate are as following. - * <table> - * <tr><td>kbps</td> - * <td>1</td><td>2</td><td>3</td><td>...</td><td>126</td></tr> - * <tr><td>value</td> - * <td>0x01</td><td>0x02</td><td>0x03</td><td>...</td><td>0x7E</td><tr> - * </table> - * 0x00 - */ - -/** - * @defgroup ServiceInformation - */ -struct tcbd_service { - s32 type; /**< Type of service. Please refer to @ref ServiceType*/ - s32 ptype; /**< Type of protection Please refer to @ref ProtectionType*/ - s32 subch_id; /**< Sub-channel id */ - s32 size_cu; /**< Size of CU(Capacity Unit) or sub-channel size*/ - s32 start_cu; /**< Start address of CU(Capacity Unit) */ - s32 reconfig; /**< Must be set 0x02*/ - s32 rs_on; /**< If type is DMB, it must be 0x01, or else 0x00 */ - s32 plevel; /**< Protection level Please refer @ref ProtectionLevel*/ - s32 bitrate; /**< Bitrate. Please refer @ref Bitrate*/ -}; - -/** - * @defgroup PreripheralType - * types of interface to read stream - */ -/** @{*/ -enum tcbd_peri_type { - PERI_TYPE_SPI_SLAVE = 1, /**< The stream can be read - * using SPI(slave) */ - PERI_TYPE_SPI_MASTER, /**< The stream can be read - * using SPI(master) */ - PERI_TYPE_PTS, /**< The stream can be read using PTS */ - PERI_TYPE_STS, /**< The stream can be read using STS */ - PERI_TYPE_HPI, /**< The stream can be read using HPI */ - PERI_TYPE_SPI_ONLY /**< The stream can be read using SPI. - * And command use same SPI interface. */ -}; -/**@}*/ - -enum tcbd_band_type { - BAND_TYPE_BAND3 = 1, /**< band III */ - BAND_TYPE_LBAND /**< L band */ -}; - -enum tcbd_div_io_type { - DIV_IO_TYPE_SINGLE = 0, - DIV_IO_TYPE_DUAL, -}; - -enum tcbd_intr_mode { - INTR_MODE_LEVEL_HIGH, /**< Interrupt will be trigered at high level */ - INTR_MODE_LEVEL_LOW, /**< Interrupt will be trigered at low level */ - INTR_MODE_EDGE_RISING, /**< Interrupt will be trigered at rising edge */ - INTR_MODE_EDGE_FALLING /**< Interrupt will be trigered at falling edge */ -}; - -/** - * @defgroup OscillatorType - * supported types of oscillator - */ -/** @{*/ -enum tcbd_clock_type { - CLOCK_19200KHZ, - CLOCK_24576KHZ, - CLOCK_38400KHZ, - CLOCK_MAX -}; -/**}@*/ - -struct tcbd_multi_service { - s32 on_air[TCBD_MAX_NUM_SERVICE]; - s32 service_idx[TCBD_MAX_NUM_SERVICE]; - s32 service_count; - u32 service_info[TCBD_MAX_NUM_SERVICE*2]; -}; - -struct tcbd_device { - u8 chip_addr; /**< Chip address for diversity or dual mode*/ - u32 main_clock; - u8 processor; /**< Activated interrnal processor */ - - u32 selected_buff; - u32 selected_stream; - u8 en_cmd_fifo; - u32 intr_threshold; /**< Interrupt threshold */ -#if defined(__READ_VARIABLE_LENGTH__) - u32 size_more_read; -#endif /*__READ_VARIABLE_LENGTH__*/ - enum tcbd_clock_type clock_type; - enum tcbd_peri_type peri_type; /**< Peripheral type for stream */ - enum tcbd_band_type curr_band; - enum tcbd_band_type prev_band; - - s32 frequency; /**< Last set frequency */ - s32 is_pal_irq_en; - u8 enabled_irq; - struct tcbd_multi_service mult_service; /**< Registered service - infomation */ -}; - -/** - * Change the type of stream. Types are - * - DMB : STREAM_TYPE_DMB - * - DAB : STREAM_TYPE_DAB - * - FIC : STREAM_TYPE_FIC - * - STATUS : STREAM_TYPE_STATUS - * - * You can combine the above types. For more information @ref TypesOfStream - * @param _device Instance of device - * @param _type type of stream - * - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_change_stream_type( - struct tcbd_device *_device, u32 _type); - -TCBB_FUNC s32 tcbd_enable_irq( - struct tcbd_device *_device, u8 _en_bit); -TCBB_FUNC s32 tcbd_disable_irq( - struct tcbd_device *_device, u8 _mask); - -/** - * @brief Change the mode of interrupt. - * @param _device Instance of device - * @param _mode Interrupt mode. For more information of mode. - * Please refer @tcbd_intr_mode - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_change_irq_mode( - struct tcbd_device *_device, enum tcbd_intr_mode _mode); - -/** - * @brief read interrupt and error status. - * @param _device instance of device - * @param _irq_status interrupt status of buffer. Please @ref InterruptStatus - * @param _err_status error status of buffer. Please @ref ErrorStatus - */ -TCBB_FUNC s32 tcbd_read_irq_status( - struct tcbd_device *_device, u8 *_irq_status, u8 *_err_status); - -/** - * @brief clear interrupt status. - * @param _device instance of device - * @param _status status of interrupt. Please @ref InterruptClear - */ -TCBB_FUNC s32 tcbd_clear_irq( - struct tcbd_device *_device, u8 _status); - -/** - * @brief select interface to read stream. - * @param _device instance of device - * @param _peri_type interface type @ref PreripheralType - */ -TCBB_FUNC s32 tcbd_select_peri( - struct tcbd_device *_device, enum tcbd_peri_type _peri_type); - -#define ENABLE_CMD_FIFO 1 -#define DISABLE_CMD_FIFO 0 - -/** - * Initialize stream configuration. - * @param _device Instance of device. - * @param _use_cmd_fifo - * Determin whether or not to use command FIFO when you read - * stream. If you use SPI interface to read stream, you - * should use ENABLE_CMD_FIFO. - * - ENABLE_CMD_FIFO - * - DISABLE_CMD_FIFO - * @param _buffer_mask - * Mask unused buffer. - * For more information, please refer @ref StreamDataConfig - * @param _threshold - * Threshold for triggering interrupt. The threshold can be - * set up to 8Kbyes. If you use STS, this value is meaningless. - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_init_stream_data_config( - struct tcbd_device *_device, - u8 _use_cmd_fifo, - u8 _buffer_mask, - u32 _threshold); - -/** - * Tune frequency. - * @param _device Instance of device - * @param _freq_khz frequency - * @param _bw_khz bandwidth - * - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_tune_frequency( - struct tcbd_device *_device, u32 _freq_khz, s32 _bw_khz); - - -/** - * @brief wait until the frequency is tuned. - * @param _device Instance of device - * @param _status Status. - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_wait_tune( - struct tcbd_device *_device, u8 *_status); - - -/** - * @brief register service(short argument) - * @param _device instance of device - * @param _subch_id sub channel id - * @param _data_mode 0:DAB,DATA 1:DMB - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_register_service( - struct tcbd_device *_device, u8 _subch_id, u8 _data_mode); - -/** - * @brief register service(long argument). - * @param _device Instance of device - * @param _service Sub channel information. @ref ServiceInformation - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_register_service_long( - struct tcbd_device *_device, struct tcbd_service *_service); - -/** - * @brief unregister sub channel. - * @param _device instance of device - * @param _subch_id sub channel information previously registered. - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_unregister_service( - struct tcbd_device *_device, u8 _subch_id); - -/** - * @brief read tream from device - * @param _device instance of device - * @param _buff buffer for stream - * @param _size size of buffer. size must bigger then - * interrupt threshold(TCBD_MAX_THRESHOLD) - * - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_read_stream( - struct tcbd_device *_device, u8 *_buff, s32 *_size); - -/** - * @brief read fic data from internal buffer(I2C/STS interface only) - * @param _device instance of device - * @param _buff buffer for fic data. - * @param _size size of buffer. _size must be 384 bytes. - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_read_fic_data( - struct tcbd_device *_device, u8 *_buff, s32 _size); - -/** - * @brief read signal quality. - * @param _device instance of device - * @param _status_data instance of struct tcbd_status_data - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_read_signal_info( - struct tcbd_device *_device, struct tcbd_status_data *_status_data); - -/** - * @brief _device instance of device. - * @param _comp_en internal processor to enable - * @param _comp_rst internal processor to reset - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_reset_ip( - struct tcbd_device *_device, u8 _comp_en, u8 _comp_rst); - -/** - * @brief start device. - * @param _device instance of device - * @param _clock_type oscillator clock type @ref OscillatorType - * @return success 0, fail -@ref ListOfErrorCode - */ -TCBB_FUNC s32 tcbd_device_start( - struct tcbd_device *_device, enum tcbd_clock_type _clock_type); -#endif /*__TCBD_API_COMMON_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_diagnosis/tcbd_diagnosis.h b/drivers/media/tdmb/tcc3170/inc/tcbd_diagnosis/tcbd_diagnosis.h deleted file mode 100644 index 7e53f0d..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_diagnosis/tcbd_diagnosis.h +++ /dev/null @@ -1,52 +0,0 @@ -/* - * tcbd_diagnosis.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_DIAGNOSIS_H__ -#define __TCBD_DIAGNOSIS_H__ - -/* 0 agc, 1 cto, 2 cfo, 3 fto, 4 sync, 5, ofdm */ -#define TCBD_LOCK_AGC 0x01 -#define TCBD_LOCK_CTO 0x02 -#define TCBD_LOCK_CFO 0x03 -#define TCBD_LOCK_FTO 0x04 -#define TCBD_LOCK_SYNC 0x10 -#define TCDD_LOCK_OFDM 0x20 - -struct tcbd_status_data { - u8 lock; - s32 rssi; - s32 snr; - s32 snr_moving_avg; - s32 pcber; - s32 pcber_moving_avg; - s32 vber; - s32 vber_moving_avg; - s32 ts_error_count; - s32 tsper; - s32 tsper_moving_avg; -}; - -TCBB_FUNC void tcbd_update_status( - u8 *_rawData, u32 size, struct tcbd_status_data *_status_data); -TCBB_FUNC void tcbd_init_status_manager(void); - -#endif /*__TCBD_SIGNAL_INFO_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_drv_io.h b/drivers/media/tdmb/tcc3170/inc/tcbd_drv_io.h deleted file mode 100644 index b09d9ca..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_drv_io.h +++ /dev/null @@ -1,95 +0,0 @@ -/* - * tcbd_drv_io.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_DRV_COMMON_H__ -#define __TCBD_DRV_COMMON_H__ -#include "tcbd_drv_register.h" -#include "tcbd_error.h" - -#define MB_HOSTMAIL 0x47 -#define MB_SLAVEMAIL 0x74 - -#define DEFAULT_CHIP_ADDRESS 0x50 -struct tcbd_io_data { - s32 chip_addr; - u32 sem; - s32 (*open)(void); - s32 (*close)(void); - s32 (*reg_write)(u8 _addr, u8 _data); - s32 (*reg_read)(u8 _addr, u8 *_data); - s32 (*reg_write_burst_cont)(u8 _addr, u8 *_data, s32 _size); - s32 (*reg_read_burst_cont)(u8 _addr, u8 *_data, s32 _size); - s32 (*reg_write_burst_fix)(u8 _addr, u8 *_data, s32 _size); - s32 (*reg_read_burst_fix)(u8 _addr, u8 *_data, s32 _size); -}; - -#define MAX_MAIL_COUNT 7 -#define MAX_TIME_TO_WAIT_MAIL 1000 -struct tcbd_mail_data { - u8 flag; - u8 count; - u16 cmd; - u32 status; - u32 data[MAX_MAIL_COUNT]; - u8 pad[2]; -}; - -TCBB_FUNC struct tcbd_io_data *tcbd_get_io_struct(void); -TCBB_FUNC void tcpal_set_i2c_io_function(void); -TCBB_FUNC void tcpal_set_cspi_io_function(void); - -TCBB_FUNC s32 tcbd_io_open(struct tcbd_device *_device); -TCBB_FUNC s32 tcbd_io_close(struct tcbd_device *_device); - -TCBB_FUNC s32 tcbd_reg_read( - struct tcbd_device *_handle, u8 _addr, u8 *_data); -TCBB_FUNC s32 tcbd_reg_write( - struct tcbd_device *_handle, u8 _addr, u8 _data); -TCBB_FUNC s32 tcbd_reg_read_burst_cont( - struct tcbd_device *_handle, u8 _addr, u8 *_data, s32 _size); -TCBB_FUNC s32 tcbd_reg_write_burst_cont( - struct tcbd_device *_handle, u8 _addr, u8 *_data, s32 _size); -TCBB_FUNC s32 tcbd_reg_read_burst_fix( - struct tcbd_device *_handle, u8 _addr, u8 *_data, s32 _size); -TCBB_FUNC s32 tcbd_reg_write_burst_fix( - struct tcbd_device *_handle, u8 _addr, u8 *_data, s32 _size); -TCBB_FUNC s32 tcbd_mem_write( - struct tcbd_device *_handle, u32 _addr, u8 *_data, u32 _size); -TCBB_FUNC s32 tcbd_mem_read( - struct tcbd_device *_handle, u32 _addr, u8 *_data, u32 _size); -TCBB_FUNC s32 tcbd_rf_reg_write( - struct tcbd_device *_handle, u8 _addr, u32 _data); -TCBB_FUNC s32 tcbd_rf_reg_read( - struct tcbd_device *_handle, u32 _addr, u32 *_data); - -TCBB_FUNC s32 tcbd_send_mail(struct tcbd_device *_device, - struct tcbd_mail_data *_mail); -TCBB_FUNC s32 tcbd_recv_mail(struct tcbd_device *_device, - struct tcbd_mail_data *_mail); -TCBB_FUNC s32 tcbd_read_mail_box(struct tcbd_device *_device, u16 cmd, - s32 len, u32 *data); -TCBB_FUNC s32 tcbd_write_mail_box(struct tcbd_device *_device, u16 _cmd, - s32 _cnt, u32 *_data); -TCBB_FUNC s32 tcbd_read_file(struct tcbd_device *_device, char *_path, - u8 *_buff, s32 _size); -extern struct spi_device *spi_dmb; /* sukjoon_temp */ -#endif /*__TCBD_DRV_COMMON_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_drv_ip.h b/drivers/media/tdmb/tcc3170/inc/tcbd_drv_ip.h deleted file mode 100644 index 7789d1c..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_drv_ip.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * tcbd_drv_ip.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_DRV_IP_H__ -#define __TCBD_DRV_IP_H__ - -enum tcbd_remap_type { - EP_RAM0_RAM1 = 0, /**< Ep can access RAM0 and RAM1 */ - EP_RAM0_RAM1_PC0, /**< Ep can access RAM0, RAM1 and initial pc is 0 */ - OP_RAM0_RAM1_PC2, /**< Op can access RAM0, RAM1 and initial pc is 0x2000*/ - OP_RAM0_EP_RAM1_PC2 /**< Op can access RAM0. Ep can access RAM1. - * Initial pc is 0x2000 */ -}; - -TCBB_FUNC s32 tcbd_send_spur_data( - struct tcbd_device *_device, s32 _freq_khz); -TCBB_FUNC s32 tcbd_send_agc_data( - struct tcbd_device *_device, enum tcbd_band_type _band_type); -TCBB_FUNC s32 tcbd_send_frequency( - struct tcbd_device *_device, s32 _freq_khz); -TCBB_FUNC s32 tcbd_send_service_info(struct tcbd_device *_device); - -TCBB_FUNC s32 tcbd_get_rom_version( - struct tcbd_device *_device, u32 *_bootVersion); - -TCBB_FUNC s32 tcbd_enable_buffer(struct tcbd_device *_device); -TCBB_FUNC s32 tcbd_disable_buffer(struct tcbd_device *_device); -TCBB_FUNC s32 tcbd_init_buffer_region(struct tcbd_device *_device); -TCBB_FUNC s32 tcbd_change_memory_view( - struct tcbd_device *_device, enum tcbd_remap_type _remap); - -TCBB_FUNC s32 tcbd_demod_tune_frequency( - struct tcbd_device *_device, u32 _freq_khz, s32 _bw_khz); - -TCBB_FUNC s32 tcbd_dsp_cold_start(struct tcbd_device *_device); -TCBB_FUNC s32 tcbd_dsp_warm_start(struct tcbd_device *_device); - -TCBB_FUNC s32 tcbd_change_chip_addr( - struct tcbd_device *_device, u8 addr); -TCBB_FUNC s32 tcbd_enable_slave_command_ack( - struct tcbd_device *_device); - -TCBB_FUNC s32 tcbd_enable_peri(struct tcbd_device *_device); -TCBB_FUNC s32 tcbd_disable_peri(struct tcbd_device *_device); -TCBB_FUNC s32 tcbd_init_bias_key(struct tcbd_device *_device); -TCBB_FUNC u32 tcbd_get_osc_clock(struct tcbd_device *_device); -TCBB_FUNC s32 tcbd_init_pll( - struct tcbd_device *_device, enum tcbd_clock_type _clock_type); -TCBB_FUNC s32 tcbd_init_div_io( - struct tcbd_device *_device, enum tcbd_div_io_type _div_io); -TCBB_FUNC s32 tcbd_init_dsp( - struct tcbd_device *_device, u8 *_boot_code, s32 _size); - -TCBB_FUNC s32 tcbd_check_dsp_status(struct tcbd_device *_device); - -#define FILTER_ENABLE (1<<2) -#define FILTER_SYNCERR (1<<3) -TCBB_FUNC s32 tcbd_set_pid_filter(struct tcbd_device *_device, u32 _filter); -#endif /*__TCBD_DRV_IP_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_drv_register.h b/drivers/media/tdmb/tcc3170/inc/tcbd_drv_register.h deleted file mode 100644 index ca80812..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_drv_register.h +++ /dev/null @@ -1,558 +0,0 @@ -/* - * tcbd_drv_register.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_DRV_REGISTER_H__ -#define __TCBD_DRV_REGISTER_H__ - -#define Bit31 0x80000000 -#define Bit30 0x40000000 -#define Bit29 0x20000000 -#define Bit28 0x10000000 -#define Bit27 0x08000000 -#define Bit26 0x04000000 -#define Bit25 0x02000000 -#define Bit24 0x01000000 -#define Bit23 0x00800000 -#define Bit22 0x00400000 -#define Bit21 0x00200000 -#define Bit20 0x00100000 -#define Bit19 0x00080000 -#define Bit18 0x00040000 -#define Bit17 0x00020000 -#define Bit16 0x00010000 -#define Bit15 0x00008000 -#define Bit14 0x00004000 -#define Bit13 0x00002000 -#define Bit12 0x00001000 -#define Bit11 0x00000800 -#define Bit10 0x00000400 -#define Bit9 0x00000200 -#define Bit8 0x00000100 -#define Bit7 0x00000080 -#define Bit6 0x00000040 -#define Bit5 0x00000020 -#define Bit4 0x00000010 -#define Bit3 0x00000008 -#define Bit2 0x00000004 -#define Bit1 0x00000002 -#define Bit0 0x00000001 -#define BitNONE 0x00000000 - -#define TCBD_SYS_EN 0x00 -#define TCBD_SYS_RESET 0x01 -#define TCBD_IRQ_MODE 0x02 -#define TCBD_IRQ_EN 0x03 -#define TCBD_IRQ_STAT_CLR 0x04 -#define TCBD_IRQ_ERROR 0x05 -#define TCBD_IRQ_LATCH 0x05 -#define TCBD_PLL_6 0x06 -#define TCBD_PLL_7 0x07 -#define TCBD_PLL_8 0x08 -#define TCBD_PLL_9 0x09 -#define TCBD_CHIPADDR 0x0a -#define TCBD_PROGRAMID 0x0b -#define TCBD_CHIPID 0x0c -#define TCBD_INIT_REMAP 0x0d -#define TCBD_INIT_PC 0x0e - -#define TCBD_GPIO_ALT 0x10 -#define TCBD_GPIO_DR 0x12 -#define TCBD_GPIO_LR 0x14 -#define TCBD_GPIO_DRV 0x16 -#define TCBD_GPIO_PE 0x18 -#define TCBD_DIVIO 0x1a - -#define TCBD_STREAM_CFG0 0x1b -#define TCBD_STREAM_CFG1 0x1c -#define TCBD_STREAM_CFG2 0x1d -#define TCBD_STREAM_CFG3 0x1e -#define TCBD_STREAM_CFG4 0x1f - -#define TCBD_CMDDMA_CTRL 0x20 -#define TCBD_CMDDMA_SADDR 0x21 -#define TCBD_CMDDMA_SIZE 0x27 -#define TCBD_CMDDMA_STARTCTRL 0x29 -#define TCBD_CMDDMA_DATA_WIND 0x2a -#define TCBD_TGTBUFF_CIR_MODE 0x2b -#define TCBD_CMDDMA_CRC32 0x2c - -#define TCBD_PERI_CTRL 0x30 -#define TCBD_PERI_MODE0 0x31 -#define TCBD_PERI_MODE1 0x32 -#define TCBD_PERI_MODE2 0x33 -#define TCBD_PERI_MODE3 0x34 -#define TCBD_PERI_TEST0 0x37 -#define TCBD_PERI_TEST1 0x38 -#define TCBD_PERI_TEST2 0x39 -#define TCBD_PERI_TEST3 0x3a -#define TCBD_PERI_TEST4 0x3b - -#define TCBD_MAIL_CTRL 0x3c -#define TCBD_MAIL_FIFO_R 0x3d -#define TCBD_MAIL_FIFO_R_LATCH 0x3d -#define TCBD_MAIL_FIFO_W 0x3e -#define TCBD_MAIL_FIFO_W_LATCH 0x3e -#define TCBD_MAIL_FIFO_WIND 0x3f - -#define TCBD_I2CMST_CTRL 0x40 -#define TCBD_I2CMST_FILTER 0x41 -#define TCBD_I2CMST_PRER_H 0x42 -#define TCBD_I2CMST_PRER_L 0x43 -#define TCBD_I2CMST_DEV_ADDR 0x44 -#define TCBD_I2CMST_TGT_ADDR 0x45 -#define TCBD_I2CMST_TXRX 0x46 -#define TCBD_I2CMST_AUTOCONFIG 0x47 -#define TCBD_I2CMST_START 0x48 -#define TCBD_I2CMST_STAT0 0x49 -#define TCBD_I2CMST_STAT1 0x4A - -#define TCBD_STREAMMIX_CFG0 0x4D - -#define TCBD_OBUFF_CONFIG 0x4e -#define TCBD_OBUFF_INIT 0x4f -#define TCBD_OBUFF_A_SADDR 0x50 -#define TCBD_OBUFF_A_EADDR 0x52 -#define TCBD_OBUFF_A_FIFO_THR 0x54 -#define TCBD_OBUFF_A_CIRBUFF_DATA_ADDR 0x54 -#define TCBD_OBUFF_A_FIFO_STAT 0x56 -#define TCBD_OBUFF_A_CIRBUFF_DATA_SIZE 0x56 -#define TCBD_OBUFF_B_SADDR 0x58 -#define TCBD_OBUFF_B_EADDR 0x5a -#define TCBD_OBUFF_B_FIFO_THR 0x5c -#define TCBD_OBUFF_B_CIRBUFF_DATA_ADDR 0x5c -#define TCBD_OBUFF_B_FIFO_STAT 0x5e -#define TCBD_OBUFF_B_CIRBUFF_DATA_SIZE 0x5e -#define TCBD_OBUFF_C_SADDR 0x60 -#define TCBD_OBUFF_C_EADDR 0x62 -#define TCBD_OBUFF_C_FIFO_THR 0x64 -#define TCBD_OBUFF_C_CIRBUFF_DATA_ADDR 0x64 -#define TCBD_OBUFF_C_FIFO_STAT 0x66 -#define TCBD_OBUFF_C_CIRBUFF_DATA_SIZE 0x66 -#define TCBD_OBUFF_D_SADDR 0x68 -#define TCBD_OBUFF_D_EADDR 0x6a -#define TCBD_OBUFF_D_FIFO_THR 0x6c -#define TCBD_OBUFF_D_CIRBUFF_DATA_ADDR 0x6c -#define TCBD_OBUFF_D_FIFO_STAT 0x6e -#define TCBD_OBUFF_D_CIRBUFF_DATA_SIZE 0x6e - -#define TCBD_RF_CFG0 0x70 -#define TCBD_RF_CFG1 0x71 -#define TCBD_RF_CFG2 0x72 -#define TCBD_RF_CFG3 0x73 -#define TCBD_RF_CFG4 0x74 -#define TCBD_RF_CFG5 0x75 -#define TCBD_RF_CFG6 0x76 -#define TCBD_OP_DEBUG0 0x78 -#define TCBD_OP_DEBUG1 0x79 -#define TCBD_OP_DEBUG2 0x7a -#define TCBD_OP_LDO_CONFIG 0x7b -#define TCBD_OP_XTAL_BIAS 0x7c -#define TCBD_OP_XTAL_BIAS_KEY 0x7d -#define TCBD_OP_STATUS0 0x7e -#define TCBD_OP_STATUS1 0x7f - - -#define TCBD_SYS_COMP_DSP Bit1 -#define TCBD_SYS_COMP_EP Bit0 -#define TCBD_SYS_COMP_ALL (Bit0|Bit1) - -#define TCBD_IRQ_MODE_PAD_ENABLE Bit2 -#define TCBD_IRQ_MODE_TRIGER Bit1 -#define TCBD_IRQ_MODE_LEVEL BitNONE -#define TCBD_IRQ_MODE_RISING Bit0 -#define TCBD_IRQ_MODE_FALLING BitNONE -#define TCBD_IRQ_EN_FIFODINIT Bit7 -#define TCBD_IRQ_EN_FIFOCINIT Bit6 -#define TCBD_IRQ_EN_FIFOBINIT Bit5 -#define TCBD_IRQ_EN_FIFOAINIT Bit4 -#define TCBD_IRQ_EN_DATAINT Bit3 -#define TCBD_IRQ_EN_I2C Bit1 -#define TCBD_IRQ_EN_MAILBOX Bit0 - -/* - * @DEFGROUP INTERRUPTSTATUS - * BIT POSTION OF INTERRUPT. - * @{ - */ -#define TCBD_IRQ_STAT_FIFODINIT Bit7 -#define TCBD_IRQ_STAT_FIFOCINIT Bit6 -#define TCBD_IRQ_STAT_FIFOBINIT Bit5 -#define TCBD_IRQ_STAT_FIFOAINIT Bit4 -#define TCBD_IRQ_STAT_DATAINT Bit3 -#define TCBD_IRQ_STAT_I2C Bit1 -#define TCBD_IRQ_STAT_MAILBOX Bit0 -/**}@*/ - - -/* - * @defgroup InterruptClear - * bit position of insterrupt clear. if you done processing interrupt - * then you must clear corresponding bit. - * @{ - */ -#define TCBD_IRQ_STATCLR_FIFODINIT Bit7 -#define TCBD_IRQ_STATCLR_FIFOCINIT Bit6 -#define TCBD_IRQ_STATCLR_FIFOBINIT Bit5 -#define TCBD_IRQ_STATCLR_FIFOAINIT Bit4 -#define TCBD_IRQ_STATCLR_DATAINT Bit3 -#define TCBD_IRQ_STATCLR_I2C Bit1 -#define TCBD_IRQ_STATCLR_MAILBOX Bit0 -#define TCBD_IRQ_STATCLR_ALL (Bit0|Bit1|Bit3|Bit4|Bit5|Bit6|Bit7) -/**}@*/ - - -/* - * @defgroup ErrorStatus - * error status of interrupt. - * if buffer overflow occurs then this bit is set. - * @{ - */ -#define TCBD_IRQ_ERROR_FIFOD Bit7 -#define TCBD_IRQ_ERROR_FIFOC Bit6 -#define TCBD_IRQ_ERROR_FIFOB Bit5 -#define TCBD_IRQ_ERROR_FIFOA Bit4 -#define TCBD_IRQ_ERROR_DATA Bit3 -#define TCBD_IRQ_ERROR_I2C Bit1 -#define TCBD_IRQ_ERROR_MAILBOX Bit0 -/**}@*/ -#define TCBD_I2CREPEAT_EN Bit2 -#define TCBD_I2CREPEAT_MODE_CONTINUE BitNONE -#define TCBD_I2CREPEAT_MODE_ONESHOT Bit1 -#define TCBD_I2CREPEAT_SCL_CMOS BitNONE -#define TCBD_I2CREPEAT_SCL_OPENDRAIN Bit0 -#define TCBD_I2CREPEAT_START Bit0 -#define TCBD_I2CREPEAT_STARTCTRL 0x4F - -#define TCBD_CMDDMA_DMAEN Bit7 -#define TCBD_CMDDMA_CIRCULARMODE Bit5 -#define TCBD_CMDDMA_CRC32EN Bit4 -#define TCBD_CMDDMA_ADDRFIX Bit3 -#define TCBD_CMDDMA_WRITEMODE Bit2 -#define TCBD_CMDDMA_READMODE BitNONE -#define TCBD_CMDDMA_BYTEMSB Bit1 -#define TCBD_CMDDMA_BITMSB Bit0 -#define TCBD_CMDDMA_START_AUTOCLR Bit7 -#define TCBD_CMDDMA_CRC32INIT_AUTOCLR Bit1 -#define TCBD_CMDDMA_INIT_AUTOCLR Bit0 - -#define TCBD_TGTBUFF_DEFAULT BitNONE -#define TCBD_TGTBUFF_CIR_MODE_C (Bit0|Bit1) -#define TCBD_TGTBUFF_CIR_MODE_B Bit1 -#define TCBD_TGTBUFF_CIR_MODE_A Bit0 - -#define TCBD_PERI_EN Bit7 -#define TCBD_PERI_SEL_SPI Bit4 -#define TCBD_PERI_SEL_TS Bit5 -#define TCBD_PERI_SEL_HPI (Bit4|Bit5) -#define TCBD_PERI_SEL_OTHER BitNONE -#define TCBD_PERI_INIT_AUTOCLR Bit1 -#define TCBD_PERI_HEADER_ON Bit0 -#define TCBD_PERI_SPI_TISSP Bit7 -#define TCBD_PERI_SPI_MOTOROLA_SSP BitNONE -#define TCBD_PERI_SPI_SLAVE Bit6 -#define TCBD_PERI_SPI_MASTER BitNONE -#define TCBD_PERI_SPI_FASTON Bit5 -#define TCBD_PERI_SPI_SIZE8BITB it0 -#define TCBD_PERI_SPI_SIZE16BIT Bit1 -#define TCBD_PERI_SPI_SIZE32BIT BitNONE -#define TCBD_PERI_TS_MSM_SLAVE Bit1 -#define TCBD_PERI_TS_NORMAL_SLAVE BitNONE -#define TCBD_PERI_TS_STS BitNONE -#define TCBD_PERI_TS_PTS Bit6 -#define TCBD_PERI_TS_FASTON Bit5 -#define TCBD_PERI_TS_TSCLKMASKON Bit4 -#define TCBD_PERI_HPI_INTEL Bit7 -#define TCBD_PERI_HPI_MOTOROLA BitNONE -#define TCBD_PERI_HPI_BYTEMSB Bit6 -#define TCBD_PERI_HPI_BITMSB Bit5 -#define TCBD_PERI_SPI_CLKINIT_LOW BitNONE -#define TCBD_PERI_SPI_CLKINIT_HIGH Bit7 -#define TCBD_PERI_SPI_CLKPOL_POS BitNONE -#define TCBD_PERI_SPI_CLKPOL_NEG Bit6 -#define TCBD_PERI_SPI_BYTEMSB1 Bit5 -#define TCBD_PERI_SPI_BITMSB1 Bit4 -#define TCBD_PERI_TS_CLKPHASE_POS BitNONE -#define TCBD_PERI_TS_CLKPHASE_NEG Bit7 -#define TCBD_PERI_TS_SYNC_ACTIVEHIGH BitNONE -#define TCBD_PERI_TS_SYNC_ACTIVELOW Bit6 -#define TCBD_PERI_TS_ENPOL_ACTIVEHIGH BitNONE -#define TCBD_PERI_TS_ENPOL_ACTIVELOW Bit5 -#define TCBD_PERI_TS_STREAM_WAIT_ON Bit4 -#define TCBD_PERI_TS_BYTEMSB Bit7 -#define TCBD_PERI_TS_BITMSB Bit6 -#define TCBD_PERI_TS_ERR_POL Bit1 -#define TCBD_PERI_TS_ERR_SIG_ON Bit0 -#define TCBD_PERI_TS_ERR_SIG_OFF BitNONE -#define TCBD_PERI_TEST0_START Bit7 -#define TCBD_PERI_TEST0_CIRCULAR_EN Bit2 -#define TCBD_PERI_TEST0_TESTMODE Bit1 -#define TCBD_PERI_TEST0_FIXMODE Bit0 - -#define TCBD_MAIL_INIT Bit6 -#define TCBD_MAIL_HOSTMAILPOST Bit5 -#define TCBD_MAIL_OPACCEPTEN Bit4 - -#define TCBD_I2CMST_INIT Bit7 -#define TCBD_I2CMST_EN Bit2 -#define TCBD_I2CMST_NORMALMODE BitNONE -#define TCBD_I2CMST_AUTOMODE Bit1 -#define TCBD_I2CMST_SCL_CMOS BitNONE -#define TCBD_I2CMST_SCL_OPENDRAIN Bit0 -#define TCBD_I2CMST_DEV_ADDR_WRITE BitNONE -#define TCBD_I2CMST_DEV_ADDR_READ Bit0 -#define TCBD_I2CMST_AUTOCONFIG_CMDQUE_ADD Bit7 -#define TCBD_I2CMST_AUTOCONFIG_CMDQUE_INIT Bit6 -#define TCBD_I2CMST_AUTOCONFIG_CMDQUE_CNT4 Bit4 -#define TCBD_I2CMST_AUTOCONFIG_CMDQUE_CNT3 Bit3 -#define TCBD_I2CMST_AUTOCONFIG_CMDQUE_CNT2 Bit2 -#define TCBD_I2CMST_AUTOCONFIG_CMDQUE_CNT1 Bit1 -#define TCBD_I2CMST_AUTOCONFIG_CMDQUE_CNT0 Bit0 -#define TCBD_I2CMST_AUTOSTART Bit7 -#define TCBD_I2CMST_NORMALSTART Bit4 -#define TCBD_I2CMST_NORMALSTOP Bit3 -#define TCBD_I2CMST_NORMALREAD Bit2 -#define TCBD_I2CMST_NORMALWRITE Bit1 -#define TCBD_I2CMST_NORMALACK Bit0 -#define TCBD_I2CMST_STAT0_NORMAL_ACKIN Bit7 -#define TCBD_I2CMST_STAT0_NORMAL_DONE Bit6 -#define TCBD_I2CMST_STAT0_ARBIT_LOST Bit5 -#define TCBD_I2CMST_STAT0_SDA Bit1 -#define TCBD_I2CMST_STAT0_SCL Bit0 -#define TCBD_I2CMST_STAT1_AUTOERR Bit7 -#define TCBD_I2CMST_STAT1_AUTODONE Bit6 -#define TCBD_I2CMST_STAT1_ARBIT_LOST Bit5 -#define TCBD_I2CMST_STAT1_RXRFIFOCNT4 Bit4 -#define TCBD_I2CMST_STAT1_RXRFIFOCNT3 Bit3 -#define TCBD_I2CMST_STAT1_RXRFIFOCNT2 Bit2 -#define TCBD_I2CMST_STAT1_RXRFIFOCNT1 Bit1 -#define TCBD_I2CMST_STAT1_RXRFIFOCNT0 Bit0 - -#define TCBD_RF_MANAGE_ENABLE Bit1 -#define TCBD_RF_MANAGE_DISABLE BitNONE -#define TCBD_RF_READ BitNONE -#define TCBD_RF_WRITE Bit0 -#define TCBD_RF_ACTION Bit0 - -#define TCBD_OBUFF_CONFIG_BUFF_D_EN Bit7 -#define TCBD_OBUFF_CONFIG_BUFF_C_EN Bit6 -#define TCBD_OBUFF_CONFIG_BUFF_B_EN Bit5 -#define TCBD_OBUFF_CONFIG_BUFF_A_EN Bit4 -#define TCBD_OBUFF_CONFIG_BUFF_D_CIRCULAR BitNONE -#define TCBD_OBUFF_CONFIG_BUFF_C_CIRCULAR BitNONE -#define TCBD_OBUFF_CONFIG_BUFF_B_CIRCULAR BitNONE -#define TCBD_OBUFF_CONFIG_BUFF_A_CIRCULAR BitNONE -#define TCBD_OBUFF_CONFIG_BUFF_D_FIFO Bit3 -#define TCBD_OBUFF_CONFIG_BUFF_C_FIFO Bit2 -#define TCBD_OBUFF_CONFIG_BUFF_B_FIFO Bit1 -#define TCBD_OBUFF_CONFIG_BUFF_A_FIFO Bit0 -#define TCBD_OBUFF_DBUFF_STATLATCH Bit7 -#define TCBD_OBUFF_CBUFF_STATLATCH Bit6 -#define TCBD_OBUFF_BBUFF_STATLATCH Bit5 -#define TCBD_OBUFF_ABUFF_STATLATCH Bit4 -#define TCBD_OBUFF_BUFF_D_INIT Bit3 -#define TCBD_OBUFF_BUFF_C_INIT Bit2 -#define TCBD_OBUFF_BUFF_B_INIT Bit1 -#define TCBD_OBUFF_BUFF_A_INIT Bit0 - -/** - * @defgroup StreamDataConfig - * You can mask unused buffer by @ref tcbd_init_stream_data_config - */ -/** @{*/ -#define STREAM_DATA_ENABLE Bit7 -#define STREAM_HEADER_ON Bit6 -#define STREAM_MASK_BUFFERD Bit3 -#define STREAM_MASK_BUFFERC Bit2 -#define STREAM_MASK_BUFFERB Bit1 -#define STREAM_MASK_BUFFERA Bit0 - -#define STREAM_BUFFER_ALL (\ - STREAM_DATA_ENABLE | \ - STREAM_HEADER_ON | \ - STREAM_MASK_BUFFERD | \ - STREAM_MASK_BUFFERC | \ - STREAM_MASK_BUFFERB | \ - STREAM_MASK_BUFFERA) -/**@}*/ - -#define STREAM_CMD_FIFO_MSB Bit0 -#define STREAM_CMD_FIFO_ENABLE Bit1 -#define STREAM_CMD_FIFO_INIT Bit4 -#define STREAM_LATCH_TOTAL_SIZE Bit5 - -/** - * @defgroup TypesOfStream - * Types of stream. - * You can change the type of stream by @ref tcbd_change_stream_type - */ -/** @{*/ -#define STREAM_TYPE_GARBAGE Bit7 -#define STREAM_TYPE_DAB_PLUS Bit6 -#define STREAM_TYPE_EPM Bit5 -#define STREAM_TYPE_DMB Bit4 -#define STREAM_TYPE_DAB Bit3 -#define STREAM_TYPE_FIC Bit2 -#define STREAM_TYPE_FIB_FILTER Bit1 -#define STREAM_TYPE_STATUS Bit0 - -#define STREAM_TYPE_ALL \ - (STREAM_TYPE_DAB_PLUS |\ - STREAM_TYPE_EPM |\ - STREAM_TYPE_DMB |\ - STREAM_TYPE_DAB |\ - STREAM_TYPE_FIC |\ - STREAM_TYPE_FIB_FILTER |\ - STREAM_TYPE_STATUS) - -#define STREAM_SET_GARBAGE(_garbage)\ - (((_garbage >> 2) << 16) | STREAM_TYPE_GARBAGE) -/**@}*/ - -#define IRQ_ERR_MAILBOX Bit0 -#define IRQ_ERR_I2C Bit1 -#define IRQ_ERR_DATA Bit3 -#define IRQ_ERR_BUFFERA Bit4 -#define IRQ_ERR_BUFFERB Bit5 -#define IRQ_ERR_BUFFERC Bit6 -#define IRQ_ERR_BUFFERD Bit7 - -#define MB_CMD_READ 0 -#define MB_CMD_WRITE 1 - -#define MB_ERR_OK 0x00 -#define MB_ERR_CMD 0x01 -#define MB_ERR_PARA 0x02 - -#define MBCMD_SYS (0x00<<11) -#define MBPARA_SYS_WARMBOOT (MBCMD_SYS | 0x00) -#define MBPARA_SYS_START (MBCMD_SYS | 0x01) -#define MBPARA_SYS_SYNC (MBCMD_SYS | 0x02) - -#define MBPARA_SYS_DAB_STREAM_SET (MBCMD_SYS | 0x0D) -#define MBPARA_SYS_DAB_STREAM_ON (MBCMD_SYS | 0x0E) -#define MBPARA_SYS_DAB_RECONFIG_CLR (MBCMD_SYS | 0x12) - -#define MBPARA_SYS_DAB_MCI_UPDATE (MBCMD_SYS | 0x0c) -#define MBPARA_SYS_DAB_DP_FLT (MBCMD_SYS | 0x0f) -#define MBPARA_SYS_DAB_RESYNC_PARAM (MBCMD_SYS | 0x10) -#define MBPARA_SYS_DAB_RESYNC_RESULT (MBCMD_SYS | 0x11) -#define MBPARA_SYS_DAB_RF_FREQ_NO (MBCMD_SYS | 0x20) -#define MBPARA_SYS_DAB_RF_FREQ (MBCMD_SYS | 0x21) -#define MBPARA_SYS_DAB_ASM_VER (MBCMD_SYS | 0xff) - -#define MBCMD_AGC_DAB (0x01<<11) -#define MBCMD_AGC_DAB_CFG (MBCMD_AGC_DAB | 0) -#define MBCMD_AGC_DAB_GAIN (MBCMD_AGC_DAB | 1) -#define MBCMD_AGC_DAB_JAM (MBCMD_AGC_DAB | 2) -#define MBCMD_AGC_DAB_3 (MBCMD_AGC_DAB | 3) -#define MBCMD_AGC_DAB_4 (MBCMD_AGC_DAB | 4) -#define MBCMD_AGC_DAB_5 (MBCMD_AGC_DAB | 5) -#define MBCMD_AGC_DAB_6 (MBCMD_AGC_DAB | 6) -#define MBCMD_AGC_DAB_7 (MBCMD_AGC_DAB | 7) -#define MBCMD_AGC_DAB_8 (MBCMD_AGC_DAB | 8) -#define MBCMD_AGC_DAB_9 (MBCMD_AGC_DAB | 9) -#define MBCMD_AGC_DAB_A (MBCMD_AGC_DAB | 10) -#define MBCMD_AGC_DAB_B (MBCMD_AGC_DAB | 11) -#define MBCMD_AGC_DAB_C (MBCMD_AGC_DAB | 12) -#define MBCMD_AGC_DAB_D (MBCMD_AGC_DAB | 13) -#define MBCMD_AGC_DAB_E (MBCMD_AGC_DAB | 14) -#define MBCMD_AGC_DAB_F (MBCMD_AGC_DAB | 15) - -#define MBCMD_FP_DAB (0x02 << 11) -#define MBCMD_FP_DAB_CFG (MBCMD_FP_DAB | 0) -#define MBCMD_FP_DAB_IIR (MBCMD_FP_DAB | 1) - -#define MBCMD_CTO_DAB (0x04<<11) -#define MBCMD_CTO_DAB_PARAM (MBCMD_CTO_DAB | 0x00) -#define MBCMD_CTO_DAB_RESULT (MBCMD_CTO_DAB | 0x01) - -#define MBCMD_CFO_DAB (0x06<<11) -#define MBCMD_CFO_DAB_PARAM (MBCMD_CFO_DAB | 0x00) -#define MBCMD_CFO_DAB_RESULT (MBCMD_CFO_DAB | 0x01) - -#define MBCMD_FFO_DAB (0x07<<11) -#define MBCMD_FTO_DAB (0x0A<<11) - -#define MBCMD_SFE_DAB (0x0B<<11) -#define MBCMD_SFE_DAB_PARAM (MBCMD_SFE_DAB | 0x00) -#define MBCMD_SFE_DAB_RESULT (MBCMD_SFE_DAB | 0x01) - -#define MBCMD_CIR_DAB (0x0C<<11) -#define MBCMD_CIR_DAB_PARAM (MBCMD_CIR_DAB | 0x00) -#define MBCMD_CIR_DAB_RESULT (MBCMD_CIR_DAB | 0x01) - -#define MBCMD_DP_DAB (0x10<<11) -#define MBCMD_DP_DAB_RESULT (MBCMD_DP_DAB | 0x00) -#define MBCMD_DP_DAB_CFG1 (MBCMD_DP_DAB | 0x01) -#define MBCMD_DP_DAB_CFG2 (MBCMD_DP_DAB | 0x02) - -#define MBCMD_DEBUG_DAB (0x1F<<11) - -#define MBPARA_SYS_VERSION (MBCMD_SYS | 0xFF) - -#define MBPARA_SYS_NUM_FREQ (MBCMD_SYS | 0x20) -#define MBPARA_SYS_FREQ_0_6 (MBCMD_SYS | 0x21) -#define MBPARA_SYS_FREQ_7_13 (MBCMD_SYS | 0x22) -#define MBPARA_SYS_FREQ_14_20 (MBCMD_SYS | 0x23) -#define MBPARA_SYS_FREQ_21_27 (MBCMD_SYS | 0x24) - -#define MBCMD_SEL_CH_INFO (0x13<<11) -#define MBPARA_SEL_CH_INFO_PRAM (MBCMD_SEL_CH_INFO | 0x00) -#define MBPARA_SEL_CH_INFO_RESULT (MBCMD_SEL_CH_INFO | 0x01) - -#define MBCMD_VARI_OSC (0x15<<11) -#define MBCMD_VARI_OSC_SPUR (MBCMD_VARI_OSC | 0x00) -#define MBCMD_VARI_OSC_RCSTEP (MBCMD_VARI_OSC | 0x01) -#define MBCMD_VARI_OSC_RFPLL (MBCMD_VARI_OSC | 0x02) - -#ifndef BITSET -#define BITSET(X, MASK) ((X) |= (u32)(MASK)) -#endif - -#ifndef BITSCLR -#define BITSCLR(X, SMASK, CMASK)\ - ((X) = ((\ - ((u32)(X)) |\ - ((u32)(SMASK))) & ~((u32)(CMASK)))) -#endif -#ifndef BITCSET -#define BITCSET(X, CMASK, SMASK)\ - ((X) = (\ - (((u32)(X)) & ~((u32)(CMASK))) |\ - ((u32)(SMASK)))) -#endif -#ifndef BITCLR -#define BITCLR(X, MASK) ((X) &= ~((u32)(MASK))) -#endif -#ifndef BITXOR -#define BITXOR(X, MASK) ((X) ^= (u32)(MASK)) -#endif -#ifndef ISZERO -#define ISZERO(X, MASK)\ - (!(((u32)(X)) & ((u32)(MASK)))) -#endif - -#ifndef ISSET -#define ISSET(X, MASK) ((u32)(X) & ((u32)(MASK))) -#endif - -#endif /*__TCBD_DRV_REGISTER_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_drv_rf.h b/drivers/media/tdmb/tcc3170/inc/tcbd_drv_rf.h deleted file mode 100644 index fdee599..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_drv_rf.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * tcbd_drv_rf.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_DRV_RF_H__ -#define __TCBD_DRV_RF_H__ - -TCBB_FUNC s32 tcbd_rf_init( - struct tcbd_device *_device, enum tcbd_band_type _band); -TCBB_FUNC s32 tcbd_rf_tune_frequency( - struct tcbd_device *_device, u32 _freq_khz, s32 _bw_khz); - -#endif /*__TCBD_DRV_RF_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_error.h b/drivers/media/tdmb/tcc3170/inc/tcbd_error.h deleted file mode 100644 index 6b66a70..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_error.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * tcbd_error.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_ERROR_H__ -#define __TCBD_ERROR_H__ - -/** - * @defgroup ListOfErrorCode - * If API fails then above error code will be returned. - * Error codes can be combined with each other. - */ -/** @{*/ -#define TCERR_SUCCESS 0x00000000 -#define TCERR_INVALID_ARG 0x00000001 -#define TCERR_BROKEN_MAIL_HEADER 0x00000002 -#define TCERR_UNKNOWN_MAIL_STATUS 0x00000004 -#define TCERR_WAIT_MAIL_TIMEOUT 0x00000008 -#define TCERR_CRC_FAIL 0x00000010 -#define TCERR_ACK_FAIL 0x00000020 -#define TCERR_OS_DRIVER_FAIL 0x00000040 -#define TCERR_CANNOT_ACCESS_MAIL 0x00000080 -#define TCERR_UNKNOWN_BAND 0x00000100 -#define TCERR_TUNE_FAILED 0x00000200 -#define TCERR_MAX_NUM_SERVICE 0x00000400 -#define TCERR_SERVICE_NOT_FOUND 0x00000800 -#define TCERR_NO_FIC_DATA 0x00001000 -#define TCERR_IO_NOT_INITIALIZED 0x00002000 -#define TCERR_WARMBOOT_FAIL 0x00004000 -#define TCERR_AREADY_REGISTERED 0x00008000 -#define TCERR_FATAL_ERROR 0x10000000 -/**@}*/ - - -#endif /*__TCBD_ERROR_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_feature.h b/drivers/media/tdmb/tcc3170/inc/tcbd_feature.h deleted file mode 100644 index 53fb880..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_feature.h +++ /dev/null @@ -1,125 +0,0 @@ -/* - * tcbd_feature.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_API_FEATURE_H__ -#define __TCBD_API_FEATURE_H__ - -#define __AGC_TABLE_IN_DSP__ - -#define __CSPI_ONLY__ -#undef __I2C_STS__ - -#undef __ALWAYS_FIC_ON__ -#undef __CALLBACK_BUFFER_HEADER__ - -#if defined(__I2C_STS__) -#define __STATUS_IN_REGISTER__ -#else /*__I2C_STS__*/ -#undef __STATUS_IN_REGISTER__ -#define __STATUS_IN_STREAM__ -#endif /*!__I2C_STS__*/ - -#if defined(__CSPI_ONLY__) -#define __READ_FIXED_LENGTH__ -#undef __READ_VARIABLE_LENGTH__ -#endif /*__CSPI_ONLY__*/ - -#undef __DEBUG_DSP_ROM__ - -#define TCBD_MAX_NUM_SERVICE 6 - -#define TCBD_DEF_BANDWIDTH (1500) -#define TCBD_STATUS_SIZE (32) -#define TCBD_FIC_SIZE (388) -#define TCBD_TS_SIZE (188) -#define TCBD_OP_HEADER_SIZE (4) -#define TCBD_MAX_FIFO_SIZE (1024*16) -#define TCBD_CHIPID_VALUE (0x37) - -#if defined(__STATUS_IN_REGISTER__) -#if defined(__CSPI_ONLY__) -#define TCBD_THRESHOLD_FIC\ - (TCBD_FIC_SIZE + TCBD_STATUS_SIZE + TCBD_OP_HEADER_SIZE*2) -#elif defined(__I2C_STS__) -#define TCBD_THRESHOLD_FIC (TCBD_FIC_SIZE) -#else /*__I2C_STS__*/ -#error "you must define __I2C_STS__ or __CSPI_ONLY__" -#endif /*!__CSPI_ONLY__ && !__I2C_STS__*/ -#else /* __STATUS_IN_REGISTER__ */ -#define TCBD_THRESHOLD_FIC\ - (TCBD_FIC_SIZE+TCBD_STATUS_SIZE+TCBD_OP_HEADER_SIZE*2) -#endif /* !__STATUS_IN_REGISTER__ */ - -#if defined(__CSPI_ONLY__) -#define TCBD_BUFFER_A_SIZE (TCBD_MAX_FIFO_SIZE) -#define TCBD_BUFFER_B_SIZE (0x0) -#define TCBD_BUFFER_C_SIZE (0x0) -#define TCBD_BUFFER_D_SIZE (0x0) - -#define TCBD_MAX_THRESHOLD (((1024*7)>>2)<<2) - -#elif defined(__I2C_STS__) -#define TCBD_BUFFER_A_SIZE (TCBD_THRESHOLD_FIC) -#define TCBD_BUFFER_B_SIZE \ - (((TCBD_MAX_FIFO_SIZE-TCBD_BUFFER_A_SIZE)>>2)<<2) -#define TCBD_BUFFER_C_SIZE (0x0) -#define TCBD_BUFFER_D_SIZE (0x0) - -#define TCBD_MAX_THRESHOLD (((TCBD_BUFFER_B_SIZE>>1)>>2)<<2) -#endif /* __I2C_STS__ */ - -#define PHY_BASE_ADDR (0x80000000) -#define PHY_MEM_FIFO_START_ADDR (0x00000000) -#define PHY_MEM_ADDR_A_START (PHY_BASE_ADDR + 0xa000) -#define PHY_MEM_ADDR_A_END\ - (PHY_MEM_ADDR_A_START+TCBD_BUFFER_A_SIZE-1) -#define PHY_MEM_ADDR_B_START\ - (PHY_MEM_ADDR_A_END+1) -#define PHY_MEM_ADDR_B_END\ - (PHY_MEM_ADDR_B_START+TCBD_BUFFER_B_SIZE-1) -#define PHY_MEM_ADDR_C_START\ - (PHY_MEM_ADDR_B_END+1) -#define PHY_MEM_ADDR_C_END\ - (PHY_MEM_ADDR_C_START+TCBD_BUFFER_C_SIZE-1) -#define PHY_MEM_ADDR_D_START\ - (PHY_MEM_ADDR_C_END+1) -#define PHY_MEM_ADDR_D_END\ - (PHY_MEM_ADDR_D_START+TCBD_BUFFER_D_SIZE-1) - -/* CODE Memory Setting */ -#define START_PC (0x0000) -#define START_PC_OFFSET (0x8000) -#define CODE_MEM_BASE (PHY_BASE_ADDR+START_PC_OFFSET) -#define CODE_TABLEBASE_RAND (0xF0020000) -#define CODE_TABLEBASE_DINT (0xF0024000) -#define CODE_TABLEBASE_DAGU (0xF0028000) -#define CODE_TABLEBASE_COL_ORDER (0xF002C000) - -/* lock check time definition */ -#define TDMB_OFDMDETECT_LOCK (100) -#define TDMB_OFDMDETECT_RETRY (2) -#define TDMB_CTO_LOCK (100) -#define TDMB_CTO_RETRY (3) -#define TDMB_CFO_LOCK (20) -#define TDMB_CFO_RETRY (3) - -#endif /*__TCBD_API_FEATURE_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_hal.h b/drivers/media/tdmb/tcc3170/inc/tcbd_hal.h deleted file mode 100644 index 634381b..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_hal.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * tcbd_hal.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_HAL_H__ -#define __TCBD_HAL_H__ - -#define IRQ_TC317X 6 -/* #define __USE_TC_CPU__ */ - -void tchal_init(void); -void tchal_reset_device(void); -void tchal_power_on_device(void); -void tchal_power_down_device(void); -void tchal_irq_setup(void); - -#endif /*__TCBD_HAL_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcbd_stream_parser/tcbd_stream_parser.h b/drivers/media/tdmb/tcc3170/inc/tcbd_stream_parser/tcbd_stream_parser.h deleted file mode 100644 index f9b0ab1..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcbd_stream_parser/tcbd_stream_parser.h +++ /dev/null @@ -1,45 +0,0 @@ -/* - * tcbd_stream_parser.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCBD_STREAM_PARSER_H__ -#define __TCBD_STREAM_PARSER_H__ - -#undef __MERGE_EACH_TYPEOF_STREAM__ - -#define SIZE_BUFF_HEADER 4 /*[TYPE(1)][SUBCH(1)][SIZE(2)]*/ - -enum DATA_TYPE { - DATA_TYPE_MSC = 0, - DATA_TYPE_FIC, - DATA_TYPE_STATUS, - DATA_TYPE_OTHER, - DATA_TYPE_MAX -}; - -typedef s32 (*tcbd_stream_callback)(s32 _dev_idx, u8 *_stream, s32 _size, - u8 _subch_id, u8 _type); - -TCBB_FUNC void tcbd_init_parser(s32 _dev_idx, - tcbd_stream_callback _streamCallback); -TCBB_FUNC s32 tcbd_split_stream(s32 _dev_idx, u8 *_stream, s32 _size); - -#endif /*__TCBD_STREAM_PARSER_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcc317x_boot_tdmb.h b/drivers/media/tdmb/tcc3170/inc/tcc317x_boot_tdmb.h deleted file mode 100644 index b334fce..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcc317x_boot_tdmb.h +++ /dev/null @@ -1,1011 +0,0 @@ -#ifndef __TCC317X_BOOT_TDMB_H__ -#define __TCC317X_BOOT_TDMB_H__ -/* - * asm file: E:\Works\ASM\TCC3500_ASM_BIN\TCC3170\LG\TCC317X_LG_v1_0_17.rom - * Created : 2012-05-04 09:54:27 - */ -#define TCC317X_BOOT_SIZE_TDMB 7996 - -unsigned char TCC317X_BOOT_DATA_TDMB[TCC317X_BOOT_SIZE_TDMB] = { - 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x1F, 0x14, - 0xAB, 0x00, 0x04, 0x60, 0x17, 0x05, 0x00, 0x00, - 0xAB, 0x00, 0x0C, 0xA0, 0x17, 0x05, 0x00, 0x00, - 0xAB, 0xB4, 0x00, 0xE0, 0x17, 0x05, 0x00, 0x00, - 0xAB, 0xC2, 0x01, 0x20, 0x18, 0x05, 0x00, 0x00, - 0xAB, 0x28, 0x00, 0x60, 0x18, 0x05, 0x00, 0x00, - 0xAB, 0xB4, 0x00, 0xA0, 0x18, 0x05, 0x00, 0x00, - 0xAB, 0x20, 0x00, 0x20, 0x19, 0x05, 0x00, 0x00, - 0xAB, 0x1C, 0x00, 0x60, 0x19, 0x05, 0x00, 0x00, - 0xAB, 0x1C, 0x00, 0xA0, 0x19, 0x05, 0x00, 0x00, - 0xAB, 0x16, 0x00, 0xE0, 0x19, 0x05, 0x00, 0x00, - 0xAB, 0x1A, 0x00, 0x20, 0x1A, 0x05, 0x00, 0x00, - 0xAB, 0x10, 0x00, 0x60, 0x1A, 0x05, 0x00, 0x00, - 0xAB, 0x84, 0x03, 0xA0, 0x1A, 0x05, 0x00, 0x00, - 0xAB, 0xB8, 0x0B, 0xE0, 0x1A, 0x05, 0x00, 0x00, - 0xAB, 0x00, 0x00, 0x20, 0x1B, 0x05, 0x00, 0x00, - 0xAB, 0x00, 0x00, 0x60, 0x1D, 0x05, 0x00, 0x00, - 0xAB, 0x00, 0x00, 0xA0, 0x1D, 0x05, 0x00, 0x00, - 0xAB, 0x30, 0x00, 0xE0, 0x18, 0x05, 0x00, 0x00, - 0xAB, 0x10, 0x00, 0xE0, 0x1D, 0x05, 0x00, 0x00, - 0xAB, 0x74, 0x15, 0x21, 0x1E, 0x05, 0x00, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x44, 0x00, - 0xCB, 0x08, 0x00, 0x00, 0x00, 0x22, 0x44, 0x00, - 0xCB, 0x3C, 0x0A, 0x00, 0x00, 0x26, 0x44, 0x00, - 0xCB, 0x60, 0x20, 0x00, 0x00, 0x2A, 0x44, 0x00, - 0xCB, 0x6E, 0x14, 0xA0, 0x28, 0x2E, 0x44, 0x00, - 0xCB, 0xFE, 0x00, 0x00, 0x00, 0x6A, 0x44, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0x6E, 0x44, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0x72, 0x44, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0x76, 0x44, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0x7A, 0x44, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0x7E, 0x44, 0x00, - 0xCB, 0x88, 0xFE, 0x59, 0x81, 0x83, 0x44, 0x00, - 0xCB, 0x88, 0xFE, 0x59, 0x81, 0x87, 0x44, 0x00, - 0xCB, 0xA6, 0xFE, 0x3D, 0x06, 0x8A, 0x44, 0x00, - 0xCB, 0x0E, 0xFE, 0x3D, 0x02, 0x8E, 0x44, 0x00, - 0xCB, 0x44, 0x00, 0x10, 0x00, 0x92, 0x44, 0x00, - 0xCB, 0x4A, 0x00, 0x00, 0x00, 0x96, 0x44, 0x00, - 0xCB, 0x7E, 0xB1, 0xE4, 0x17, 0x9B, 0x44, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0x9E, 0x44, 0x00, - 0xCB, 0x10, 0x04, 0x00, 0x40, 0xFB, 0x45, 0x00, - 0xCB, 0x00, 0x0D, 0x00, 0x40, 0xFF, 0x45, 0x00, - 0xCB, 0xE0, 0x00, 0x00, 0x40, 0x13, 0x46, 0x00, - 0xCB, 0x78, 0x02, 0x00, 0x40, 0x17, 0x46, 0x00, - 0xCB, 0x12, 0xCA, 0xFE, 0x51, 0xA2, 0x44, 0x00, - 0xCB, 0x5A, 0x04, 0x52, 0xE8, 0xA7, 0x44, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0xAB, 0x44, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0xAE, 0x44, 0x00, - 0xCB, 0x58, 0x12, 0xAE, 0xE6, 0xB3, 0x44, 0x00, - 0xCB, 0x06, 0x0A, 0x10, 0x10, 0xB6, 0x44, 0x00, - 0xCB, 0x1C, 0x92, 0x22, 0x00, 0xBA, 0x44, 0x00, - 0xCB, 0x78, 0x82, 0x9E, 0x00, 0xBE, 0x44, 0x00, - 0xCB, 0xF0, 0x04, 0x3D, 0x01, 0xC2, 0x44, 0x00, - 0xCB, 0x3C, 0x8E, 0x4A, 0x00, 0xC6, 0x44, 0x00, - 0xCB, 0x40, 0x06, 0x00, 0x0C, 0xCB, 0x44, 0x00, - 0xCB, 0x80, 0x00, 0x00, 0x00, 0x06, 0x44, 0x01, - 0x01, 0x00, 0xCB, 0xA2, 0xCA, 0x99, 0x35, 0x02, - 0x44, 0x01, 0xCB, 0x40, 0x00, 0x00, 0x00, 0x06, - 0x44, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0x0E, 0x04, 0x2A, 0x3F, 0x5E, 0xA2, - 0x6A, 0x3F, 0x88, 0x23, 0xCB, 0x3E, 0xFE, 0xFF, - 0xFF, 0x93, 0x44, 0x01, 0x0F, 0x31, 0x01, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0F, 0x31, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0x2F, 0x03, 0x51, - 0x04, 0x00, 0x00, 0x00, 0x0F, 0x31, 0x1F, 0x0E, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0x31, 0x1F, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x2A, 0x01, 0x46, 0x22, - 0x8B, 0x05, 0x89, 0x80, 0x8C, 0x51, 0x00, 0x00, - 0x6A, 0x01, 0x1A, 0xA3, 0x8B, 0x25, 0x89, 0x80, - 0x81, 0x51, 0x00, 0x00, 0x8B, 0x2D, 0x89, 0x80, - 0x82, 0x51, 0x00, 0x00, 0x8B, 0x35, 0x89, 0x80, - 0x83, 0x51, 0x00, 0x00, 0x8B, 0x3D, 0x89, 0x80, - 0x8A, 0x51, 0x00, 0x00, 0xCB, 0x06, 0x00, 0x00, - 0x00, 0x02, 0x46, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0xAB, 0x0E, 0x00, 0x20, - 0xE0, 0x14, 0x00, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x12, 0x46, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x16, 0x46, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x1A, 0x46, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x1E, 0x46, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x22, 0x46, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x26, 0x46, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x2E, 0x46, 0x01, 0xAB, 0x02, 0x00, 0xA0, - 0xE0, 0x14, 0x00, 0x00, 0x0F, 0x99, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xAE, 0xC7, 0x00, 0x00, - 0x2E, 0x4F, 0x44, 0x01, 0x6E, 0x50, 0xD8, 0x05, - 0xAE, 0x50, 0x7C, 0x02, 0xEE, 0x50, 0xAC, 0x01, - 0x2E, 0x51, 0x8C, 0x06, 0x6E, 0x51, 0x60, 0x4A, - 0x2E, 0x42, 0x00, 0x08, 0x0F, 0x25, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0x37, 0xC3, 0x07, - 0x00, 0x00, 0x01, 0x00, 0xCB, 0x20, 0x00, 0x00, - 0x00, 0x02, 0x40, 0x01, 0xCB, 0x00, 0x0C, 0x01, - 0x28, 0x83, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x20, - 0x00, 0x86, 0x40, 0x01, 0xCB, 0xFE, 0xFF, 0xFF, - 0xFF, 0x8B, 0x40, 0x01, 0xCB, 0x00, 0x70, 0x00, - 0x00, 0x8E, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x3E, 0x93, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x96, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x9A, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x9E, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x40, - 0x08, 0xA2, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xA6, 0x40, 0x01, 0xCB, 0x00, 0x90, 0x00, - 0x00, 0xAA, 0x40, 0x01, 0xCB, 0xFE, 0x9F, 0xFC, - 0x07, 0xAE, 0x40, 0x01, 0xCB, 0x00, 0x80, 0x00, - 0x00, 0xB2, 0x40, 0x01, 0xCB, 0xFE, 0x8F, 0xFC, - 0x07, 0xB6, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xBA, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xBE, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xC2, 0x40, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xC6, 0x40, 0x01, 0xCB, 0xE0, 0xFF, 0x21, - 0x00, 0x42, 0x47, 0x01, 0xCB, 0x90, 0x08, 0x24, - 0x0D, 0x56, 0x47, 0x01, 0xCB, 0xB6, 0x0D, 0xB6, - 0x0D, 0x5A, 0x47, 0x01, 0xCB, 0xD8, 0x16, 0xDA, - 0x16, 0x5E, 0x47, 0x01, 0xCB, 0x5A, 0x1B, 0xEC, - 0x1F, 0x62, 0x47, 0x01, 0xCB, 0x20, 0x64, 0x88, - 0xA8, 0x66, 0x47, 0x01, 0xCB, 0xAA, 0xCC, 0xEC, - 0xEE, 0x6A, 0x47, 0x01, 0xCB, 0x30, 0x33, 0x55, - 0x75, 0x6F, 0x47, 0x01, 0xCB, 0x76, 0x99, 0xB9, - 0xFD, 0x73, 0x47, 0x01, 0xCB, 0x40, 0x00, 0x48, - 0x02, 0x76, 0x47, 0x01, 0xCB, 0xE0, 0x05, 0xF8, - 0x07, 0x7A, 0x47, 0x01, 0xCB, 0x40, 0x00, 0xC4, - 0x00, 0x7E, 0x47, 0x01, 0xCB, 0x0A, 0x02, 0x96, - 0x03, 0x82, 0x47, 0x01, 0xCB, 0xA0, 0x04, 0x2A, - 0x06, 0x86, 0x47, 0x01, 0xCB, 0x76, 0x07, 0xFC, - 0x07, 0x8A, 0x47, 0x01, 0xCB, 0x02, 0x00, 0x00, - 0x80, 0x33, 0x47, 0x01, 0xCB, 0x04, 0x32, 0x00, - 0x00, 0x36, 0x47, 0x01, 0xCB, 0x6E, 0x01, 0x00, - 0x00, 0x3A, 0x47, 0x01, 0xCB, 0x02, 0x00, 0x00, - 0x80, 0x3F, 0x47, 0x01, 0xCB, 0xFE, 0x07, 0xFE, - 0x07, 0xC2, 0x46, 0x01, 0xCB, 0x1E, 0x00, 0x00, - 0x00, 0xD6, 0x46, 0x01, 0xCB, 0x3E, 0x00, 0x20, - 0x00, 0xDA, 0x46, 0x01, 0xCB, 0xBE, 0x00, 0x40, - 0x00, 0xDE, 0x46, 0x01, 0xCB, 0xDE, 0x00, 0xC0, - 0x00, 0xE2, 0x46, 0x01, 0x8B, 0x65, 0x88, 0x82, - 0xB9, 0x51, 0x00, 0x00, 0xCB, 0x20, 0x02, 0xFE, - 0x03, 0x9E, 0x47, 0x01, 0xCB, 0xFE, 0xFF, 0x43, - 0x20, 0xFA, 0x46, 0x01, 0xCB, 0x22, 0x00, 0x00, - 0x00, 0xBA, 0x47, 0x01, 0xAB, 0x08, 0x01, 0x21, - 0xF0, 0x14, 0x00, 0x00, 0xCB, 0x04, 0xB0, 0x80, - 0x00, 0xDE, 0x47, 0x01, 0xCB, 0x06, 0x16, 0x00, - 0x02, 0xE2, 0x47, 0x01, 0xCB, 0x02, 0x18, 0x00, - 0x08, 0xE6, 0x47, 0x01, 0xCB, 0x00, 0x20, 0x00, - 0x00, 0x16, 0x47, 0x01, 0x0E, 0x03, 0x00, 0x00, - 0x06, 0x20, 0xBD, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xDA, 0x47, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xCE, 0x47, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xD2, 0x47, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xD6, 0x47, 0x00, 0x0F, 0x99, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0xDD, 0x44, 0x2A, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0x2B, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x46, 0x04, 0x26, 0x04, - 0xAB, 0x00, 0x00, 0x00, 0x0B, 0x03, 0x00, 0x00, - 0xCB, 0x80, 0x10, 0x60, 0x15, 0x4E, 0x47, 0x00, - 0xCB, 0x40, 0x18, 0x20, 0x1D, 0x52, 0x47, 0x00, - 0xCB, 0x00, 0x23, 0x82, 0x18, 0x56, 0x47, 0x00, - 0xCB, 0x62, 0x1D, 0x42, 0x23, 0x5A, 0x47, 0x00, - 0xCB, 0x22, 0x2A, 0x02, 0x34, 0x5E, 0x47, 0x00, - 0xCB, 0x84, 0x1D, 0x64, 0x23, 0x62, 0x47, 0x00, - 0xCB, 0x44, 0x2A, 0x24, 0x34, 0x66, 0x47, 0x00, - 0xCB, 0x86, 0x20, 0x66, 0x2A, 0x6A, 0x47, 0x00, - 0xCB, 0x46, 0x30, 0x26, 0x3A, 0x6E, 0x47, 0x00, - 0xCB, 0x06, 0x46, 0x88, 0x28, 0x72, 0x47, 0x00, - 0xCB, 0x68, 0x34, 0x48, 0x3A, 0x76, 0x47, 0x00, - 0xCB, 0x28, 0x46, 0x08, 0x54, 0x7A, 0x47, 0x00, - 0xCB, 0x8A, 0x30, 0x6A, 0x3A, 0x7E, 0x47, 0x00, - 0xCB, 0x4A, 0x46, 0x2A, 0x54, 0x82, 0x47, 0x00, - 0xCB, 0x0A, 0x68, 0x8C, 0x3A, 0x86, 0x47, 0x00, - 0xCB, 0x6C, 0x46, 0x4C, 0x54, 0x8A, 0x47, 0x00, - 0xCB, 0x2C, 0x68, 0x8E, 0x40, 0x8E, 0x47, 0x00, - 0xCB, 0x6E, 0x54, 0x4E, 0x60, 0x92, 0x47, 0x00, - 0xCB, 0x2E, 0x74, 0x0E, 0x8C, 0x96, 0x47, 0x00, - 0xCB, 0x90, 0x50, 0x70, 0x68, 0x9A, 0x47, 0x00, - 0xCB, 0x50, 0x74, 0x30, 0x8C, 0x9E, 0x47, 0x00, - 0xCB, 0x10, 0xA8, 0x92, 0x60, 0xA2, 0x47, 0x00, - 0xCB, 0x72, 0x74, 0x52, 0x8C, 0xA6, 0x47, 0x00, - 0xCB, 0x32, 0xA8, 0x12, 0xD0, 0xAA, 0x47, 0x00, - 0xCB, 0x94, 0x74, 0x74, 0x8C, 0xAE, 0x47, 0x00, - 0xCB, 0x54, 0xA8, 0x34, 0xD0, 0xB2, 0x47, 0x00, - 0xCB, 0x14, 0xE8, 0x96, 0x80, 0xB6, 0x47, 0x00, - 0xCB, 0x76, 0xA8, 0x56, 0xC0, 0xBA, 0x47, 0x00, - 0xCB, 0x36, 0xE8, 0x16, 0x18, 0xBF, 0x47, 0x00, - 0xCB, 0x98, 0xA0, 0x78, 0xD0, 0xC2, 0x47, 0x00, - 0xCB, 0x38, 0x18, 0x9B, 0xC0, 0xC6, 0x47, 0x00, - 0xCB, 0x5A, 0x18, 0x1B, 0xA0, 0xCB, 0x47, 0x00, - 0x06, 0x02, 0x43, 0x04, 0xCB, 0x06, 0x00, 0x00, - 0x00, 0x02, 0x46, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0xAB, 0x0E, 0x00, 0x20, - 0xE0, 0x14, 0x00, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x12, 0x46, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x16, 0x46, 0x01, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x2E, 0x46, 0x01, 0xAB, 0x02, 0x00, 0xA0, - 0xE0, 0x14, 0x00, 0x00, 0x2A, 0x01, 0x46, 0x22, - 0x8B, 0x05, 0x89, 0x80, 0x8C, 0x51, 0x00, 0x00, - 0x6A, 0x01, 0x1A, 0xA3, 0x0F, 0x99, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0xCB, 0x20, 0x00, 0x00, - 0x00, 0x02, 0x40, 0x01, 0x0E, 0x03, 0x01, 0x00, - 0x06, 0x20, 0xBD, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x90, 0x39, 0x03, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xDA, 0x47, 0x00, 0xAB, 0x00, 0x00, 0x60, - 0x1F, 0x05, 0x00, 0x00, 0xCB, 0x00, 0x00, 0x02, - 0x00, 0xAA, 0x46, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xD6, 0x47, 0x00, 0x0F, 0x99, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0xDD, 0x44, 0x2A, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0x2B, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x46, 0x04, 0x34, 0x04, - 0xAB, 0x00, 0x00, 0x00, 0x0B, 0x03, 0x00, 0x00, - 0x0E, 0x1F, 0x00, 0x00, 0x0A, 0x7A, 0x1C, 0xA3, - 0x6A, 0x25, 0x31, 0xA2, 0x6A, 0x0F, 0x32, 0xA2, - 0x8B, 0xCD, 0x86, 0x80, 0x1A, 0x51, 0x00, 0x00, - 0x8B, 0x55, 0x8D, 0x80, 0x1B, 0x51, 0x00, 0x00, - 0x8B, 0x6D, 0x8F, 0x82, 0x1C, 0x51, 0x00, 0x00, - 0x8B, 0x65, 0x8F, 0x82, 0x1D, 0x51, 0x00, 0x00, - 0x8B, 0x55, 0x8F, 0x82, 0x1E, 0x51, 0x00, 0x00, - 0x8B, 0x5D, 0x8F, 0x82, 0x1F, 0x51, 0x00, 0x00, - 0x2A, 0x3F, 0xE8, 0x23, 0x97, 0x8F, 0x8F, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0xC3, 0x3E, 0x04, 0x2A, 0x1D, 0x34, 0x22, - 0x97, 0x0F, 0x87, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x42, 0x3D, 0x04, 0x0E, 0x17, 0x08, 0x00, - 0x0A, 0x0D, 0xF6, 0x28, 0x2A, 0x03, 0x18, 0xA2, - 0xF6, 0x15, 0x04, 0x40, 0x96, 0x11, 0xFF, 0xFF, - 0x9A, 0x08, 0x08, 0x00, 0x76, 0x1C, 0x00, 0x08, - 0x1B, 0x06, 0x06, 0x00, 0x00, 0x00, 0x00, 0x01, - 0xCB, 0x28, 0x01, 0x00, 0x00, 0x42, 0x44, 0x01, - 0x6A, 0x07, 0x22, 0xA2, 0x6A, 0x0B, 0x24, 0xA2, - 0x8B, 0x65, 0x88, 0x82, 0x15, 0x51, 0x00, 0x00, - 0xCB, 0x02, 0x01, 0x00, 0x00, 0x4E, 0x44, 0x01, - 0x01, 0x00, 0x01, 0x00, 0x6A, 0x25, 0x29, 0xA2, - 0x6A, 0x0F, 0x28, 0xA2, 0x8B, 0xCD, 0x86, 0x80, - 0x14, 0x51, 0x00, 0x00, 0x8B, 0x55, 0x8D, 0x80, - 0x14, 0x51, 0x00, 0x00, 0x8B, 0x6D, 0x8F, 0x82, - 0x14, 0x51, 0x00, 0x00, 0x8B, 0x65, 0x8F, 0x82, - 0x14, 0x51, 0x00, 0x00, 0x8B, 0x55, 0x8F, 0x82, - 0x14, 0x51, 0x00, 0x00, 0x8B, 0x5D, 0x8F, 0x82, - 0x14, 0x51, 0x00, 0x00, 0x2A, 0x07, 0x26, 0xA2, - 0x96, 0x33, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0x63, 0x3B, 0x04, 0x1A, 0x0C, 0x00, 0x14, - 0x7A, 0x10, 0x0C, 0x08, 0x01, 0x00, 0x01, 0x00, - 0x26, 0x83, 0x3C, 0x04, 0x3A, 0x0C, 0x10, 0x04, - 0x4A, 0x1E, 0xF6, 0x28, 0x4A, 0x1E, 0xF8, 0x28, - 0x4E, 0x14, 0x00, 0x00, 0x6A, 0x0B, 0x14, 0xA2, - 0xCB, 0x02, 0x00, 0x00, 0x7E, 0x2F, 0x44, 0x01, - 0x2A, 0x1D, 0x34, 0x22, 0x97, 0x0F, 0x07, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0xC2, 0x3E, 0x04, 0xF6, 0x75, 0x38, 0x04, - 0x97, 0x0F, 0x07, 0x00, 0x80, 0xFF, 0x7F, 0x00, - 0xF6, 0xFD, 0x7C, 0x40, 0x6A, 0x3F, 0x14, 0xA2, - 0xCB, 0x02, 0x00, 0x00, 0x88, 0x2E, 0x44, 0x01, - 0x2A, 0x3F, 0xE8, 0x23, 0x9A, 0x7C, 0x7C, 0x00, - 0x6A, 0x3F, 0xE8, 0x23, 0x2A, 0x0D, 0x32, 0x22, - 0x7B, 0x0C, 0x0C, 0xC0, 0x4F, 0x2C, 0x00, 0x00, - 0xA6, 0x22, 0x40, 0x04, 0xCB, 0x04, 0x40, 0x00, - 0x00, 0x92, 0x44, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0x40, 0x04, 0xCB, 0x02, 0x80, 0x00, - 0x00, 0x92, 0x44, 0x01, 0xAB, 0x00, 0x02, 0x20, - 0x60, 0x14, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0xAB, 0x00, 0x06, 0x20, - 0xE0, 0x14, 0x00, 0x00, 0x2A, 0x1B, 0x8C, 0xA3, - 0xF6, 0x6D, 0x34, 0x34, 0x96, 0xDD, 0x10, 0x00, - 0x17, 0x07, 0x49, 0x00, 0x08, 0x00, 0x00, 0x00, - 0x0A, 0xFC, 0x19, 0x2A, 0x76, 0xFC, 0x7C, 0x14, - 0x36, 0x0E, 0x0E, 0x1F, 0x36, 0x92, 0x0E, 0x0D, - 0x4F, 0x24, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0F, 0x37, 0xC3, 0x07, 0x00, 0x00, 0x01, 0x00, - 0x06, 0x10, 0x9A, 0x04, 0x6A, 0x25, 0x11, 0xA2, - 0x2A, 0x3F, 0x0E, 0x22, 0xB7, 0x8F, 0x0F, 0x01, - 0x00, 0x00, 0x00, 0x00, 0x6A, 0x3F, 0x0E, 0x22, - 0xA6, 0x83, 0x0D, 0x6C, 0xF6, 0x05, 0x48, 0x42, - 0x7A, 0x06, 0x09, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0xA3, 0x51, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x60, 0x5A, 0x04, 0xCB, 0x02, 0x00, 0x00, - 0x00, 0xD2, 0x47, 0x00, 0x2A, 0x15, 0x54, 0x23, - 0x5B, 0x3E, 0x14, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x46, 0xA3, 0x45, 0x04, 0x8B, 0x4D, 0x8D, 0x80, - 0xAA, 0x11, 0x00, 0x00, 0x2A, 0x17, 0x90, 0x21, - 0x97, 0x85, 0x85, 0x0F, 0x00, 0x00, 0x00, 0x00, - 0x5B, 0x3E, 0x16, 0x3E, 0x00, 0x00, 0x00, 0x00, - 0x46, 0xE3, 0x46, 0x04, 0xCB, 0x7E, 0x14, 0xA0, - 0x28, 0x2E, 0x44, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x22, 0x47, 0x04, 0xCB, 0x6E, 0x14, 0xA0, - 0x28, 0x2E, 0x44, 0x00, 0x0F, 0x99, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0A, 0xCC, 0x00, 0x28, - 0x0A, 0xDC, 0xD8, 0x28, 0x2A, 0x15, 0x18, 0x22, - 0x2A, 0x17, 0x1A, 0x22, 0x5B, 0x3E, 0x18, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0x43, 0x51, 0x04, 0x5B, 0x3E, 0x1A, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x42, 0x51, 0x04, 0x2A, 0x3D, 0x54, 0x23, - 0x7B, 0x3E, 0x3C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0xE2, 0x49, 0x04, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xD6, 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0x4B, 0x04, 0x2A, 0x3D, 0xEA, 0x23, - 0x9A, 0x78, 0x78, 0x00, 0x6A, 0x3D, 0xEA, 0x23, - 0x7B, 0x3E, 0x3C, 0x3C, 0x00, 0x00, 0x00, 0x00, - 0xE6, 0xA2, 0x4B, 0x04, 0x2A, 0x3D, 0x14, 0x23, - 0x9A, 0x78, 0x78, 0x00, 0x6A, 0x3D, 0x14, 0x23, - 0xCB, 0x10, 0x00, 0x00, 0x00, 0x02, 0x40, 0x01, - 0x0F, 0x37, 0xC1, 0x05, 0x00, 0x00, 0x01, 0x00, - 0x06, 0x62, 0x2E, 0x04, 0x2A, 0x1D, 0x34, 0x22, - 0x97, 0x0F, 0x07, 0x40, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x42, 0x51, 0x04, 0xF6, 0x1D, 0x28, 0x50, - 0x96, 0x33, 0x3F, 0x00, 0x76, 0x34, 0x0C, 0x14, - 0x1B, 0xAE, 0x06, 0x60, 0x29, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x0A, 0x35, - 0x00, 0x02, 0x5B, 0x3E, 0x06, 0x1E, 0x00, 0x00, - 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x26, 0x23, 0x4F, 0x04, 0xF6, 0x1D, 0x2C, 0x40, - 0x96, 0x33, 0x03, 0x00, 0x5B, 0x3E, 0x06, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0x23, 0x50, 0x04, 0x97, 0x01, 0x49, 0x08, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0x23, 0x50, 0x04, 0xF6, 0x75, 0x38, 0x04, - 0x97, 0x0F, 0x07, 0x00, 0x80, 0xFF, 0x7F, 0x00, - 0xF6, 0xFD, 0x7C, 0x40, 0x6A, 0x3F, 0x14, 0xA2, - 0xCB, 0x02, 0x00, 0x00, 0x88, 0x2E, 0x44, 0x01, - 0x06, 0x42, 0x51, 0x04, 0xF6, 0x6D, 0x38, 0x44, - 0x2A, 0x07, 0xEC, 0x23, 0x7A, 0x7C, 0x34, 0x0C, - 0x26, 0x03, 0x51, 0x04, 0x6A, 0x3F, 0x14, 0xA2, - 0xCB, 0x02, 0x00, 0x00, 0x88, 0x2E, 0x44, 0x01, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0xDA, 0x47, 0x00, - 0xA6, 0x63, 0x2E, 0x34, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x7A, 0x06, 0x02, 0x00, - 0x46, 0x63, 0x52, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xD0, 0x38, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x7A, 0x06, 0x03, 0x00, - 0x46, 0x63, 0x53, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x90, 0x7D, 0x03, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0x63, 0x2E, 0x34, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x7A, 0x06, 0x04, 0x00, - 0x46, 0x63, 0x54, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE0, 0xBD, 0x04, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0x63, 0x2E, 0x34, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x7A, 0x06, 0x05, 0x00, - 0x46, 0x23, 0x55, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xD0, 0x94, 0x03, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x7A, 0x06, 0x06, 0x00, - 0x46, 0xE3, 0x55, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x50, 0x98, 0x03, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x7A, 0x06, 0x07, 0x00, - 0x46, 0xA3, 0x56, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x50, 0x9A, 0x03, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x7A, 0x06, 0x08, 0x00, - 0x46, 0xA3, 0x57, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xD0, 0x9B, 0x03, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0x63, 0x2E, 0x34, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x7A, 0x06, 0x00, 0x00, - 0x46, 0x63, 0x58, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x60, 0x63, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x7A, 0x06, 0x01, 0x00, - 0x46, 0x03, 0x43, 0x04, 0x2A, 0x0D, 0x32, 0x22, - 0x7B, 0x0C, 0x0C, 0xC0, 0x4F, 0x2C, 0x00, 0x00, - 0xA6, 0xA2, 0x59, 0x04, 0xCB, 0x04, 0x40, 0x00, - 0x00, 0x92, 0x44, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0x59, 0x04, 0xCB, 0x02, 0x80, 0x00, - 0x00, 0x92, 0x44, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x90, 0x79, 0x03, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x43, 0x04, 0x0A, 0x0A, 0x10, 0xA0, - 0x4A, 0x04, 0x76, 0x28, 0xAB, 0x00, 0x00, 0xE0, - 0x80, 0x14, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x10, 0x85, 0x02, 0x0A, 0x0D, 0x08, 0x29, - 0x0A, 0x1D, 0x06, 0x29, 0x5A, 0x0A, 0x00, 0x00, - 0x46, 0x23, 0x5C, 0x04, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x16, 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x82, 0x5C, 0x04, 0x2A, 0x05, 0x8A, 0x23, - 0x9A, 0x08, 0x08, 0x00, 0x6A, 0x05, 0x8A, 0x23, - 0x5A, 0x0A, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0xA2, 0x5D, 0x04, 0xAB, 0x06, 0x00, 0x20, - 0x60, 0x14, 0x00, 0x00, 0xCB, 0x3E, 0xFE, 0xFF, - 0xFF, 0x93, 0x44, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0x5F, 0x04, 0x2A, 0x0D, 0x32, 0x22, - 0x7B, 0x0C, 0x0C, 0xC0, 0x4F, 0x2C, 0x00, 0x00, - 0xA6, 0xA2, 0x5E, 0x04, 0xCB, 0x04, 0x40, 0x00, - 0x00, 0x92, 0x44, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0x5E, 0x04, 0xCB, 0x02, 0x80, 0x00, - 0x00, 0x92, 0x44, 0x01, 0x2A, 0x3F, 0x8A, 0x23, - 0x0F, 0x3B, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7A, 0x7C, 0x7C, 0x74, 0x01, 0x00, 0x01, 0x00, - 0x26, 0xE3, 0x5F, 0x04, 0xAB, 0x00, 0x02, 0x20, - 0x60, 0x14, 0x00, 0x00, 0x5A, 0x2A, 0x00, 0x00, - 0x46, 0x63, 0x60, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0xB1, 0x03, 0x0A, 0x0D, 0x00, 0x28, - 0x5A, 0x06, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x62, 0xBB, 0x03, 0x5A, 0x06, 0x01, 0x00, - 0x46, 0x23, 0xB0, 0x03, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x90, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, - 0xE6, 0x23, 0x62, 0x4C, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xD0, 0x76, 0x01, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0x62, 0x04, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0x91, 0x0B, 0x3B, 0x01, 0x00, 0x01, 0x00, - 0x66, 0xD1, 0x76, 0x39, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0xE1, 0xC1, 0x3C, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0xA3, 0xAA, 0x1B, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x22, 0xA9, 0x03, 0x2A, 0x01, 0x0E, 0x22, - 0x96, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x72, 0x79, 0x03, 0x2A, 0x01, 0x58, 0x22, - 0x17, 0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x00, - 0x46, 0xA3, 0x64, 0x04, 0xAB, 0x02, 0x00, 0x20, - 0x43, 0x05, 0x00, 0x00, 0x2A, 0x0D, 0x0E, 0x22, - 0x17, 0x03, 0x03, 0x00, 0x00, 0x00, 0x78, 0x00, - 0x7B, 0x3E, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x66, 0x62, 0x66, 0x04, 0x7B, 0x3E, 0x0C, 0x00, - 0x00, 0x00, 0x20, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x62, 0x67, 0x04, 0x7B, 0x3E, 0x0C, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x62, 0x6A, 0x04, 0x0F, 0x2F, 0x03, 0x51, - 0x04, 0x00, 0x00, 0x00, 0xCB, 0x4A, 0x00, 0x00, - 0x00, 0x96, 0x44, 0x00, 0xCB, 0x7E, 0xB1, 0xE4, - 0x17, 0x9B, 0x44, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0x6B, 0x04, 0x0F, 0x2F, 0x03, 0x71, - 0x04, 0x00, 0x00, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x96, 0x44, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0x9A, 0x44, 0x00, 0x2A, 0x0D, 0x32, 0x22, - 0x7B, 0x0E, 0x0C, 0xA0, 0xC4, 0x05, 0x00, 0x00, - 0x66, 0x62, 0x69, 0x04, 0x7B, 0x0E, 0x0C, 0xC0, - 0x43, 0x06, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x62, 0x69, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0x6B, 0x04, 0x0F, 0x2F, 0x03, 0x91, - 0x00, 0x00, 0x00, 0x00, 0xCB, 0x4A, 0x00, 0x00, - 0x00, 0x96, 0x44, 0x00, 0xCB, 0x7E, 0xB1, 0xE4, - 0x17, 0x9B, 0x44, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0x6B, 0x04, 0x0F, 0x2F, 0x03, 0x91, - 0x04, 0x00, 0x00, 0x00, 0xCB, 0x4A, 0x00, 0x00, - 0x00, 0x96, 0x44, 0x00, 0xCB, 0x7E, 0xB1, 0xE4, - 0x17, 0x9B, 0x44, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0x6B, 0x04, 0x0F, 0x31, 0x01, 0x00, - 0x01, 0x00, 0x00, 0x00, 0x0F, 0x31, 0x01, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0x31, 0x1F, 0x0E, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0x31, 0x1F, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x8B, 0x2D, 0x89, 0x80, - 0x82, 0x51, 0x00, 0x00, 0x8B, 0x35, 0x89, 0x80, - 0x83, 0x51, 0x00, 0x00, 0xCB, 0x04, 0x40, 0x00, - 0x00, 0x92, 0x44, 0x01, 0x2A, 0x0D, 0x66, 0x22, - 0x7B, 0x0C, 0x0C, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x46, 0x23, 0x77, 0x03, 0xCB, 0x86, 0x44, 0x22, - 0x2C, 0xCE, 0x44, 0x00, 0xCB, 0x46, 0x44, 0xAC, - 0x01, 0xD2, 0x44, 0x00, 0xCB, 0x22, 0x00, 0x7C, - 0x00, 0xD6, 0x44, 0x00, 0xCB, 0x86, 0x04, 0x44, - 0xB4, 0xDA, 0x44, 0x00, 0xCB, 0x86, 0x10, 0x44, - 0xBC, 0xDE, 0x44, 0x00, 0xCB, 0x86, 0x20, 0x44, - 0xC0, 0xE2, 0x44, 0x00, 0xCB, 0x86, 0x28, 0x44, - 0xC4, 0xE6, 0x44, 0x00, 0xCB, 0x86, 0x38, 0x44, - 0xC8, 0xEA, 0x44, 0x00, 0xCB, 0x86, 0x40, 0x44, - 0xD0, 0xEE, 0x44, 0x00, 0xCB, 0x86, 0x44, 0x44, - 0xD8, 0xF2, 0x44, 0x00, 0xCB, 0x86, 0x50, 0x44, - 0xE0, 0xF6, 0x44, 0x00, 0xCB, 0x86, 0x58, 0x22, - 0x54, 0xFA, 0x44, 0x00, 0xCB, 0x86, 0x68, 0x22, - 0x60, 0xFE, 0x44, 0x00, 0xCB, 0x86, 0x74, 0x22, - 0x68, 0x02, 0x45, 0x00, 0xCB, 0x86, 0x7C, 0x22, - 0x70, 0x06, 0x45, 0x00, 0xCB, 0x86, 0x84, 0x22, - 0x78, 0x0A, 0x45, 0x00, 0xCB, 0x86, 0x8C, 0x22, - 0x7C, 0x0E, 0x45, 0x00, 0xCB, 0x86, 0x98, 0x22, - 0x80, 0x12, 0x45, 0x00, 0xCB, 0x86, 0xA8, 0x22, - 0x88, 0x16, 0x45, 0x00, 0xCB, 0x86, 0xB4, 0x22, - 0x90, 0x1A, 0x45, 0x00, 0xCB, 0x86, 0xBC, 0x22, - 0x94, 0x1E, 0x45, 0x00, 0xCB, 0x86, 0xC0, 0x22, - 0xA0, 0x22, 0x45, 0x00, 0xCB, 0x86, 0xC8, 0x22, - 0xA8, 0x26, 0x45, 0x00, 0xCB, 0x44, 0x48, 0x22, - 0xB4, 0x2A, 0x45, 0x00, 0xCB, 0x44, 0x50, 0x22, - 0xBC, 0x2E, 0x45, 0x00, 0xCB, 0x44, 0x64, 0x22, - 0xC0, 0x32, 0x45, 0x00, 0xCB, 0x44, 0x6C, 0x22, - 0xC4, 0x36, 0x45, 0x00, 0xCB, 0x44, 0x74, 0x22, - 0xCC, 0x3A, 0x45, 0x00, 0xCB, 0x44, 0x7C, 0x22, - 0xD4, 0x3E, 0x45, 0x00, 0xCB, 0x44, 0x84, 0x22, - 0xDC, 0x42, 0x45, 0x00, 0xCB, 0x44, 0x8C, 0x22, - 0xE4, 0x46, 0x45, 0x00, 0xCB, 0x44, 0x90, 0x22, - 0xEC, 0x4A, 0x45, 0x00, 0xCB, 0x44, 0xA0, 0x22, - 0xF4, 0x4E, 0x45, 0x00, 0xCB, 0x44, 0xA8, 0x22, - 0xFC, 0x52, 0x45, 0x00, 0xCB, 0x44, 0xAC, 0x22, - 0xFE, 0x56, 0x45, 0x00, 0xCB, 0x86, 0x58, 0x22, - 0x54, 0x5A, 0x45, 0x00, 0xCB, 0x86, 0x68, 0x22, - 0x60, 0x5E, 0x45, 0x00, 0xCB, 0x86, 0x74, 0x22, - 0x68, 0x62, 0x45, 0x00, 0xCB, 0x86, 0x7C, 0x22, - 0x70, 0x66, 0x45, 0x00, 0xCB, 0x86, 0x84, 0x22, - 0x78, 0x6A, 0x45, 0x00, 0xCB, 0x86, 0x58, 0x44, - 0xE8, 0x6E, 0x45, 0x00, 0xCB, 0x86, 0x68, 0x44, - 0xF0, 0x72, 0x45, 0x00, 0xCB, 0x86, 0x74, 0x44, - 0xF4, 0x76, 0x45, 0x00, 0xCB, 0x86, 0x7C, 0x44, - 0xFC, 0x7A, 0x45, 0x00, 0xCB, 0x86, 0x84, 0x44, - 0xFE, 0x7E, 0x45, 0x00, 0xCB, 0x44, 0x48, 0x22, - 0xB4, 0x82, 0x45, 0x00, 0xCB, 0x44, 0x50, 0x22, - 0xBC, 0x86, 0x45, 0x00, 0xCB, 0x44, 0x64, 0x22, - 0xC0, 0x8A, 0x45, 0x00, 0xCB, 0x44, 0x6C, 0x22, - 0xC4, 0x8E, 0x45, 0x00, 0xCB, 0x44, 0x74, 0x22, - 0xCC, 0x92, 0x45, 0x00, 0xCB, 0x86, 0xD0, 0x22, - 0xB4, 0x96, 0x45, 0x00, 0xCB, 0x86, 0xD8, 0x22, - 0xBC, 0x9A, 0x45, 0x00, 0xCB, 0x86, 0xE4, 0x22, - 0xC0, 0x9E, 0x45, 0x00, 0xCB, 0x86, 0xEC, 0x22, - 0xC4, 0xA2, 0x45, 0x00, 0xCB, 0x86, 0xF4, 0x22, - 0xCC, 0xA6, 0x45, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x22, 0x77, 0x03, 0x0A, 0x08, 0x7A, 0xA7, - 0x17, 0x00, 0x80, 0x0F, 0x00, 0x00, 0x00, 0x00, - 0x0E, 0x07, 0x00, 0x00, 0x0A, 0xF8, 0x7E, 0xA3, - 0x7A, 0x38, 0x00, 0x04, 0x76, 0x78, 0x78, 0x70, - 0x97, 0x87, 0x07, 0x00, 0x80, 0x00, 0x00, 0x00, - 0x46, 0x53, 0x97, 0x04, 0x2A, 0x15, 0x18, 0xA2, - 0xF6, 0x5D, 0x28, 0x40, 0x9A, 0x2C, 0x2C, 0x00, - 0x96, 0xAA, 0xFF, 0xFF, 0x76, 0x74, 0x04, 0x0C, - 0x3A, 0x38, 0x30, 0x38, 0x7A, 0x3C, 0x38, 0x2C, - 0x26, 0x03, 0x7E, 0x04, 0x3A, 0x38, 0x3C, 0x28, - 0x76, 0x74, 0x38, 0x08, 0x1B, 0x1C, 0x1C, 0x00, - 0x00, 0x00, 0x00, 0x01, 0xCB, 0x20, 0x01, 0x00, - 0x00, 0x42, 0x44, 0x01, 0x6A, 0x1D, 0x22, 0xA2, - 0xCB, 0x10, 0x00, 0x00, 0x00, 0x4A, 0x44, 0x01, - 0x8B, 0x65, 0x88, 0x82, 0x15, 0x51, 0x00, 0x00, - 0xCB, 0x02, 0x01, 0x00, 0x00, 0x4E, 0x44, 0x01, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x2A, 0x1F, - 0x26, 0xA2, 0x96, 0xFF, 0x80, 0x00, 0x01, 0x00, - 0x46, 0xB3, 0x80, 0x04, 0x8B, 0xA5, 0x88, 0x82, - 0xCB, 0x11, 0x00, 0x00, 0x8B, 0xA5, 0x88, 0x82, - 0xCC, 0x11, 0x00, 0x00, 0x8B, 0xA5, 0x88, 0x82, - 0xCD, 0x11, 0x00, 0x00, 0x8B, 0xA5, 0x88, 0x82, - 0xCE, 0x11, 0x00, 0x00, 0x8B, 0xA5, 0x88, 0x82, - 0xCF, 0x11, 0x00, 0x00, 0x8B, 0xA5, 0x88, 0x82, - 0xD0, 0x11, 0x00, 0x00, 0x8B, 0xA5, 0x88, 0x82, - 0xD1, 0x11, 0x00, 0x00, 0x8B, 0xA5, 0x88, 0x82, - 0xD2, 0x11, 0x00, 0x00, 0x0F, 0x07, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7B, 0x1E, 0x06, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x86, 0x52, 0x97, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x10, 0x98, 0x04, 0x7B, 0x1E, 0x08, 0xFE, - 0x01, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x52, 0x97, 0x04, 0x7B, 0x1E, 0x08, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x52, 0x97, 0x04, 0x96, 0x45, 0xE0, 0x00, - 0x96, 0x46, 0x1F, 0x00, 0x7B, 0x1E, 0x0C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x52, 0x97, 0x04, 0x7B, 0x1E, 0x0C, 0x3A, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0x52, 0x97, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x10, 0x98, 0x04, 0x96, 0x4F, 0x1F, 0x00, - 0x36, 0x05, 0x05, 0x0F, 0x7B, 0x1E, 0x0A, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0xE2, 0x87, 0x04, 0x3A, 0x0C, 0x0C, 0x18, - 0xBA, 0x0C, 0x0C, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0x83, 0x04, 0x3A, 0x18, 0x18, 0x0C, - 0x7A, 0xDA, 0x01, 0x00, 0x7B, 0x1E, 0x06, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x86, 0x52, 0x97, 0x04, 0x7A, 0x3C, 0x0C, 0x18, - 0x26, 0x23, 0x89, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0x83, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x10, 0x98, 0x04, 0x96, 0x4A, 0xFC, 0x00, - 0xF6, 0x55, 0x28, 0x08, 0x96, 0x4B, 0x03, 0x00, - 0x76, 0x5C, 0x2C, 0x20, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x10, 0x98, 0x04, 0x36, 0x0B, 0x0B, 0x04, - 0x06, 0x10, 0x98, 0x04, 0x0E, 0x15, 0x10, 0x00, - 0x96, 0x5F, 0x80, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x42, 0x8B, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x10, 0x98, 0x04, 0x0E, 0x25, 0x10, 0x00, - 0x2A, 0x1F, 0x18, 0x22, 0x97, 0x87, 0x07, 0x00, - 0x00, 0xF8, 0x01, 0x00, 0xF6, 0x7D, 0x3C, 0x50, - 0x7A, 0x3C, 0x3C, 0x28, 0x01, 0x00, 0x01, 0x00, - 0x46, 0x23, 0x88, 0x04, 0x96, 0x5F, 0x80, 0x00, - 0x66, 0xE2, 0x92, 0x04, 0x0E, 0x2B, 0x01, 0x00, - 0x96, 0x51, 0x1C, 0x00, 0xF6, 0x0D, 0x04, 0x08, - 0x96, 0x54, 0x03, 0x00, 0x76, 0x24, 0x10, 0x20, - 0x36, 0x04, 0x04, 0x09, 0x7A, 0x2A, 0x00, 0x00, - 0x66, 0x62, 0x8F, 0x04, 0x7A, 0x2A, 0x01, 0x00, - 0x66, 0xE2, 0x8F, 0x04, 0x7A, 0x2A, 0x02, 0x00, - 0x66, 0x62, 0x90, 0x04, 0x7A, 0x2A, 0x03, 0x00, - 0x66, 0x62, 0x90, 0x04, 0x7A, 0x2A, 0x04, 0x00, - 0x66, 0x62, 0x91, 0x04, 0x7A, 0x2A, 0x05, 0x00, - 0x66, 0xE2, 0x91, 0x04, 0x7A, 0x2A, 0x06, 0x00, - 0x66, 0x62, 0x92, 0x04, 0x3F, 0x0E, 0x10, 0x3C, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0x92, 0x04, 0x3F, 0x0E, 0x10, 0x30, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0x92, 0x04, 0x3F, 0x0E, 0x10, 0x20, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0x92, 0x04, 0x3F, 0x0E, 0x10, 0x18, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0x92, 0x04, 0x3F, 0x0E, 0x10, 0x10, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0x92, 0x04, 0x3F, 0x0E, 0x10, 0x6C, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0x92, 0x04, 0x3F, 0x0E, 0x10, 0x54, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0x92, 0x04, 0x3F, 0x0E, 0x10, 0x48, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x42, 0x95, 0x04, 0x0E, 0x2B, 0x00, 0x00, - 0x96, 0x50, 0x3E, 0x00, 0x96, 0x52, 0x01, 0x00, - 0x76, 0x14, 0x08, 0x10, 0xF6, 0x05, 0x00, 0x04, - 0x1B, 0xAE, 0x00, 0xA6, 0x23, 0x00, 0x00, 0x00, - 0x1B, 0xB0, 0x00, 0xA6, 0x27, 0x00, 0x00, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x2A, 0x1C, 0x20, 0x03, - 0xF6, 0x71, 0x70, 0x10, 0x96, 0xE4, 0x80, 0xFF, - 0xF6, 0x25, 0x10, 0x1C, 0x96, 0xE1, 0x70, 0x00, - 0xF6, 0x0D, 0x04, 0x10, 0x96, 0xE3, 0x0F, 0x00, - 0x76, 0x04, 0x10, 0x28, 0x36, 0x00, 0x00, 0x0B, - 0x76, 0x14, 0x28, 0x2C, 0x76, 0x74, 0x04, 0x20, - 0x36, 0x02, 0x02, 0x0E, 0x36, 0x02, 0x02, 0x03, - 0x2A, 0x1D, 0x18, 0x22, 0x2A, 0x1F, 0x1A, 0x22, - 0x36, 0x0E, 0x0E, 0x00, 0x36, 0x0F, 0x0F, 0x02, - 0x6A, 0x1D, 0x18, 0x22, 0x6A, 0x1F, 0x1A, 0x22, - 0x37, 0x49, 0x49, 0x00, 0x08, 0x00, 0x00, 0x00, - 0xCB, 0x00, 0x00, 0x00, 0x00, 0xCE, 0x47, 0x00, - 0x05, 0x04, 0x9A, 0x04, 0x04, 0x00, 0x7A, 0x40, - 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x26, 0x23, 0x7C, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x05, 0x04, 0xF6, 0x75, 0x0C, 0x08, 0x1B, 0xAE, - 0x1C, 0x96, 0x23, 0x00, 0x00, 0x00, 0x1B, 0xB0, - 0x1C, 0x96, 0x27, 0x00, 0x00, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x2A, 0x1C, 0x20, 0x03, 0x96, 0x3F, - 0x03, 0x00, 0x76, 0x7C, 0x3C, 0x0C, 0xF6, 0x21, - 0x70, 0x78, 0x96, 0x44, 0xFF, 0x00, 0x9A, 0x0C, - 0x0C, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x05, 0x04, 0xCB, 0x40, 0x00, 0x00, 0x00, 0x06, - 0x44, 0x01, 0x2A, 0x01, 0x04, 0xA2, 0x17, 0x00, - 0x00, 0x00, 0x00, 0x78, 0x00, 0x00, 0x01, 0x00, - 0x66, 0xE2, 0x84, 0x02, 0x2A, 0x01, 0x00, 0xA2, - 0x01, 0x00, 0x97, 0x00, 0x00, 0x00, 0x00, 0x80, - 0x7F, 0x00, 0x7B, 0x02, 0x02, 0x00, 0x00, 0x00, - 0x8E, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0xE3, 0x84, 0x02, 0x96, 0x01, 0x00, 0xF8, - 0x96, 0x02, 0xFF, 0x07, 0x97, 0x01, 0x00, 0x00, - 0x00, 0x38, 0x00, 0x00, 0x17, 0x02, 0x00, 0x00, - 0x00, 0x04, 0x00, 0x00, 0x97, 0x02, 0x00, 0x00, - 0x80, 0x03, 0x00, 0x00, 0xF6, 0x1D, 0x0C, 0x50, - 0xF6, 0x25, 0x10, 0x4C, 0xF6, 0x2D, 0x14, 0x40, - 0x0F, 0x0D, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x7A, 0x3E, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x62, 0x9E, 0x04, 0x7A, 0x3E, 0x00, 0x98, - 0x66, 0x92, 0x9F, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0x03, 0x02, 0x7A, 0x5E, 0x0C, 0x00, - 0x66, 0xE2, 0x9E, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0x03, 0x02, 0x2A, 0x0F, 0x00, 0xA2, - 0x4A, 0x3C, 0xD8, 0x28, 0x4A, 0x3D, 0xEA, 0x28, - 0xCB, 0x02, 0x00, 0x00, 0x00, 0xCE, 0x47, 0x00, - 0x05, 0x04, 0x7A, 0x5E, 0x00, 0x00, 0x01, 0x00, - 0x66, 0x62, 0xA0, 0x04, 0x7A, 0x5E, 0x01, 0x00, - 0x66, 0x92, 0xA2, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0x83, 0x02, 0x2A, 0x0F, 0x00, 0xA2, - 0x2A, 0x11, 0x00, 0xA2, 0x97, 0x83, 0x03, 0x00, - 0x00, 0xF8, 0x07, 0x00, 0x17, 0x04, 0x04, 0x00, - 0x80, 0x3F, 0x00, 0x00, 0x6A, 0x0F, 0x18, 0x22, - 0x6A, 0x11, 0x1A, 0x22, 0x8B, 0x05, 0x88, 0x82, - 0x0E, 0x11, 0x00, 0x00, 0x8B, 0x05, 0x88, 0x82, - 0x0F, 0x11, 0x00, 0x00, 0x8B, 0x05, 0x88, 0x82, - 0x10, 0x11, 0x00, 0x00, 0x8B, 0x05, 0x88, 0x82, - 0x11, 0x11, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x05, 0x04, 0x8B, 0x05, 0x88, 0x82, 0x12, 0x11, - 0x00, 0x00, 0x8B, 0x05, 0x88, 0x82, 0x13, 0x11, - 0x00, 0x00, 0x8B, 0x05, 0x88, 0x82, 0x14, 0x11, - 0x00, 0x00, 0x8B, 0x05, 0x88, 0x82, 0x15, 0x11, - 0x00, 0x00, 0x8B, 0x05, 0x88, 0x82, 0x16, 0x11, - 0x00, 0x00, 0x8B, 0x05, 0x88, 0x82, 0x17, 0x11, - 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x6A, 0x00, 0x04, 0x03, 0x6A, 0x02, 0x04, 0x03, - 0x6A, 0x04, 0x04, 0x03, 0x6A, 0x06, 0x04, 0x03, - 0x6A, 0x08, 0x04, 0x03, 0x6A, 0x0A, 0x04, 0x03, - 0x6A, 0x0C, 0x04, 0x03, 0x6A, 0x0E, 0x04, 0x03, - 0x6A, 0x10, 0x04, 0x03, 0x6A, 0x12, 0x04, 0x03, - 0x6A, 0x14, 0x04, 0x03, 0x6A, 0x16, 0x04, 0x03, - 0x6A, 0x18, 0x04, 0x03, 0x6A, 0x1A, 0x04, 0x03, - 0x6A, 0x1C, 0x04, 0x03, 0x6A, 0x1E, 0x04, 0x03, - 0x6A, 0x20, 0x04, 0x03, 0x6A, 0x98, 0x04, 0x03, - 0x6A, 0xAE, 0x04, 0x03, 0x6A, 0xB0, 0x04, 0x03, - 0x6A, 0xB2, 0x04, 0x03, 0x6A, 0xB4, 0x04, 0x03, - 0x6A, 0xE4, 0x04, 0x03, 0x6A, 0xE6, 0x04, 0x03, - 0x6A, 0xE8, 0x04, 0x03, 0x6A, 0xEA, 0x04, 0x03, - 0x0A, 0x0C, 0x3E, 0x2A, 0x96, 0x01, 0x01, 0x00, - 0x66, 0xE2, 0x59, 0x00, 0x2A, 0x01, 0x5A, 0x23, - 0x96, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0xE3, 0x59, 0x00, 0x96, 0x01, 0x10, 0x00, - 0x46, 0x63, 0xBD, 0x04, 0x2A, 0x05, 0xD2, 0xA3, - 0x0A, 0x38, 0x88, 0xA3, 0x2A, 0x09, 0x46, 0x23, - 0x2A, 0x0B, 0x48, 0x23, 0x2A, 0x0D, 0x4A, 0x23, - 0x2A, 0x0F, 0x4C, 0x23, 0x2A, 0x11, 0x2E, 0x23, - 0x96, 0x22, 0xFF, 0xFF, 0x96, 0x09, 0xE0, 0x1F, - 0x76, 0x4C, 0x24, 0x4C, 0x96, 0x01, 0x00, 0x08, - 0x46, 0xA3, 0xAC, 0x04, 0x1A, 0x18, 0x18, 0x08, - 0x1A, 0x1C, 0x1C, 0x0C, 0x6A, 0x0D, 0x4A, 0x23, - 0x6A, 0x0F, 0x4C, 0x23, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0xAD, 0x04, 0x1A, 0x10, 0x10, 0x08, - 0x1A, 0x14, 0x14, 0x0C, 0x6A, 0x09, 0x46, 0x23, - 0x6A, 0x0B, 0x48, 0x23, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA2, 0xB8, 0x04, 0x96, 0x02, 0x0C, 0x00, - 0x5A, 0x46, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0xA2, 0xB5, 0x04, 0x0A, 0xAD, 0xF8, 0x28, - 0x2A, 0x17, 0x4E, 0x23, 0x2A, 0x19, 0xDA, 0xA3, - 0x2A, 0x09, 0x50, 0x23, 0x2A, 0x0B, 0xD8, 0xA3, - 0x2A, 0x1B, 0x8C, 0xA3, 0xF6, 0x6D, 0x34, 0x34, - 0x96, 0xDD, 0x10, 0x00, 0x17, 0x07, 0xC9, 0xF7, - 0xFF, 0xFF, 0x7F, 0x00, 0x36, 0x92, 0x0E, 0x0D, - 0x7A, 0x08, 0x14, 0x10, 0x7A, 0x0C, 0x30, 0x2C, - 0x66, 0x62, 0xBD, 0x04, 0x8B, 0xDC, 0x9D, 0xE2, - 0x1E, 0x05, 0x00, 0x00, 0x8B, 0xDC, 0x9D, 0x22, - 0x1F, 0x05, 0x00, 0x00, 0x2A, 0x03, 0x64, 0x22, - 0x2A, 0x09, 0x84, 0x23, 0x17, 0x80, 0x00, 0x00, - 0x00, 0x00, 0x40, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x62, 0xB2, 0x04, 0x7A, 0x00, 0x08, 0x0C, - 0x46, 0xA3, 0xB1, 0x04, 0xF6, 0x0D, 0x04, 0x60, - 0x96, 0x11, 0x7F, 0x00, 0x3A, 0x10, 0x10, 0x04, - 0x06, 0x42, 0xB2, 0x04, 0xBA, 0x10, 0x10, 0x00, - 0x17, 0x00, 0x02, 0x00, 0x00, 0x00, 0x40, 0x00, - 0x66, 0x42, 0xB2, 0x04, 0x0E, 0x13, 0x00, 0x00, - 0x6A, 0x09, 0x84, 0x23, 0x6A, 0x0B, 0x50, 0x23, - 0x6A, 0x19, 0x4E, 0x23, 0x96, 0x81, 0x10, 0x00, - 0x66, 0x62, 0xBD, 0x04, 0x0A, 0x1C, 0xFE, 0xA3, - 0x96, 0x11, 0x04, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0xA3, 0xB3, 0x04, 0x0F, 0x05, 0x00, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7A, 0x0C, 0x0C, 0x08, - 0xBF, 0x0E, 0x0C, 0xBC, 0x00, 0x00, 0x00, 0x00, - 0x4E, 0x0C, 0x28, 0x00, 0xB6, 0x99, 0x01, 0x00, - 0x97, 0x80, 0x81, 0xFF, 0x7F, 0x00, 0x00, 0x00, - 0x66, 0xE2, 0xB4, 0x04, 0x6A, 0x07, 0x14, 0xA2, - 0x6A, 0x13, 0x16, 0xA2, 0x2A, 0x13, 0xEC, 0x23, - 0x97, 0x81, 0x81, 0xFF, 0x7F, 0x00, 0x00, 0x00, - 0x3A, 0x24, 0x24, 0x0C, 0x6A, 0x13, 0xEC, 0x23, - 0x06, 0x62, 0xBD, 0x04, 0x0A, 0xAD, 0xF8, 0x28, - 0x0A, 0xCD, 0xFA, 0x28, 0x3A, 0x30, 0x30, 0x0C, - 0x4A, 0x64, 0xFA, 0x28, 0x8B, 0xE4, 0x9D, 0xE2, - 0x1E, 0x05, 0x00, 0x00, 0x8B, 0xE4, 0x9D, 0x22, - 0x1F, 0x05, 0x00, 0x00, 0xAB, 0x00, 0x00, 0x60, - 0x1F, 0x05, 0x00, 0x00, 0x96, 0x81, 0x08, 0x00, - 0x66, 0x62, 0xBD, 0x04, 0xF6, 0x1D, 0x30, 0x08, - 0x4E, 0x0C, 0x28, 0x00, 0xB6, 0x99, 0x01, 0x00, - 0x6A, 0x07, 0x14, 0xA2, 0x6A, 0x13, 0x16, 0xA2, - 0x2A, 0x13, 0xEC, 0x23, 0x97, 0x81, 0x81, 0xFF, - 0x7F, 0x00, 0x00, 0x00, 0x3A, 0x24, 0x24, 0x0C, - 0x6A, 0x13, 0xEC, 0x23, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0xBD, 0x04, 0x0A, 0xAD, 0xE8, 0x29, - 0x0A, 0xBD, 0x38, 0x2A, 0x0A, 0xCD, 0xF8, 0x28, - 0x0A, 0xDD, 0xFA, 0x28, 0x1A, 0x34, 0x34, 0x0C, - 0x4A, 0x6C, 0xFA, 0x28, 0x8B, 0xE4, 0x9D, 0xE2, - 0x1E, 0x05, 0x00, 0x00, 0x5A, 0x04, 0x28, 0x2C, - 0x46, 0x63, 0xBD, 0x04, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xF6, 0x51, 0x00, 0x8B, 0xE4, 0x9D, 0x22, - 0x1F, 0x05, 0x00, 0x00, 0x2A, 0x01, 0xE6, 0x23, - 0x7A, 0x02, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x62, 0xBC, 0x04, 0x0A, 0x0D, 0xD8, 0x28, - 0x7A, 0x02, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0x23, 0xBC, 0x04, 0x37, 0x49, 0x49, 0x00, - 0x08, 0x00, 0x00, 0x00, 0xCB, 0x00, 0x00, 0x00, - 0x00, 0xCE, 0x47, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0xBC, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xA0, 0x7B, 0x04, 0x96, 0x81, 0x04, 0x00, - 0x66, 0x62, 0xBD, 0x04, 0xF6, 0x1D, 0x34, 0x08, - 0x9A, 0x0C, 0x0C, 0x00, 0x4E, 0x0C, 0x30, 0x00, - 0xB6, 0x99, 0x01, 0x00, 0x6A, 0x07, 0x14, 0xA2, - 0x6A, 0x13, 0x16, 0xA2, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x50, 0xBF, 0x02, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0x59, 0x00, 0x01, 0x00, 0x01, 0x00, - 0xE6, 0xE3, 0xBD, 0x7C, 0x17, 0x49, 0xC9, 0xFF, - 0xBF, 0xFF, 0x7F, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xD0, 0x52, 0x01, 0x01, 0x00, 0x01, 0x00, - 0xE6, 0x23, 0x89, 0x0B, 0x8B, 0x05, 0x89, 0x80, - 0x8C, 0x51, 0x00, 0x00, 0x2A, 0x01, 0x58, 0x22, - 0x17, 0x07, 0x00, 0x00, 0x00, 0x00, 0x38, 0x00, - 0x0A, 0x5C, 0x79, 0x28, 0x7B, 0x3E, 0x2A, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x66, 0x62, 0xC0, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0x89, 0x03, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xD0, 0xCA, 0x00, 0xAB, 0x18, 0x00, 0xE0, - 0x08, 0x05, 0x00, 0x00, 0x0A, 0x2D, 0x78, 0x28, - 0x0A, 0x8D, 0x76, 0x28, 0x0A, 0x9D, 0x22, 0x28, - 0x0F, 0x17, 0x00, 0x04, 0x00, 0x00, 0x00, 0x00, - 0x2A, 0x1D, 0x04, 0xA0, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0x91, 0x03, 0x0A, 0xAD, 0x0C, 0x28, - 0x0A, 0xBD, 0x10, 0x28, 0x0A, 0xCD, 0x16, 0x28, - 0x0A, 0xDD, 0x18, 0x28, 0x0A, 0xFD, 0x46, 0x28, - 0x0A, 0x0D, 0x1F, 0x28, 0x2A, 0x1D, 0x14, 0x22, - 0xB7, 0x26, 0x05, 0xD0, 0x04, 0x00, 0x00, 0x00, - 0xEE, 0x39, 0x00, 0x0D, 0x6E, 0x3A, 0x00, 0x0E, - 0x0F, 0xA4, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0F, 0xDA, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x1A, 0x04, 0x2C, 0x2C, 0x1A, 0x08, 0x04, 0x2C, - 0x76, 0x1C, 0x2C, 0x40, 0x37, 0xC4, 0x01, 0x00, - 0x08, 0x00, 0x08, 0x00, 0xB7, 0xC4, 0x00, 0x00, - 0x08, 0x00, 0x00, 0x00, 0xB6, 0x22, 0x00, 0x10, - 0x4E, 0x24, 0x0A, 0x00, 0x0E, 0x28, 0x2A, 0x00, - 0x0F, 0x47, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0E, 0x55, 0x36, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x46, 0xC4, 0xC5, 0x04, - 0xB3, 0xFF, 0x0A, 0x09, 0x41, 0x83, 0x2F, 0x00, - 0x0A, 0x2D, 0x40, 0x28, 0x2A, 0x4D, 0x96, 0x21, - 0xB6, 0xC0, 0x18, 0x0A, 0xB6, 0xC1, 0x08, 0x00, - 0x0E, 0x34, 0x01, 0x00, 0x0E, 0x28, 0x06, 0x00, - 0x0E, 0x0F, 0x00, 0x00, 0x0E, 0x55, 0x0A, 0x00, - 0x46, 0x04, 0xC8, 0x04, 0x4E, 0x34, 0x0D, 0x00, - 0x4E, 0x28, 0x0E, 0x00, 0x0E, 0x59, 0x36, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x66, 0xC4, 0xC7, 0x04, - 0x53, 0xFF, 0x2A, 0xE4, 0x4E, 0xEE, 0xE0, 0x03, - 0x9A, 0x0C, 0x0C, 0x00, 0xBA, 0x04, 0x34, 0x00, - 0x96, 0xA0, 0x02, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0x63, 0xC9, 0x04, 0xB7, 0x26, 0x06, 0x10, - 0x04, 0x00, 0x00, 0x00, 0xB7, 0x84, 0x00, 0x00, - 0x00, 0x00, 0x13, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0xC9, 0x04, 0xB7, 0x26, 0x06, 0x0C, - 0x04, 0x00, 0x00, 0x00, 0xB7, 0x84, 0x00, 0x00, - 0x00, 0x00, 0x0F, 0x00, 0x0F, 0x47, 0x06, 0x00, - 0x06, 0x00, 0x00, 0x00, 0xAE, 0xA1, 0x01, 0x00, - 0x0E, 0x55, 0x36, 0x00, 0x31, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x46, 0xC4, 0xCA, 0x04, - 0xB3, 0xFF, 0x0A, 0x04, 0x89, 0x03, 0x00, 0x00, - 0x0E, 0x5B, 0x00, 0x00, 0x0E, 0x5F, 0x00, 0x00, - 0x0E, 0x63, 0x00, 0x00, 0x0E, 0x67, 0x00, 0x00, - 0x0E, 0x58, 0x1C, 0x01, 0x8E, 0x5C, 0x1C, 0x01, - 0x0E, 0x60, 0x20, 0x01, 0x8E, 0x64, 0x20, 0x01, - 0x0E, 0x69, 0x58, 0x00, 0x7A, 0x00, 0x58, 0x5C, - 0xA6, 0x82, 0xCC, 0x04, 0x0E, 0x69, 0x5C, 0x00, - 0x0E, 0x6D, 0x60, 0x00, 0x7A, 0x00, 0x60, 0x64, - 0xA6, 0x02, 0xCD, 0x04, 0x0E, 0x6D, 0x64, 0x00, - 0x0E, 0x59, 0x68, 0x00, 0x7A, 0x00, 0x68, 0x6C, - 0xA6, 0x82, 0xCD, 0x04, 0x0E, 0x59, 0x6C, 0x00, - 0x2A, 0x01, 0xB2, 0x21, 0x7B, 0x3E, 0x00, 0x8C, - 0x3F, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0xA2, 0xCE, 0x04, 0xBF, 0x5E, 0x58, 0xCC, - 0xCC, 0x00, 0x00, 0x00, 0x76, 0xBE, 0x5C, 0x44, - 0x06, 0x02, 0xCF, 0x04, 0xBF, 0x5E, 0x58, 0x78, - 0x14, 0x00, 0x00, 0x00, 0x76, 0xBE, 0x5C, 0x44, - 0xF6, 0x05, 0x34, 0x14, 0xAE, 0x27, 0x00, 0x00, - 0x0E, 0x63, 0x00, 0x00, 0x0E, 0x0B, 0x00, 0x00, - 0x0E, 0x0F, 0x00, 0x00, 0x0E, 0x13, 0x00, 0x00, - 0x0E, 0x17, 0x00, 0x00, 0x0E, 0x1B, 0x00, 0x00, - 0x0E, 0x1F, 0x00, 0x00, 0xAE, 0xA1, 0x03, 0x00, - 0x0E, 0x24, 0x5D, 0x00, 0x0E, 0x59, 0x02, 0x00, - 0x66, 0x04, 0xD4, 0x04, 0xAE, 0x4A, 0x10, 0x00, - 0x31, 0x00, 0x01, 0x00, 0x46, 0x04, 0xD1, 0x04, - 0xB3, 0xFF, 0x0A, 0x04, 0x89, 0x03, 0x00, 0x00, - 0x0E, 0x08, 0x1C, 0x01, 0x8E, 0x0C, 0x1C, 0x01, - 0x0E, 0x10, 0x20, 0x01, 0x8E, 0x14, 0x20, 0x01, - 0x79, 0x59, 0xF9, 0x79, 0x7A, 0x10, 0x18, 0x10, - 0x7A, 0x14, 0x18, 0x14, 0xF6, 0x15, 0x08, 0x7C, - 0xF6, 0x1D, 0x0C, 0x7C, 0xF6, 0x25, 0x10, 0x7C, - 0xF6, 0x2D, 0x14, 0x7C, 0x1A, 0x60, 0x60, 0x08, - 0x76, 0x3C, 0x1C, 0x04, 0x76, 0x44, 0x08, 0x60, - 0x36, 0x07, 0x07, 0x08, 0x1A, 0x60, 0x60, 0x0C, - 0x76, 0x44, 0x0C, 0x40, 0x36, 0x07, 0x07, 0x08, - 0x1A, 0x60, 0x60, 0x10, 0x76, 0x44, 0x10, 0x20, - 0x36, 0x07, 0x07, 0x08, 0x1A, 0x60, 0x60, 0x14, - 0x36, 0x07, 0x07, 0x05, 0xAE, 0x2B, 0x00, 0x00, - 0x0E, 0x61, 0x25, 0x00, 0x2E, 0xB1, 0xFF, 0x7F, - 0x76, 0x04, 0x34, 0x08, 0x76, 0x0C, 0x34, 0x04, - 0x0E, 0x55, 0x02, 0x00, 0x31, 0x00, 0x01, 0x00, - 0x01, 0x00, 0x01, 0x00, 0x46, 0x44, 0xD5, 0x04, - 0xB3, 0x33, 0x16, 0x04, 0x89, 0x03, 0x00, 0x00, - 0x0E, 0x67, 0x00, 0x00, 0x0E, 0x6B, 0x00, 0x00, - 0x0E, 0x64, 0x14, 0x01, 0x8E, 0x68, 0x14, 0x01, - 0xBA, 0x64, 0x64, 0x00, 0x5A, 0x68, 0x00, 0x68, - 0x0E, 0x79, 0x68, 0x00, 0xF6, 0x75, 0x34, 0x10, - 0x9A, 0x38, 0x38, 0x00, 0x76, 0x74, 0x38, 0x14, - 0x7A, 0x08, 0x68, 0x38, 0x01, 0x00, 0x01, 0x00, - 0xE6, 0x42, 0xD7, 0x04, 0x7A, 0x78, 0x68, 0x00, - 0xF6, 0x8D, 0x68, 0x14, 0xF6, 0x95, 0x64, 0x14, - 0x0F, 0x17, 0xFE, 0xFF, 0xFF, 0xFF, 0x01, 0x00, - 0x0F, 0x19, 0xFE, 0xFF, 0xFF, 0xFF, 0x01, 0x00, - 0x0F, 0x2B, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0x0E, 0x21, 0x1C, 0x00, 0xF6, 0x75, 0x34, 0x10, - 0x97, 0x0F, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, - 0x66, 0x02, 0xD9, 0x04, 0x0E, 0x2D, 0x54, 0x00, - 0x76, 0x44, 0x20, 0x04, 0x9A, 0x54, 0x54, 0x00, - 0x7A, 0x7C, 0x54, 0x38, 0x01, 0x00, 0x01, 0x00, - 0x26, 0x83, 0xD8, 0x04, 0xF6, 0x75, 0x34, 0x0C, - 0x97, 0x0F, 0x04, 0x00, 0x00, 0x00, 0x40, 0x00, - 0x66, 0x62, 0xDA, 0x04, 0x0E, 0x31, 0x54, 0x00, - 0x06, 0xE2, 0xDA, 0x04, 0x76, 0x44, 0x20, 0x04, - 0x9A, 0x54, 0x54, 0x00, 0x7A, 0x7C, 0x54, 0x38, - 0x26, 0xC3, 0xD9, 0x04, 0x7A, 0x7C, 0x48, 0x2C, - 0x66, 0xC2, 0xDC, 0x04, 0x76, 0x04, 0x34, 0x08, - 0x7A, 0x7C, 0x2C, 0x30, 0x76, 0xFC, 0x7C, 0x14, - 0x3A, 0x7C, 0x00, 0x7C, 0xBF, 0x0A, 0x00, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x3F, 0x0A, 0x08, 0x28, - 0x00, 0x00, 0x00, 0x00, 0xBA, 0x08, 0x08, 0x00, - 0x7A, 0x7C, 0x7C, 0x08, 0x01, 0x00, 0x01, 0x00, - 0xE6, 0xC2, 0xDC, 0x04, 0x76, 0xCC, 0x2C, 0x14, - 0x7A, 0x6C, 0x64, 0x3C, 0x0E, 0x2D, 0x3C, 0x00, - 0x2A, 0x01, 0x90, 0x21, 0x7B, 0x3E, 0x00, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0xC2, 0xDD, 0x04, 0x4A, 0x8E, 0x4C, 0x2A, - 0x0A, 0x7D, 0x46, 0x2A, 0x0A, 0x8D, 0x4C, 0x2A, - 0x0A, 0x5D, 0x51, 0x2A, 0x0A, 0x0D, 0x4E, 0x2A, - 0x0A, 0x1D, 0x44, 0x2A, 0x0A, 0x2D, 0x48, 0x2A, - 0xF6, 0x1D, 0x34, 0x10, 0x9A, 0x0C, 0x0C, 0x00, - 0x76, 0x1C, 0x0C, 0x14, 0x7A, 0x7C, 0x64, 0x0C, - 0xE6, 0xA2, 0xDF, 0x04, 0x0E, 0x1F, 0x01, 0x00, - 0x9A, 0x08, 0x08, 0x00, 0x0E, 0x57, 0x00, 0x00, - 0x06, 0xE2, 0xE3, 0x04, 0x7B, 0x3E, 0x0E, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0xE3, 0xE3, 0x04, 0x7A, 0x7C, 0x20, 0x44, - 0x46, 0x23, 0xE1, 0x04, 0x0E, 0x2D, 0x78, 0x00, - 0x0E, 0x57, 0x00, 0x00, 0x0E, 0x07, 0x00, 0x00, - 0x0E, 0x21, 0x44, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0xE3, 0x04, 0x7B, 0x3E, 0x2A, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0x63, 0xE3, 0x04, 0x7A, 0x7C, 0x44, 0x00, - 0xA6, 0x22, 0xE2, 0x04, 0x4A, 0xF6, 0x54, 0x2A, - 0x0E, 0x01, 0x44, 0x00, 0x9A, 0x04, 0x04, 0x00, - 0x7B, 0x3E, 0x02, 0x28, 0x00, 0x00, 0x00, 0x00, - 0x26, 0xE3, 0xE3, 0x04, 0x0A, 0xBD, 0x54, 0x2A, - 0x0E, 0x57, 0x00, 0x00, 0x0E, 0x07, 0x00, 0x00, - 0x0E, 0x23, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0xE2, 0xE3, 0x04, 0x0E, 0x57, 0x01, 0x00, - 0x0E, 0x07, 0x01, 0x00, 0x4A, 0xF6, 0x54, 0x2A, - 0x0E, 0x01, 0x44, 0x00, 0x0A, 0x3D, 0x4A, 0x2A, - 0x0A, 0x6D, 0x52, 0x2A, 0x0E, 0x13, 0x14, 0x00, - 0x0E, 0x17, 0x0A, 0x00, 0x2A, 0x3F, 0x90, 0x21, - 0x7B, 0x3E, 0x3E, 0x14, 0x00, 0x00, 0x00, 0x00, - 0xA6, 0x22, 0xE5, 0x04, 0x0E, 0x13, 0x05, 0x00, - 0x0E, 0x17, 0x02, 0x00, 0x7B, 0x3E, 0x0E, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0xE3, 0xE7, 0x04, 0x9A, 0x0C, 0x0C, 0x00, - 0x7B, 0x3E, 0x06, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x46, 0x63, 0xE6, 0x04, 0x0E, 0x19, 0x64, 0x00, - 0x06, 0x22, 0xE8, 0x04, 0x7A, 0x7C, 0x0C, 0x10, - 0x46, 0x23, 0xE8, 0x04, 0x7A, 0x7C, 0x08, 0x14, - 0x26, 0x23, 0xE7, 0x04, 0x76, 0xFC, 0x34, 0x08, - 0x7A, 0x2C, 0x18, 0x7C, 0x0E, 0x1F, 0x00, 0x00, - 0x0E, 0x0F, 0x00, 0x00, 0x0E, 0x0B, 0x00, 0x00, - 0x0E, 0x1B, 0x00, 0x00, 0x0E, 0x21, 0x44, 0x00, - 0x06, 0x22, 0xE8, 0x04, 0x0E, 0x0F, 0x00, 0x00, - 0x0E, 0x0B, 0x00, 0x00, 0x4A, 0x3E, 0x46, 0x2A, - 0x4A, 0x46, 0x4C, 0x2A, 0x4A, 0xAE, 0x50, 0x2A, - 0x4A, 0x06, 0x4E, 0x2A, 0x4A, 0x0E, 0x44, 0x2A, - 0x4A, 0x16, 0x48, 0x2A, 0x4A, 0x1E, 0x4A, 0x2A, - 0x4A, 0x36, 0x52, 0x2A, 0x36, 0x1F, 0x07, 0x15, - 0x7B, 0x3E, 0x3E, 0x02, 0x00, 0x00, 0x00, 0x00, - 0x46, 0xC3, 0xEA, 0x04, 0x7B, 0x3E, 0x3C, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x26, 0xC3, 0xEA, 0x04, 0x7B, 0x3E, 0x3C, 0x40, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x86, 0xC2, 0xEA, 0x04, 0x0E, 0x2D, 0x78, 0x00, - 0x0A, 0x7D, 0x56, 0x2A, 0x0A, 0x8D, 0x5A, 0x2A, - 0x0A, 0x5D, 0x5D, 0x2A, 0x2A, 0x01, 0x90, 0x21, - 0x7B, 0x3E, 0x00, 0x16, 0x00, 0x00, 0x00, 0x00, - 0x26, 0x63, 0xF2, 0x04, 0x7A, 0x7C, 0x48, 0x1C, - 0xA6, 0x62, 0xEC, 0x04, 0x7A, 0x7C, 0x48, 0x1C, - 0x26, 0xE3, 0xEE, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x62, 0xF1, 0x04, 0x7B, 0x3E, 0x10, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0xA3, 0xED, 0x04, 0xAB, 0x02, 0x00, 0xA0, - 0x4B, 0x05, 0x00, 0x00, 0xAB, 0x02, 0x00, 0x60, - 0x4B, 0x05, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x22, 0xF3, 0x04, 0x9A, 0x54, 0x54, 0x00, - 0x4A, 0xAE, 0x5C, 0x2A, 0x7B, 0x3E, 0x2A, 0x08, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x86, 0x62, 0xF1, 0x04, 0xAB, 0x02, 0x00, 0x60, - 0x4B, 0x05, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x22, 0xF3, 0x04, 0x7B, 0x3E, 0x10, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x46, 0x23, 0xF0, 0x04, 0xAB, 0x02, 0x00, 0x60, - 0x4B, 0x05, 0x00, 0x00, 0xAB, 0x04, 0x00, 0xA0, - 0x4B, 0x05, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x22, 0xF3, 0x04, 0x9A, 0x54, 0x54, 0x00, - 0x4A, 0xAE, 0x5C, 0x2A, 0x7B, 0x3E, 0x2A, 0x28, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x86, 0x62, 0xF1, 0x04, 0xAB, 0x04, 0x00, 0x60, - 0x4B, 0x05, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x22, 0xF3, 0x04, 0x4A, 0x96, 0x56, 0x2A, - 0x4A, 0xDE, 0x58, 0x2A, 0xAB, 0x00, 0x00, 0x60, - 0x4B, 0x05, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xA0, - 0x4B, 0x05, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x22, 0xF3, 0x04, 0x4A, 0x96, 0x56, 0x2A, - 0x4A, 0x86, 0x58, 0x2A, 0xAB, 0x00, 0x00, 0x60, - 0x4B, 0x05, 0x00, 0x00, 0xAB, 0x00, 0x00, 0xA0, - 0x4B, 0x05, 0x00, 0x00, 0x0A, 0xFD, 0x59, 0x2A, - 0x7A, 0x70, 0x7C, 0x40, 0x3B, 0x38, 0x38, 0x14, - 0x00, 0x00, 0x00, 0x00, 0x0F, 0x03, 0x9C, 0xFF, - 0xFF, 0xFF, 0x01, 0x00, 0x0F, 0x05, 0x18, 0x00, - 0x00, 0x00, 0x00, 0x00, 0x7A, 0x00, 0x70, 0x04, - 0xA6, 0xE2, 0xF4, 0x04, 0x7A, 0x00, 0x60, 0x08, - 0xA6, 0xE2, 0xF4, 0x04, 0x01, 0x00, 0x01, 0x00, - 0x06, 0x02, 0xF5, 0x04, 0x0E, 0x73, 0x00, 0x00, - 0x7A, 0x74, 0x2C, 0x3C, 0x6A, 0x2D, 0xA4, 0x28, - 0x6A, 0x2F, 0xA6, 0x28, 0x6A, 0x31, 0xA8, 0x28, - 0x6A, 0x33, 0xAA, 0x28, 0x6A, 0x35, 0xAC, 0x28, - 0x6A, 0x37, 0xAE, 0x28, 0x6A, 0x39, 0xB0, 0x28, - 0x6A, 0x3B, 0x94, 0x28, 0x0A, 0x1D, 0x77, 0x28, - 0x0A, 0x2D, 0x3B, 0x28, 0x3A, 0x00, 0x44, 0x74, - 0x16, 0x00, 0x00, 0x12, 0x4A, 0x06, 0x76, 0x28, - 0x4A, 0xEC, 0x06, 0xA4, 0x0A, 0x3D, 0x61, 0x28, - 0x5A, 0x00, 0x60, 0x4C, 0x01, 0x00, 0x01, 0x00, - 0xA6, 0xD2, 0xF7, 0x04, 0x37, 0x49, 0x49, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x05, 0x04, 0x17, 0x49, 0xC9, 0xFB, 0xFF, 0xFF, - 0x7F, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00, - 0x05, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, - 0xDF, 0x01, 0x9A, 0xFF, 0x00, 0x00, 0x00, 0x02, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x04, - 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x05, - 0x00, 0x00, 0x00, 0x00, -}; -#endif /* __TCC317X_BOOT_TDMB_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcc_fic_decoder/tcc_fic_decoder.h b/drivers/media/tdmb/tcc3170/inc/tcc_fic_decoder/tcc_fic_decoder.h deleted file mode 100644 index 17f2ed6..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcc_fic_decoder/tcc_fic_decoder.h +++ /dev/null @@ -1,123 +0,0 @@ -/* - * tcc_fic_decoder.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCC_FIC_DECODER_H__ -#define __TCC_FIC_DECODER_H__ -#include "tcc_fic_fig.h" - -#define CH_UPDATE_NO_DATA 0 -#define CH_UPDATE_ESSENTIAL_DATA 1 -#define CH_UPDATE_FULL_DATA 2 - -#define MAX_FIC_SIZE 384 -#define TCC_FIB_SIZE 32 - -struct fic_parser_matadata { - struct tcc_ensemble esmbl_start; - struct tcc_service svc_start[NUM_SVC]; - struct tcc_service_comp svc_comp_start[NUM_SVC_COMP]; - struct tcc_sub_channel subch_start[NUM_SUB_CH]; - struct tcc_user_app_types user_app_start[NUM_USER_APP]; - struct tcc_program_type prg_start[NUM_SVC_COMP]; - struct tcc_xpad_user_app fig1_6_start[NUM_USER_APP]; - - u8 fig_cn; - u8 fig_oe0; - u8 fig_pd; - u8 fig_oe1; - - u8 reconf_stage; - u8 cif_count_hi; - u8 cif_count_lo; - u16 cif_count; - u8 occur_change; - - u32 fib_cnt; /* max 12 */ -}; - -#define MAX_SVC_COMP_NUM 2 -#define MAX_SVC_NUM 10 - -struct tcc_service_comp_info { - struct tcc_service_comp svc_comp; - struct tcc_sub_channel sub_ch; -}; - -struct tcc_service_info { - struct tcc_service svc; - struct tcc_service_comp_info svc_comp_info[MAX_SVC_COMP_NUM]; -}; - -struct tcc_ensemble_info { - struct tcc_ensemble ensbl; - struct tcc_service_info svc_info[MAX_SVC_NUM]; -}; - -s32 fig0_ext00(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); -s32 fig0_ext01(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); -s32 fig0_ext02(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); -s32 fig0_ext03(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); -s32 fig0_ext04(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); -s32 fig0_ext05(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); -s32 fig0_ext07(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); -s32 fig0_ext08(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); -s32 fig0_ext13(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); -s32 fig0_ext17(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen); - -s32 fig1_ext00(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen, u8 charset); -s32 fig1_ext01(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen, u8 charset); -s32 fig1_ext04(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen, u8 charset); -s32 fig1_ext05(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen, u8 charset); -s32 fig1_ext06(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 iLen, u8 charset); - -void tcc_fic_parser_init(void); -s32 tcc_fic_run_decoder(u8 *buff, s32 size); - -void tcc_fic_disp_ensbl_info(struct tcc_ensemble_info *ensbl_info); -struct tcc_ensemble_info *tcc_fic_get_ensbl_info(s32 _disp); - -struct tcc_service_comp_info *tcc_fic_get_svc_comp_info(s32 _subch_id); -u8 tcc_fic_get_ptype(struct tcc_service_comp_info *svc_comp_info); -u8 tcc_fic_get_plevel(struct tcc_service_comp_info *svc_comp_info); -u16 tcc_fic_get_cu_start(struct tcc_service_comp_info *svc_comp_info); -u16 tcc_fic_get_cu_size(struct tcc_service_comp_info *svc_comp_info); -u8 tcc_fic_get_subch_id(struct tcc_service_comp_info *svc_comp_info); -u8 tcc_fic_get_bitrate(struct tcc_service_comp_info *svc_comp_info); -u8 tcc_fic_get_rs(struct tcc_service_comp_info *svc_comp_info); - - -#endif /* __TCC_FIC_DECODER_H__ */ diff --git a/drivers/media/tdmb/tcc3170/inc/tcc_fic_decoder/tcc_fic_fig.h b/drivers/media/tdmb/tcc3170/inc/tcc_fic_decoder/tcc_fic_fig.h deleted file mode 100644 index 895c13a..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcc_fic_decoder/tcc_fic_fig.h +++ /dev/null @@ -1,228 +0,0 @@ -/* - * tcc_fic_fig.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCC_FIC_FIG_H__ -#define __TCC_FIC_FIG_H__ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#define FICERR_FIG1_5_NOTREADY_SERVICE 11050 -#define FICERR_FIG1_4_NOTREADY_SRVCOMP 11041 -#define FICERR_FIG1_4_NOTREADY_SRVCOMP1 11040 -#define FICERR_FIG1_1_NOTREADY_SERVICE 11010 -#define FICERR_FIG0_13_ALREADY_USERAPPL 10130 -#define FICERR_FIG0_7_BLOCK 10071 -#define FICERR_FIG0_7_RETURN 10070 -#define FICERR_FIG0_5_NOTREADY_SERVICE 10051 -#define FICERR_FIG0_5_NOTREADY_SRVCOMP 10050 -#define FICERR_FIG0_4_NOTREADY_SRVCOMP 10041 -#define FICERR_FIG0_4_ALREADY_CA_FIELD 10040 -#define FICERR_FIG0_3_NOTREADY_SRVCOMP 10032 -#define FICERR_FIG0_3_NOTREADY_SRVCOMP1 10031 -#define FICERR_FIG0_3_ALREADY_SRVCOMP 10030 -#define FICERR_FIG_NODATA 2 -#define FICERR_FIBD_ENDMARKER 1 -#define FICERR_SUCCESS 0 - -#define FICERR_FIBD_FICSYNC_FAILURE -1 -#define FICERR_FIBD_CRC_FAILURE -2 -#define FICERR_FIBD_UNKNOWN_FIGTYPE -3 -#define FICERR_FIBD_INVALID_LENGTH -4 -#define FICERR_FIG0_NEXT_FIG -1000 -#define FICERR_FIG0_NEXT_FIG1 -1001 -#define FICERR_FIG0_0_NO_ENSEMBLEARRAY -10000 -#define FICERR_FIG0_1_FULL_SUBCHARRAY -10010 -#define FICERR_FIG0_1_INVALID_LENGTH -10011 -#define FICERR_FIG0_1_NO_SUBCHARRAY -10012 -#define FICERR_FIG0_2_FULL_SERVICEARRAY -10020 -#define FICERR_FIG0_2_FULL_SRVCOMPARRAY -10021 -#define FICERR_FIG0_2_INVALID_LENGTH -10022 -#define FICERR_FIG0_2_NO_SRVARRAY -10023 -#define FICERR_FIG0_2_NO_SRVCOMPARRAY -10024 -#define FICERR_FIG0_3_INVALID_LENGTH -10030 -#define FICERR_FIG0_3_NO_SRVCOMPARRAY -10031 -#define FICERR_FIG0_4_INVALID_LENGTH -10040 -#define FICERR_FIG0_4_NO_SRVCOMPARRAY -10041 -#define FICERR_FIG0_5_INVALID_LENGTH -10050 -#define FICERR_FIG0_5_NO_SRVCOMPARRAY -10051 -#define FICERR_FIG0_8_INVALID_LENGTH -10080 -#define FICERR_FIG0_8_NO_SRVCOMPARRAY -10081 -#define FICERR_FIG0_13_FULL_USERAPPLARRAY -10130 -#define FICERR_FIG0_13_INVALID_LENGTH -10131 -#define FICERR_FIG0_13_NO_USERAPPLARRAY -10132 -#define FICERR_FIG0_17_OTHER_ENSEMBLE -10170 -#define FICERR_FIG0_17_NO_PROGTYPEARRAY -10171 -#define FICERR_FIG0_17_FULL_PROGTYPEARRAY -10172 -#define FICERR_FIG0_17_INVALID_LENGTH -10073 -#define FICERR_FIG1_1_NO_SERVICEARRAY -11011 -#define FICERR_FIG1_4_NO_SRVCOMPARRAY -11041 -#define FICERR_FIG1_5_NO_SERVICEARRAY -11052 -#define FICERR_FIG1_6_NO_XPADLABELARRAY -11061 - -#define FIG0 0x0 -#define FIG1 0x1 - -#define EXT_00 0 -#define EXT_01 1 -#define EXT_02 2 -#define EXT_03 3 -#define EXT_04 4 -#define EXT_05 5 -#define EXT_06 6 -#define EXT_07 7 -#define EXT_08 8 -#define EXT_09 9 -#define EXT_10 10 -#define EXT_11 11 -#define EXT_12 12 -#define EXT_13 13 -#define EXT_14 14 -#define EXT_15 15 -#define EXT_16 16 -#define EXT_17 17 -#define EXT_18 18 -#define EXT_19 19 -#define EXT_20 20 -#define EXT_21 21 -#define EXT_22 22 -#define EXT_23 23 -#define EXT_24 24 -#define EXT_25 25 -#define EXT_26 26 -#define EXT_27 27 -#define EXT_28 28 -#define EXT_29 29 -#define EXT_30 30 -#define EXT_31 31 - -#define INITVAL_SCIDS 0xff - -#define NUM_SVC 64 /**< max num of struct tcc_service */ -#define NUM_SUB_CH (NUM_SVC + 0) /**< max num of struct tcc_sub_channel */ -#define NUM_SVC_COMP NUM_SUB_CH /**< max num of struct tcc_service_comp */ -#define NUM_PRG_TYPE NUM_SVC_COMP /**< max_num of struct tcc_program_type. */ -#define NUM_USER_APP NUM_SVC /**< max_num of struct tcc_user_app_type. */ - -/**FIG 0/1 */ -struct tcc_sub_channel { - u8 subch_id; /**< 6bits Sub channel Id */ - u8 tbl_index; /**< 6bits TableIndex */ - u8 form_flag; /**< [3] : FormFlag@n - * [2] : Option@n - * [1~0] : protection */ - u16 start_cu; /**< 10bits Start Address */ - u16 size_cu; /**< 10bits Sub channel size */ -}; - -/** FIG 0/2 and FIG1 */ -struct tcc_service_comp { - u8 order; /**< 4bits 0 : primary, 1: secondary */ - u8 tmid; /**< 2bits Transport Mechanism Id */ - u8 ascty_dscty; /**< 6bits Audio Service Component Type */ - u8 fidc_id; /**< 6bits subch_id or FIDCId in FIG 0/4 */ - u8 ca_flag; /**< 1bit CA Flag */ - u8 dg_mf_flag; /**< 1bit DG Flag or MF flag */ - u8 lang; /**< 8bit language field of FIG 0/5 */ - u8 scids; /**< 4bit Service component Identifier - * within ther Service */ - u8 ca_org_flag; /**< 1bit */ - u8 charset; /**< character set */ - u8 label[16]; /**< 16bytes Service component label */ - u16 scid; /**< 12bits Service Component Id */ - u16 pack_add; /**< 10bits Packet Address */ - u16 ca_org; /**< 16bits conditional access organization */ - u16 char_flag; /**< refer to ETSI EN 300 401 5.2.2.1 */ - u32 sid; /**< 32bit */ -}; - - -/** FIG 0/17 */ -struct tcc_program_type { - u8 sd; /**< 1bit */ - u8 ps; /**< 1bit */ - u8 nfc; /**< 2bit */ - u8 lang; /**< 8Bit */ - u8 i18n_code; /**< 5bit */ - u8 coarse_code; /**< 6bit */ - u8 fine_code; /**< 8bit */ - u16 sid; /**< 16bit */ -}; - - -/** FIG 0/2 and FIG1/1 */ -struct tcc_service { - u32 sid; /**< 32bits CountryId + serviceReference - * ECC + CountryId + ServiceReference */ - u8 charset; /**< character set */ - u8 svc_label[16]; /**< 16bytes Service label - * (Program service and Data service) */ - u16 char_flag; /**< refer to ETSI EN 300 401 5.2.2.1 */ - u8 ca_id; /**< 3bit */ - u8 num_svc_comp; /**< 4bits Number of Service Component */ -}; - - -/** FIG 0/0 */ -struct tcc_ensemble { - u8 al_flag; /**< 1bit Al flag */ - u8 num_subch; /**< a number of struct tcc_sub_channel */ - u8 num_svc; /**< a number of struct tcc_service */ - u8 num_program; /**< a number of ProgNumberInfo */ - u8 num_svc_comp; /**< a number of struct tcc_service_comp */ - u8 num_user_app; /**< a number of FIG0/13 */ - u8 num_ann; /**< a number of FIG0/18 */ - u8 num_prg_type; /**< a number of FIG0/17 */ - u8 num_oe_svc; /**< a number of FIG0/24 other ensemble*/ - u8 num_fi; /**< a number of FIG0/21 */ - u8 num_oe_fi; /**< a number of FIG0/21 other ensemble*/ - u8 charset; /**< character set */ - u8 label[16]; /**< 16bytes Ensemble label */ - u16 char_flag; /**< refer to ETSI EN 300 401 5.2.2.1 */ - u16 eid; /**< 16bits country Id Ensemble reference */ -}; - -struct tcc_user_app_type { - u16 type; /**< User application Type */ - u8 len; /**< User Application Type length */ - u8 data[24]; /**< User Application Data */ -}; - -/** FIG 0/13 */ -struct tcc_user_app_types { - u32 sid; /**< Service ID */ - u8 scids; /**< scids */ - u8 num_app; /**< appl */ - struct tcc_user_app_type app_type[6]; -}; - -/** FIG 1/6 */ -struct tcc_xpad_user_app { - u8 charset; /**< character set */ - u8 label[16]; /**< label */ - u16 type; /**< X-PAD application type */ - u32 sid; /**< Service ID */ - u8 scids; /**< scids */ - u16 char_flag; -}; - -#endif /* __TCC_FIC_FIG_H__ */ diff --git a/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_debug.h b/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_debug.h deleted file mode 100644 index cb115b0..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_debug.h +++ /dev/null @@ -1,75 +0,0 @@ -/* - * tcpal_debug.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCPAL_DEBUG_H__ -#define __TCPAL_DEBUG_H__ - -#define DEBUG_ERROR 0x00000001 -#define DEBUG_INFO 0x00000002 -#define DEBUG_DRV_IO 0x00000004 -#define DEBUG_API_COMMON 0x00000008 -#define DEBUG_TCPAL_OS 0x00000010 -#define DEBUG_TCHAL 0x00000020 -#define DEBUG_TCPAL_CSPI 0x00000040 -#define DEBUG_DRV_COMP 0x00000080 -#define DEBUG_DRV_RF 0x00000100 -#define DEBUG_TCPAL_I2C 0x00000200 -#define DEBUG_DRV_PERI 0x00000400 -#define DEBUG_STREAM_PARSER 0x00000800 -#define DEBUG_PARSING_TIME 0x00001000 -#define DEBUG_PARSING_PROC 0x00002000 -#define DEBUG_INTRRUPT 0x00004000 -#define DEBUG_STREAM_READ 0x00008000 -#define DEBUG_STREAM_STACK 0x00010000 -#define DEBUG_STATUS 0x00020000 -#define DEBUG_PARSE_HEADER 0x00040000 - -#define MAX_SIZE_DSP_ROM (1024*10) -#define MAX_PATH 128 - -s32 printk(const char *fmt, ...); - -#define tcbd_debug(__class, __msg, ...)\ -do {\ - if (__class&tcbd_debug_class) {\ - if (__class == DEBUG_ERROR)\ - printk(KERN_ERR"[%s:%d] " __msg,\ - __func__, __LINE__, ##__VA_ARGS__);\ - else if (__class == DEBUG_INFO)\ - printk(KERN_INFO __msg, ##__VA_ARGS__);\ - else\ - printk(KERN_INFO"[%s:%d] " __msg,\ - __func__, __LINE__, ##__VA_ARGS__);\ - } \ -} while (0) - -s32 tcbd_debug_spur_dbg(void); -s32 tcbd_debug_rom_from_fs(void); -s32 *tcbd_debug_spur_clk_cfg(void); -char *tcbd_debug_rom_path(void); - -void tcbd_debug_mbox_rx(u16 *_cmd, s32 *_len, u32 **_data); -void tcbd_debug_mbox_tx(u16 *_cmd, s32 *_len, u32 **_data); - -extern u32 tcbd_debug_class; - -#endif /*__TCPAL_DEBUG_H_*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_os.h b/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_os.h deleted file mode 100644 index 85e4a3d..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_os.h +++ /dev/null @@ -1,62 +0,0 @@ -/* - * tcpal_os.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCPAL_OS_H__ -#define __TCPAL_OS_H__ -#include "tcpal_types.h" -#include <linux/init.h> -#include <linux/kernel.h> -#include <linux/module.h> -#include <linux/moduleparam.h> -#include <linux/fs.h> -#include <linux/uaccess.h> - -/* For TimeCheck */ -#define TCPAL_MAX_TIMECNT 0xFFFFFFFFFFFFFFFFULL -TCBB_FUNC u64 tcpal_get_time(void); -TCBB_FUNC u64 tcpal_diff_time(u64 _start_timeCount); - -/* for sleep */ -TCBB_FUNC void tcpal_msleep(s32 _ms); -TCBB_FUNC void tcpal_usleep(s32 _us); - -/* for memory allocation, free, set */ -TCBB_FUNC void *tcpal_malloc(u32 _size); -TCBB_FUNC void tcpal_free(void *_ptr); - -/* For Semaphore */ -#define TCPAL_INFINITE_SEMAPHORE 0xFFFFFFFFUL - -TCBB_FUNC s32 tcpal_create_lock( - u32 *_semaphore, - char *_name, - u32 _initialCount); -TCBB_FUNC s32 tcpal_destroy_lock(u32 *_semaphore); -TCBB_FUNC s32 tcpal_lock(u32 *_semaphore); -TCBB_FUNC s32 tcpal_unlock(u32 *_semaphore); - -TCBB_FUNC s32 tcpal_irq_register_handler(void *_device); -TCBB_FUNC s32 tcpal_irq_unregister_handler(void); -TCBB_FUNC s32 tcpal_irq_enable(void); -TCBB_FUNC s32 tcpal_irq_disable(void); - -#endif /*__TCPAL_OS_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_queue.h b/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_queue.h deleted file mode 100644 index 05e7982..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_queue.h +++ /dev/null @@ -1,66 +0,0 @@ -/* - * tcpal_queue.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#ifndef __TCBD_QUEUE_H__ -#define __TCBD_QUEUE_H__ - -#define TCBD_QUEUE_SIZE 50 - -struct tcbd_queue_item { - u8 *buffer; - u8 subch_id; - s32 size; - s32 type; -}; - -struct tcbd_queue { - s32 front; - s32 rear; - s32 qsize; - s32 pointer; - s32 buff_size; - u8 *global_buffer; - u32 sem; - struct tcbd_queue_item q[TCBD_QUEUE_SIZE]; -}; - -TCBB_FUNC void tcbd_init_queue( - struct tcbd_queue *_queue, u8* buffer, s32 _buff_size); -TCBB_FUNC void tcbd_deinit_queue(struct tcbd_queue *_queue); - -TCBB_FUNC s32 tcbd_enqueue( - struct tcbd_queue *_queue, u8 *_chunk, s32 _size, - u8 _subch_id, s32 _type); - -TCBB_FUNC s32 tcbd_dequeue( - struct tcbd_queue *_queue, u8 *_chunk, s32 *_size, - u8 *_subch_id, s32 *_type); - -TCBB_FUNC s32 tcbd_dequeue_ptr( - struct tcbd_queue *_queue, u8 **_chunk, s32 *_size, s32 *_type); - -TCBB_FUNC s32 tcbd_get_first_queue_ptr( - struct tcbd_queue *_queue, u8 **_chunk, s32 *_size, s32 *_type); - -TCBB_FUNC s32 tcbd_queue_is_empty(struct tcbd_queue *_queue); -TCBB_FUNC s32 tcbd_queue_is_full(struct tcbd_queue *_queue); -TCBB_FUNC void tcbd_reset_queue(struct tcbd_queue *_queue); -#endif /*__TCBD_QUEUE_H__*/ diff --git a/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_types.h b/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_types.h deleted file mode 100644 index e0bb984..0000000 --- a/drivers/media/tdmb/tcc3170/inc/tcpal/tcpal_types.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * tcpal_types.h - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#ifndef __TCPAL_TYPES_H__ -#define __TCPAL_TYPES_H__ - -#ifdef NULL - #undef NULL - #define NULL (void *)0 -#else - #define NULL (void *)0 -#endif - -#define TCBB_FUNC - -#define SWAP16(x) \ - ((u16)(\ - (((u16)(x)&(u16)0x00ffU) << 8) |\ - (((u16)(x)&(u16)0xff00U) >> 8))) - -#define SWAP32(x)\ - ((u32)(\ - (((u32)(x)&(u32)0x000000ffUL) << 24)| \ - (((u32)(x)&(u32)0x0000ff00UL) << 8)| \ - (((u32)(x)&(u32)0x00ff0000UL) >> 8)| \ - (((u32)(x)&(u32)0xff000000UL) >> 24))) - -#define MIN(x, y) ((x) < (y) ? (x) : (y)) -#define MAX(x, y) ((x) > (y) ? (x) : (y)) - -#endif diff --git a/drivers/media/tdmb/tcc3170/src/Makefile b/drivers/media/tdmb/tcc3170/src/Makefile deleted file mode 100644 index 8b4cd2e..0000000 --- a/drivers/media/tdmb/tcc3170/src/Makefile +++ /dev/null @@ -1,19 +0,0 @@ - -#obj-y += tcbd_hal.o -obj-y += tcbd_drv_io.o -obj-y += tcbd_drv_rf.o -obj-y += tcbd_drv_peri.o -obj-y += tcbd_drv_dual.o -obj-y += tcbd_drv_ip.o -obj-y += tcbd_api_common.o - -obj-y += tcbd_diagnosis/ -obj-y += tcbd_stream_parser/ -obj-y += tcpal_linux/ -obj-y += tcc_fic_decoder/ - -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcpal -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcbd_diagnosis -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcbd_stream_parser -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcc_fic_decoder diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_api_common.c b/drivers/media/tdmb/tcc3170/src/tcbd_api_common.c deleted file mode 100644 index 986f3d9..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_api_common.c +++ /dev/null @@ -1,648 +0,0 @@ -/* - * tcbd_api_common.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcbd_api_common.h" -#include "tcbd_drv_ip.h" -#include "tcbd_drv_io.h" -#include "tcbd_drv_rf.h" - -#include "tcc317x_boot_tdmb.h" - -s32 tcbd_device_start(struct tcbd_device *_device, - enum tcbd_clock_type _clock_type) -{ - s32 ret = 0, ver; - u8 *dsp_rom = TCC317X_BOOT_DATA_TDMB; - s32 size = TCC317X_BOOT_SIZE_TDMB; -#if defined(__DEBUG_DSP_ROM__) - static u8 dsp_rom_buff[MAX_SIZE_DSP_ROM]; - if (tcbd_debug_rom_from_fs() == 1) { - ret = tcbd_read_file(_device, tcbd_debug_rom_path(), - dsp_rom_buff, MAX_SIZE_DSP_ROM); - if (ret > 0) { - dsp_rom = dsp_rom_buff; - size = ret; - tcbd_debug(DEBUG_ERROR, "rom:%s, size:%d\n", - tcbd_debug_rom_path(), size); - } - } -#endif /*__DEBUG_DSP_ROM__*/ - - /* Initialize PLL */ - tcbd_init_pll(_device, _clock_type); - tcbd_init_buffer_region(_device); - tcbd_init_div_io(_device, DIV_IO_TYPE_SINGLE); - tcbd_enable_buffer(_device); - tcbd_enable_peri(_device); - ret = tcbd_init_dsp(_device, dsp_rom, size); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, "failed to initialize dsp!! " - "error:%d\n", ret); - return -TCERR_FATAL_ERROR; - } else { - tcbd_get_rom_version(_device, &ver); - tcbd_debug(DEBUG_API_COMMON, "device start success!! " - "version:0x%X\n", ver); - } - return 0; -} - -s32 tcbd_enable_irq(struct tcbd_device *_device, u8 _en_bit) -{ - s32 ret = 0; - - if (!_device->is_pal_irq_en) { - tcpal_irq_enable(); - _device->is_pal_irq_en = 1; - } - ret |= tcbd_reg_write(_device, TCBD_IRQ_STAT_CLR, TCBD_IRQ_STATCLR_ALL); - ret |= tcbd_reg_write(_device, TCBD_IRQ_EN, _en_bit); - _device->enabled_irq = _en_bit; - return ret; -} - -s32 tcbd_disable_irq(struct tcbd_device *_device, u8 _mask) -{ - s32 ret = 0; - - if (_device->is_pal_irq_en) { - tcpal_irq_disable(); - _device->is_pal_irq_en = 0; - } - ret |= tcbd_reg_write(_device, TCBD_IRQ_STAT_CLR, TCBD_IRQ_STATCLR_ALL); - ret |= tcbd_reg_write(_device, TCBD_IRQ_EN, _mask); - return ret; -} - -s32 tcbd_read_irq_status( - struct tcbd_device *_device, - u8 *_irq_status, - u8 *_err_status) -{ - s32 ret = 0; - short status; - - ret = tcbd_reg_write(_device, TCBD_IRQ_LATCH, 0x5E); - ret |= tcbd_reg_read_burst_cont( - _device, TCBD_IRQ_STAT_CLR, (u8 *)&status, 2); - *_irq_status = status & 0xFF; - *_err_status = (status >> 8) & 0xFF; - return ret; -} - -s32 tcbd_clear_irq(struct tcbd_device *_device, u8 _status) -{ - return tcbd_reg_write(_device, TCBD_IRQ_STAT_CLR, _status); -} - -s32 tcbd_change_irq_mode( - struct tcbd_device *_device, enum tcbd_intr_mode _mode) -{ - u8 mode = TCBD_IRQ_MODE_PAD_ENABLE; - switch (_mode) { - case INTR_MODE_LEVEL_HIGH: - mode |= TCBD_IRQ_MODE_LEVEL | TCBD_IRQ_MODE_RISING; - break; - case INTR_MODE_LEVEL_LOW: - mode |= TCBD_IRQ_MODE_LEVEL | TCBD_IRQ_MODE_FALLING; - break; - case INTR_MODE_EDGE_RISING: - mode |= TCBD_IRQ_MODE_TRIGER | TCBD_IRQ_MODE_RISING; - break; - case INTR_MODE_EDGE_FALLING: - mode |= TCBD_IRQ_MODE_TRIGER | TCBD_IRQ_MODE_FALLING; - break; - default: - mode |= TCBD_IRQ_MODE_LEVEL | TCBD_IRQ_MODE_FALLING; - break; - } - return tcbd_reg_write(_device, TCBD_IRQ_MODE, mode); -} - -s32 tcbd_init_stream_data_config( - struct tcbd_device *_device, - u8 _use_cmd_fifo, - u8 _buffer_mask, - u32 _threshold) -{ - s32 ret = 0; - u16 threshold = SWAP16((_threshold>>2)); - - /* Disable internal buffer */ - ret |= tcbd_reg_write(_device, TCBD_STREAM_CFG0, 0); - /* Change interrupt threshold */ - ret |= tcbd_reg_write_burst_cont( - _device, TCBD_STREAM_CFG1, (u8 *)&threshold, 2); - - if (_use_cmd_fifo == ENABLE_CMD_FIFO) - ret |= tcbd_reg_write(_device, TCBD_STREAM_CFG3, 0x12); - else - ret |= tcbd_reg_write(_device, TCBD_STREAM_CFG3, 0x10); - - tcbd_reset_ip(_device, TCBD_SYS_COMP_ALL, TCBD_SYS_COMP_EP); - - /* Enable internal buffer */ - ret |= tcbd_reg_write(_device, TCBD_STREAM_CFG0, _buffer_mask); - - _device->intr_threshold = _threshold; - _device->selected_buff = _buffer_mask; - _device->en_cmd_fifo = _use_cmd_fifo; - -#if defined(__READ_VARIABLE_LENGTH__) - _device->size_more_read = 0; -#endif /*__READ_VARIABLE_LENGTH__*/ - return ret; -} - -#if defined(__CSPI_ONLY__) -#if defined(__READ_FIXED_LENGTH__) -s32 tcbd_read_stream(struct tcbd_device *_device, u8 *_buff, s32 *_size) -{ - u32 bytes_read = _device->intr_threshold; - - if (bytes_read <= 0 || _buff == NULL) - return -TCERR_INVALID_ARG; -/* - tcbd_reg_write(_device, TCBD_STREAM_CFG3, 0x22); - tcbd_reg_read_burst_cont( - _device, TCBD_STREAM_CFG1, (u8 *)&bytes_remain, 2); - bytes_remain = SWAP16(bytes_remain) << 2; - - tcbd_debug(DEBUG_STREAM_READ, "%d bytes read, %d bytes remain\n", - bytes_read, bytes_remain); -*/ - *_size = bytes_read; - - return tcbd_reg_read_burst_fix( - _device, TCBD_STREAM_CFG4, _buff, bytes_read); -} -#elif defined(__READ_VARIABLE_LENGTH__) -s32 tcbd_read_stream(struct tcbd_device *_device, u8 *_buff, s32 *_size) -{ - u32 bytes_remain = 0; - u32 bytes_read = _device->intr_threshold; - - if (bytes_read <= 0 || _buff == NULL) - return -TCERR_INVALID_ARG; - - tcbd_reg_write(_device, TCBD_STREAM_CFG3, 0x22); - tcbd_reg_read_burst_cont( - _device, TCBD_STREAM_CFG1, (u8 *)&bytes_remain, 2); - - /* bytes_remain is word count. x4 needed */ - bytes_remain = SWAP16(bytes_remain) << 2; - bytes_read = bytes_read + bytes_remain - _device->size_more_read; - tcbd_debug(DEBUG_STREAM_READ, "%d bytes remain, real data size:%d\n", - bytes_remain, bytes_read); - - if ((_device->intr_threshold << 1) < bytes_read) { - tcbd_debug(DEBUG_ERROR, "Could not read data over " - "TCBD_MAX_THRESHOLD(%d)\n", - bytes_read); - return -TCERR_FATAL_ERROR; - } - _device->size_more_read = bytes_remain; - *_size = bytes_read; - return tcbd_reg_read_burst_fix( - _device, TCBD_STREAM_CFG4, _buff, bytes_read); -} -#else -#error "you must define __READ_VARIABLE_LENGTH__ or __READ_FIXED_LENGTH__" -#endif /*!__READ_FIXED_LENGTH__ && !__READ_VARIABLE_LENGTH__*/ -#endif /*__CSPI_ONLY__*/ - -s32 tcbd_tune_frequency( - struct tcbd_device *_device, u32 _freq_khz, s32 _bw_khz) -{ - s32 ret = 0; - u64 tick; - - tcbd_debug(DEBUG_API_COMMON, "freq:%d, bw:%d\n", _freq_khz, _bw_khz); - - memset(&_device->mult_service, 0, sizeof(_device->mult_service)); - tick = tcpal_get_time(); - if (_freq_khz < 1000000) - _device->curr_band = BAND_TYPE_BAND3; - else - _device->curr_band = BAND_TYPE_LBAND; - ret |= tcbd_reset_ip(_device, TCBD_SYS_COMP_ALL, TCBD_SYS_COMP_ALL); - - ret |= tcbd_rf_tune_frequency(_device, _freq_khz, _bw_khz); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, "failed to tune frequency to RF!! " - "ret:%d\n", ret); - return ret; - } - - switch (_device->peri_type) { - case PERI_TYPE_SPI_ONLY: - ret |= tcbd_init_stream_data_config(_device, ENABLE_CMD_FIFO, - STREAM_DATA_ENABLE | STREAM_HEADER_ON | - STREAM_MASK_BUFFERA, TCBD_THRESHOLD_FIC); - break; - case PERI_TYPE_STS: - ret |= tcbd_init_stream_data_config(_device, DISABLE_CMD_FIFO, - 0, 0); - break; - default: - tcbd_debug(DEBUG_ERROR, "%d not implemented!!\n", - _device->peri_type); - return -TCERR_FATAL_ERROR; - } - tcbd_init_status_manager(); - - ret |= tcbd_demod_tune_frequency(_device, _freq_khz, _bw_khz); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, "failed to tune frequency " - "to demodulator!! ret:%d\n", ret); - return ret; - } - _device->prev_band = _device->curr_band; - _device->frequency = _freq_khz; - -#if defined(__READ_VARIABLE_LENGTH__) - _device->size_more_read = 0; -#endif /*__READ_VARIABLE_LENGTH__*/ - tcbd_debug(DEBUG_API_COMMON, " # Frequency set time :%lld\n", - tcpal_diff_time(tick)); - - return ret; -} - -s32 tcbd_wait_tune(struct tcbd_device *_device, u8 *_status) -{ - s32 ret = 0; - u8 cto, cfo, ofdm; - u64 time_tick, time_tune_wait; - - time_tune_wait = TDMB_OFDMDETECT_LOCK * TDMB_OFDMDETECT_RETRY; - time_tick = tcpal_get_time(); - do { - ret = tcbd_reg_read(_device, TCBD_PROGRAMID, _status); - if (ret < 0) - goto exit_wait_tune; - - cto = ((*_status) >> 1) & 0x01; - cfo = ((*_status) >> 2) & 0x01; - if (cto && cfo) - goto exit_wait_tune; - - ofdm = ((*_status) >> 5) & 0x01; - if (ofdm) - break; - } while (tcpal_diff_time(time_tick) < time_tune_wait); - - if (ofdm == 0) { - ret = -TCERR_TUNE_FAILED; - goto exit_wait_tune; - } - - time_tune_wait = (TDMB_CTO_LOCK * TDMB_CTO_RETRY) + - (TDMB_CTO_LOCK + TDMB_CFO_LOCK) * - TDMB_CFO_RETRY; - time_tick = tcpal_get_time(); - do { - ret = tcbd_reg_read(_device, TCBD_PROGRAMID, _status); - if (ret < 0) - goto exit_wait_tune; - - cto = ((*_status) >> 1) & 0x01; - cfo = ((*_status) >> 2) & 0x01; - if (cto && cfo) - break; - } while (tcpal_diff_time(time_tick) < time_tune_wait); - - if (cto && cfo) - tcbd_debug(DEBUG_API_COMMON, "lock status : 0x%02X\n", - *_status); - else - ret = -TCERR_TUNE_FAILED; - -exit_wait_tune: - return ret; -} - -static inline s32 tcbd_calc_threshold(struct tcbd_service *_service) -{ - s32 threshold = 0; - s32 uep_bitrate[] = { - 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384}; - - switch (_service->ptype) { - case PROTECTION_TYPE_UEP: - threshold = (uep_bitrate[_service->bitrate] * 6) << 2; - break; - case PROTECTION_TYPE_EEP: - threshold = (_service->bitrate * 6) << 5; - break; - } - - if (TCBD_MAX_THRESHOLD < threshold) - threshold = TCBD_MAX_THRESHOLD; - - tcbd_debug(DEBUG_API_COMMON, "ptype:%s, bitrate :%d, interrupt " - "threshold:%d\n", (_service->ptype) ? "EEP" : "UEP", - _service->bitrate, threshold); - - return threshold>>1; -} - -static inline s32 tcbd_find_empty_slot( - struct tcbd_multi_service *_multi_svc) -{ - s32 i; - - for (i = 0; i < TCBD_MAX_NUM_SERVICE; i++) { - if (_multi_svc->on_air[i] == 0) - return i; - } - return -1; -} - -static inline s32 tcbd_find_used_slot( - struct tcbd_multi_service *_multi_svc, u8 _subch_id) -{ - s32 i; - u32 *service_info = _multi_svc->service_info; - - if (_multi_svc->service_count == 0) - return -1; - - for (i = 0; i < TCBD_MAX_NUM_SERVICE; i++) { - if (((service_info[i * 2] >> 20) & 0x3F) == _subch_id) - return i; - } - return -1; -} - -#define FLAG_SHORT_PARAM 0 -#define FLAG_LONG_PARAM 1 -static inline s32 tcbd_set_service(struct tcbd_device *_device, - struct tcbd_service *_service, s32 _flag) -{ - s32 ret = 0; - u32 threshold = 0, sel_buff = 0, sel_stream = 0; - u8 en_cmd_fifo = 0; - - sel_buff = STREAM_DATA_ENABLE | STREAM_HEADER_ON | - STREAM_MASK_BUFFERA; - switch (_device->peri_type) { - case PERI_TYPE_SPI_ONLY: - if (_flag == FLAG_LONG_PARAM) { - threshold = tcbd_calc_threshold(_service); - sel_stream = STREAM_SET_GARBAGE(threshold) | - STREAM_TYPE_ALL; - } else { - threshold = TCBD_MAX_THRESHOLD; - sel_stream = STREAM_SET_GARBAGE(TCBD_MAX_THRESHOLD) | - STREAM_TYPE_ALL; - } - tcbd_debug(DEBUG_API_COMMON, "threshold : %d\n", threshold); - en_cmd_fifo = ENABLE_CMD_FIFO; - break; - case PERI_TYPE_STS: - en_cmd_fifo = DISABLE_CMD_FIFO; - sel_stream = STREAM_TYPE_ALL; -#if !defined(__ALWAYS_FIC_ON__) - sel_buff &= ~(STREAM_HEADER_ON); -#endif /*__ALWAYS_FIC_ON__*/ - break; - default: - tcbd_debug(DEBUG_ERROR, "not implemented!\n"); - return -1; - } - -#if !defined(__ALWAYS_FIC_ON__) - sel_stream &= ~(STREAM_TYPE_FIC); -#endif /*__ALWAYS_FIC_ON__*/ - -#if defined(__STATUS_IN_REGISTER__) - sel_stream &= ~(STREAM_TYPE_STATUS); -#endif /* __STATUS_IN_REGISTER__ */ - -#if defined(__READ_VARIABLE_LENGTH__) - _device->size_more_read = 0; -#endif /*__READ_VARIABLE_LENGTH__*/ - ret |= tcbd_disable_irq(_device, 0); - - ret |= tcbd_change_stream_type(_device, sel_stream); - ret |= tcbd_init_stream_data_config( - _device, en_cmd_fifo, sel_buff, threshold); - - ret |= tcbd_send_service_info(_device); - if (_device->peri_type == PERI_TYPE_SPI_ONLY) - ret |= tcbd_enable_irq(_device, _device->enabled_irq); - return ret; -} - -s32 tcbd_register_service(struct tcbd_device *_device, u8 _subch_id, - u8 _data_mode) -{ - s32 empty_slot, empty_slot2x; - struct tcbd_service service = {0, }; - struct tcbd_multi_service *mult_service = &_device->mult_service; - u32 *service_info = mult_service->service_info; - - if (tcbd_find_used_slot(mult_service, _subch_id) >= 0) { - tcbd_debug(DEBUG_ERROR, "aready registerd service! " - "subch_id:%d\n", _subch_id); - return -TCERR_AREADY_REGISTERED; - } - - empty_slot = tcbd_find_empty_slot(mult_service); - if (empty_slot < 0) { - tcbd_debug(DEBUG_ERROR, "Exceed maxinum number of service!!\n"); - return -TCERR_MAX_NUM_SERVICE; - } - service.subch_id = _subch_id; - empty_slot2x = empty_slot << 1; - mult_service->on_air[empty_slot] = 1; - mult_service->service_count++; - - tcbd_debug(DEBUG_API_COMMON, "sub channel:%d, data mode:%d\n", - _subch_id, _data_mode); - service_info[empty_slot2x] = - (_subch_id << 20) | - (2 << 26); - service_info[empty_slot2x + 1] = - (empty_slot << 20) | - (_data_mode << 16); - - return tcbd_set_service(_device, &service, FLAG_SHORT_PARAM); -} - -s32 tcbd_register_service_long(struct tcbd_device *_device, - struct tcbd_service *_service) -{ - s32 empty_slot, empty_slot2x; - u32 data_mode = 0; - struct tcbd_multi_service *mult_service = &_device->mult_service; - u32 *service_info = mult_service->service_info; - - if (tcbd_find_used_slot(mult_service, _service->subch_id) >= 0) { - tcbd_debug(DEBUG_ERROR, "aready registerd service! " - "subch_id:%d\n", _service->subch_id); - return -TCERR_AREADY_REGISTERED; - } - - empty_slot = tcbd_find_empty_slot(mult_service); - if (empty_slot < 0) { - tcbd_debug(DEBUG_ERROR, "Exceed maxinum number of service!!\n"); - return -TCERR_MAX_NUM_SERVICE; - } - - switch (_service->type) { - case SERVICE_TYPE_DAB: - case SERVICE_TYPE_DABPLUS: - case SERVICE_TYPE_DATA: - data_mode = 0; break; - case SERVICE_TYPE_DMB: - data_mode = 1; break; - default: - data_mode = 2; break; - } - - empty_slot2x = empty_slot << 1; - mult_service->on_air[empty_slot] = 1; - mult_service->service_count++; - - service_info[empty_slot2x] = - (_service->reconfig << 26) | - (_service->subch_id << 20) | - (_service->size_cu << 10) | - _service->start_cu; - service_info[empty_slot2x + 1] = - (empty_slot << 20) | - /*(0 << 18) |*/ - (data_mode << 16) | - (_service->ptype << 11) | - (_service->plevel << 8) | - _service->bitrate; - - return tcbd_set_service(_device, _service, FLAG_LONG_PARAM); -} - -s32 tcbd_unregister_service(struct tcbd_device *_device, u8 _subch_id) -{ - s32 ret = 0; - s32 service_idx; - struct tcbd_multi_service *mult_service = &_device->mult_service; - u32 *service_info = mult_service->service_info; - - tcbd_disable_irq(_device, 0); - service_idx = tcbd_find_used_slot(mult_service, _subch_id); - if (service_idx < 0) { - tcbd_debug(DEBUG_ERROR, "not registered service!\n"); - return -TCERR_SERVICE_NOT_FOUND; - } - /*tcbd_disable_peri(_device);*/ - - service_info[service_idx * 2] = 0x00; - service_info[service_idx * 2 + 1] = 0x00; - mult_service->on_air[service_idx] = 0; - mult_service->service_count--; - - ret |= tcbd_send_service_info(_device); - return ret; -} - -s32 tcbd_read_fic_data(struct tcbd_device *_device, u8 *_buff, s32 _size) -{ - s32 ret = 0; - u32 addr_fic_buff; - u8 status, err_status; - - tcbd_read_irq_status(_device, &status, &err_status); - if (_size != TCBD_FIC_SIZE) { - tcbd_debug(DEBUG_ERROR, "wrong fic size! %d\n", _size); - ret = -TCERR_INVALID_ARG; - goto exit_read_fic; - } - if (status & TCBD_IRQ_STAT_FIFOAINIT) { - addr_fic_buff = PHY_MEM_ADDR_A_START; - tcbd_debug(DEBUG_INTRRUPT, "status:0x%02X, err:0x%02X\n", - status, err_status); - - ret = tcbd_mem_read(_device, addr_fic_buff, _buff, _size); - } else - ret = -TCERR_NO_FIC_DATA; -exit_read_fic: - tcbd_clear_irq(_device, status); - return ret; - } - -static s32 tcbd_disp_dsp_debug(struct tcbd_device *_device) -{ - s32 pos_buf = 0, ret, i; - u32 len = 0, *data = NULL; - u16 cmd; - s8 debug_buff[256]; - - tcbd_debug_mbox_rx(&cmd, &len, &data); - if (data == NULL) - return 0; - - ret = tcbd_read_mail_box(_device, cmd, len, data); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, "failed to read mail box, " - "err:%d\n", ret); - return ret; -} - - for (i = 0; i < 6; i++) - pos_buf += sprintf(debug_buff + pos_buf, "[%d:%08X]", - i, data[i]); - tcbd_debug(DEBUG_INFO, "%s\n", debug_buff); - - return 0; -} - -s32 tcbd_read_signal_info( - struct tcbd_device *_device, - struct tcbd_status_data *_status_data) -{ - s32 ret = 0; -#if defined(__STATUS_IN_REGISTER__) - u8 status[32] = {0, }; -#endif /*__STATUS_IN_REGISTER__*/ - - if (!_status_data) - return -TCERR_INVALID_ARG; - - if (tcbd_debug_spur_dbg() == 1) - tcbd_disp_dsp_debug(_device); - -#if defined(__STATUS_IN_REGISTER__) - ret = tcbd_reg_write(_device, TCBD_OP_STATUS0, 0x1); - ret |= tcbd_reg_read_burst_fix(_device, - TCBD_OP_STATUS1, status, TCBD_STATUS_SIZE); - tcbd_update_status(status, TCBD_STATUS_SIZE, _status_data); -#elif defined(__STATUS_IN_STREAM__) - - tcbd_update_status(NULL, 0, _status_data); -#endif /*__STATUS_IN_STREAM__*/ - return ret; -} diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_diagnosis/Makefile b/drivers/media/tdmb/tcc3170/src/tcbd_diagnosis/Makefile deleted file mode 100644 index a901855..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_diagnosis/Makefile +++ /dev/null @@ -1,5 +0,0 @@ -obj-y += tcbd_diagnosis.o - -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcpal -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcbd_diagnosis diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_diagnosis/tcbd_diagnosis.c b/drivers/media/tdmb/tcc3170/src/tcbd_diagnosis/tcbd_diagnosis.c deleted file mode 100644 index e425df8..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_diagnosis/tcbd_diagnosis.c +++ /dev/null @@ -1,386 +0,0 @@ -/* - * tcbd_diagnosis.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcbd_diagnosis.h" -#include "tcbd_error.h" - -#define OFFSET_RF_LOOP_GAIN 4 -#define OFFSET_BB_LOOP_GAIN 5 -#define OFFSET_PRS_SNR 8 -#define OFFSET_PCBER 12 -#define OFFSET_RS_PKT_CNT 16 -#define OFFSET_RS_OVER_CNT 20 -#define OFFSET_RS_ERR_CNT_LO 24 -#define OFFSET_RS_ERR_CNT_HI 28 - -#define MAX_MAVG_ARRAY_SIZE 10 - -#define MIN_SNR 0 -#define MAX_SNR 25 - -#define MIN_PCBER 0 -#define MAX_PCBER 1 - -#define MIN_VITERBIBER 0 -#define MAX_VITERBIBER 1 - -#define MIN_TSPER 0 -#define MAX_TSPER 1 - -#define MIN_RSSI (-105) -#define MAX_RSSI 3 - -#define SCALE_FACTOR 10000 -#define ERROR_LIMIT 2000 - -struct tcbd_moving_avg { - u32 array[MAX_MAVG_ARRAY_SIZE+1]; - u32 pre_sum; - u64 total_sum; - s32 index; - s32 moving_cnt; - s32 total_cnt; -}; - -struct tcbd_raw_status { - u8 lock_status; - u8 rf_loop_gain; - u8 bb_loop_gain; - - s32 pcber; - u32 prs_snr; - - u32 rs_over_cnt; - u32 rs_pkt_cnt; - u64 rs_err_cnt; -}; - -struct tcbd_raw_status_manager { - u32 resynced; - struct tcbd_raw_status old_status; - struct tcbd_raw_status curr_status; - - struct tcbd_status_data status_data; -}; - -static struct tcbd_moving_avg moving_average[4]; -static struct tcbd_raw_status_manager status_manager; - -static inline u32 tcbd_log10(u32 _val) -{ - u32 i, snr = 0; - u32 snr_table[28] = { - 1024, 1289, 1622, 2043, 2572, 3238, 4076, 5132, - 6461, 8133, 10240, 12891, 6229, 20431, 25721, 32381, - 40766, 51321, 64610, 81339, 102400, 128913, 162293, 204314, - 257217, 323817, 407661, 513215 }; - - if (_val < snr_table[0]) - return 0; - - if (_val >= snr_table[27]) - return 27; - - for (i = 0; i < 27; i++) { - if (_val >= snr_table[i] && - _val < snr_table[i + 1]) { - snr = i; - break; - } - } - - return snr; -} - -static s32 tcbd_get_moving_avg( - struct tcbd_moving_avg *_slot, u32 _value, s32 _windowSize) -{ - s32 moving_sum; - u32 result; - - if (MAX_MAVG_ARRAY_SIZE < _windowSize) { - tcbd_debug(0, - "max window size is %d\n", MAX_MAVG_ARRAY_SIZE); - return -TCERR_INVALID_ARG; - } - - if (_slot->moving_cnt >= _windowSize) - _slot->pre_sum += _slot->array[_slot->index]; - else - _slot->moving_cnt++; - - _slot->array[_slot->index] = _value; - _slot->index++; - - _slot->index %= _windowSize; - _slot->total_cnt++; - _slot->total_sum += _value; - - moving_sum = _slot->total_sum - _slot->pre_sum; - result = moving_sum / _slot->moving_cnt; - - if (_slot->index == 0) { - _slot->total_sum = moving_sum; - _slot->pre_sum = 0; - } - - return result; -} - - -static inline void tcbd_calc_rssi(struct tcbd_status_data *_status_data) -{ - struct tcbd_raw_status *curr_status = &status_manager.curr_status; - - if (curr_status->rf_loop_gain <= 120) - _status_data->rssi = 1500 - - ((int)curr_status->bb_loop_gain) * 37 - - 27 * ((int)curr_status->rf_loop_gain); - else if (curr_status->rf_loop_gain <= 216) - _status_data->rssi = 1500 - - ((int)curr_status->bb_loop_gain) * 35 - - 24 * ((int)curr_status->rf_loop_gain); - else - _status_data->rssi = 1500 - - ((int)curr_status->bb_loop_gain) * 33 - - 22 * ((int)curr_status->rf_loop_gain); - - _status_data->rssi /= 100; - if (_status_data->rssi < MIN_RSSI) - _status_data->rssi = MIN_RSSI; - else if (_status_data->rssi > MAX_RSSI) - _status_data->rssi = MAX_RSSI; -} - -static inline void tcbd_calc_pcber(struct tcbd_status_data *_status_data) -{ - long long over; - struct tcbd_raw_status *curr_status = &status_manager.curr_status; - - over = (u64)curr_status->pcber * SCALE_FACTOR; - _status_data->pcber = (u32)(over >> 16); - - if (_status_data->pcber < MIN_PCBER) - _status_data->pcber = MIN_PCBER; - else if (_status_data->pcber > MAX_PCBER * ERROR_LIMIT) - _status_data->pcber = MAX_PCBER * ERROR_LIMIT; - - if (_status_data->pcber <= 20) - _status_data->pcber = 0; - - _status_data->pcber_moving_avg = - tcbd_get_moving_avg( - &moving_average[0], - _status_data->pcber, - MAX_MAVG_ARRAY_SIZE); -} - -static inline void tcbd_calc_snr(struct tcbd_status_data *_status_data) -{ - struct tcbd_raw_status *curr_status = &status_manager.curr_status; - - if ((int)curr_status->prs_snr < 0) - _status_data->snr = MAX_SNR; - else if (curr_status->prs_snr == 0) - _status_data->snr = MIN_SNR; - else - _status_data->snr = tcbd_log10(curr_status->prs_snr); - - if (_status_data->snr < MIN_SNR) - _status_data->snr = MIN_SNR; - else if (_status_data->snr > MAX_SNR) - _status_data->snr = MAX_SNR; - - _status_data->snr_moving_avg = - tcbd_get_moving_avg( - &moving_average[1], - _status_data->snr, - MAX_MAVG_ARRAY_SIZE); -} - -static inline void tcbd_calc_viterbi_ber(struct tcbd_status_data *_status_data) -{ - s32 rs_err, rs_over, rs_under; - struct tcbd_raw_status *old_status, *curr_status; - - old_status = &status_manager.old_status; - curr_status = &status_manager.curr_status; - - if (status_manager.resynced) { - _status_data->vber = MAX_VITERBIBER * ERROR_LIMIT; - goto exit_calc_viterbi_ber; - } - - if (status_manager.resynced && curr_status->rs_pkt_cnt == 0) { - _status_data->vber = MIN_VITERBIBER; - goto exit_calc_viterbi_ber; - } - - rs_err = ((u32)(curr_status->rs_over_cnt - - old_status->rs_over_cnt)) * SCALE_FACTOR; - - rs_over = (rs_err * (8 * 8) + - ((u32)(curr_status->rs_err_cnt - - old_status->rs_err_cnt)) * SCALE_FACTOR); - rs_under = - (curr_status->rs_pkt_cnt - - old_status->rs_pkt_cnt) * 204 * 8; - if (!rs_under) - return; - - _status_data->vber = rs_over / rs_under; - - if (_status_data->vber < MIN_VITERBIBER) - _status_data->vber = MIN_VITERBIBER; - else if (_status_data->vber > MAX_VITERBIBER * ERROR_LIMIT) - _status_data->vber = MAX_VITERBIBER * ERROR_LIMIT; - -exit_calc_viterbi_ber: - _status_data->vber_moving_avg = - tcbd_get_moving_avg( - &moving_average[3], - _status_data->vber, - MAX_MAVG_ARRAY_SIZE); -} - -static inline void tcbd_calc_tsper(struct tcbd_status_data *_status_data) -{ - s32 rs_over, rs_under; - struct tcbd_raw_status *old_status, *curr_status; - - old_status = &status_manager.old_status; - curr_status = &status_manager.curr_status; - - if (status_manager.resynced) { - _status_data->tsper = MAX_TSPER * ERROR_LIMIT; - goto exit_calc_tsper; - } - - if (status_manager.resynced && curr_status->rs_pkt_cnt == 0) { - _status_data->tsper = MIN_TSPER; - goto exit_calc_tsper; - } - - rs_over = (curr_status->rs_over_cnt - - old_status->rs_over_cnt) * SCALE_FACTOR; - rs_under = curr_status->rs_pkt_cnt - old_status->rs_pkt_cnt; - if (!rs_under) - return; - - _status_data->ts_error_count = rs_over; - _status_data->tsper = rs_over / rs_under; - if (_status_data->tsper < MIN_TSPER) - _status_data->tsper = MIN_TSPER; - else if (_status_data->tsper > MAX_TSPER * ERROR_LIMIT) - _status_data->tsper = MAX_TSPER * ERROR_LIMIT; - -exit_calc_tsper: - _status_data->tsper_moving_avg = tcbd_get_moving_avg( - &moving_average[2], - _status_data->tsper, - MAX_MAVG_ARRAY_SIZE); -} - -void tcbd_update_status_per_frame( - u8 *_raw_data, struct tcbd_status_data *_status_data) -{ - struct tcbd_raw_status *old_status, *curr_status; - struct tcbd_status_data *status_data; - - if (!_raw_data && !_status_data) - return; - - if (_raw_data == NULL) { - memcpy(_status_data, &status_manager.status_data, - sizeof(struct tcbd_status_data)); - return; - } - - status_data = (_status_data) ? - _status_data : &status_manager.status_data; - old_status = &status_manager.old_status; - curr_status = &status_manager.curr_status; - memcpy(old_status, curr_status, sizeof(struct tcbd_raw_status)); - - curr_status->rf_loop_gain = _raw_data[OFFSET_RF_LOOP_GAIN]; - curr_status->bb_loop_gain = _raw_data[OFFSET_BB_LOOP_GAIN]; - - curr_status->prs_snr = - *((u32 *)(_raw_data + OFFSET_PRS_SNR)); - curr_status->pcber = - *((u32 *)(_raw_data + OFFSET_PCBER)); - - curr_status->rs_pkt_cnt = - *((u32 *)(_raw_data + OFFSET_RS_PKT_CNT)); - curr_status->rs_over_cnt = - *((u32 *)(_raw_data + OFFSET_RS_OVER_CNT)); - curr_status->rs_err_cnt = - *((u64 *)(_raw_data + OFFSET_RS_ERR_CNT_LO)); - curr_status->rs_err_cnt |= - (*((u64 *)(_raw_data + OFFSET_RS_ERR_CNT_HI))) << 32; - - if (curr_status->rs_pkt_cnt != old_status->rs_pkt_cnt) { - status_manager.resynced = 0; - if (curr_status->rs_pkt_cnt == 0 && old_status->rs_pkt_cnt) - status_manager.resynced = 1; - else if (curr_status->rs_pkt_cnt < old_status->rs_pkt_cnt) { - if (old_status->rs_pkt_cnt < 0x80000000) - status_manager.resynced = 1; - } - } - - tcbd_calc_snr(status_data); - tcbd_calc_pcber(status_data); - tcbd_calc_viterbi_ber(status_data); - tcbd_calc_tsper(status_data); - tcbd_calc_rssi(status_data); - - status_data->lock = *((u8 *)_raw_data); - if (status_manager.resynced) { - memset(moving_average, 0, sizeof(moving_average)); - memset(&status_manager.old_status, 0, - sizeof(struct tcbd_raw_status)); - } -} - -void tcbd_update_status( - u8 *_raw_data, u32 _size, struct tcbd_status_data *_status_data) -{ - s32 i; - - if (!_raw_data) - tcbd_update_status_per_frame(NULL, _status_data); - - for (i = 0; i < _size / TCBD_STATUS_SIZE; i++) - tcbd_update_status_per_frame(_raw_data + i * TCBD_STATUS_SIZE, - _status_data); -} - -void tcbd_init_status_manager(void) -{ - memset(&status_manager, 0, sizeof(status_manager)); - memset(moving_average, 0, sizeof(moving_average)); -} diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_drv_dual.c b/drivers/media/tdmb/tcc3170/src/tcbd_drv_dual.c deleted file mode 100644 index 0897012..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_drv_dual.c +++ /dev/null @@ -1,54 +0,0 @@ -/* - * tcbd_drv_dual.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcbd_api_common.h" -#include "tcbd_drv_io.h" - -s32 tcbd_change_chip_addr(struct tcbd_device *_device, u8 addr) -{ - _device->chip_addr = addr; - return tcbd_reg_write(_device, TCBD_CHIPADDR, addr); -} - -s32 tcbd_enable_slave_command_ack(struct tcbd_device *_device) -{ - s32 ret = 0; - u16 outData = SWAP16((0x1 << 15)); - u16 outEnable = SWAP16((0x1 << 15)); - - ret |= tcbd_reg_write_burst_cont( - _device, TCBD_GPIO_LR, (u8 *)&outData, 2); - ret |= tcbd_reg_write_burst_cont( - _device, TCBD_GPIO_DR, (u8 *)&outEnable, 2); - - return ret; -} - -s32 tcbd_init_div_io( - struct tcbd_device *_device, enum tcbd_div_io_type _divIo) -{ - return tcbd_reg_write(_device, TCBD_DIVIO, (u8)_divIo); -} diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_drv_io.c b/drivers/media/tdmb/tcc3170/src/tcbd_drv_io.c deleted file mode 100644 index e2bcbea..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_drv_io.c +++ /dev/null @@ -1,516 +0,0 @@ -/* - * tcbd_drv_io.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcbd_api_common.h" -#include "tcbd_drv_ip.h" -#include "tcbd_drv_io.h" - -static struct tcbd_io_data tcbd_io_funcs; - -struct tcbd_io_data *tcbd_get_io_struct(void) -{ - return &tcbd_io_funcs; -} - -s32 tcbd_io_open(struct tcbd_device *_device) -{ - s32 ret = 0; - - if (tcbd_io_funcs.open == NULL) - return -TCERR_IO_NOT_INITIALIZED; - - tcpal_create_lock(&tcbd_io_funcs.sem, "tcbd_io_lock", 0); - - ret = tcbd_io_funcs.open(); - if (ret < 0) - return ret; - - _device->chip_addr = DEFAULT_CHIP_ADDRESS; - - /*Initialize internal processor */ - tcbd_reset_ip(_device, TCBD_SYS_COMP_EP, TCBD_SYS_COMP_ALL); - - return ret; -} - -s32 tcbd_io_close(struct tcbd_device *_device) -{ - s32 ret = 0; - - if (tcbd_io_funcs.close == NULL) - return -TCERR_IO_NOT_INITIALIZED; - - tcpal_destroy_lock(&tcbd_io_funcs.sem); - - ret = tcbd_io_funcs.close(); - memset(_device, 0, sizeof(struct tcbd_device)); - - return ret; -} - -s32 tcbd_reg_read( - struct tcbd_device *_device, u8 _addr, u8 *_data) -{ - s32 ret; - - if (tcbd_io_funcs.reg_read == NULL) - return -TCERR_IO_NOT_INITIALIZED; - - if (_device == NULL || _data == NULL) - return -TCERR_INVALID_ARG; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - ret = tcbd_io_funcs.reg_read(_addr, _data); - tcpal_unlock(&tcbd_io_funcs.sem); - return ret; -} - -s32 tcbd_reg_write( - struct tcbd_device *_device, u8 _addr, u8 _data) -{ - s32 ret; - - if (tcbd_io_funcs.reg_write == NULL) - return -TCERR_IO_NOT_INITIALIZED; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - ret = tcbd_io_funcs.reg_write(_addr, _data); - tcpal_unlock(&tcbd_io_funcs.sem); - - return ret; -} - -s32 tcbd_reg_read_burst_cont( - struct tcbd_device *_device, u8 _addr, u8 *_data, s32 _size) -{ - s32 ret; - - if (tcbd_io_funcs.reg_read_burst_cont == NULL) - return -TCERR_IO_NOT_INITIALIZED; - - if (_device == NULL || _data == NULL) - return TCERR_INVALID_ARG; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - ret = tcbd_io_funcs.reg_read_burst_cont(_addr, _data, _size); - tcpal_unlock(&tcbd_io_funcs.sem); - - return ret; -} - -s32 tcbd_reg_write_burst_cont( - struct tcbd_device *_device, u8 _addr, u8 *_data, s32 _size) -{ - s32 ret; - - if (tcbd_io_funcs.reg_write_burst_cont == NULL) - return -TCERR_IO_NOT_INITIALIZED; - - if (_device == NULL || _data == NULL || _size <= 0) - return TCERR_INVALID_ARG; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - ret = tcbd_io_funcs.reg_write_burst_cont(_addr, _data, _size); - tcpal_unlock(&tcbd_io_funcs.sem); - - return ret; -} - -s32 tcbd_reg_read_burst_fix( - struct tcbd_device *_device, u8 _addr, u8 *_data, s32 _size) -{ - s32 ret; - - if (tcbd_io_funcs.reg_read_burst_fix == NULL) - return -TCERR_IO_NOT_INITIALIZED; - - if (_device == NULL || _data == NULL || _size <= 0) - return TCERR_INVALID_ARG; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - ret = tcbd_io_funcs.reg_read_burst_fix(_addr, _data, _size); - tcpal_unlock(&tcbd_io_funcs.sem); - - return ret; -} - -s32 tcbd_reg_write_burst_fix( - struct tcbd_device *_device, u8 _addr, u8 *_data, s32 _size) -{ - s32 ret; - - if (tcbd_io_funcs.reg_write_burst_fix == NULL) - return -TCERR_IO_NOT_INITIALIZED; - - if (_device == NULL || _data == NULL || _size <= 0) - return TCERR_INVALID_ARG; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - ret = tcbd_io_funcs.reg_write_burst_fix(_addr, _data, _size); - tcpal_unlock(&tcbd_io_funcs.sem); - - return ret; -} - -s32 tcbd_mem_write( - struct tcbd_device *_device, u32 _addr, u8 *_data, u32 _size) -{ - s32 ret = 0; - u32 addr = SWAP32(_addr); - u16 size = SWAP16((u16)(_size>>2)); - u8 ctrl_data; - - if (_size <= 0 || _data == NULL || _device == NULL) - return -TCERR_INVALID_ARG; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - - ctrl_data = - TCBD_CMDDMA_DMAEN | - TCBD_CMDDMA_WRITEMODE | - TCBD_CMDDMA_CRC32EN; - ret |= tcbd_io_funcs.reg_write(TCBD_CMDDMA_CTRL, ctrl_data); - ret |= tcbd_io_funcs.reg_write_burst_cont( - TCBD_CMDDMA_SADDR, (u8 *)&addr, sizeof(u32)); - ret |= tcbd_io_funcs.reg_write_burst_cont( - TCBD_CMDDMA_SIZE, (u8 *)&size, sizeof(u16)); - ctrl_data = - TCBD_CMDDMA_START_AUTOCLR | - TCBD_CMDDMA_INIT_AUTOCLR | - TCBD_CMDDMA_CRC32INIT_AUTOCLR | - TCBD_CMDDMA_CRC32INIT_AUTOCLR; - ret |= tcbd_io_funcs.reg_write(TCBD_CMDDMA_STARTCTRL, ctrl_data); - ret |= tcbd_io_funcs.reg_write_burst_fix( - TCBD_CMDDMA_DATA_WIND, _data, _size); - - tcpal_unlock(&tcbd_io_funcs.sem); - return ret; -} - -s32 tcbd_mem_read( - struct tcbd_device *_device, u32 _addr, u8 *_data, u32 _size) -{ - s32 ret = 0; - u8 ctrl_data; - u32 addr = SWAP32(_addr); - u16 size = SWAP16((u16)(_size >> 2)); - - if (_size <= 0 || _data == NULL || _device == NULL) - return -TCERR_INVALID_ARG; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - - ctrl_data = TCBD_CMDDMA_DMAEN | TCBD_CMDDMA_READMODE; - ret |= tcbd_io_funcs.reg_write(TCBD_CMDDMA_CTRL, ctrl_data); - ret |= tcbd_io_funcs.reg_write_burst_cont( - TCBD_CMDDMA_SADDR, (u8 *)&addr, sizeof(u32)); - ret |= tcbd_io_funcs.reg_write_burst_cont( - TCBD_CMDDMA_SIZE, (u8 *)&size, sizeof(u16)); - ctrl_data = - TCBD_CMDDMA_START_AUTOCLR | - TCBD_CMDDMA_INIT_AUTOCLR | - TCBD_CMDDMA_CRC32INIT_AUTOCLR; - ret |= tcbd_io_funcs.reg_write(TCBD_CMDDMA_STARTCTRL, ctrl_data); - ret |= tcbd_io_funcs.reg_read_burst_fix( - TCBD_CMDDMA_DATA_WIND, _data, _size); - - tcpal_unlock(&tcbd_io_funcs.sem); - return ret; -} - -s32 tcbd_rf_reg_write( - struct tcbd_device *_device, u8 _addr, u32 _data) -{ - s32 ret = 0; - u32 data = SWAP32(_data); - - if (_device == NULL) - return TCERR_INVALID_ARG; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - - ret |= tcbd_io_funcs.reg_write( - TCBD_RF_CFG0, - TCBD_RF_MANAGE_ENABLE|TCBD_RF_WRITE); - ret |= tcbd_io_funcs.reg_write(TCBD_RF_CFG2, _addr); - ret |= tcbd_io_funcs.reg_write_burst_cont( - TCBD_RF_CFG3, (u8 *)&data, sizeof(u32)); - ret |= tcbd_io_funcs.reg_write(TCBD_RF_CFG1, TCBD_RF_ACTION); - ret |= tcbd_io_funcs.reg_write(TCBD_RF_CFG0, TCBD_RF_MANAGE_DISABLE); - - tcpal_unlock(&tcbd_io_funcs.sem); - return ret; -} - -s32 tcbd_rf_reg_read( - struct tcbd_device *_device, u32 _addr, u32 *_data) -{ - s32 ret = 0; - u32 data = 0; - - if (_device == NULL) - return TCERR_INVALID_ARG; - - tcpal_lock(&tcbd_io_funcs.sem); - tcbd_io_funcs.chip_addr = _device->chip_addr; - - ret |= tcbd_io_funcs.reg_write( - TCBD_RF_CFG0, TCBD_RF_MANAGE_ENABLE|TCBD_RF_READ); - ret |= tcbd_io_funcs.reg_write(TCBD_RF_CFG2, _addr); - ret |= tcbd_io_funcs.reg_write(TCBD_RF_CFG1, TCBD_RF_ACTION); - ret |= tcbd_io_funcs.reg_read_burst_cont( - TCBD_RF_CFG3, (u8 *)&data, sizeof(u32)); - ret |= tcbd_io_funcs.reg_write(TCBD_RF_CFG0, TCBD_RF_MANAGE_DISABLE); - - *_data = SWAP32(data); - - tcpal_unlock(&tcbd_io_funcs.sem); - return ret; -} - -s32 tcbd_send_mail( - struct tcbd_device *_device, struct tcbd_mail_data *_mail) -{ - s32 ret = 0, count; - u8 mail_data[32]; - u8 reg_data = 0; - u64 time_tick, elapsed; - - tcpal_lock(&tcbd_io_funcs.sem); - - ret = tcbd_io_funcs.reg_write(TCBD_MAIL_CTRL, TCBD_MAIL_INIT); - - *((u32 *)mail_data) = - (MB_HOSTMAIL << 24) | (_mail->count << 20) | - (_mail->flag << 19) | (MB_ERR_OK << 16) | _mail->cmd; - - count = MIN(_mail->count, MAX_MAIL_COUNT); - if (count > 0) - memcpy(mail_data + sizeof(u32) , - _mail->data, count * sizeof(u32)); - - ret |= tcbd_io_funcs.reg_write_burst_fix( - TCBD_MAIL_FIFO_WIND, mail_data, - sizeof(u32) + count * sizeof(u32)); - ret |= tcbd_io_funcs.reg_write(TCBD_MAIL_CTRL, TCBD_MAIL_HOSTMAILPOST); - if (ret < 0) - goto exit_send_mail; - - time_tick = tcpal_get_time(); - do { - elapsed = tcpal_diff_time(time_tick); - if (elapsed > (u64)MAX_TIME_TO_WAIT_MAIL) { - ret = -TCERR_WAIT_MAIL_TIMEOUT; - goto exit_send_mail; - } - /* latch mail status to register */ - ret = tcbd_io_funcs.reg_write(TCBD_MAIL_FIFO_W, 0x5E); - /* read ratched status from register */ - ret |= tcbd_io_funcs.reg_read(TCBD_MAIL_FIFO_W, ®_data); - if (ret < 0) - break; - } while (!(reg_data & 0x1)); /* check fifo status */ - - tcbd_debug(DEBUG_DRV_IO, "cmd:0x%X, count:%d, elapsed time:%llu\n", - _mail->cmd, count, elapsed); - -exit_send_mail: - tcpal_unlock(&tcbd_io_funcs.sem); - return ret; -} - -s32 tcbd_recv_mail( - struct tcbd_device *_device, struct tcbd_mail_data *_mail) -{ - s32 ret = 0; - s32 mail_hdr; - u8 mail_data[32] = {0, }; - u8 reg_data = 0; - u8 bytes_read; - u64 time_tick, elapsed; - - tcpal_lock(&tcbd_io_funcs.sem); - - time_tick = tcpal_get_time(); - do { - /* latch mail status to register */ - ret = tcbd_io_funcs.reg_write(TCBD_MAIL_FIFO_R, 0x5E); - /* read ratched status from register */ - ret |= tcbd_io_funcs.reg_read(TCBD_MAIL_FIFO_R, ®_data); - - elapsed = tcpal_diff_time(time_tick); - if (elapsed > (u64)MAX_TIME_TO_WAIT_MAIL) - ret = -TCERR_WAIT_MAIL_TIMEOUT; - - if (ret < 0) - goto exit_recv_mail; - } while ((reg_data & 0xFC) < 3); /* check fifo status */ - bytes_read = (reg_data >> 2) & 0x3F; - tcbd_debug(DEBUG_DRV_IO, "cmd:0x%X, bytes_read:%d, elapsed time:%llu\n", - _mail->cmd, bytes_read, elapsed); - - ret = tcbd_io_funcs.reg_read_burst_fix( - TCBD_MAIL_FIFO_WIND, mail_data, bytes_read); - /*only warm boot cmd */ - if (bytes_read == 4) { - memcpy(_mail->data, mail_data, bytes_read); - goto exit_recv_mail; - } - - mail_hdr = *((u32 *)mail_data); - if ((mail_hdr >> 24) != MB_SLAVEMAIL) { - tcbd_debug(DEBUG_ERROR, "Error : cmd=0x%X bytes_read=%d\n", - _mail->cmd, bytes_read); - tcbd_debug(DEBUG_ERROR, " [0x%02X][0x%02X][0x%02X][0x%02X]" - "[0x%02X][0x%02X][0x%02X][0x%02X]\n", - mail_data[0], mail_data[1], mail_data[2], - mail_data[3], mail_data[4], mail_data[5], - mail_data[6], mail_data[7]); - - ret = -TCERR_BROKEN_MAIL_HEADER; - goto exit_recv_mail; - } - _mail->cmd = mail_hdr & 0xFFFF; - _mail->status = (mail_hdr >> 16) & 0x7; - if (_mail->status) { - tcbd_debug(DEBUG_ERROR, "Mail Error : status=0x%X, cmd=0x%X\n", - _mail->status, _mail->cmd); - ret = -TCERR_UNKNOWN_MAIL_STATUS; - goto exit_recv_mail; - } - _mail->count = (bytes_read >> 2) - 1; - memcpy(_mail->data, mail_data + 4, bytes_read - 4); - -exit_recv_mail: - tcpal_unlock(&tcbd_io_funcs.sem); - return ret; -} - -s32 tcbd_read_mail_box(struct tcbd_device *_device, u16 _cmd, s32 _cnt, - u32 *_data) -{ - s32 ret = 0; - struct tcbd_mail_data mail = {0, }; - - mail.flag = MB_CMD_READ; - mail.cmd = _cmd; - mail.count = _cnt; - ret = tcbd_send_mail(_device, &mail); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, "failed to send mail! %d\n", ret); - goto exit_read_mail_box; - } - - ret = tcbd_recv_mail(_device, &mail); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, "failed to recv mail! %d\n", ret); - goto exit_read_mail_box; - } - - memcpy((void *)_data, (void *)mail.data, _cnt * sizeof(u32)); - -exit_read_mail_box: - return ret; -} - -s32 tcbd_write_mail_box(struct tcbd_device *_device, u16 _cmd, s32 _cnt, - u32 *_data) -{ - u32 *data = NULL; - struct tcbd_mail_data mail = {0, }; - - if (_cnt > MAX_MAIL_COUNT || _data == NULL) { - tcbd_debug(DEBUG_ERROR, "invalid param, cnt:%d\n", _cnt); - return -TCERR_INVALID_ARG; - } - - mail.flag = MB_CMD_WRITE; - mail.cmd = _cmd; - mail.count = _cnt; - memcpy((void *)mail.data, (void *)_data, _cnt * sizeof(u32)); -#if defined(__DEBUG_DSP_ROM__) - tcbd_debug_mbox_tx(&_cmd, &_cnt, &data); - if (data != NULL) { - int i, sz = 0; - char print_buff[80]; - mail.cmd = _cmd; - mail.count = _cnt; - memcpy((void *)mail.data, (void *)data, _cnt * sizeof(u32)); - for (i = 0; i < _cnt; i++) - sz += sprintf(print_buff + sz, "[%08X]", data[i]); - - tcbd_debug(DEBUG_ERROR, "cmd 0x%X, cnt:%d, %s\n", - _cmd, _cnt, print_buff); - } -#endif /*__DEBUG_DSP_ROM__*/ - return tcbd_send_mail(_device, &mail); -} - -#if defined(__DEBUG_DSP_ROM__) -s32 tcbd_read_file(struct tcbd_device *_device, char *_path, u8 *_buff, - s32 _size) -{ - int ret; - struct file *flip = NULL; - mm_segment_t old_fs; - - if (_path == NULL) { - tcbd_debug(DEBUG_ERROR, "invalid filename! %s\n", _path); - return -1; - } - - if (_buff == NULL) { - tcbd_debug(DEBUG_ERROR, "Invaild pointer! 0x%X\n", (u32)_buff); - return -1; - } - - flip = filp_open(_path, O_RDWR, 0); - if (IS_ERR(flip)) { - tcbd_debug(DEBUG_ERROR, "%s open failed\n", _path); - return -1; - } - - old_fs = get_fs(); - set_fs(KERNEL_DS); - - flip->f_pos = 0; - ret = vfs_read(flip, _buff, _size, &flip->f_pos); - - filp_close(flip, NULL); - set_fs(old_fs); - - return ret; -} -#endif /*__DEBUG_DSP_ROM__*/ diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_drv_ip.c b/drivers/media/tdmb/tcc3170/src/tcbd_drv_ip.c deleted file mode 100644 index a5f81eb..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_drv_ip.c +++ /dev/null @@ -1,808 +0,0 @@ -/* - * tcbd_drv_ip.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "tcpal_os.h" -#include "tcbd_feature.h" -#include "tcpal_debug.h" - -#include "tcbd_api_common.h" -#include "tcbd_drv_ip.h" -#include "tcbd_drv_io.h" -#include "tcbd_drv_rf.h" - -struct tcbd_spur_data { - s32 freq_khz; - s32 num_data; - s32 data[7]; -}; - -struct tcbd_agc_data { - s32 cmd; - s32 num_data; - u32 data[7]; -}; - -#define MAX_BOOT_TABLE 5 -struct tcbd_boot_bin { - u32 size; - u32 crc; - u32 addr; - u8 *data; -}; - -static u32 clock_config_table[3][5] = { - { 0x60, 0x00, 0x0F, 0x03, 19200}, - { 0x60, 0x01, 0x18, 0x03, 24576}, - { 0x60, 0x01, 0x0F, 0x03, 38400} -}; - -static struct tcbd_spur_data spur_data_table_default[] = { - { 181936, 2, {(0x035C<<16)|(0x0342), (0x0359<<16)|(0x033e)} }, - { 183008, 2, {(0x00CA<<16)|(0x036B), (0x00CE<<16)|(0x0368)} }, - { 192352, 2, {(0x0081<<16)|(0x0328), (0x0084<<16)|(0x0324)} }, - { 201008, 2, {(0x033A<<16)|(0x0366), (0x0336<<16)|(0x0363)} }, - { 201072, 2, {(0x034B<<16)|(0x0352), (0x0347<<16)|(0x034F)} }, - { 211280, 2, {(0x001E<<16)|(0x0307), (0x001F<<16)|(0x0302)} }, - { 211648, 2, {(0x009F<<16)|(0x033E), (0x00A2<<16)|(0x033A)} }, - { 220352, 2, {(0x0361<<16)|(0x033E), (0x035E<<16)|(0x033A)} }, - { 230784, 2, {(0x008B<<16)|(0x032F), (0x008E<<16)|(0x032B)} }, - {1459808, 2, {(0x00CA<<16)|(0x036B), (0x00CE<<16)|(0x0368)} }, - {1468368, 2, {(0x0366<<16)|(0x033A), (0x0363<<16)|(0x0336)} }, - {1478640, 2, {(0x005A<<16)|(0x0316), (0x005C<<16)|(0x0311)} } -}; - -static struct tcbd_spur_data spur_data_table_24576[] = { - { 180064, 2, {(0x03C3<<16)|(0x030D), (0x03C2<<16)|(0x0308)} }, - { 184736, 2, {(0x0092<<16)|(0x033A), (0x0098<<16)|(0x0332)} }, - { 188928, 2, {(0x00B1<<16)|(0x034F), (0x00B5<<16)|(0x034B)} }, - { 189008, 2, {(0x00C6<<16)|(0x0366), (0x00CA<<16)|(0x0363)} }, - { 195936, 2, {(0x0328<<16)|(0x037F), (0x0324<<16)|(0x037C)} }, - { 196736, 2, {(0x0030<<16)|(0x030F), (0x0032<<16)|(0x0305)} }, - { 199280, 2, {(0x000B<<16)|(0x030A), (0x000B<<16)|(0x0300)} }, - { 204640, 2, {(0x03C3<<16)|(0x030D), (0x03C2<<16)|(0x0308)} }, - { 205280, 2, {(0x039F<<16)|(0x031E), (0x039B<<16)|(0x0315)} }, - { 208736, 2, {(0x03C4<<16)|(0x0312), (0x03C2<<16)|(0x0308)} }, - { 213008, 2, {(0x0006<<16)|(0x0305), (0x0006<<16)|(0x0300)} }, - { 213360, 2, {(0x0086<<16)|(0x032C), (0x0089<<16)|(0x0328)} }, - { 229072, 2, {(0x038F<<16)|(0x031F), (0x038D<<16)|(0x031B)} }, - { 237488, 2, {(0x03E2<<16)|(0x0307), (0x03E1<<16)|(0x0302)} }, - { 1458096, 2, {(0x03E2<<16)|(0x0307), (0x03E1<<16)|(0x0302)} }, - { 1466656, 2, {(0x006B<<16)|(0x031E), (0x006D<<16)|(0x0319)} }, - { 1475216, 2, {(0x00D4<<16)|(0x037A), (0x00D8<<16)|(0x0377)} }, - { 1482064, 2, {(0x0325<<16)|(0x0384), (0x0321<<16)|(0x0382)} }, - { 1490624, 2, {(0x0389<<16)|(0x0322), (0x0387<<16)|(0x031E)} }, -}; - -#if defined(__AGC_TABLE_IN_DSP__) -static struct tcbd_agc_data agc_data_table_lband[] = { - {MBCMD_AGC_DAB_JAM, 3, - {0x0, (195 << 16) + (23 << 8) + 24, 0x001C0012} }, -}; - -static struct tcbd_agc_data agc_table_data_vhf[] = { - {MBCMD_AGC_DAB_JAM, 3, - {0x0, (195 << 16) + (16 << 8) + 17, 0x005a0043} }, -}; -#else /*__AGC_TABLE_IN_DSP__*/ -static struct tcbd_agc_data agc_data_table_lband[] = { - { MBCMD_AGC_DAB_CFG, 3, {0xC0ACFF44, 0x031EFF53, 0x011EFF07} }, - { MBCMD_AGC_DAB_JAM, 3, - {0x00091223, (195 << 16) + (23 << 8) + 24, 0x001C0012} }, - { MBCMD_AGC_DAB_3, 7, - {0x52120223, 0x58120823, 0x5c121223, - 0x60121c23, 0x62122023, 0x68122423, 0x6a122a23} }, - { MBCMD_AGC_DAB_4, 7, - {0x70123223, 0x30093a23, 0x32094023, 0x3a094823, - 0x3c095223, 0x40095823, 0x42095c23} }, - { MBCMD_AGC_DAB_5, 7, - {0x48096023, 0x4a096223, 0x52096423, - 0x4e096823, 0x58096a23, 0x5a097023, 0x5e090812} }, - { MBCMD_AGC_DAB_6, 7, - {0x62091212, 0x68090e12, 0x70091c12, - 0x72092012, 0x78092412, 0x7a093012, 0x7c093812} }, - { MBCMD_AGC_DAB_7, 4, - {0x7e093a12, 0x6f094012, 0x73094212, 0x7f094a12} }, - { MBCMD_AGC_DAB_8, 5, - {0x30093a23, 0x32094023, 0x3a094823, 0x3c095223, 0x40095823} }, - { MBCMD_AGC_DAB_9, 5, - {0x72123a23, 0x78124023, 0x7a124823, 0x7e125223, 0x73125823} }, - { MBCMD_AGC_DAB_A, 5, - {0x5e090812, 0x62091212, 0x68090e12, 0x70091c12, 0x72092012} }, - { MBCMD_AGC_DAB_B, 5, - {0x5e097223, 0x62097823, 0x68097a23, 0x70097e23, 0x72097323} }, - { MBCMD_AGC_DAB_C, 5, {0x0, 0x0, 0x0, 0x0, 0x0} }, - { MBCMD_AGC_DAB_D, 5, {0x0, 0x0, 0x0, 0x0, 0x0} }, - { MBCMD_AGC_DAB_E, 5, {0x0, 0x0, 0x0, 0x0, 0x0} }, - { MBCMD_AGC_DAB_F, 5, {0x0, 0x0, 0x0, 0x0, 0x0} }, -}; - -static struct tcbd_agc_data agc_table_data_vhf[] = { - { MBCMD_AGC_DAB_CFG, 3, - {0xC0ACFF44, 0x031EFF53, 0x011EFF07} }, - { MBCMD_AGC_DAB_JAM, 3, - {0x16112243, (195 << 16) + (16 << 8) + 17, 0x005a0043} }, - { MBCMD_AGC_DAB_3, 7, - {0x5a220243, 0x5e220843, 0x60221043, - 0x62221443, 0x64221c43, 0x68222043, 0x6c222243} }, - { MBCMD_AGC_DAB_4, 7, - {0x70222843, 0x2a112c43, 0x30113443, 0x34113a43, - 0x38113e43, 0x3c114243, 0x3e114643} }, - { MBCMD_AGC_DAB_5, 7, - {0x40114c43, 0x44115443, 0x48115a43, 0x4a115e43, - 0x50116043, 0x54116443, 0x5a112422} }, - { MBCMD_AGC_DAB_6, 7, - {0x5e112822, 0x60113222, 0x62113622, 0x66113a22, - 0x6a113e22, 0x6e114222, 0x72114622} }, - { MBCMD_AGC_DAB_7, 4, - {0x76114822, 0x7a115022, 0x7e115422, 0x7f115622} }, - { MBCMD_AGC_DAB_8, 5, - {0x2a112c43, 0x30113443, 0x34113a43, 0x38113e43, 0x3c114243} }, - { MBCMD_AGC_DAB_9, 5, - {0x74222c43, 0x78223443, 0x7a223a43, 0x7e223e43, 0x7f224243} }, - { MBCMD_AGC_DAB_A, 5, - {0x5a112422, 0x5e112822, 0x60113222, 0x62113622, 0x66113a22} }, - { MBCMD_AGC_DAB_B, 5, - {0x5a116843, 0x5e116c43, 0x60117243, 0x62117643, 0x66117a43} }, - { MBCMD_AGC_DAB_C, 5, {0x0, 0x0, 0x0, 0x0, 0x0} }, - { MBCMD_AGC_DAB_D, 5, {0x0, 0x0, 0x0, 0x0, 0x0} }, - { MBCMD_AGC_DAB_E, 5, {0x0, 0x0, 0x0, 0x0, 0x0} }, - { MBCMD_AGC_DAB_F, 5, {0x0, 0x0, 0x0, 0x0, 0x0} }, -}; -#endif /*!__AGC_TABLE_IN_DSP__*/ - -s32 tcbd_send_spur_data(struct tcbd_device *_device, s32 _freq_khz) -{ - s32 ret = 0, i; - s32 size_table; - struct tcbd_spur_data *spur_table; - - switch (_device->clock_type) { - case CLOCK_24576KHZ: - spur_table = spur_data_table_24576; - size_table = ARRAY_SIZE(spur_data_table_24576); - break; - case CLOCK_38400KHZ: - case CLOCK_19200KHZ: - default: - spur_table = spur_data_table_default; - size_table = ARRAY_SIZE(spur_data_table_default); - break; - } - for (i = 0; i < size_table; i++) { - if (spur_table[i].freq_khz != _freq_khz) - continue; - - tcbd_debug(DEBUG_DRV_COMP, "freq:%d, num mail data:%d\n", - _freq_khz, spur_table[i].num_data); - ret = tcbd_write_mail_box(_device, MBCMD_FP_DAB_IIR, - spur_table[i].num_data, - spur_table[i].data); - break; - } - - return ret; -} - -s32 tcbd_send_agc_data(struct tcbd_device *_device, - enum tcbd_band_type _band_type) -{ - s32 ret = 0, i; - s32 size_table; - struct tcbd_agc_data *agc_table; - - switch (_band_type) { - case BAND_TYPE_LBAND: - size_table = ARRAY_SIZE(agc_data_table_lband); - agc_table = agc_data_table_lband; - break; - case BAND_TYPE_BAND3: - size_table = ARRAY_SIZE(agc_table_data_vhf); - agc_table = agc_table_data_vhf; - break; - default: - tcbd_debug(DEBUG_ERROR, "Unknown band type:%d\n", _band_type); - return -1; - } - tcbd_debug(DEBUG_DRV_COMP, "agc table size:%d, band:%s\n", size_table, - (_band_type == BAND_TYPE_LBAND) ? "Lband" : "Band3"); - - for (i = 0; i < size_table; i++) { - ret |= tcbd_write_mail_box(_device, agc_table[i].cmd, - agc_table[i].num_data, - agc_table[i].data); - } - - return ret; -} - -s32 tcbd_send_frequency(struct tcbd_device *_device, s32 _freq_khz) -{ - s32 data, ret = 0; - - tcbd_debug(DEBUG_DRV_COMP, "freq:%d\n", _freq_khz); - - data = 1; - ret |= tcbd_write_mail_box(_device, MBPARA_SYS_NUM_FREQ, 1, &data); - ret |= tcbd_write_mail_box(_device, MBPARA_SYS_FREQ_0_6, 1, &_freq_khz); - - return ret; -} - -static inline void tcbd_sort_start_cu(struct tcbd_multi_service *_multi_svc, - u32 *_svc_info) -{ - s32 i, j; - s32 start_cu[TCBD_MAX_NUM_SERVICE]; - u32 tmp_cu, tmp_info[2]; - - memcpy(_svc_info, _multi_svc->service_info, - sizeof(u32) * TCBD_MAX_NUM_SERVICE << 1); - for (i = 0; i < TCBD_MAX_NUM_SERVICE; i++) { - if (_svc_info[i << 1] != 0) - start_cu[i] = _svc_info[i << 1] & 0x3FF; - else - start_cu[i] = 0x3FF; - } - - for (i = 0; i < TCBD_MAX_NUM_SERVICE; i++) { - for (j = i + 1; j < TCBD_MAX_NUM_SERVICE; j++) { - if (start_cu[i] > start_cu[j]) { - tmp_cu = start_cu[i]; - tmp_info[0] = _svc_info[i * 2]; - tmp_info[1] = _svc_info[i * 2 + 1]; - - start_cu[i] = start_cu[j]; - _svc_info[i * 2] = _svc_info[j * 2]; - _svc_info[i * 2 + 1] = _svc_info[j * 2 + 1]; - - start_cu[j] = tmp_cu; - _svc_info[j * 2] = tmp_info[0]; - _svc_info[j * 2 + 1] = tmp_info[1]; - } - } - } - for (i = 0; i < TCBD_MAX_NUM_SERVICE * 2; i++) - tcbd_debug(DEBUG_DRV_COMP, "%02d: 0x%08X\n", i, _svc_info[i]); -} - -s32 tcbd_send_service_info(struct tcbd_device *_device) -{ - s32 ret = 0; - struct tcbd_multi_service *mult_service = &_device->mult_service; - u32 sorted_svc_info[TCBD_MAX_NUM_SERVICE * 2]; - u8 num_svc = TCBD_MAX_NUM_SERVICE; - - tcbd_sort_start_cu(mult_service, sorted_svc_info); - - ret = tcbd_write_mail_box(_device, MBPARA_SEL_CH_INFO_PRAM, - num_svc, sorted_svc_info); - ret |= tcbd_write_mail_box(_device, MBPARA_SEL_CH_INFO_PRAM + 1, - num_svc, sorted_svc_info + num_svc); - ret |= tcbd_write_mail_box(_device, MBPARA_SYS_DAB_MCI_UPDATE, 1, - &mult_service->service_count); - tcbd_debug(DEBUG_DRV_COMP, "service count:%d\n", - mult_service->service_count); - return ret; -} - -s32 tcbd_disable_buffer(struct tcbd_device *_device) -{ - s32 ret = 0; - ret |= tcbd_reg_write(_device, TCBD_OBUFF_CONFIG, 0); - return ret; -} - -s32 tcbd_enable_buffer(struct tcbd_device *_device) -{ - s32 i, ret = 0; - u8 buff_en = 0, buff_init = 0; - - u32 list_size_buf[] = { - TCBD_BUFFER_A_SIZE, TCBD_BUFFER_B_SIZE, - TCBD_BUFFER_C_SIZE, TCBD_BUFFER_D_SIZE }; - u8 list_buff_init[] = { - TCBD_OBUFF_BUFF_A_INIT, TCBD_OBUFF_BUFF_B_INIT, - TCBD_OBUFF_BUFF_C_INIT, TCBD_OBUFF_BUFF_D_INIT }; - u32 list_buff_en[] = { - TCBD_OBUFF_CONFIG_BUFF_A_EN | TCBD_OBUFF_CONFIG_BUFF_A_CIRCULAR, - TCBD_OBUFF_CONFIG_BUFF_B_EN | TCBD_OBUFF_CONFIG_BUFF_B_CIRCULAR, - TCBD_OBUFF_CONFIG_BUFF_C_EN | TCBD_OBUFF_CONFIG_BUFF_C_CIRCULAR, - TCBD_OBUFF_CONFIG_BUFF_D_EN | TCBD_OBUFF_CONFIG_BUFF_D_CIRCULAR, - }; - - for (i = 0; i < ARRAY_SIZE(list_size_buf); i++) { - if (list_size_buf[i]) { - buff_init |= list_buff_init[i]; - buff_en |= list_buff_en[i]; - } - } - tcbd_debug(DEBUG_DRV_COMP, "buffer init : 0x%02X, buffer en:0x%02X\n", - buff_init, buff_en); - ret |= tcbd_reg_write(_device, TCBD_OBUFF_INIT, buff_init); - ret |= tcbd_reg_write(_device, TCBD_OBUFF_CONFIG, buff_en); - return ret; -} -/*__DEBUG_TCBD__*/ -s32 tcbd_init_buffer_region(struct tcbd_device *_device) -{ - s32 i, ret = 0; - u32 addr_start, addr_end; -#if defined(__DEBUG_TCBD__) - u16 reg_val[2]; -#endif /*__DEBUG_TCBD__*/ - u32 list_size_buf[] = { - TCBD_BUFFER_A_SIZE, TCBD_BUFFER_B_SIZE, - TCBD_BUFFER_C_SIZE, TCBD_BUFFER_D_SIZE }; - u8 reg_addr_buff[] = { - TCBD_OBUFF_A_SADDR, TCBD_OBUFF_B_SADDR, - TCBD_OBUFF_C_SADDR, TCBD_OBUFF_D_SADDR }; - u32 addr_set_buff[] = { - (PHY_MEM_ADDR_A_START>>2), (PHY_MEM_ADDR_A_END>>2), - (PHY_MEM_ADDR_B_START>>2), (PHY_MEM_ADDR_B_END>>2), - (PHY_MEM_ADDR_C_START>>2), (PHY_MEM_ADDR_C_END>>2), - (PHY_MEM_ADDR_D_START>>2), (PHY_MEM_ADDR_D_END>>2), - }; - - for (i = 0; i < ARRAY_SIZE(list_size_buf); i++) { - if (!list_size_buf[i]) - continue; - - addr_start = SWAP16(addr_set_buff[i * 2 + 0]); - addr_end = SWAP16(addr_set_buff[i * 2 + 1]); - tcbd_debug(DEBUG_DRV_COMP, "reg:%02x, %c buffer size: %d\n", - reg_addr_buff[i], 'A' + i, - (addr_set_buff[i * 2 + 1] << 2) - - (addr_set_buff[i * 2 + 0] << 2) + 4); - ret = tcbd_reg_write_burst_cont( - _device, reg_addr_buff[i], (u8 *)&addr_start, 2); - ret |= tcbd_reg_write_burst_cont( - _device, reg_addr_buff[i] + 2, (u8 *)&addr_end, 2); - - if (ret < 0) - return ret; - } -#if defined(__DEBUG_TCBD__) - for (i = 0; i < 4 && list_size_buf[i]; i++) { - tcbd_reg_read_burst_cont( - _device, reg_addr_buff[i], (u8 *)®_val[0], 2); - tcbd_reg_read_burst_cont( - _device, reg_addr_buff[i] + 2, (u8 *)®_val[1], 2); - tcbd_debug(DEBUG_DRV_COMP, "%c buffer start:%X, end:%X\n", - 'A' + i, - SWAP16(reg_val[0]) << 2, - SWAP16(reg_val[1]) << 2); - } -#endif /*__DEBUG_TCBD__*/ - /*tcbd_enable_buffer(_device);*/ - return ret; -} - -s32 tcbd_change_memory_view(struct tcbd_device *_device, - enum tcbd_remap_type _remap) -{ - return tcbd_reg_write(_device, TCBD_INIT_REMAP, (u8)_remap); -} - -s32 tcbd_init_bias_key(struct tcbd_device *_device) -{ - s32 ret = 0; - - ret |= tcbd_reg_write(_device, TCBD_OP_XTAL_BIAS, 0x05); - ret = tcbd_reg_write(_device, TCBD_OP_XTAL_BIAS_KEY, 0x5E); - - return ret; -} - -u32 tcbd_get_osc_clock(struct tcbd_device *_device) -{ - return clock_config_table[(int)_device->clock_type][4]; -} - -s32 tcbd_init_pll(struct tcbd_device *_device, enum tcbd_clock_type _ctype) -{ - /* - * _pll_data[0] = PLL_WAIT_TIME - * _pll_data[1] = PLL_P - * _pll_data[2] = PLL_M - * _pll_data[3] = PLL_S - * _pll_data[4] = OSC_LOCK - * */ - s32 ret = 0; - u32 out, vco; - u8 pll_data[2]; - u8 pll_r, pll_f, pll_od, pll_m; - u32 *clock_config = NULL; - - if (!_device || _ctype >= CLOCK_MAX) - return -TCERR_INVALID_ARG; - - _device->clock_type = _ctype; - - if (!tcbd_debug_spur_dbg()) - clock_config = clock_config_table[(s32)_ctype]; - else - clock_config = tcbd_debug_spur_clk_cfg(); - - tcbd_debug(DEBUG_DRV_COMP, "osc clock:%d, P:%X, M:%X, S:%d\n", - clock_config[1], clock_config[2], - clock_config[3], clock_config[4]); - pll_r = clock_config[1] + 1; - pll_f = clock_config[2] + 1; - pll_od = clock_config[3] & 0x3; - pll_m = (clock_config[3] & 0x4) >> 2; - - vco = clock_config[4] * (pll_f / pll_r); - - if (pll_od) - out = vco >> pll_od; - else - out = vco; - - if (pll_m) - out = out>>pll_m; - - _device->main_clock = out; - pll_data[0] = clock_config[2] | (pll_m << 6) | 0x80; - pll_data[1] = (clock_config[1] << 3) | (pll_od << 1); - - ret = tcbd_reg_write(_device, TCBD_PLL_7, pll_data[1]); - ret = tcbd_reg_write(_device, TCBD_PLL_6, pll_data[0]); - tcpal_msleep(1); - tcbd_debug(DEBUG_DRV_COMP, "clock out:%d, pll[0]=%02X, pll[1]=%02X\n", - out, pll_data[0], pll_data[1]); - - ret |= tcbd_init_bias_key(_device); - - return ret; -} - - -static s32 tcbd_check_dsp(struct tcbd_device *_device) -{ - s32 ret = 0; - u32 status; - - ret = tcbd_reg_read_burst_fix( - _device, TCBD_MAIL_FIFO_WIND, (u8 *)&status, 4); - - if (status != 0x1ACCE551) { - tcbd_debug(DEBUG_ERROR, " # Error access mail [0x%X]\n", - status); - return -TCERR_CANNOT_ACCESS_MAIL; - } - - return ret; -} - -s32 tcbd_reset_ip(struct tcbd_device *_device, u8 _comp_en, u8 _comp_rst) -{ - s32 ret = 0; - _device->processor = _comp_en; - - ret |= tcbd_reg_write(_device, TCBD_SYS_EN, _comp_en); - ret |= tcbd_reg_write(_device, TCBD_SYS_RESET, _comp_rst); - - return ret; -} - -s32 tcbd_change_stream_type(struct tcbd_device *_device, u32 _format) -{ - _device->selected_stream = _format; - return tcbd_write_mail_box(_device, MBPARA_SYS_DAB_STREAM_SET, - 1, &_format); -} - -s32 tcbd_demod_tune_frequency(struct tcbd_device *_device, u32 _freq_khz, - s32 _bw_khz) -{ - s32 ret = 0; - u32 sel_stream = 0; - - switch (_device->peri_type) { - case PERI_TYPE_SPI_ONLY: - case PERI_TYPE_STS: - sel_stream = STREAM_TYPE_ALL; - break; - default: - tcbd_debug(DEBUG_ERROR, "not implemented!\n"); - return -1; - } -#if defined(__STATUS_IN_REGISTER__) - sel_stream &= ~(STREAM_TYPE_STATUS); -#endif /* __STATUS_IN_REGISTER__ */ - - ret = tcbd_change_stream_type(_device, sel_stream); - ret |= tcbd_send_spur_data(_device, _freq_khz); - ret |= tcbd_send_frequency(_device, _freq_khz); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, - "Failed to send spur and freq to op, err:%d\n", ret); - return ret; - } - - if (_device->curr_band != _device->prev_band) - tcbd_send_agc_data(_device, _device->curr_band); - - ret |= tcbd_set_pid_filter(_device, FILTER_ENABLE | FILTER_SYNCERR); - ret |= tcbd_dsp_warm_start(_device); - return ret; -} - - -s32 tcbd_dsp_cold_start(struct tcbd_device *_device) -{ - s32 ret = 0; - u16 new_pc = SWAP16(START_PC_OFFSET); - - ret = tcbd_change_memory_view(_device, OP_RAM0_EP_RAM1_PC2); - ret |= tcbd_reg_write_burst_cont( - _device, TCBD_INIT_PC, (u8 *)&new_pc, 2); - ret |= tcbd_reg_write(_device, TCBD_SYS_RESET, TCBD_SYS_COMP_DSP); - ret |= tcbd_reg_write( - _device, TCBD_SYS_EN, TCBD_SYS_COMP_DSP | TCBD_SYS_COMP_EP); - - if (ret < 0) - return ret; - - return tcbd_check_dsp(_device); -} - -static inline s32 tcbd_start_demod(struct tcbd_device *_device) -{ - s32 ret = 0; - struct tcbd_mail_data mail = {0, }; - - mail.flag = MB_CMD_READ; - mail.cmd = MBPARA_SYS_START; - mail.count = 1; - mail.data[0] = 0x19; - switch (_device->clock_type) { - case CLOCK_24576KHZ: - mail.data[0] |= 0x1 << 28; - break; - case CLOCK_38400KHZ: - mail.data[0] |= 0x2 << 28; - break; - case CLOCK_19200KHZ: - mail.data[0] |= 0x0 << 28; - break; - default: - break; - } - ret |= tcbd_send_mail(_device, &mail); - ret |= tcbd_recv_mail(_device, &mail); - - return ret; -} - -s32 tcbd_dsp_warm_start(struct tcbd_device *_device) -{ - s32 ret = 0; - struct tcbd_mail_data mail = {0, }; - - mail.flag = MB_CMD_WRITE; - mail.cmd = MBPARA_SYS_WARMBOOT; - mail.count = 0; - - ret |= tcbd_send_mail(_device, &mail); - ret |= tcbd_recv_mail(_device, &mail); - - if (ret < 0 || mail.data[0] != 0x1ACCE551) { - tcbd_debug(DEBUG_ERROR, " # Could not warm boot! [%08X]\n", - mail.data[0]); - return -TCERR_WARMBOOT_FAIL; - } - ret = tcbd_start_demod(_device); - - if (ret >= 0) - tcbd_debug(DEBUG_DRV_COMP, "Warm boot succeed! [0x%X] ret:%d\n", - mail.data[0], ret); - return ret; -} - -static s32 tcbd_parse_dsp_rom( - u8 *_data, u32 _size, struct tcbd_boot_bin *_boot_bin) -{ - - u32 idx = 0; - u32 length; - s32 table_idx = 0; - - memset(_boot_bin, 0, sizeof(struct tcbd_boot_bin) * MAX_BOOT_TABLE); - - /* cold boot */ - if (_data[idx + 3] != 0x01) { - tcbd_debug(DEBUG_ERROR, "# Coldboot_preset_Error\n"); - return 0; - } - idx += 4; - length = (_data[idx] << 24) + (_data[idx + 1] << 16) + - (_data[idx + 2] << 8) + (_data[idx + 3]); - idx += 4; - _boot_bin[table_idx].addr = CODE_MEM_BASE; - _boot_bin[table_idx].data = _data + idx; - _boot_bin[table_idx].crc = *((u32 *)(_data + idx + length - 4)); - _boot_bin[table_idx++].size = length - 4; - idx += length; - _size -= (length + 8); - - /* dagu */ - if (_data[idx + 3] != 0x02) { - tcbd_debug(DEBUG_ERROR, "# Coldboot_preset_Error\n"); - return 0; - } - idx += 4; - length = (_data[idx] << 24) + (_data[idx + 1] << 16) + - (_data[idx + 2] << 8) + (_data[idx + 3]); - idx += 4; - _boot_bin[table_idx].addr = CODE_TABLEBASE_DAGU; - _boot_bin[table_idx].data = _data + idx; - _boot_bin[table_idx++].size = length; - idx += length; - _size -= (length + 8); - - /* dint */ - if (_data[idx + 3] != 0x03) { - tcbd_debug(DEBUG_ERROR, "# Coldboot_preset_Error\n"); - return 0; - } - idx += 4; - length = (_data[idx] << 24) + (_data[idx + 1] << 16) + - (_data[idx + 2] << 8) + (_data[idx + 3]); - idx += 4; - _boot_bin[table_idx].addr = CODE_TABLEBASE_DINT; - _boot_bin[table_idx].data = _data + idx; - _boot_bin[table_idx++].size = length; - idx += length; - _size -= (length + 8); - - /* rand */ - if (_data[idx + 3] != 0x04) { - tcbd_debug(DEBUG_ERROR, "# Coldboot_preset_Error\n"); - return 0; - } - - idx += 4; - length = (_data[idx] << 24) + (_data[idx + 1] << 16) + - (_data[idx + 2] << 8) + (_data[idx + 3]); - idx += 4; - _boot_bin[table_idx].addr = CODE_TABLEBASE_RAND; - _boot_bin[table_idx].data = _data + idx; - _boot_bin[table_idx++].size = length; - idx += length; - _size -= (length + 8); - - if (_size >= 8) { - /* col_order */ - if (_data[idx + 3] != 0x05) { - tcbd_debug(DEBUG_ERROR, "# Coldboot_preset_Error\n"); - return 0; - } - idx += 4; - length = (_data[idx] << 24) + (_data[idx + 1] << 16) + - (_data[idx + 2] << 8) + (_data[idx + 3]); - idx += 4; - - _boot_bin[table_idx].addr = CODE_TABLEBASE_COL_ORDER; - _boot_bin[table_idx].data = _data + idx; - _boot_bin[table_idx++].size = length; - idx += length; - _size -= (length + 8); - } - - /* tcbd_debug(DEBUG_DRV_COMP, " # remain size :%d\n", _size); */ - return table_idx; -} - -s32 tcbd_init_dsp(struct tcbd_device *_device, u8 *_boot_code, s32 _size) -{ - s32 i, ret = 0; - s32 num_table_entry = 0; - u32 dma_crc = 0; - u64 tick; - struct tcbd_boot_bin boot_bin[MAX_BOOT_TABLE]; - - tick = tcpal_get_time(); - num_table_entry = tcbd_parse_dsp_rom(_boot_code, _size, boot_bin); - - ret |= tcbd_change_memory_view(_device, EP_RAM0_RAM1); - - for (i = 0; i < num_table_entry && boot_bin[i].size; i++) { - tcbd_debug(DEBUG_API_COMMON, "# download boot to 0x%X, " - "size %d\n", boot_bin[i].addr, - boot_bin[i].size); - ret |= tcbd_mem_write(_device, boot_bin[i].addr, - boot_bin[i].data, boot_bin[i].size); - ret |= tcbd_reg_read_burst_cont(_device, TCBD_CMDDMA_CRC32, - (u8 *)&dma_crc, 4); - if (boot_bin[i].crc && (SWAP32(dma_crc) != boot_bin[i].crc)) { - tcbd_debug(DEBUG_ERROR, "# CRC Error DMA[0x%08X] !=" - " BIN[0x%08X]\n", dma_crc, - boot_bin[i].crc); - return -TCERR_CRC_FAIL; - } - } - - ret = tcbd_dsp_cold_start(_device); - if (ret < 0) - tcbd_debug(DEBUG_ERROR, "Failed to cold boot! ret:%d\n", ret); - else - tcbd_debug(DEBUG_API_COMMON, "# %llums elapsed to download!\n", - tcpal_diff_time(tick)); - return ret; -} - -s32 tcbd_get_rom_version(struct tcbd_device *_device, u32 *_boot_version) -{ - s32 ret = 0; - struct tcbd_mail_data mail = {0, }; - - mail.flag = MB_CMD_READ; - mail.cmd = MBPARA_SYS_VERSION; - mail.count = 0; - ret = tcbd_send_mail(_device, &mail); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, "failed to send mail! %d\n", ret); - return ret; - } - - ret = tcbd_recv_mail(_device, &mail); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, "failed to recv mail! %d\n", ret); - return ret; - } - - memcpy(_boot_version, &mail.data[0], sizeof(u32)); - - return ret; -} - -s32 tcbd_check_dsp_status(struct tcbd_device *_device) -{ - s32 i, j, len; - s8 *item_name[] = {" CTO", " CFO", " SFE", "RESYNC" }; - s8 dbg_buff[255]; - static struct tcbd_mail_data check_item[] = { - {MB_CMD_READ, 2, MBCMD_CTO_DAB_RESULT, }, - {MB_CMD_READ, 3, MBCMD_CFO_DAB_RESULT, }, - {MB_CMD_READ, 3, MBCMD_SFE_DAB_RESULT, }, - {MB_CMD_READ, 7, MBPARA_SYS_DAB_RESYNC_RESULT, } - }; - - for (i = 0; i < ARRAY_SIZE(check_item); i++) { - tcbd_read_mail_box(_device, - check_item[i].cmd, - check_item[i].count, - check_item[i].data); - len = sprintf(dbg_buff, " %s ", item_name[i]); - for (j = 0; j < check_item[i].count; j++) { - len += sprintf(dbg_buff + len, "[%d] = 0x%08X, ", - j, check_item[i].data[j]); - } - tcbd_debug(DEBUG_INFO, "%s\n", dbg_buff); - } - return 0; -} - -s32 tcbd_set_pid_filter(struct tcbd_device *_device, u32 _filter) -{ - return tcbd_write_mail_box(_device, MBPARA_SYS_DAB_DP_FLT, 1, &_filter); -} diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_drv_peri.c b/drivers/media/tdmb/tcc3170/src/tcbd_drv_peri.c deleted file mode 100644 index 8a162f7..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_drv_peri.c +++ /dev/null @@ -1,267 +0,0 @@ -/* - * tcbd_drv_peri.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcbd_api_common.h" -#include "tcbd_drv_io.h" - -#define TCBD_PERI_SPI_READY_TIME 0x00 -#define TCBD_PERI_SPI_WAIT_TIME 0x00 - -static inline void tcbd_peri_spi_slave( - u8 *_peri_mode, u8 _interface_speed) -{ - _peri_mode[0] = TCBD_PERI_SPI_MOTOROLA_SSP | - TCBD_PERI_SPI_SLAVE | - TCBD_PERI_SPI_SIZE32BIT | - _interface_speed; - _peri_mode[1] = TCBD_PERI_SPI_CLKINIT_LOW | - TCBD_PERI_SPI_CLKPOL_POS | - TCBD_PERI_SPI_BITMSB1 | - (TCBD_PERI_SPI_READY_TIME << 2) | - TCBD_PERI_SPI_WAIT_TIME; -} - -static inline void tcbd_peri_spi_master( - u8 *_peri_mode, u8 _interface_speed) -{ - _peri_mode[0] = TCBD_PERI_SPI_MOTOROLA_SSP | - TCBD_PERI_SPI_MASTER | - TCBD_PERI_SPI_SIZE32BIT | - _interface_speed; - _peri_mode[1] = TCBD_PERI_SPI_CLKINIT_LOW | - TCBD_PERI_SPI_CLKPOL_POS | - TCBD_PERI_SPI_BITMSB1 | - (TCBD_PERI_SPI_READY_TIME << 2) | - TCBD_PERI_SPI_WAIT_TIME; -} - -#define TCBD_PERI_TS_STREAM_WAIT_TIME 0x02 -#define TCBD_PERI_TS_MSM_SYNC_HIGH_TIME 0x00 -#define TCBD_PERI_TS_MSM_SYNC_LOW_TIME 0x00 -static inline void tcbd_peri_sts( - u8 *_peri_mode, u8 _interface_speed) -{ - _peri_mode[0] = TCBD_PERI_TS_NORMAL_SLAVE | - TCBD_PERI_TS_STS | - TCBD_PERI_TS_FASTON | - _interface_speed; - - _peri_mode[1] = TCBD_PERI_TS_CLKPHASE_NEG | - TCBD_PERI_TS_SYNC_ACTIVEHIGH | - TCBD_PERI_TS_ENPOL_ACTIVEHIGH | - TCBD_PERI_TS_STREAM_WAIT_ON | - TCBD_PERI_TS_STREAM_WAIT_TIME; - _peri_mode[2] = TCBD_PERI_TS_BITMSB | - (TCBD_PERI_TS_MSM_SYNC_HIGH_TIME << 3) | - TCBD_PERI_TS_MSM_SYNC_LOW_TIME; - _peri_mode[3] = TCBD_PERI_TS_ERR_SIG_OFF; -} - -static inline void tcbd_peri_pts( - u8 *_peri_mode, u8 _interface_speed) -{ - _peri_mode[0] = TCBD_PERI_TS_NORMAL_SLAVE | - TCBD_PERI_TS_PTS | - TCBD_PERI_TS_FASTON | - TCBD_PERI_TS_TSCLKMASKON | - _interface_speed; - _peri_mode[1] = TCBD_PERI_TS_CLKPHASE_POS | - TCBD_PERI_TS_SYNC_ACTIVEHIGH | - TCBD_PERI_TS_ENPOL_ACTIVEHIGH | - TCBD_PERI_TS_STREAM_WAIT_ON | - TCBD_PERI_TS_STREAM_WAIT_TIME; - _peri_mode[2] = (TCBD_PERI_TS_MSM_SYNC_HIGH_TIME << 3) | - TCBD_PERI_TS_MSM_SYNC_LOW_TIME; - _peri_mode[3] = TCBD_PERI_TS_ERR_SIG_OFF; -} - -static inline void tcbd_peri_hpi(u8 *_peri_mode) -{ - _peri_mode[0] = TCBD_PERI_HPI_INTEL; -} - -static inline u8 tcbd_calc_clock( - struct tcbd_device *_device, s32 _min_khz, s32 _max_khz) -{ - u32 min_dlr = 0, max_dlr = 0, minv = -1, maxv = -1; - - min_dlr = (_device->main_clock / (2 * _min_khz)) - 1; - max_dlr = (_device->main_clock / (2 * _max_khz)) - 1; - - if (min_dlr >= 0 && min_dlr < 8) - minv = min_dlr; - else if (min_dlr >= 8) - minv = 7; - - if (max_dlr >= 0 && max_dlr < 8) - maxv = max_dlr; - else if (max_dlr >= 8) - maxv = 7; - - if (minv == -1 && maxv == -1) { - tcbd_debug(DEBUG_DRV_PERI, - " # Can't find DLR value, DLR will set to zero\n"); - return 0; - } - - if (maxv == -1) - maxv = minv; - else if (minv == -1) - minv = maxv; - - return minv; -} - -s32 tcbd_init_peri_gpio( - struct tcbd_device *_device, enum tcbd_peri_type _peri_type) -{ - u8 cfg_value[10] = {0, }; - /*u8 drv_strength[] = {0xFF, 0xFF};*/ - - tcbd_debug(DEBUG_DRV_PERI, "peri type:%d\n", (s32)(_peri_type)); - memset(cfg_value, 0, sizeof(cfg_value)); - - switch (_peri_type) { - case PERI_TYPE_SPI_SLAVE: - case PERI_TYPE_PTS: - case PERI_TYPE_HPI: - case PERI_TYPE_SPI_ONLY: - return 0; - - case PERI_TYPE_SPI_MASTER: - cfg_value[0] = 0x0E; - cfg_value[1] = 0x34; - break; - case PERI_TYPE_STS: - cfg_value[0] = 0x0E; - cfg_value[1] = 0x3C; - break; - default: - break; - } - - tcbd_reg_write_burst_cont(_device, TCBD_GPIO_ALT, cfg_value, 2); - /*tcbd_reg_write_burst_cont(_device, TCBD_GPIO_DRV, drv_strength, 2);*/ - return 0; -} - -s32 tcbd_select_peri( - struct tcbd_device *_device, enum tcbd_peri_type _peri_type) -{ - s32 ret = 0; - u8 peri_mode[4] = {0, }; - u8 interface_speed = 4; /*tcbd_calc_clock(_device, 3000, 10000);*/ - - tcbd_debug(DEBUG_DRV_PERI, "peri type:%d, clock div:%d\n", - (s32)(_peri_type), interface_speed); - switch (_peri_type) { - case PERI_TYPE_SPI_SLAVE: - tcbd_peri_spi_slave(peri_mode, interface_speed); - ret |= tcbd_reg_write_burst_cont( - _device, TCBD_PERI_MODE0, peri_mode, 2); - ret |= tcbd_reg_write(_device, TCBD_PERI_CTRL, 0x90); - ret |= tcbd_init_peri_gpio(_device, PERI_TYPE_SPI_SLAVE); - break; - case PERI_TYPE_SPI_MASTER: - tcbd_peri_spi_master(peri_mode, interface_speed); - ret |= tcbd_reg_write_burst_cont( - _device, TCBD_PERI_MODE0, peri_mode, 2); - ret |= tcbd_reg_write(_device, TCBD_PERI_CTRL, 0x90); - ret |= tcbd_init_peri_gpio(_device, PERI_TYPE_SPI_MASTER); - break; - case PERI_TYPE_PTS: - tcbd_peri_pts(peri_mode, interface_speed); - ret |= tcbd_reg_write_burst_cont( - _device, TCBD_PERI_MODE0, peri_mode, 4); - ret |= tcbd_init_peri_gpio(_device, PERI_TYPE_PTS); - break; - case PERI_TYPE_STS: - tcbd_peri_sts(peri_mode, interface_speed); - ret |= tcbd_reg_write_burst_cont( - _device, TCBD_PERI_MODE0, peri_mode, 4); - ret |= tcbd_init_peri_gpio(_device, PERI_TYPE_STS); - break; - case PERI_TYPE_HPI: - tcbd_peri_hpi(peri_mode); - ret |= tcbd_reg_write(_device, TCBD_PERI_MODE0, peri_mode[0]); - break; - case PERI_TYPE_SPI_ONLY: - ret |= tcbd_reg_write(_device, TCBD_PERI_CTRL, 0x80); - ret |= tcbd_init_peri_gpio(_device, PERI_TYPE_SPI_ONLY); - default: - break; - } - _device->peri_type = _peri_type; - return ret; -} - -s32 tcbd_init_gpio_for_slave(struct tcbd_device *_device) -{ - u8 cfg_value[10] = {0, }; - - cfg_value[0] = 0x01; - cfg_value[1] = 0xC0; - return tcbd_reg_write_burst_cont( - _device, TCBD_GPIO_ALT, cfg_value, 10); -} - -s32 tcbd_enable_peri(struct tcbd_device *_device) -{ - u8 data = TCBD_PERI_EN | TCBD_PERI_INIT_AUTOCLR; - - switch (_device->peri_type) { - case PERI_TYPE_SPI_ONLY: - data = 0x80; - break; - case PERI_TYPE_SPI_SLAVE: - case PERI_TYPE_SPI_MASTER: - data |= TCBD_PERI_SEL_SPI | TCBD_PERI_HEADER_ON; - break; - case PERI_TYPE_PTS: - case PERI_TYPE_STS: - data |= TCBD_PERI_SEL_TS | TCBD_PERI_HEADER_ON; - break; - case PERI_TYPE_HPI: - data |= TCBD_PERI_SEL_HPI | TCBD_PERI_HEADER_ON; - break; - default: - break; - } - - return tcbd_reg_write(_device, TCBD_PERI_CTRL, data); -} - -s32 tcbd_disable_peri(struct tcbd_device *_device) -{ - s32 ret = 0; - u8 data; - - ret |= tcbd_reg_read(_device, TCBD_PERI_CTRL, &data); - data &= ~TCBD_PERI_EN; - ret |= tcbd_reg_write(_device, TCBD_PERI_CTRL, data); - - return ret; -} diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_drv_rf.c b/drivers/media/tdmb/tcc3170/src/tcbd_drv_rf.c deleted file mode 100644 index a988077..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_drv_rf.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - * tcbd_drv_rf.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ -#include "tcpal_os.h" -#include "tcbd_feature.h" -#include "tcpal_debug.h" - -#include "tcbd_api_common.h" -#include "tcbd_drv_ip.h" -#include "tcbd_drv_io.h" -#include "tcbd_drv_rf.h" - -struct tcbd_rf_data { - u8 addr; - u32 data; -}; - -static struct tcbd_rf_data tcc3170_rf_table_band3[] = { - {0x02, 0x00030000}, - {0x04, 0x00002002}, - {0x05, 0x5500640B}, - {0x06, 0x1AADA754}, - {0x07, 0x00002000}, - {0x08, 0x42222249}, - {0x09, 0x000D2299}, - {0x0A, 0xD87060DD}, - {0x0B, 0x00000E72}, - {0x0C, 0x02AE7077}, - {0x0D, 0x00240376}, - {0x0E, 0X7F7F0711} -}; - -static struct tcbd_rf_data tcc3170_rf_table_lband[] = { - {0x02, 0x00030000}, - {0x04, 0x00004001}, - {0x06, 0x0AADA754}, - {0x07, 0x00002000}, - {0x08, 0x42222249}, - {0x09, 0x000D2299}, - {0x0A, 0xD87060DD}, - {0x0B, 0x00000E72}, - {0x0C, 0x02AE7077}, - {0x0D, 0x00240376}, - {0x0E, 0X7F7F0907} -}; - -static u64 tcbd_div64(u64 x, u64 y) -{ - u64 a, b, q, counter; - - q = 0; - if (y != 0) { - while (x >= y) { - a = x >> 1; - b = y; - counter = 1; - while (a >= b) { - b <<= 1; - counter <<= 1; - } - x -= b; - q += counter; - } - } - return q; -} - - -s32 tcbd_rf_init(struct tcbd_device *_device, enum tcbd_band_type _band) -{ - s32 i = 0; - s32 size; - s32 ret = 0; - struct tcbd_rf_data *rf_data; - - switch (_band) { - case BAND_TYPE_BAND3: - size = ARRAY_SIZE(tcc3170_rf_table_band3); - rf_data = tcc3170_rf_table_band3; - break; - case BAND_TYPE_LBAND: - size = ARRAY_SIZE(tcc3170_rf_table_lband); - rf_data = tcc3170_rf_table_lband; - break; - default: - return -TCERR_UNKNOWN_BAND; - break; - } - - for (i = 0; i < size; i++) - ret |= tcbd_rf_reg_write( - _device, rf_data[i].addr, rf_data[i].data); - return ret; -} - -#define SCALE_FACTOR 22 -#define DIV(A, B) (tcbd_div64((A<<SCALE_FACTOR), B)) -static inline s32 tcbd_rf_set_frequency( - struct tcbd_device *_device, s32 _freq_khz, s32 _bw_khz) -{ - s32 ret = 0; - u64 N, F; - u64 Flo, VCO_DIV, FOffset, Fvco, FR, PLL_MODE; - u64 N_int, intF, intVCO_DIV; - u64 osc_clock, fpfd, f_freq_khz; - u64 Temp1, Temp2; - u32 DIV_MODE; - s32 RST_PLL = 1, band = 0; - u32 rf_cfg2 = 0, rf_cfg4 = 0; - - FOffset = 0; - - /* l-band */ - if (_freq_khz > 1000000) - band = 1; - - if (band == 0) { - /* band III */ - ret |= tcbd_rf_reg_write(_device, 0x04, 0x00002002); - ret |= tcbd_rf_reg_write(_device, 0x0e, 0x7F7F0711); - } else { - /* LBAND */ - ret |= tcbd_rf_reg_write(_device, 0x04, 0x00004001); - ret |= tcbd_rf_reg_write(_device, 0x0e, 0x7F7F0907); - } - - ret |= tcbd_rf_reg_read(_device, 0x06, (u32 *)&rf_cfg2); - if (((rf_cfg2 >> 28) & 0x01) == 0) - FR = 0; - else - FR = 1; - - if (((rf_cfg2 >> 31) & 0x01) == 0) - PLL_MODE = 2; - else - PLL_MODE = 4; - - osc_clock = tcbd_get_osc_clock(_device); - f_freq_khz = _freq_khz; - - /* Calculate PLL */ - if (f_freq_khz < 250000) { - /* VHF */ - DIV_MODE = 0x00; - fpfd = osc_clock >> FR; - VCO_DIV = 16; - - Flo = f_freq_khz - FOffset; - Fvco = Flo * VCO_DIV; - - Temp1 = Fvco << FR; - Temp2 = PLL_MODE * osc_clock; - N = DIV(Temp1, Temp2); - N_int = (N >> SCALE_FACTOR) << SCALE_FACTOR; - F = ((N - N_int) * (2 << 21)) >> SCALE_FACTOR; - - if (N_int < (19 << SCALE_FACTOR)) { - FR = 1; - fpfd = osc_clock >> FR; - VCO_DIV = 16; - Flo = f_freq_khz - FOffset; - Fvco = Flo * VCO_DIV; - - Temp1 = Fvco * FR; - Temp2 = PLL_MODE * osc_clock; - N = DIV(Temp1, Temp2); - N_int = (N >> SCALE_FACTOR) << SCALE_FACTOR; - F = ((N - N_int) * (2 << 21)) >> SCALE_FACTOR; - } - intF = F; - intVCO_DIV = VCO_DIV; - } else { - /* LBAND */ - DIV_MODE = 0x01; - fpfd = osc_clock >> FR; - VCO_DIV = 2; - - Flo = f_freq_khz - FOffset; - Fvco = Flo * VCO_DIV; - - Temp1 = Fvco << FR; - Temp2 = PLL_MODE * osc_clock; - N = DIV(Temp1, Temp2); - N_int = (N >> SCALE_FACTOR) << SCALE_FACTOR; - F = ((N - N_int) * (2 << 21)) >> SCALE_FACTOR; - - if (N_int < (19 << SCALE_FACTOR)) { - FR = 1; - - VCO_DIV = 2; - Flo = f_freq_khz - FOffset; - Fvco = Flo * VCO_DIV; - - Temp1 = Fvco << FR; - Temp2 = PLL_MODE * osc_clock; - N = DIV(Temp1, Temp2); - N_int = (N >> SCALE_FACTOR) << SCALE_FACTOR; - F = ((N - N_int) * (2<<21)) >> SCALE_FACTOR; - } - intF = F; - intVCO_DIV = VCO_DIV; - } - - rf_cfg4 = (u32)((N_int >> SCALE_FACTOR) & 0xFF) ; - rf_cfg4 |= ((intF & 0x3FFFFF) << 8); - rf_cfg4 |= ((RST_PLL & 0x01) << 30); - rf_cfg4 |= ((DIV_MODE & 0x01) << 31); - ret |= tcbd_rf_reg_write(_device, 0x08, rf_cfg4); - - ret |= tcbd_rf_reg_read(_device, 0x06, (u32 *)&rf_cfg2); - if (FR == 0) - BITCLR(rf_cfg2, Bit28); - else - BITSET(rf_cfg2, Bit28); - - ret |= tcbd_rf_reg_write(_device, 0x06, rf_cfg2); - - return ret; -} - -s32 tcbd_rf_tune_frequency( - struct tcbd_device *_device, u32 _freq_khz, s32 _bw_khz) -{ - s32 ret = 0; - - if (_device->curr_band != _device->prev_band) - ret |= tcbd_rf_init(_device, _device->curr_band); - - ret |= tcbd_rf_set_frequency(_device, _freq_khz, _bw_khz); - - if (ret < 0) - tcbd_debug(DEBUG_ERROR, - "Failed to set frequency to RF, err:%d\n", ret); - - return ret; -} diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_hal.c b/drivers/media/tdmb/tcc3170/src/tcbd_hal.c deleted file mode 100644 index fba77e7..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_hal.c +++ /dev/null @@ -1,140 +0,0 @@ -/* - * tcbd_hal.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <linux/module.h> -#include <linux/interrupt.h> -#include <linux/io.h> -#include <linux/delay.h> - -#include <bsp.h> - -#include "tcpal_os.h" -#include "tcpal_debug.h" -#include "tcbd_hal.h" -#include "tcbd_feature.h" - -#define __USE_DXB0_IRQ__ -/*#define __USE_DXB1_IRQ__*/ - -#ifdef __USE_TC_CPU__ -static PGPIO RGPIO; -static PPIC RPIC; -#endif - -void tchal_init(void) -{ -#ifdef __USE_TC_CPU__ - tcbd_debug(DEBUG_TCHAL, "\n"); - RGPIO = (PGPIO)tcc_p2v(HwGPIO_BASE); - RPIC = (PPIC)tcc_p2v(HwPIC_BASE); -#endif - tchal_power_down_device(); -} - -void tchal_reset_device(void) -{ -#ifdef __USE_TC_CPU__ - tcbd_debug(DEBUG_TCHAL, "\n"); -#if defined(__CSPI_ONLY__) - /* select peripheral mode as SPI */ -#if defined(__USE_DXB1_IRQ__) - BITCLR(RGPIO->GPAFN1, Hw16 - Hw12); /* DXB1_IRQ Set GPIO mode*/ - BITSET(RGPIO->GPAEN, Hw11); /* DXB1_IRQ output mode*/ - BITCLR(RGPIO->GPADAT, Hw11); /* DXB1_IRQ clear*/ -#elif defined(__USE_DXB0_IRQ__) - BITCLR(RGPIO->GPDFN1, Hw8 - Hw4); /* DXB0_IRQ Set GPIO mode*/ - BITSET(RGPIO->GPDEN, Hw9); /* DXB0_IRQ output mode*/ - BITCLR(RGPIO->GPDDAT, Hw9); /* DXB0_IRQ clear*/ -#endif /*__USE_DXB1_IRQ__*/ -#endif /*__CSPI_ONLY__*/ - - /* reset */ -#if defined(__CSPI_ONLY__) - BITCLR(RGPIO->GPEFN1, Hw16 - Hw12); /* DXB1_RST# Set GPIO mode */ - BITSET(RGPIO->GPEEN, Hw11);/* DXB1_RST# Set GPIO Output mode*/ - BITCLR(RGPIO->GPEDAT, Hw11);/* DXB1_RST# Clear */ - tcpal_msleep(10); - BITSET(RGPIO->GPEDAT, Hw11);/* DXB1_RST# Set*/ -#elif defined(__I2C_STS__) - BITCLR(RGPIO->GPDFN1, Hw4 - Hw0); /* DXB0_RST# Set GPIO mode */ - BITSET(RGPIO->GPDEN, Hw8); /* DXB0_RST# Set GPIO Output mode*/ - BITCLR(RGPIO->GPDDAT, Hw8); /* DXB0_RST# Clear */ - tcpal_msleep(10); - BITSET(RGPIO->GPDDAT, Hw8); /* DXB0_RST# Set*/ -#else /*__CSPI_ONLY__ || __I2C_STS__*/ -#error "you must define __CSPI_ONLY__ or __I2C_STS__" -#endif /*!__CSPI_ONLY__ && !__I2C_STS__*/ -#endif -} - -void tchal_power_on_device(void) -{ -#ifdef __USE_TC_CPU__ - tcbd_debug(DEBUG_TCHAL, "\n"); - BITCLR(RGPIO->GPEFN0, Hw16 - Hw12);/* DXB1_PD Set GPIO mode*/ - - BITSET(RGPIO->GPEEN, Hw3);/* DXB1_PD Set GPIO Output mode*/ - BITCLR(RGPIO->GPEDAT, Hw3);/* DXB1_PD Clear*/ - tcpal_msleep(10); - BITSET(RGPIO->GPEDAT, Hw3);/* DXB1_PD Set*/ - tcpal_msleep(10); - - tchal_reset_device(); - tchal_irq_setup(); -#endif -} - - -void tchal_power_down_device(void) -{ -#ifdef __USE_TC_CPU__ - tcbd_debug(DEBUG_TCHAL, "\n"); - BITCLR(RGPIO->GPEFN0, Hw16 - Hw12); - BITSET(RGPIO->GPEEN, Hw3);/* DXB1_PD Set GPIO Output mode*/ - BITCLR(RGPIO->GPEDAT, Hw3);/* DXB1_PD Clear*/ -#if defined(__CSPI_ONLY__) - BITCLR(RGPIO->GPEDAT, Hw11);/* DXB1_RST# Clear*/ -#elif defined(__I2C_STS__) - BITCLR(RGPIO->GPDDAT, Hw8);/* DXB0_RST# Clear */ -#else -#error "you must define __CSPI_ONLY__ or __I2C_STS__" -#endif -#endif -} - -void tchal_irq_setup(void) -{ -#ifdef __USE_TC_CPU__ -#if defined(__USE_DXB1_IRQ__) - BITCLR(RGPIO->GPAFN1, Hw16 - Hw12);/* DXB1_IRQ Set GPIO mode*/ - BITCLR(RGPIO->GPAEN, Hw11);/* DXB1_IRQ input mode*/ - - BITCSET(RGPIO->EINTSEL0, Hw32 - Hw24, 11<<24); /*GPIO_A11*/ -#elif defined(__USE_DXB0_IRQ__) - BITCLR(RGPIO->GPDFN1, Hw8 - Hw4); /* DXB0_IRQ Set GPIO mode*/ - BITCLR(RGPIO->GPDEN, Hw9); /* DXB0_IRQ input mode*/ - - BITCSET(RGPIO->EINTSEL0, Hw32 - Hw24, 20<<24); /*GPIO_D9*/ -#endif /*__USE_DXB1_IRQ__*/ - BITSET(RPIC->POL0, 1<<IRQ_TC317X); -#endif -} diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_stream_parser/Makefile b/drivers/media/tdmb/tcc3170/src/tcbd_stream_parser/Makefile deleted file mode 100644 index 4c58a2c..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_stream_parser/Makefile +++ /dev/null @@ -1,6 +0,0 @@ - -obj-y += tcbd_stream_parser.o - -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcpal -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcbd_stream_parser diff --git a/drivers/media/tdmb/tcc3170/src/tcbd_stream_parser/tcbd_stream_parser.c b/drivers/media/tdmb/tcc3170/src/tcbd_stream_parser/tcbd_stream_parser.c deleted file mode 100644 index 229bcc1..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcbd_stream_parser/tcbd_stream_parser.c +++ /dev/null @@ -1,525 +0,0 @@ -/* - * tcbd_stream_parser.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcbd_stream_parser.h" - -#define SIZE_MSC_CACHE_BUFF (188*20) -#define SIZE_FIC_CACHE_BUFF (388*2) -#define SIZE_STATUS_CACHE_BUFF (32*2) - -#if defined(__MERGE_EACH_TYPEOF_STREAM__) -#define SIZE_MSC_STACK_BUFF (1024*16) -#define SIZE_FIC_STACK_BUFF (388*10) -#define SIZE_STATUS_STACK_BUFF (32*10) -#endif /*!__MERGE_EACH_TYPEOF_STREAM__*/ - -#define MAX_SUBCH_ID (0x1<<6) -enum tcbd_split_stream_state { - STATE_NO_SYNC = 0, - STATE_OTHER, - STATE_STATUS, - STATE_MSC, - STATE_FIC, - STATE_GARBAGE, - STATE_ERROR -}; - -#define HEADER_SIZE 4 -#define SYNC_BYTE 0x5C -struct op_header { - u8 sync; /**< sync byte. must be 0x5C */ - u8 subch; /**< sub channel id */ - u16 data_size; - u8 parity; - enum DATA_TYPE type; -}; - -#if defined(__MERGE_EACH_TYPEOF_STREAM__) -struct merged_stream_info { - s32 curr_pos; /**< Current position of buffer of merged stream */ - u8 *buffer; /**< Buffer for stacking stream chunk */ - u8 subch_id; -}; -#endif /* __MERGE_EACH_TYPEOF_STREAM__ */ - -struct tcbd_split_stream_data { - s32 dev_idx; - s32 header_err[2]; - enum tcbd_split_stream_state state; - s32 header_cnt; - s32 remain; - s32 next_read; - u8 *buffer; - struct op_header header; -#if defined(__MERGE_EACH_TYPEOF_STREAM__) - struct merged_stream_info merged_msc[TCBD_MAX_NUM_SERVICE]; - struct merged_stream_info merged_fic; - struct merged_stream_info merged_status; - u8 quick_msc_idx[MAX_SUBCH_ID]; - u8 num_subch; -#endif /*__MERGE_EACH_TYPEOF_STREAM__ */ - tcbd_stream_callback stream_callback; -}; - -static struct tcbd_split_stream_data tcbd_stream_spliter[2]; - -static inline u8 tcbd_parity_check(u8 *parity) -{ - u32 i, k; - u8 p = 0; - - for (i = 0; i < 4; i++) { - for (k = 0; k < 8; k++) - p = (p + ((parity[i] >> k) & 1)) & 1; - } - - return p; -} - -#define FIC_ID 0x00 -#define STATUS_ID 0x3F -#define GARBAGE_ID 0x04 -#define OTHER_CHIP_ID 0x3D - -static inline void tcbd_change_parser_state(struct op_header *header, - struct tcbd_split_stream_data *_parser) -{ - s32 size_limit[] = { -1, 4096, 32, 4096, 388, 4096}; - s8 *type[] = {NULL, "other", "status", "msc", "fic", "garbage"}; - - switch ((enum DATA_TYPE)header->type) { - case DATA_TYPE_MSC: - if (header->data_size == 388) { - _parser->state = STATE_FIC; - header->type = DATA_TYPE_FIC; - } else - _parser->state = STATE_MSC; - break; - case DATA_TYPE_FIC: - if (header->subch == GARBAGE_ID) - _parser->state = STATE_GARBAGE; - else if (header->subch == FIC_ID) - _parser->state = STATE_FIC; - else - _parser->state = STATE_ERROR; - break; - case DATA_TYPE_STATUS: - if (header->subch == STATUS_ID) - _parser->state = STATE_STATUS; - else - _parser->state = STATE_ERROR; - break; - case DATA_TYPE_OTHER: - if (header->subch == OTHER_CHIP_ID) - _parser->state = STATE_OTHER; - else - _parser->state = STATE_ERROR; - break; - default: - tcbd_debug(DEBUG_ERROR, "unknown data type!!"); - _parser->state = STATE_ERROR; - break; - } - switch (_parser->state) { - case STATE_ERROR: - _parser->header_err[1]++; - _parser->state = STATE_NO_SYNC; - break; - default: - if (size_limit[_parser->state] < header->data_size) { - tcbd_debug(DEBUG_ERROR, "wrong data size %s:%d!\n", - type[_parser->state], header->data_size); - _parser->header_err[1]++; - _parser->state = STATE_NO_SYNC; - - } else - _parser->header_cnt++; - break; - } -} - -static s32 tcbd_parse_header(struct tcbd_split_stream_data *_parser) -{ - u8 *stream = _parser->buffer; - struct op_header *header = &_parser->header; - - _parser->state = STATE_NO_SYNC; - if ((stream[3] != SYNC_BYTE) || (tcbd_parity_check(stream) != 1)) { - _parser->header_err[0]++; - return HEADER_SIZE; - } - - header->sync = stream[3]; - header->type = (stream[2] & 0xC0) >> 6; - header->data_size = ((stream[1]<<7) | (stream[0]>>1)) << 2; - header->subch = stream[2] & 0x3F; - - tcbd_debug(DEBUG_PARSE_HEADER, "sync:0x%02X, type:%d, size:%d\n", - header->sync, header->type, - header->data_size); - tcbd_change_parser_state(header, _parser); - - return HEADER_SIZE; -} - -#if defined(__MERGE_EACH_TYPEOF_STREAM__) -static void tcbd_merge_each_stream(struct tcbd_split_stream_data *_parser, - u8 *chunk_buff) -{ - static u8 msc_buff[TCBD_MAX_NUM_SERVICE][SIZE_MSC_STACK_BUFF]; - static u8 fic_buff[SIZE_FIC_STACK_BUFF]; - static u8 status_buff[SIZE_STATUS_STACK_BUFF]; - - struct merged_stream_info *merged; - struct op_header *header = &_parser->header; - - s32 sz_stack_buff[] = { - SIZE_MSC_STACK_BUFF, - SIZE_FIC_STACK_BUFF, - SIZE_STATUS_STACK_BUFF}; - s32 quick_msc_idx = 0; - - switch (header->type) { - case DATA_TYPE_MSC: - if (_parser->num_subch >= TCBD_MAX_NUM_SERVICE) { - tcbd_debug(DEBUG_ERROR, "exceeded max num service!\n"); - return; - } - if (_parser->quick_msc_idx[header->subch] == 0xFF) - _parser->quick_msc_idx[header->subch] = - _parser->num_subch++; - - quick_msc_idx = _parser->quick_msc_idx[header->subch]; - if (quick_msc_idx >= TCBD_MAX_NUM_SERVICE) - tcbd_debug(DEBUG_ERROR, "quick_msc_idx:%d, header->" - "subch:%d\n", quick_msc_idx, header->subch); - - merged = &_parser->merged_msc[quick_msc_idx]; - merged->buffer = msc_buff[quick_msc_idx]; - merged->subch_id = header->subch; - break; - case DATA_TYPE_FIC: - merged = &_parser->merged_fic; - merged->buffer = fic_buff; - break; - case DATA_TYPE_STATUS: - merged = &_parser->merged_status; - merged->buffer = status_buff; - break; - default: - tcbd_debug(DEBUG_ERROR, "unknown stream type!\n"); - return; - } - - if (merged->curr_pos+header->data_size > sz_stack_buff[header->type]) { - tcbd_debug(DEBUG_ERROR, "overflow stack buffer!!\n"); - return; - } - - tcbd_debug(DEBUG_STREAM_STACK, "type:%d, subchid:%u, buffer:%p " - "currpos:%d, size:%d\n", header->type, header->subch, - merged->buffer, merged->curr_pos, header->data_size); - memcpy(merged->buffer + merged->curr_pos, chunk_buff, - header->data_size); - merged->curr_pos += header->data_size; -} - -static s32 tcbd_push_merged_stream(struct tcbd_split_stream_data *_parser) -{ - register s32 i; - struct merged_stream_info *merged = NULL; - struct merged_stream_info *list_stream[] = { - NULL, &_parser->merged_fic, &_parser->merged_status, NULL - }; - - tcbd_debug(DEBUG_STREAM_STACK, "header num:%d, num subch :%d\n", - _parser->header_cnt, _parser->num_subch); - for (i = 0; i < _parser->num_subch; i++) { - merged = &_parser->merged_msc[i]; - if (!merged->buffer || !merged->curr_pos) - continue; - - /* send merged data to user space */ - if (_parser->stream_callback) { - _parser->stream_callback(_parser->dev_idx, - merged->buffer, merged->curr_pos, - merged->subch_id, DATA_TYPE_MSC); - merged->buffer = NULL; - merged->curr_pos = 0; - } - } - - for (i = 1; i < (s32)DATA_TYPE_MAX; i++) { - merged = list_stream[i]; - if (!merged || !merged->buffer || !merged->curr_pos) - continue; - - /* send merged data to user space */ - if (_parser->stream_callback) { - _parser->stream_callback(_parser->dev_idx, - merged->buffer, merged->curr_pos, - merged->subch_id, i); - merged->buffer = NULL; - merged->curr_pos = 0; - } - } - return 0; -} -#endif /*__MERGE_EACH_TYPEOF_STREAM__ */ - -static void tcbd_stack_chunk(struct tcbd_split_stream_data *_parser, - u8 *_buffer) -{ - u8 *chunk_buff = (_buffer) ? _buffer : _parser->buffer; -#if defined(__MERGE_EACH_TYPEOF_STREAM__) - tcbd_merge_each_stream(_parser, chunk_buff); -#else /* __MERGE_EACH_TYPEOF_STREAM__ */ - struct op_header *header = &_parser->header; - if (_parser->stream_callback) { - _parser->stream_callback(_parser->dev_idx, chunk_buff, - header->data_size, header->subch, header->type); - } -#endif /* !__MERGE_EACH_TYPEOF_STREAM__ */ -} - -static inline s32 tcbd_push_concat(struct tcbd_split_stream_data *_parser, - u8 *_cache_buff) -{ - s32 pre_copied, ret; - u8 *buffer = _parser->buffer; - struct op_header *header = &_parser->header; - - s8 *type[] = {"msc", "fic", "status", "other"}; - s32 size_cache_buff[] = { - SIZE_MSC_CACHE_BUFF, - SIZE_FIC_CACHE_BUFF, - SIZE_STATUS_CACHE_BUFF}; - - if (header->data_size > size_cache_buff[header->type]) { - tcbd_debug(DEBUG_ERROR, "overflow %s cache buffer!! size:%d\n", - type[header->type], header->data_size); - _parser->state = STATE_ERROR; - ret = HEADER_SIZE; - goto exit_func; - } - - pre_copied = header->data_size - _parser->next_read; - if (_parser->next_read > _parser->remain) { - memcpy(_cache_buff + pre_copied, buffer, _parser->remain); - _parser->next_read -= _parser->remain; - ret = _parser->remain; - tcbd_debug(DEBUG_PARSING_PROC, "keep %s data %d bytes, pre:%d," - "next:%d, buffer:%p\n", type[header->type], - _parser->remain, pre_copied, _parser->next_read, - _cache_buff); - } else { - memcpy(_cache_buff + pre_copied, buffer, _parser->next_read); - tcbd_stack_chunk(_parser, _cache_buff); - ret = _parser->next_read; - tcbd_debug(DEBUG_PARSING_PROC, "send %s data %d bytes, pre:%d," - "curr:%d, buffer:%p\n", type[header->type], - header->data_size, pre_copied, - _parser->next_read, _cache_buff); - _parser->state = STATE_NO_SYNC; - } - -exit_func: - return ret; -} - -static inline void tcbd_push_medium(struct tcbd_split_stream_data *_parser) -{ - struct op_header *header = &_parser->header; - s8 *type[] = {"msc", "fic", "status", "other"}; - - tcbd_debug(DEBUG_PARSING_PROC, "send %s data %d bytes\n", - type[header->type], header->data_size); - tcbd_stack_chunk(_parser, NULL); -} - -static inline s32 tcbd_cache_ramnant(struct tcbd_split_stream_data *_parser, - u8 *_cache_buff) -{ - struct op_header *header = &_parser->header; - u8 *buffer = _parser->buffer; - s8 *type[] = {"msc", "fic", "status", "other"}; - s32 size_cache_buff[] = { - SIZE_MSC_CACHE_BUFF, - SIZE_FIC_CACHE_BUFF, - SIZE_STATUS_CACHE_BUFF}; - - tcbd_debug(DEBUG_PARSING_PROC, "keep %s data %d bytes buff:%p\n", - type[header->type], _parser->remain, _cache_buff); - - if (header->data_size > size_cache_buff[header->type]) { - tcbd_debug(DEBUG_ERROR, "overflow %s cache buffer!! size:%d\n", - type[header->type], header->data_size); - _parser->state = STATE_ERROR; - return HEADER_SIZE; - } else { - memcpy(_cache_buff, buffer, _parser->remain); - return _parser->remain; - } -} - -static s32 tcbd_push_chunk(struct tcbd_split_stream_data *_parser, - u8 *_cached_buff) -{ - s32 move; - struct op_header *header = &_parser->header; - - if (_parser->next_read) { - if (_parser->state != STATE_GARBAGE) - move = tcbd_push_concat(_parser, _cached_buff); - else { - if (_parser->next_read > _parser->remain) { - _parser->next_read -= _parser->remain; - move = _parser->remain; - } else { - move = _parser->next_read; - _parser->state = STATE_NO_SYNC; - } - } - } else if (_parser->remain >= header->data_size) { - if (_parser->state != STATE_GARBAGE) - tcbd_push_medium(_parser); - - _parser->state = STATE_NO_SYNC; - move = header->data_size; - } else { - if (_parser->state != STATE_GARBAGE) - move = tcbd_cache_ramnant(_parser, _cached_buff); - else - move = _parser->remain; - - _parser->next_read = header->data_size - _parser->remain; - } - - switch (_parser->state) { - case STATE_NO_SYNC: -#if defined(__USING_TS_IF__) - if (_parser->next_read == 0) - move += 188 - ((move + SIZE_BUFF_HEADER) % 188); - else - move += 188 - (move % 188); -#endif /*__USING_TS_IF__*/ - case STATE_ERROR: - _parser->state = STATE_NO_SYNC; - _parser->next_read = 0; - default: - break; - } - - return move; -} - -s32 tcbd_split_stream(s32 _dev_idx, u8 *_stream, s32 _size) -{ - s32 ret = 0; - register s32 point, move; - /* buffer for un-handled spare data of each interrupt */ - static u8 cache_buff_msc[SIZE_MSC_CACHE_BUFF]; - static u8 cache_buff_fic[SIZE_FIC_CACHE_BUFF]; - static u8 buff_cache_status[SIZE_STATUS_CACHE_BUFF]; - - struct tcbd_split_stream_data *spliter = &tcbd_stream_spliter[_dev_idx]; - - u64 time = 0; - point = move = 0; - spliter->remain = _size; - spliter->header_cnt = 0; - memset(spliter->header_err, 0, sizeof(spliter->header_err)); - - time = tcpal_get_time(); - while (spliter->remain > 0) { - spliter->buffer = _stream + point; - switch (spliter->state) { - case STATE_NO_SYNC: - move = tcbd_parse_header(spliter); - break; - case STATE_OTHER: - move = tcbd_parse_header(spliter); - tcbd_debug(DEBUG_ERROR, "State Other!! size:%d\n", - spliter->header.data_size); - break; - case STATE_MSC: - move = tcbd_push_chunk(spliter, cache_buff_msc); - break; - case STATE_FIC: - move = tcbd_push_chunk(spliter, cache_buff_fic); - break; - case STATE_STATUS: - move = tcbd_push_chunk(spliter, buff_cache_status); - break; - - case STATE_GARBAGE: - move = tcbd_push_chunk(spliter, NULL); - tcbd_debug(DEBUG_STREAM_PARSER, "State Garbage!:%d\n", - spliter->header.data_size); - break; - default: - move = 0; point = 0; - spliter->state = STATE_NO_SYNC; - spliter->next_read = 0; - tcbd_debug(DEBUG_ERROR, "something wrong!\n"); - goto exit_func; - } - spliter->remain -= move; - point += move; - tcbd_debug(0, "remain:%d, point:%d, move:%d\n", - spliter->remain, point, move); - } -exit_func: -#if defined(__MERGE_EACH_TYPEOF_STREAM__) - ret = tcbd_push_merged_stream(spliter); -#endif /*__MERGE_EACH_TYPEOF_STREAM__*/ - tcbd_debug(DEBUG_PARSING_TIME, "%lldms elapsed to parse!\n", - tcpal_diff_time(time)); - - if (spliter->header_err[0] || spliter->header_err[1]) - tcbd_debug(DEBUG_ERROR, "header err, parity:%d, state:%d\n", - spliter->header_err[0], spliter->header_err[1]); - return ret; -} - -void tcbd_init_parser(s32 _dev_idx, tcbd_stream_callback _stream_callback) -{ - tcbd_stream_callback bak = NULL; - struct tcbd_split_stream_data *spliter = &tcbd_stream_spliter[_dev_idx]; - - if (spliter->stream_callback) - bak = spliter->stream_callback; - - memset(spliter, 0, sizeof(struct tcbd_split_stream_data)); - spliter->dev_idx = _dev_idx; -#if defined(__MERGE_EACH_TYPEOF_STREAM__) - memset(spliter->quick_msc_idx, 0xFF, sizeof(spliter->quick_msc_idx)); -#endif /*__MERGE_EACH_TYPEOF_STREAM__*/ - if (_stream_callback) - spliter->stream_callback = _stream_callback; - else if (bak) - spliter->stream_callback = bak; -} diff --git a/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/Makefile b/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/Makefile deleted file mode 100644 index 9dcc13e..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -obj-y += tcc_fic_decoder.o -obj-y += tcc_fic_fig0.o -obj-y += tcc_fic_fig1.o - -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcpal -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcc_fic_decoder diff --git a/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/tcc_fic_decoder.c b/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/tcc_fic_decoder.c deleted file mode 100644 index 8997c44..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/tcc_fic_decoder.c +++ /dev/null @@ -1,540 +0,0 @@ -/* - * tcc_fic_decoder.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcc_fic_decoder.h" - -/****************************************************************************** -* UEP Table -* +---------------+-----------+-----------------------------------+ -* |Bit rate(4bits)|Protect Lv | SubCh Size(9bits) | -* |---------------|---+---+---|---+---+---+---+---+---+---+---+---| -* | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | x | -* +---------------+-----------+-----------------------------------+ -* -*******************************************************************************/ -static const unsigned short uep_table[64] = { - 0x0810, 0x0615, 0x0418, 0x021d, 0x0023, 0x1818, 0x161d, 0x1423, - 0x122a, 0x1034, 0x281d, 0x2623, 0x242a, 0x2234, 0x3820, 0x362a, - 0x3430, 0x323a, 0x3046, 0x4828, 0x4634, 0x443a, 0x4246, 0x4054, - 0x5830, 0x563a, 0x5446, 0x5254, 0x5068, 0x683a, 0x6646, 0x6454, - 0x6268, 0x7840, 0x7654, 0x7460, 0x7274, 0x708c, 0x8850, 0x8668, - 0x8474, 0x828c, 0x80a8, 0x9860, 0x9674, 0x948c, 0x92a8, 0x90d0, - 0xa874, 0xa68c, 0xa4a8, 0xa2d0, 0xa0e8, 0xb880, 0xb6a8, 0xb4c0, - 0xb2e8, 0xb118, 0xc8a0, 0xc6d0, 0xc318, 0xd8c0, 0xd518, 0xd1a0 }; - -static struct fic_parser_matadata parser_metadata; -static struct tcc_ensemble_info user_ensbl_info; - -static s32 parsing_fig0(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 length) -{ - s32 ret = FICERR_SUCCESS; - u8 extension; - - fic_info->fig_cn = (*fig_buff & 0x80) >> 7; - fic_info->fig_oe0 = (*fig_buff & 0x40) >> 6; - fic_info->fig_pd = (*fig_buff & 0x20) >> 5; - extension = (*fig_buff++ & 0x1f); - - length--; - /* service link FIG */ - if ((extension != 6) && (extension != 21) && (extension != 24)) { - if (fic_info->fig_cn) { - if (fic_info->reconf_stage) { - if (extension > 0) - return FICERR_FIG0_NEXT_FIG; - } else { - return FICERR_FIG0_NEXT_FIG1; - } - } - } - - switch (extension) { - case EXT_00: - ret = fig0_ext00(fic_info, fig_buff, length); - break; - case EXT_01: - ret = fig0_ext01(fic_info, fig_buff, length); - break; - case EXT_02: - ret = fig0_ext02(fic_info, fig_buff, length); - break; - case EXT_03: - ret = fig0_ext03(fic_info, fig_buff, length); - break; - case EXT_04: - ret = fig0_ext04(fic_info, fig_buff, length); - break; - case EXT_05: - ret = fig0_ext05(fic_info, fig_buff, length); - break; - case EXT_08: - ret = fig0_ext08(fic_info, fig_buff, length); - break; - case EXT_13: - ret = fig0_ext13(fic_info, fig_buff, length); - break; - case EXT_17: - ret = fig0_ext17(fic_info, fig_buff, length); - break; - default: - break; - } - return ret; -} - - -static s32 parsing_fig1( - struct fic_parser_matadata *fic_info, - u8 *fig_buff, - s32 length) -{ - s32 ret; - u8 extension, charset; - - fic_info->fig_oe1 = (*fig_buff & 0x08) >> 3; - - if (fic_info->fig_oe1 != 0) - return FICERR_FIG_NODATA; - - charset = (*fig_buff & 0xf0) >> 4; - extension = (*fig_buff++ & 0x07); - length--; - switch (extension) { - case EXT_00: - ret = fig1_ext00(fic_info, fig_buff, length, charset); - break; - case EXT_01: - ret = fig1_ext01(fic_info, fig_buff, length, charset); - break; - case EXT_04: - ret = fig1_ext04(fic_info, fig_buff, length, charset); - break; - case EXT_05: - ret = fig1_ext05(fic_info, fig_buff, length, charset); - break; - case EXT_06: - ret = fig1_ext06(fic_info, fig_buff, length, charset); - default: - break; - } - - return FICERR_SUCCESS; -} - -static u32 fic_channel_updated(void) -{ - u32 i, j; - u32 num_svc, num_svc_comp, num_subch; - - struct fic_parser_matadata *metadata = &parser_metadata; - struct tcc_ensemble *esmbl = &metadata->esmbl_start; - struct tcc_service *svc = metadata->svc_start; - struct tcc_service_comp *svc_comp = metadata->svc_comp_start; - struct tcc_user_app_types *user_app = metadata->user_app_start; - - num_svc = esmbl->num_svc; - num_svc_comp = esmbl->num_svc_comp; - num_subch = esmbl->num_svc_comp; - - if (!num_svc_comp) - return CH_UPDATE_NO_DATA; - - if (!num_subch) - return CH_UPDATE_NO_DATA; - - if (esmbl->label[0] == 0x00) - return CH_UPDATE_NO_DATA; - - if (num_svc) { - for (i = 0; i < num_svc; i++) { - if ((svc + i)->svc_label[0] == 0) - return CH_UPDATE_NO_DATA; - } - } else { - return CH_UPDATE_NO_DATA; - } - - for (i = 0; i < num_svc_comp; i++) { - if ((svc_comp + i)->fidc_id == 0xff) - return CH_UPDATE_NO_DATA; - } - - for (i = 0; i < num_svc_comp; i++) { - if (svc_comp[i].tmid == 3 || svc_comp[i].ascty_dscty == 5) { - if (svc_comp[i].ascty_dscty == 0) - return CH_UPDATE_ESSENTIAL_DATA; - - for (j = 0; j < num_svc_comp; j++) { - if (svc_comp[i].sid == user_app[j].sid && - svc_comp[i].scids == user_app[j].scids) - break; - } - if (j == num_svc_comp) - return CH_UPDATE_ESSENTIAL_DATA; - - if (svc_comp[i].scids == 0x0f) - return CH_UPDATE_ESSENTIAL_DATA; - } - - if (svc_comp[i].order) { - if ((svc_comp + i)->label[0] == 0) - return CH_UPDATE_ESSENTIAL_DATA; - } - } - - return CH_UPDATE_FULL_DATA; -} - -void tcc_fic_parser_init(void) -{ - s32 i; - struct fic_parser_matadata *metadata; - - metadata = &parser_metadata; - memset(metadata, 0, sizeof(parser_metadata)); - - metadata->reconf_stage = 0; - metadata->fig_cn = 0; - metadata->fig_oe0 = 0; - metadata->fig_pd = 0; - metadata->fig_oe1 = 0; - metadata->fib_cnt = 0; - - for (i = 0; i < NUM_SVC_COMP; i++) - metadata->svc_comp_start[i].scids = 0x0f; - - for (i = 0; i < NUM_USER_APP; i++) - metadata->user_app_start[i].scids = 0x0f; -} - -static s32 fib_decode(u8 *fig_buff) -{ - s32 ret = FICERR_SUCCESS; - struct fic_parser_matadata *fic_info; - - s32 fig_len; - u32 fig_type; - u32 buff_point = 0; - s32 buff_len = 30; - - fic_info = &parser_metadata; - - if (ret != FICERR_SUCCESS) - return ret; - - /* the size of FIG is bigger than 2bytes */ - while (buff_len > 0) { - /* find a FIG header */ - if (*(fig_buff + buff_point) == 0xff || - *(fig_buff + buff_point) == 0x00) { - ret = FICERR_FIBD_ENDMARKER; - break; - } - - fig_type = (*(fig_buff + buff_point) & 0xe0) >> 5; - fig_len = (*(fig_buff + buff_point) & 0x1f); - if (fig_len > 29 || fig_len == 0) - return FICERR_FIBD_INVALID_LENGTH; - - buff_point++; - if (fig_len <= 0x01) { - ret = FICERR_FIG_NODATA; - return ret; - } - - switch (fig_type) { - case FIG0: - ret = parsing_fig0(fic_info, - fig_buff + buff_point, fig_len); - break; - case FIG1: - ret = parsing_fig1(fic_info, - fig_buff+buff_point, fig_len); - break; - default: - ret = FICERR_FIBD_UNKNOWN_FIGTYPE; - return ret; - } - - buff_point += fig_len; - buff_len -= (fig_len + 1); - } - - if (buff_len < 0) - ret = FICERR_FIBD_INVALID_LENGTH; - return ret; -} - -static u16 fib_crc16(u8 *buf) -{ - u32 b, len; - u8 crcl, crcm; - - crcl = 0xff; - crcm = 0xff; - - - for (len = 0; len < 30; len++) { - b = *(buf + len) ^ crcm; - b = b ^ (b >> 4); - crcm = crcl ^ (b >> 3) ^ (b << 4); - crcl = b ^ (b << 5); - } - - crcl = crcl ^ 0xff; - crcm = crcm ^ 0xff; - return (u16)crcl | ((u16)crcm << 8); -} - - -static void fic_copy_sub_ch(struct fic_parser_matadata *fic_info, - struct tcc_service_comp_info *svc_comp_info) -{ - s32 i; - struct tcc_ensemble *esbl = &fic_info->esmbl_start; - struct tcc_sub_channel *subch_start = fic_info->subch_start; - - for (i = 0; i < esbl->num_svc_comp; i++) { - if (svc_comp_info->svc_comp.fidc_id != subch_start[i].subch_id) - continue; - memcpy(&svc_comp_info->sub_ch, &subch_start[i], - sizeof(struct tcc_sub_channel)); - break; - } -} - -static void fic_copy_svc_comp(struct fic_parser_matadata *fic_info, - struct tcc_service_info *svc_info) -{ - s32 i, j = 0; - struct tcc_ensemble *esbl = &fic_info->esmbl_start; - struct tcc_service_comp *src_svc_comp = fic_info->svc_comp_start; - struct tcc_service_comp_info *svc_comp_info; - - for (i = 0; i < esbl->num_svc_comp; i++) { - if (svc_info->svc.sid != src_svc_comp[i].sid) - continue; - svc_comp_info = &svc_info->svc_comp_info[j]; - memcpy(&svc_comp_info->svc_comp, &src_svc_comp[i], - sizeof(struct tcc_service_comp)); - fic_copy_sub_ch(fic_info, svc_comp_info); - j++; - } -} - -struct tcc_service_comp_info *tcc_fic_get_svc_comp_info(s32 _subch_id) -{ - s32 i; - struct tcc_service_comp_info *svc_comp_info; - struct tcc_ensemble *ensbl = &user_ensbl_info.ensbl; - struct tcc_service_info *svc_info = user_ensbl_info.svc_info; - - for (i = 0; i < ensbl->num_svc_comp; i++) { - svc_comp_info = &svc_info[i].svc_comp_info[0]; - if (svc_comp_info->svc_comp.fidc_id == _subch_id) - return svc_comp_info; - } - return NULL; -} - -u8 tcc_fic_get_ptype(struct tcc_service_comp_info *svc_comp_info) -{ - struct tcc_sub_channel *sub_ch = &svc_comp_info->sub_ch; - if (sub_ch->form_flag & 0x08) - return 1; - else - return 0; -} - -u8 tcc_fic_get_plevel(struct tcc_service_comp_info *svc_comp_info) -{ - u8 eep8[4] = {0, 1, 2, 3}; - u8 eep32[4] = {4, 5, 6, 7}; - u8 opt, protect; - struct tcc_sub_channel *sub_ch = &svc_comp_info->sub_ch; - - if (sub_ch->form_flag & 0x08) { - opt = (sub_ch->form_flag & 0x04) ? 1 : 0; - protect = sub_ch->form_flag & 0x03; - if (opt) - return eep32[protect]; - else - return eep8[protect]; - } else { - return (uep_table[sub_ch->tbl_index] & 0x0E00) >> 9; - } -} - -u16 tcc_fic_get_cu_size(struct tcc_service_comp_info *svc_comp_info) -{ - struct tcc_sub_channel *sub_ch = &svc_comp_info->sub_ch; - - if (sub_ch->form_flag & 0x08) - return sub_ch->size_cu; - else - return uep_table[sub_ch->tbl_index] & 0x1FF; -} - -u16 tcc_fic_get_cu_start(struct tcc_service_comp_info *svc_comp_info) -{ - struct tcc_sub_channel *sub_ch = &svc_comp_info->sub_ch; - - return sub_ch->size_cu; -} - -u8 tcc_fic_get_subch_id(struct tcc_service_comp_info *svc_comp_info) -{ - struct tcc_sub_channel *sub_ch = &svc_comp_info->sub_ch; - - return sub_ch->subch_id; -} - - -u8 tcc_fic_get_bitrate(struct tcc_service_comp_info *svc_comp_info) -{ - u8 opt, protect; - struct tcc_sub_channel *sub_ch = &svc_comp_info->sub_ch; - - if ((sub_ch->form_flag & 0x08) == 0) - return (uep_table[sub_ch->tbl_index] & 0xf000) >> 12; - - opt = (sub_ch->form_flag & 0x04) ? 1 : 0; - protect = sub_ch->form_flag & 0x03; - if (opt) { - switch (protect) { - case 0: - return sub_ch->size_cu / 27; - case 1: - return sub_ch->size_cu / 21; - case 2: - return sub_ch->size_cu / 18; - case 3: - return sub_ch->size_cu / 15; - default: - return 0; - } - /*human readable bitrate is x32*/ - } else { - switch (protect) { - case 0: - return sub_ch->size_cu / 12; - case 1: - return sub_ch->size_cu / 8; - case 2: - return sub_ch->size_cu / 6; - case 3: - return sub_ch->size_cu / 4; - default: - return 0; - } - /*human readable bitrate is x8*/ - } -} - -u8 tcc_fic_get_rs(struct tcc_service_comp_info *svc_comp_info) -{ - struct tcc_service_comp *svc_comp = &svc_comp_info->svc_comp; - if (svc_comp->ascty_dscty == 0x18) - return 1; - else - return 0; -} - -/** -* @param buff buffer for fic -* @param size fic buffer size. it must be 384 bytes. -* @return -1 : invalid argument, 0 : in progress, > 0 : parsing done -*/ -s32 tcc_fic_run_decoder(u8 *buff, s32 size) -{ - s32 cnt = 0, ret = 0; - s32 num_broken_fib = 0; - u16 fib_crc; - - if ((size%TCC_FIB_SIZE) != 0) { - tcbd_debug(DEBUG_ERROR, "invalid fic size:%d!\n", size); - return -1; - } - while (size > cnt * TCC_FIB_SIZE) { - fib_crc = (u16)(buff[(cnt * TCC_FIB_SIZE) + 30] << 8) | - (u16)buff[(cnt * TCC_FIB_SIZE) + 31]; - if (fib_crc != fib_crc16(buff + (cnt * TCC_FIB_SIZE))) { - num_broken_fib++; - tcbd_debug(DEBUG_ERROR, "broken fib cnt:%d\n", cnt); - goto cont_loop; - } - fib_decode(buff + (cnt * TCC_FIB_SIZE)); - ret = fic_channel_updated(); - if (ret == CH_UPDATE_ESSENTIAL_DATA || - ret == CH_UPDATE_FULL_DATA) { - break; - } -cont_loop: - cnt++; - } - return ret; -} - -void tcc_fic_disp_ensbl_info(struct tcc_ensemble_info *ensbl_info) -{ - s32 i, j; - struct tcc_ensemble *esbl = &ensbl_info->ensbl; - struct tcc_service_info *svc_info; - struct tcc_service_comp_info *svc_comp_info; - - tcbd_debug(DEBUG_INFO, "[ %s ] %d services available!\n", - esbl->label, esbl->num_svc); - for (i = 0; i < esbl->num_svc; i++) { - svc_info = &ensbl_info->svc_info[i]; - tcbd_debug(DEBUG_INFO, " => [ %s ] %d service component\n", - svc_info->svc.svc_label, - svc_info->svc.num_svc_comp); - for (j = 0; j < svc_info->svc.num_svc_comp; j++) { - svc_comp_info = &svc_info->svc_comp_info[j]; - tcbd_debug(DEBUG_INFO, " -> sub channel id [%d]\n", - svc_comp_info[j].svc_comp.fidc_id); - } - } -} - -struct tcc_ensemble_info *tcc_fic_get_ensbl_info(s32 _disp) -{ - s32 i; - struct fic_parser_matadata *fic_info = &parser_metadata; - struct tcc_ensemble *esbl = &fic_info->esmbl_start; - struct tcc_service *svc = fic_info->svc_start; - struct tcc_service_info *svc_info; - - memcpy(&user_ensbl_info.ensbl, esbl, sizeof(struct tcc_ensemble)); - for (i = 0; i < esbl->num_svc; i++) { - svc_info = &user_ensbl_info.svc_info[i]; - memcpy(&svc_info->svc, &svc[i], sizeof(struct tcc_service)); - fic_copy_svc_comp(fic_info, svc_info); - } - - if (_disp) - tcc_fic_disp_ensbl_info(&user_ensbl_info); - - return &user_ensbl_info; -} - diff --git a/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/tcc_fic_fig0.c b/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/tcc_fic_fig0.c deleted file mode 100644 index a7e2a1f..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/tcc_fic_fig0.c +++ /dev/null @@ -1,911 +0,0 @@ -/* - * tcc_fic_fig0.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcc_fic_decoder.h" - -void fig0_ext00_update_reconf_mode(struct fic_parser_matadata *parser) -{ -/* - if (parser->cif_count == 0xff00) - gpFicParserInfo->reconf_mode = 2; - - if (cif_cnt >= parser->cif_count && - (cif_cnt - parser->cif_count) > 0x100) - gpFicParserInfo->reconf_mode = 3; - else if (cif_cnt + 0x1400 - parser->cif_count > 0x100) - gpFicParserInfo->reconf_mode = 3; - - parser->cif_count = cif_cnt; - if (fig_len == 5 && change_flag) { - parser->occur_change = *fig_buff; - - if (parser->reconf_stage == 0) - parser->reconf_stage = 1; - - if (parser->cif_count_hi == 0xff) { - parser->cif_count_hi = - (parser->cif_count & 0x1f00) >> 8; - parser->cif_count_lo = - (parser->cif_count & 0xff); - } - } else if (parser->reconf_stage == 1 && - parser->cif_count_hi != ((parser->cif_count & 0x1f00) >> 8) && - parser->occur_change <= ((parser->cif_count & 0xff) + 4)) { - parser->reconf_stage = 2; - parser->cif_count_hi = 0xff; - gpFicParserInfo->reconf_mode = 1; - } - } -*/ -} - -/******************************************************************** -* Function: Parsing FIG 0/0 -* Ensemble Information Field ETSI EN 300401 V010401p Figure 29 -*********************************************************************/ -s32 fig0_ext00(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 fig_len) -{ - s32 ret = FICERR_SUCCESS; - u8 change_flag; - u16 cif_cnt; - struct tcc_ensemble *esb_start; - - esb_start = &parser->esmbl_start; - if (esb_start == NULL) - ret = FICERR_FIG0_0_NO_ENSEMBLEARRAY; - else { - esb_start->eid = (u16)(*fig_buff++) << 8; - /* eid = Country Id(b15-b12), Ensemble reference(b11-b0) */ - esb_start->eid |= *fig_buff++; - - /*b15-b14: Change flag about service Organization */ - change_flag = (*fig_buff & 0xc0) >> 6; - /*b13: Alarm flag, 1: alarm message accessible */ - esb_start->al_flag = (*fig_buff & 0x20) >> 5; - cif_cnt = (u16)(*fig_buff++ & 0x1f) << 8; - /*b12-b0: CIF Count, b12-b8->modulo 20, b7-b0->modulo250 */ - cif_cnt |= *fig_buff++; - - /*fig0_ext00_update_reconf_mode(parser);*/ - } - return ret; -} - -/******************************************************************** -* Function: Parsing FIG 0/1 -* Sub-channel Organization Field ETSI EN 300401 V010401p Figure 22 -*********************************************************************/ -s32 fig0_ext01(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 fig_len) -{ - s32 ret = FICERR_SUCCESS; - u8 subchid, i, flag = 0; - u8 tbl_switch = 0xff; - - struct tcc_ensemble *esmbl; - struct tcc_sub_channel *subch_start, *subch_prev; - - esmbl = &parser->esmbl_start; - subch_start = subch_prev = parser->subch_start; - - if (subch_start == 0) - return FICERR_FIG0_1_NO_SUBCHARRAY; - while (fig_len > 0) { - if (esmbl->num_subch == NUM_SUB_CH) { - ret = FICERR_FIG0_1_FULL_SUBCHARRAY; - return ret; - } - - subchid = (*fig_buff & 0xfc) >> 2; /*b15-b10: subch_id */ - - for (i = 0; i < esmbl->num_subch; i++) { - subch_start = subch_prev + i; - if (subchid == subch_start->subch_id) { - flag = 1; - break; - } - } - - subch_start = subch_prev + i; - subch_start->subch_id = subchid; - subch_start->start_cu = (u16)(*fig_buff++ & 0x03) << 8; - /*b9-b0: Start Address */ - subch_start->start_cu |= *fig_buff++; - /*b7(b15): Short or Long form flag, 0:Short form 1:Long form*/ - subch_start->form_flag = ((*fig_buff & 0x80) ? 1 : 0) << 3; - fig_len -= 2; - - - /* In Long form case */ - if (subch_start->form_flag & 0x08) { - /*b14-b12: Option 000: 1,2,3,4-A 001: 1,2,3,4-B*/ - subch_start->form_flag |= - ((*fig_buff & 0x10) ? 1 : 0) << 2; - /*b11-b10: Protection level */ - subch_start->form_flag |= (*fig_buff & 0x0c) >> 2; - subch_start->size_cu = (u16)(*fig_buff++ & 0x03) << 8; - /*b9-b0: Sub-channel size */ - subch_start->size_cu |= *fig_buff++; - fig_len -= 2; - } else { - /* In Short form case */ - /* b6: Table switch */ - tbl_switch = (*fig_buff & 0x40)>>6; - if (!tbl_switch) - /*b5-b0: Table index */ - subch_start->tbl_index = *fig_buff++ & 0x3f; - else - /* Invalid Table index */ - subch_start->tbl_index = *fig_buff++ | 0xff; - - fig_len -= 1; - } - - if (!flag) - esmbl->num_subch++; - flag = 0; - } - if (fig_len < 0) - ret = FICERR_FIG0_1_INVALID_LENGTH; - - return ret; -} - -u8 *fig0_ext02_sid(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 *fig_len, u32 *sid) -{ - /* PD from FIG0 Header PD=1: 32bit sid */ - if (parser->fig_pd == 1) { - /*b31-b0: sid(ECC,Country Id,Service reference) */ - *sid = (u32)(*fig_buff++ << 24); - *sid |= (u32)(*fig_buff++ << 16); - *sid |= (u32)(*fig_buff++ << 8); - *sid |= (u32)(*fig_buff++); - *fig_len -= 4; - } else { - /* PD from FIG0 Header PD=0: 16bit sid */ - /*b15-b0: sid(Country Id,Service reference */ - *sid = (u32)(*fig_buff++ << 8); - *sid |= (u32)(*fig_buff++); - *fig_len -= 2; - } - return fig_buff; -} - -u8 *fig0_ext02_check_num_comp(struct fic_parser_matadata *parser, - u8 *fig_buff, u8 *num_comp) -{ - /* b3-b0: Number of Service Componentsin current FIG0_2, - * max 12 or 11 */ - *num_comp = (*fig_buff & 0x0f); - if (parser->fig_pd == 1) { - if (*num_comp > 11) - return NULL; - } else { - if (*num_comp > 12) - return NULL; - } - return fig_buff; -} - -u8 *fig0_ext02_update_svc(struct fic_parser_matadata *parser, - u8 *fig_buff, u32 sid, struct tcc_service **svc_start) -{ - u8 i, al; - struct tcc_ensemble *esmbl; - /*struct tcc_service *svc_start;*/ - - esmbl = &parser->esmbl_start; - al = 0; - for (i = 0; i < esmbl->num_svc; i++) { - *svc_start = parser->svc_start + i; - if (sid == (*svc_start)->sid) { - al = 1; - break; - } - } - - if (al == 0) { - *svc_start = parser->svc_start + i; - (*svc_start)->sid = sid; - /*b6-b4: Conditional Access Identifier */ - (*svc_start)->ca_id = (*fig_buff++ & 0x70) >> 4; - esmbl->num_svc++; - } else { - fig_buff++; - } - return fig_buff; -} - -s32 fig0_ext02_check_new_svc_comp(struct fic_parser_matadata *parser, - u32 sid, u16 scid, u8 tmid, u8 fidc_id) -{ - s32 j; - struct tcc_service_comp *svc_comp_start; - - for (j = 0; j < parser->esmbl_start.num_svc_comp; j++) { - svc_comp_start = parser->svc_comp_start + j; - if ((tmid == 0) || (tmid == 1) || (tmid == 2)) { - if ((fidc_id == svc_comp_start->fidc_id) && - (tmid == svc_comp_start->tmid) && - (sid == svc_comp_start->sid)) - return 1; - } else if (tmid == 3) { - if ((scid == svc_comp_start->scid) && - (sid == svc_comp_start->sid)) - return 1; - } - } - return 0; -} - -u8 *fig0_ext02_update_svc_comp(struct fic_parser_matadata *parser, - u8 *fig_buff, u32 sid, u8 *p_flag, struct tcc_service *svc_start) -{ - u8 is_updated, tmid, ascty_dscty = 0xff, fidc_id = 0xff; - u16 scid = 0xffff; - - struct tcc_ensemble *esmbl; - /*struct tcc_service *svc_start;*/ - struct tcc_service_comp *svc_comp_start; - - esmbl = &parser->esmbl_start; - svc_comp_start = parser->svc_comp_start; - - /*b15-b14: Transport Mechanism Identifier */ - tmid = (*fig_buff & 0xc0) >> 6; - switch (tmid) { - case 0: /* MSC-Stream mode - audio */ - case 1: /* MSC-Stream mode - data */ - case 2: - /*b13-b8: Data Service Component type */ - ascty_dscty = (*fig_buff++ & 0x3f); - /*b7-b2: FIDCId */ - fidc_id = (*fig_buff & 0xfc) >> 2; - /* Invalid scid */ - scid = 0xffff; - break; - case 3: /* MSC-Packet mode - data */ - scid = (*fig_buff++ & 0x3f) << 6; - /*b13-b2: Service Component Identifier */ - scid |= (*fig_buff & 0xfc) >> 2; - /* Invalid subch_id */ - fidc_id = 0xff; - ascty_dscty = 0xff; - break; - default: - tcbd_debug(DEBUG_ERROR, "unknown tmid!\n"); - break; - } - - is_updated = fig0_ext02_check_new_svc_comp(parser, - sid, scid, tmid, fidc_id); - if (is_updated == 0) { - /*b1: PS flag, 1: Primary service component 0: Secondary */ - if ((*fig_buff & 0x02) && *p_flag == 0) { - svc_comp_start = parser->svc_comp_start + - esmbl->num_svc_comp; - svc_comp_start->order = 0; - *p_flag = 1; - } else { - if (*p_flag) { - svc_comp_start = parser->svc_comp_start + - esmbl->num_svc_comp; - svc_comp_start->order = - svc_start->num_svc_comp; - } else { - svc_comp_start = parser->svc_comp_start + - esmbl->num_svc_comp + 1; - svc_comp_start->order = - svc_start->num_svc_comp + 1; - } - } - svc_comp_start->sid = sid; - svc_comp_start->tmid = tmid; - svc_comp_start->ascty_dscty = ascty_dscty; - svc_comp_start->fidc_id = fidc_id; - svc_comp_start->scid = scid; - svc_comp_start->ca_flag = (*fig_buff++ & 0x01); - svc_comp_start->ca_org = 0xffff; - svc_comp_start->scids = INITVAL_SCIDS; - - esmbl->num_svc_comp++; - svc_start->num_svc_comp++; - } else { - fig_buff++; /* pointer update */ - } - return fig_buff; -} - - -/******************************************************************** -* Function: Parsing FIG 0/2 -* Service Organization Field EN 300401 v010401p Figure 24 -*********************************************************************/ -s32 fig0_ext02(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 fig_len) -{ - s32 ret = FICERR_SUCCESS; - u8 k, num_comp, p_flag; - u32 sid; - struct tcc_ensemble *esmbl; - struct tcc_service *svc; - - esmbl = &parser->esmbl_start; - while (fig_len > 0) { - if (esmbl->num_svc == NUM_SVC) - return FICERR_FIG0_2_FULL_SERVICEARRAY; - - if (!fig_buff) - return FICERR_FIG0_2_INVALID_LENGTH; - - fig_buff = fig0_ext02_sid(parser, fig_buff, &fig_len, &sid); - fig_buff = fig0_ext02_check_num_comp( - parser, fig_buff, &num_comp); - if (fig_buff == NULL) - return FICERR_FIG0_2_INVALID_LENGTH; - - fig_buff = fig0_ext02_update_svc(parser, fig_buff, sid, &svc); - - if (num_comp == 0) - goto cont_while; - - p_flag = 0; - for (k = 0; k < num_comp; k++) { - if (esmbl->num_svc_comp == NUM_SVC_COMP) - return FICERR_FIG0_2_FULL_SRVCOMPARRAY; - - fig_buff = fig0_ext02_update_svc_comp( - parser, fig_buff, sid, &p_flag, svc); - fig_len -= 2; - } -cont_while: - fig_len -= 1; - } - - if (fig_len < 0) - return FICERR_FIG0_2_INVALID_LENGTH; - - return ret; -} - -/******************************************************************** -* Function: Parsing FIG 0/3 -* Service Component Field in Packet Mode -* ETSI EN 300401 V010401p Figure 26 -*********************************************************************/ -s32 fig0_ext03(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 fig_len) -{ - u8 i; - u16 scid = 0xffff; - struct tcc_ensemble *esmbl; - struct tcc_service_comp *svc_comp_start; - - u8 ca_org_flag = 0xff, dg_mf_flag = 0xff; - u8 ascty_dscty = 0xff, fidc_id = 0xff; - u16 pack_add = 0xffff, ca_org = 0xffff; - - esmbl = &parser->esmbl_start; - svc_comp_start = parser->svc_comp_start; - - if (svc_comp_start == 0) - return FICERR_FIG0_3_NO_SRVCOMPARRAY; - - if (esmbl->num_svc_comp == 0) - return FICERR_FIG0_3_NOTREADY_SRVCOMP1; - - while (fig_len > 0) { - scid = (u16)(*fig_buff++) << 4; - /* Service Component Identifier (b15~b4) */ - scid |= (*fig_buff & 0xf0) >> 4; - /* b0, 0: ca_org field absent, 1: ca_org field present */ - ca_org_flag = (*fig_buff++ & 0x01); - /* b7, 1: data groups are not used to transport - * the service component */ - dg_mf_flag = (*fig_buff & 0x80) >> 7; - /* b5-b0, Data Service Component Type */ - ascty_dscty = (*fig_buff++ & 0x3f); - /* b15-b10, Sub-channel Identifier */ - fidc_id = (*fig_buff & 0xfc) >> 2; - pack_add = (u16)(*fig_buff++ & 0x03) << 8; - /* b9-b0, Packet address */ - pack_add |= (*fig_buff++); - fig_len -= 5; - if (ca_org_flag) { - /* b15-b0, Conditional Access Organization */ - ca_org = (u16)(*fig_buff++) << 8; - ca_org |= (u16)(*fig_buff++); - fig_len -= 2; - } - for (i = 0; i < esmbl->num_svc_comp; i++) { - svc_comp_start = parser->svc_comp_start + i; - if (scid == svc_comp_start->scid) { - svc_comp_start->ca_org_flag = ca_org_flag; - svc_comp_start->dg_mf_flag = dg_mf_flag; - svc_comp_start->ascty_dscty = ascty_dscty; - svc_comp_start->fidc_id = fidc_id; - svc_comp_start->pack_add = pack_add; - if (ca_org_flag) - svc_comp_start->ca_org = ca_org; - } - } - } - if (fig_len < 0) - return FICERR_FIG0_3_INVALID_LENGTH; - return FICERR_SUCCESS; -} - -/******************************************************************** -* Function: Parsing FIG 0/4 -* Service Component Field in Stream Mode or -* FIC ETSI EN 300401 v010401p Figure 27 -*********************************************************************/ -s32 fig0_ext04(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 fig_len) -{ - u8 i = 0; - u8 flag, id; - struct tcc_ensemble *esmbl; - struct tcc_service_comp *svc_comp_start; - - esmbl = &parser->esmbl_start; - svc_comp_start = parser->svc_comp_start; - - if (svc_comp_start == 0) - return FICERR_FIG0_4_NO_SRVCOMPARRAY; - - while (fig_len > 0) { - /* b6, 0: MSC and subch_id, 1: FIC and FIDCId */ - flag = (*fig_buff & 0x40) ? 1 : 0; - /* b5-b0, subch_id or FIDCId */ - id = (*fig_buff++ & 0x3f); - - for (i = 0; i < esmbl->num_svc_comp; i++) { - svc_comp_start = parser->svc_comp_start + i; - if (id == svc_comp_start->fidc_id) { - if (svc_comp_start->ca_org != 0xffff) - return FICERR_FIG0_4_ALREADY_CA_FIELD; - else - break; - } - } - - if (i >= esmbl->num_svc_comp) - return FICERR_FIG0_4_NOTREADY_SRVCOMP; - - svc_comp_start = parser->svc_comp_start + i; - svc_comp_start->dg_mf_flag = flag; - svc_comp_start->fidc_id = id; - svc_comp_start->ca_org = (u16)(*fig_buff++) << 8; - /* b15-b0: Conditional Access Organization */ - svc_comp_start->ca_org |= (u16)(*fig_buff++); - fig_len -= 3; - } - - if (fig_len < 0) - return FICERR_FIG0_4_INVALID_LENGTH; - - return FICERR_SUCCESS; -} - -/******************************************************************** -* Function: Parsing FIG 0/5 -* Service Component Language Field ETSI EN 300401 v010401p Figure 45 -* Short form(LS=0) b7: LS flag, b6: MSC_FIC flag, b5-b0: subch_id_FIDCId, -* b7-b0: Language -* Long form(LS=1) b15: LS flag, b14-b12: Rfa, b11-b0: scid, b7-b0: Language -*********************************************************************/ -s32 fig0_ext05(struct fic_parser_matadata *parser, u8 *fig_buff, s32 fig_len) -{ - u16 id; - u8 i; - struct tcc_ensemble *esmbl; - struct tcc_service_comp *svc_comp_start; - - esmbl = &parser->esmbl_start; - svc_comp_start = parser->svc_comp_start; - - if (svc_comp_start == 0) - return FICERR_FIG0_5_NO_SRVCOMPARRAY; - - if (esmbl->num_svc == 0) - return FICERR_FIG0_5_NOTREADY_SERVICE; - - while (fig_len > 0) { - if (*fig_buff & 0x80) { - /* b7(LS) = 1: Long form Case */ - id = (*fig_buff++ & 0x0f) << 8; - /* b11-b0: scid Service Component Id */ - id |= (*fig_buff++); - fig_len -= 2; - for (i = 0; i < esmbl->num_svc_comp; i++) { - svc_comp_start = parser->svc_comp_start + i; - if (id == svc_comp_start->scid) - break; - } - } else { - /* b7(LS) = 0: Short form Case */ - /* b5-b0: subch_id/FIDCId is mixed*/ - id = (*fig_buff++ & 0x3f); - fig_len -= 1; - for (i = 0; i < esmbl->num_svc_comp; i++) { - svc_comp_start = parser->svc_comp_start + i; - if (id == svc_comp_start->fidc_id) - break; - } - } - - if (i == esmbl->num_svc_comp) - return FICERR_FIG0_5_NOTREADY_SRVCOMP; - - svc_comp_start = parser->svc_comp_start + i; - /* b7-b0: Language of the audio or data service component, - * TS 101 756 Tables 9 and 10 */ - svc_comp_start->lang = *fig_buff++; - fig_len -= 1; - } - if (fig_len < 0) - return FICERR_FIG0_5_INVALID_LENGTH; - - return FICERR_SUCCESS; -} - -/**************************************************************************** -* Function: Parsing FIG 0/7 -* Data Service Component Type extension -* There is not FIG 0/7 in ETSI EN 300401 not yet. -*****************************************************************************/ -s32 fig0_ext07(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 fig_len) -{ - u8 tmid, num, i, k; - u16 id, extdscty; - struct tcc_ensemble *esmbl; - struct tcc_service_comp *svc_comp_start; - - esmbl = &parser->esmbl_start; - svc_comp_start = parser->svc_comp_start; - - tmid = (*fig_buff & 0x30) >> 4; - num = (*fig_buff++ & 0x0f); - for (k = 0; k < num; k++) { - switch (tmid) { - case 0: - return FICERR_FIG0_7_RETURN; - case 1: - case 2: - /* MSC stream/FIDC */ - id = (*fig_buff & 0xfc) >> 2; - extdscty = (u16)(*fig_buff & 0x03) << 8; - extdscty |= (*fig_buff++); - fig_len -= 2; - for (i = 0; i < esmbl->num_svc_comp; i++) { - svc_comp_start = parser->svc_comp_start + i; - if (tmid == svc_comp_start->tmid && - id == svc_comp_start->fidc_id) - break; - } - break; - - case 3: - id = (u16)(*fig_buff & 0x3f) << 6; - id |= (*fig_buff++ & 0xfc) >> 2; - extdscty = (u16)(*fig_buff & 0x03) << 8; - extdscty |= (*fig_buff++); - fig_len -= 3; - for (i = 0; i < esmbl->num_svc_comp; i++) { - svc_comp_start = parser->svc_comp_start + i; - if (tmid == svc_comp_start->tmid && - id == svc_comp_start->scid) - break; - } - break; - default: - break; - } - } - return FICERR_SUCCESS; -} - -/******************************************************************** -* Function: Parsing FIG 0/8 -* Service Component Global Definition Field EN 300401 V010401p Figure 28 -*********************************************************************/ -s32 fig0_ext08(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 fig_len) -{ - s32 ret = FICERR_SUCCESS; - u8 i; - u8 ls_flag = 0xff, ext_flag = 0xff; - u8 scids = 0xff, subch_id = 0xff; - u32 sid = 0xffffffff; - u16 scid = 0xffff; - s32 is_fic_db = 0; - s32 is_fic = 0; - struct tcc_ensemble *esmbl; - struct tcc_service_comp *svc_comp_start; - - esmbl = &parser->esmbl_start; - svc_comp_start = parser->svc_comp_start; - - if (svc_comp_start == 0) - return FICERR_FIG0_8_NO_SRVCOMPARRAY; - - while (fig_len > 0) { - /* PD from FIG0 Header PD=1: 32bit sid */ - if (parser->fig_pd == 1) { - /* b32-b0: sid(Service Identifier) */ - sid = (u32)(*fig_buff++ << 24); - sid |= (u32)(*fig_buff++ << 16); - sid |= (u32)(*fig_buff++ << 8); - sid |= (u32)(*fig_buff++); - fig_len -= 4; - } else { - /* PD from FIG0 Header PD=0: 16bit sid */ - sid = (u32)(*fig_buff++ << 8); - /* b15-b0: sid(Service Identifier) */ - sid |= (u32)(*fig_buff++); - fig_len -= 2; - } - - /* b7: Ext.flag(extension Flag) - * 0: Rfa field absent, 1: Rfa field present */ - ext_flag = (*fig_buff & 0x80); - /* b3-b0: - * scids(Service Component Identifier within the Service) */ - scids = (*fig_buff++ & 0x0f); - /* b7: LS flag(Long form or Short form), - * 1: Long form 0: Short form */ - ls_flag = (*fig_buff & 0x80); - - if (ls_flag) { - /* Long form case */ - scid = (*fig_buff++ & 0x0f) << 8; - /* b11-b0: scid(Service Component Identifier) */ - scid |= (*fig_buff++); - fig_len -= 3; - } else { - /* Short form case */ - /* b6: MSC_FIC flag 0: MSC_subch_id 1: FIC_FIDCId */ - is_fic = ((*fig_buff) >> 6) & 1; - /* b5-b0: subch_id or FIDCId */ - subch_id = (*fig_buff++ & 0x3f); - fig_len -= 2; - } - - - if (ext_flag) { - fig_buff++; - fig_len -= 1; - } - - for (i = 0; i < esmbl->num_svc_comp; i++) { - svc_comp_start = parser->svc_comp_start + i; - if (sid != svc_comp_start->sid) - continue; - - if (ls_flag && scid == svc_comp_start->scid) { - svc_comp_start->scids = scids; - break; - } else { - is_fic_db = (svc_comp_start->tmid == 2) ? 1 : 0; - if ((is_fic_db == is_fic) && - (subch_id == svc_comp_start->fidc_id)) { - svc_comp_start->scids = scids; - break; - } - } - } - } - if (fig_len < 0) - ret = FICERR_FIG0_8_INVALID_LENGTH; - return ret; -} - -/******************************************************************** -* Function: Parsing FIG 0/13 -* User Application Field EN 300401 v010401p Figure68 -*********************************************************************/ -s32 fig0_ext13(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 fig_len) -{ - u32 i, k; - u32 sid; - u8 scids; - struct tcc_ensemble *esmbl; - struct tcc_user_app_types *usrapp_start; - - esmbl = &parser->esmbl_start; - usrapp_start = parser->user_app_start; - - if (usrapp_start == 0) - return FICERR_FIG0_13_NO_USERAPPLARRAY; - - while (fig_len > 0) { - if (esmbl->num_user_app == NUM_USER_APP) - return FICERR_FIG0_13_FULL_USERAPPLARRAY; - - /* PD from FIG0 Header PD=1: 32bit sid */ - if (parser->fig_pd == 1) { - sid = (u32)(*fig_buff++ << 24); - sid |= (u32)(*fig_buff++ << 16); - sid |= (u32)(*fig_buff++ << 8); - sid |= (u32)(*fig_buff++); - fig_len -= 4; - } else { - /* PD from FIG0 Header PD=0: 16bit sid */ - sid = (u32)(*fig_buff++ << 8); - /*b15-b0: sid(16bit) */ - sid |= (u32)(*fig_buff++); - fig_len -= 2; - } - - /* b7-b4: - * scids(Service Component Identifier within the Service) */ - scids = (*fig_buff & 0xf0) >> 4; - - for (i = 0; i < esmbl->num_user_app; i++) { - usrapp_start = parser->user_app_start + i; - if (sid == usrapp_start->sid && - scids == usrapp_start->scids) { - return FICERR_FIG0_13_ALREADY_USERAPPL; - } - } - usrapp_start = parser->user_app_start + i; - - /* b3-b0: No. of User Applications */ - usrapp_start->num_app = (*fig_buff++ & 0x0f); - if (usrapp_start->num_app > 6) { - usrapp_start->num_app = 0; - return FICERR_FIG0_13_INVALID_LENGTH; - } - fig_len -= 1; - - for (i = 0; i < usrapp_start->num_app; i++) { - struct tcc_user_app_type *ua = - &usrapp_start->app_type[i]; - ua->type = (*fig_buff++) << 3; - /*b15-b5: User Application Type */ - ua->type += ((*fig_buff & 0xe0) >> 5); - /*b4-b0: User Application data length in bytes */ - ua->len = (*fig_buff++ & 0x1f); - if (ua->len > 23) { - ua->len = 0; - return FICERR_FIG0_13_INVALID_LENGTH; - } - - for (k = 0; k < ua->len; k++) - ua->data[k] = *fig_buff++; - fig_len -= (2 + ua->len); - } - - usrapp_start->sid = sid; - usrapp_start->scids = scids; - - esmbl->num_user_app++; - } - - if (fig_len < 0) - return FICERR_FIG0_13_INVALID_LENGTH; - - return FICERR_SUCCESS; -} - -/******************************************************************** -* Function: Parsing FIG 0/17 -* Programme Type Field EN 300401 V010401p Figure49 -* Input : ucOffset is the point of buffer being processed and length -* Return : return the start point of next FIG -*********************************************************************/ -s32 fig0_ext17(struct fic_parser_matadata *parser, - u8 *fig_buff, s32 fig_len) -{ - s32 ret = FICERR_SUCCESS; - u8 i, k; - u8 lang_flag, cc_flag, end_flag; - u16 sid; - u8 sd, ps; - struct tcc_ensemble *esmbl; - struct tcc_program_type *prg_start; - - esmbl = &parser->esmbl_start; - prg_start = parser->prg_start; - - if (prg_start == 0x00) { - ret = FICERR_FIG0_17_NO_PROGTYPEARRAY; - return ret; - } - - if (parser->fig_oe0) { - ret = FICERR_FIG0_17_OTHER_ENSEMBLE; - return ret; - } - - while (fig_len > 0) { - if (esmbl->num_prg_type == NUM_PRG_TYPE) { - ret = FICERR_FIG0_17_FULL_PROGTYPEARRAY; - return ret; - } - sid = (*fig_buff++) << 8; - /*b15-b0: sid */ - sid |= *fig_buff++; - /*b7:SD(Static or Dynamic) 1: - * represent the current programme contents */ - sd = (*fig_buff & 0x80) ? 1 : 0; - /*b6: PS(Primary or Secondary) 0: - * Primary Service Component 1: Secondary */ - ps = (*fig_buff & 0x40) ? 1 : 0; - /* for making End condition */ - end_flag = 0; - for (k = 0; k < esmbl->num_prg_type; k++) { - prg_start = parser->prg_start + k; - if (sid == prg_start->sid && - sd == prg_start->sd && - ps == prg_start->ps) { - end_flag = 1; - break; - } - } - fig_len -= 2; - if (end_flag) - prg_start = parser->prg_start + k; - else - prg_start = parser->prg_start + - esmbl->num_prg_type; - - prg_start->sid = sid; - prg_start->sd = sd; - prg_start->ps = ps; - /*b5: Language flag, 0: language field absent */ - lang_flag = (*fig_buff & 0x20) ? 1 : 0; - /*b4: Complementary Code flag, 1: - * CC, preceding Rfa and Rfu fields present */ - cc_flag = (*fig_buff & 0x10) ? 1 : 0; - /* This field is strange things */ - prg_start->nfc = (*fig_buff++ & 0x0f); - fig_len -= 1; - if (lang_flag) { - fig_len -= 1; - prg_start->lang = *fig_buff++; - } - - /*b4-b0: International Code */ - prg_start->i18n_code = (*fig_buff++ & 0x1f); - fig_len -= 1; - if (cc_flag) { - prg_start->coarse_code = (*fig_buff++); - fig_len -= 1; - } - - for (i = 0; i < prg_start->nfc; i++) { - prg_start->fine_code = *fig_buff++; - fig_len -= 1; - } - if (!end_flag) - esmbl->num_prg_type++; - } - if (fig_len < 0) - ret = FICERR_FIG0_17_INVALID_LENGTH; - return ret; -} diff --git a/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/tcc_fic_fig1.c b/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/tcc_fic_fig1.c deleted file mode 100644 index d2653fa..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcc_fic_decoder/tcc_fic_fig1.c +++ /dev/null @@ -1,254 +0,0 @@ -/* - * tcc_fic_fig1.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcc_fic_decoder.h" - -static u8 *fig_put_in_label(u8 *label, u8 *fig_buff) -{ - u8 m; - - for (m = 0; m < 16; m++) - *label++ = *fig_buff++; - label--; - for (; *label == 0x20 || *label == 0; label--) - *label = 0; - - return fig_buff; -} - -s32 fig1_ext00(struct fic_parser_matadata *fic_info, - u8 *fig_buff, - s32 length, - u8 charset) -{ - s32 ret = FICERR_SUCCESS; - u16 tmp; - struct tcc_ensemble *ensmbl; - - ensmbl = &fic_info->esmbl_start; - - tmp = (*fig_buff++) << 8; - tmp |= (*fig_buff++); - - ensmbl->charset = charset; - fig_buff = fig_put_in_label(ensmbl->label, fig_buff); - ensmbl->char_flag = (*fig_buff++)<<8; - ensmbl->char_flag |= *fig_buff; - - return ret; -} - -/* - * Program sService label - */ -s32 fig1_ext01(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 length, u8 charset) -{ - s32 ret = FICERR_SUCCESS; - u16 sid; - u8 i; - struct tcc_ensemble *ensmbl; - struct tcc_service *svc_start; - - ensmbl = &fic_info->esmbl_start; - svc_start = fic_info->svc_start; - - if (svc_start == 0) - return FICERR_FIG1_1_NO_SERVICEARRAY; - - sid = (*fig_buff++) << 8; - sid |= (*fig_buff++); - for (i = 0; i < ensmbl->num_svc; i++) { - svc_start = fic_info->svc_start + i; - if (sid == svc_start->sid) - break; - } - - if (i == ensmbl->num_svc) { - ret = FICERR_FIG1_1_NOTREADY_SERVICE; - return ret; - } - - svc_start->charset = charset; - fig_buff = fig_put_in_label(svc_start->svc_label, fig_buff); - svc_start->char_flag = (*fig_buff++)<<8; - svc_start->char_flag |= *fig_buff; - - return ret; -} - -/* - * sService Component label - */ -s32 fig1_ext04(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 length, u8 charset) -{ - s32 ret = FICERR_SUCCESS; - u32 sid; - u8 i, scids, pd; - struct tcc_service_comp *svc_comp_start; - struct tcc_ensemble *ensmbl; - - ensmbl = &fic_info->esmbl_start; - svc_comp_start = fic_info->svc_comp_start; - - if (svc_comp_start == 0) - return FICERR_FIG1_4_NO_SRVCOMPARRAY; - - /* If no service informaion, return */ - if (ensmbl->num_svc_comp == 0) { - ret = FICERR_FIG1_4_NOTREADY_SRVCOMP; - return ret; - } - - pd = (*fig_buff & 0x80) ? 1 : 0; - scids = *fig_buff++ & 0x0f; - if (pd) { - sid = (u32)(*fig_buff++ << 24); - sid |= (u32)(*fig_buff++ << 16); - sid |= (u32)(*fig_buff++ << 8); - sid |= (u32)(*fig_buff++); - } else { - sid = (u32)(*fig_buff++ << 8); - sid |= (u32)(*fig_buff++); - } - - for (i = 0; i < ensmbl->num_svc_comp; i++) { - svc_comp_start = fic_info->svc_comp_start + i; - if (scids == svc_comp_start->scids && - sid == svc_comp_start->sid) - break; - } - if (i == ensmbl->num_svc_comp) { - ret = FICERR_FIG1_4_NOTREADY_SRVCOMP1; - return ret; - } - - svc_comp_start->charset = charset; - fig_buff = fig_put_in_label(svc_comp_start->label, fig_buff); - - svc_comp_start->char_flag = (*fig_buff++) << 8; - svc_comp_start->char_flag |= *fig_buff; - - return ret; -} - -/* - * Data sService label - */ -s32 fig1_ext05(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 length, u8 charset) -{ - s32 ret = FICERR_SUCCESS; - u32 sid; - u32 j; - struct tcc_ensemble *ensmbl; - struct tcc_service *svc_start; - - ensmbl = &fic_info->esmbl_start; - svc_start = fic_info->svc_start; - - if (svc_start == 0) - return FICERR_FIG1_5_NO_SERVICEARRAY; - - sid = (*fig_buff++) << 24; - sid |= (*fig_buff++) << 16; - sid |= (*fig_buff++) << 8; - sid |= (*fig_buff++); - for (j = 0; j < ensmbl->num_svc; j++) { - svc_start = fic_info->svc_start + j; - if (sid == svc_start->sid) - break; - } - - if (j == ensmbl->num_svc) { - ret = FICERR_FIG1_5_NOTREADY_SERVICE; - return ret; - } - - svc_start->charset = charset; - fig_buff = fig_put_in_label(svc_start->svc_label, fig_buff); - svc_start->char_flag = (*fig_buff++) << 8; - svc_start->char_flag |= *fig_buff; - - return ret; -} - -s32 fig1_ext06(struct fic_parser_matadata *fic_info, - u8 *fig_buff, s32 length, u8 charset) -{ - s32 ret = FICERR_SUCCESS; - s32 p_d; - u32 sid; - u8 scids; - u8 xpad_appl_type; - s32 i, empty_idx; - - struct tcc_ensemble *ensmbl; - struct tcc_xpad_user_app *user_app_start; - - ensmbl = &fic_info->esmbl_start; - user_app_start = fic_info->fig1_6_start; - - if (user_app_start == 0) - return FICERR_FIG1_6_NO_XPADLABELARRAY; - - p_d = fig_buff[0] >> 7; - scids = fig_buff[0] & 0x0f; - fig_buff++; - if (p_d) { - sid = (fig_buff[0] << 24) | (fig_buff[1] << 16) | - (fig_buff[2] << 8) | fig_buff[3]; - fig_buff += 4; - } else { - sid = (fig_buff[0] << 8) | fig_buff[1]; - fig_buff += 2; - } - xpad_appl_type = fig_buff[0] & 0x1f; - fig_buff++; - - empty_idx = -1; - - for (i = 0; i < NUM_USER_APP; i++) { - if (user_app_start[i].sid == sid && - user_app_start[i].scids == scids && - user_app_start[i].type == xpad_appl_type) { - empty_idx = i; - break; - } - if (empty_idx == -1 && user_app_start[i].sid == 0) - empty_idx = i; - } - - if (empty_idx != -1) { - user_app_start[empty_idx].sid = sid; - user_app_start[empty_idx].scids = scids; - user_app_start[empty_idx].charset = charset; - user_app_start[empty_idx].type = xpad_appl_type; - fig_buff = fig_put_in_label( - user_app_start[empty_idx].label, fig_buff); - user_app_start[empty_idx].char_flag = (*fig_buff++) << 8; - user_app_start[empty_idx].char_flag |= *fig_buff; - } - - return ret; -} diff --git a/drivers/media/tdmb/tcc3170/src/tcpal_linux/Makefile b/drivers/media/tdmb/tcc3170/src/tcpal_linux/Makefile deleted file mode 100644 index 70efca8..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcpal_linux/Makefile +++ /dev/null @@ -1,15 +0,0 @@ - -obj-y += tcpal_irq_handler.o -obj-y += tcpal_debug.o -obj-y += tcpal_queue.o -obj-y += tcpal_linux.o -obj-y += tcpal_io_cspi.o -obj-y += tcpal_io_i2c.o - -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcpal -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcbd_diagnosis -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcbd_stream_parser -ccflags-y += -Idrivers/media/tdmb/tcc3170/inc/tcc_fic_decoder - -ccflags-y += -Idrivers/media/tdmb/ diff --git a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_debug.c b/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_debug.c deleted file mode 100644 index abe8ca7..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_debug.c +++ /dev/null @@ -1,106 +0,0 @@ -/* - * tcpal_debug.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -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 | - /*DEBUG_DRV_PERI | */ - /*DEBUG_DRV_IO | */ - /*DEBUG_DRV_COMP | */ - /*DEBUG_DRV_RF | */ - /*DEBUG_TCPAL_OS | */ - /*DEBUG_TCPAL_CSPI | */ - /*DEBUG_TCPAL_I2C | */ - /*DEBUG_TCHAL | */ - /*DEBUG_STREAM_READ | */ - /*DEBUG_STREAM_PARSER |*/ - /*DEBUG_PARSING_PROC | */ - /*DEBUG_INTRRUPT | */ - DEBUG_INFO | - DEBUG_ERROR; - -module_param(tcbd_debug_class, int, 0664); - diff --git a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_io_cspi.c b/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_io_cspi.c deleted file mode 100644 index b9ec89d..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_io_cspi.c +++ /dev/null @@ -1,492 +0,0 @@ -/* - * tcpal_io_cspi.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcbd_api_common.h" -#include "tcbd_drv_io.h" - -#include <linux/module.h> -#include <linux/semaphore.h> -#include <linux/delay.h> -#include <linux/slab.h> -#include <linux/interrupt.h> -#include <linux/platform_device.h> -#include <linux/spi/spi.h> - -#include <linux/io.h> -#include <asm/mach-types.h> - -#include "tcbd_hal.h" - -#define SPICMD_VALID_BITS 36 -#define SPICMD_BUFF_LEN 8 -#define SPICMD_ACK 0x47 - -#define SPI_SPEED_HZ 10000000 -#define SPI_BITS_PER_WORD 8 - -#define DMA_MAX_SIZE (2048) - -#define CSPI_READ 0 -#define CSPI_WRITE 1 - -#define CONTINUOUS_MODE 0 -#define FIXED_MODE 1 - -#if defined(__CSPI_ONLY__) - -struct tcpal_cspi_data { - spinlock_t spin_lock; - u8 buff_dummy[DMA_MAX_SIZE+(SPICMD_BUFF_LEN*2)+1]; - u8 buff_rw[DMA_MAX_SIZE+(SPICMD_BUFF_LEN*2)+1]; - u8 buff_init_cmd[SPICMD_BUFF_LEN]; /*Set all bit to 1*/ - struct spi_device *spi_dev; -}; - -static struct tcbd_io_data *tcbd_cspi_io_funcs; -static struct tcpal_cspi_data tcpal_cspi_io_data; - -static u8 tcpal_calc_crc8(u8 *data, s32 len) -{ - u16 masking, carry; - u16 crc; - u32 i, loop, remain; - - crc = 0x0000; - loop = len / 8; - remain = len - loop * 8; - - for (i = 0; i < loop; i++) { - masking = 1 << 8; - while ((masking >>= 1)) { - carry = crc & 0x40; - crc <<= 1; - if ((!carry) ^ (!(*data & masking))) - crc ^= 0x9; - crc &= 0x7f; - } - data++; - } - - masking = 1 << 8; - while (remain) { - carry = crc & 0x40; - crc <<= 1; - masking >>= 1; - if ((!carry) ^ (!(*data & masking))) - crc ^= 0x9; - crc &= 0x7f; - remain--; - } - - return (u8) crc; -} - - -#if defined(__USE_TC_CPU__) -static struct spi_device *tcpal_find_cspi_device(void) -{ - struct spi_master *spi_master; - struct spi_device *spi_device; - struct device *pdev; - s8 buff[64]; - - spi_master = spi_busnum_to_master(0); - if (!spi_master) { - tcbd_debug(DEBUG_ERROR, - "spi_busnum_to_master(%d) returned NULL\n", 0); - return NULL; - } - - spi_device = spi_alloc_device(spi_master); - if (!spi_device) { - put_device(&spi_master->dev); - tcbd_debug(DEBUG_TCPAL_CSPI, - "spi_alloc_device() failed\n"); - return NULL; - } - - /* specify a chip select line */ - spi_device->chip_select = 0; - - snprintf(buff, sizeof(buff), "%s.%u", - dev_name(&spi_device->master->dev), - spi_device->chip_select); - - pdev = bus_find_device_by_name(spi_device->dev.bus, NULL, buff); - if (pdev) - tcbd_debug(DEBUG_TCPAL_CSPI, "spi_device :0x%X\n", - (u32)spi_device); - put_device(&spi_master->dev); - return spi_device; -} -#endif /*__USE_TC_CPU__*/ - -static s32 tcpal_cspi_close(void) -{ -#ifdef __USE_TC_CPU__ - struct tcpal_cspi_data *spi_data = &tcpal_cspi_io_data; - spi_tcc_close(spi_data->spi_dev); - spi_dev_put(spi_data->spi_dev); - spi_data->spi_dev = NULL; -#endif - - tcbd_debug(DEBUG_TCPAL_CSPI, "\n"); - return 0; -} - -static s32 tcpal_cspi_open(void) -{ - s32 ret = 0; - struct tcpal_cspi_data *spi_data = &tcpal_cspi_io_data; - - memset(&tcpal_cspi_io_data, 0, sizeof(tcpal_cspi_io_data)); - memset(spi_data->buff_init_cmd, 0xFF, SPICMD_BUFF_LEN); - -#ifdef __USE_TC_CPU__ - spi_data->spi_dev = tcpal_find_cspi_device(); - - if (spi_data->spi_dev) { - ret = spi_tcc_open(spi_data->spi_dev); - if (ret < 0) - goto cspi_init_fail; - spi_data->spi_dev->mode = SPI_MODE_0; - spi_data->spi_dev->bits_per_word = SPI_BITS_PER_WORD; - spi_data->spi_dev->max_speed_hz = SPI_SPEED_HZ; - ret = spi_setup(spi_data->spi_dev); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, - "spi_setup failed :%d\n", ret); - goto cspi_init_fail; - } - } -#else - spi_data->spi_dev = spi_dmb; -#endif /*__USE_TC_CPU__*/ - - tcbd_debug(DEBUG_TCPAL_CSPI, "\n"); - return 0; - -cspi_init_fail: - return -1; -} - -static inline s32 tcpal_cspi_write_and_read( - u8 *_buffin, - u8 *_buffout, - u32 _length) -{ - struct spi_transfer xfer = {0, }; - struct spi_message msg; - s32 ret = 0; - struct tcpal_cspi_data *spi_data = &tcpal_cspi_io_data; - - if (!spi_data->spi_dev || !_length) - return -EFAULT; - if (!_buffin && !_buffout) - return -EFAULT; - - xfer.tx_buf = _buffin; - xfer.rx_buf = _buffout; - xfer.len = _length; -/* xfer.speed_hz = SPI_SPEED_HZ; */ -/* xfer.bits_per_word = SPI_BITS_PER_WORD; */ - - spi_message_init(&msg); - spi_message_add_tail(&xfer, &msg); - - ret = spi_sync(spi_data->spi_dev, &msg); - - if (ret < 0) - return -TCERR_OS_DRIVER_FAIL; - - return 0; -} - -static inline s32 tcpal_cspi_single_io( - u8 _write_flag, - u16 _reg_addr, - u8 *_data) -{ - s32 ret = 0; - u8 buffer[SPICMD_BUFF_LEN+1]; - u8 buffout[SPICMD_BUFF_LEN+1]; - u8 crc; - - /* start bit(1) + chip_id(7) */ - buffer[0] = tcbd_cspi_io_funcs->chip_addr; - /* mode(1) + rw(1) + fix(1) + addr(5) */ - buffer[1] = (0 << 7) | (_write_flag << 6) | (1 << 5) | - ((_reg_addr & 0x7c0) >> 6); - /* addr(6bit) + NULL(2bit) */ - buffer[2] = (_reg_addr & 0x03f) << 2 | 0x0; - - if (_write_flag) - buffer[3] = _data[0]; /* write */ - else - buffer[3] = 0x0; /* null(8) */ - - buffer[4] = 0x00; - - crc = tcpal_calc_crc8(buffer, 36); - buffer[4] = 0x00 | ((crc & 0x7f) >> 3); /* null(4) + crc(4) */ - buffer[5] = ((crc & 0x07) << 5) | 0x0f; /* crc(3) + end bit(5) */ - buffer[6] = 0xff; - buffer[7] = 0xff; - - ret = tcpal_cspi_write_and_read(buffer, buffout, SPICMD_BUFF_LEN); - if (ret < 0) - return ret; - - if (buffout[7] != SPICMD_ACK) { /* ack */ - tcbd_debug(DEBUG_ERROR, - "# Single %s ACK error chip_addr:0x%X, regAddr:0x%X\n", - _write_flag ? "Write" : "Read", - tcbd_cspi_io_funcs->chip_addr, _reg_addr); - tcbd_debug(DEBUG_ERROR, - "# [%02x][%02x][%02x][%02x][%02x]" - "[%02x][%02x][%02x]//[%02x][%02x][%02x]\n", - buffer[0], buffer[1], buffer[2], - buffer[3], buffer[4], buffer[5], - buffer[6], buffer[7], - buffout[6], buffout[7], buffout[8]); - return -TCERR_ACK_FAIL; - } - - if (_write_flag == 0) - *_data = buffout[6]; - - return 0; -} - -static inline s32 tcpal_cspi_burst_io( - u8 _write_flag, - u16 _reg_addr, - u8 *_data, - s32 _size, - u8 _fixedMode) -{ - s32 ret = 0; - struct tcpal_cspi_data *spi_data = &tcpal_cspi_io_data; - u8 crc; - u8 *buffer; - u8 *buffout; - - if (_write_flag == 0) { - buffer = spi_data->buff_dummy; - buffout = spi_data->buff_rw; - } else { - memcpy(spi_data->buff_rw+SPICMD_BUFF_LEN, _data, _size); - buffer = spi_data->buff_rw; - buffout = spi_data->buff_dummy; - } - memset(buffer+SPICMD_BUFF_LEN+_size, 0xFF, SPICMD_BUFF_LEN); - - if (_size > DMA_MAX_SIZE) - return -TCERR_INVALID_ARG; - - /* MAX 16KB (Output buffer max size 7KB) (LENGTH + 1 Byte) */ - _size--; - - /* start bit(1) + chip_id(7) */ - buffer[0] = tcbd_cspi_io_funcs->chip_addr; - /* mode(1) + rw(1) + fix(1) + addr(5) */ - buffer[1] = 1 << 7 | _write_flag << 6 | _fixedMode << 5 | - ((_reg_addr & 0x7c0) >> 6); - /* addr(6bit) + length(2bit) */ - buffer[2] = (_reg_addr & 0x03f) << 2 | ((_size & 0x3000) >> 12); - /* length(8bit) */ - buffer[3] = (_size & 0xff0) >> 4; - - buffer[4] = (_size & 0xf) << 4; - crc = tcpal_calc_crc8(buffer, 36); - /* length(4) + crc(4) */ - buffer[4] = ((_size & 0xf) << 4) | ((crc & 0x7f) >> 3); - /* crc(3) + end bit(5) */ - buffer[5] = ((crc & 0x07) << 5) | 0x0f; - buffer[6] = 0xff; - buffer[7] = 0xff; - - _size++; - - ret = tcpal_cspi_write_and_read( - buffer, buffout, _size+SPICMD_BUFF_LEN*2); - if (ret < 0) - return ret; - - if (buffout[7] != SPICMD_ACK) {/* ack */ - tcbd_debug(DEBUG_ERROR, - "# Burst %s ACK error, chip_addr:0x%X, " - "reg_addr:0x%X, size:%d, mode:%d\n", - _write_flag ? "Write" : "Read", - tcbd_cspi_io_funcs->chip_addr, - _reg_addr, _size, _fixedMode); - tcbd_debug(DEBUG_ERROR, - "# [%02x][%02x][%02x][%02x][%02x]" - "[02%x][02%x][%02x]//[%02x][%02x][%02x]\n", - buffer[0], buffer[1], buffer[2], - buffer[3], buffer[4], buffer[5], - buffer[6], buffer[7], - buffout[6], buffout[7], buffout[8]); - return -TCERR_ACK_FAIL; - } - - if (_write_flag == 0) - memcpy(_data, buffout + SPICMD_BUFF_LEN, _size); - - return 0; -} - -static inline s32 tcpal_cspi_reg_read_burst( - u8 _reg_addr, - u8 *_data, - s32 _size, - u8 mode) -{ - u32 i; - u32 cmax, cremain; - s32 ret; - - cmax = _size / DMA_MAX_SIZE; - cremain = _size % DMA_MAX_SIZE; - - for (i = 0; i < cmax; i++) { - ret = tcpal_cspi_burst_io( - CSPI_READ, - _reg_addr, - &_data[i * DMA_MAX_SIZE], - DMA_MAX_SIZE, - mode); - if (ret < 0) - return ret; - } - - if (cremain != 0) { - ret = tcpal_cspi_burst_io( - CSPI_READ, - _reg_addr, - &_data[i * DMA_MAX_SIZE], - cremain, - mode); - if (ret < 0) - return ret; - } - return 0; -} - -static inline s32 tcpal_cspi_reg_write_burst( - u8 _reg_addr, - u8 *_data, - s32 _size, - u8 mode) -{ - u32 i; - u32 cmax, cremain; - s32 ret; - - cmax = _size / DMA_MAX_SIZE; - cremain = _size % DMA_MAX_SIZE; - - for (i = 0; i < cmax; i++) { - ret = tcpal_cspi_burst_io( - CSPI_WRITE, - _reg_addr, - &_data[i * DMA_MAX_SIZE], - DMA_MAX_SIZE, - mode); - if (ret < 0) - return ret; - } - - if (cremain) { - ret = tcpal_cspi_burst_io( - CSPI_WRITE, - _reg_addr, - &_data[i * DMA_MAX_SIZE], - cremain, - mode); - if (ret < 0) - return ret; - } - - return 0; -} - -static s32 tcpal_cspi_reg_read(u8 _reg_addr, u8 *_data) -{ - return tcpal_cspi_single_io(CSPI_READ, _reg_addr, _data); -} - -static s32 tcpal_cspi_reg_write(u8 _reg_addr, u8 _data) -{ - return tcpal_cspi_single_io(CSPI_WRITE, _reg_addr, &_data); -} - -static s32 tcpal_cspi_reg_read_burst_cont( - u8 _reg_addr, u8 *_data, s32 _size) -{ - return tcpal_cspi_reg_read_burst( - _reg_addr, _data, _size, CONTINUOUS_MODE); -} - -static s32 tcpal_cspi_reg_write_burst_cont( - u8 _reg_addr, u8 *_data, s32 _size) -{ - return tcpal_cspi_reg_write_burst( - _reg_addr, _data, _size, CONTINUOUS_MODE); -} - -static s32 tcpal_cspi_reg_read_burst_fix( - u8 _reg_addr, u8 *_data, s32 _size) -{ - return tcpal_cspi_reg_read_burst( - _reg_addr, _data, _size, FIXED_MODE); -} - -static s32 tcpal_cspi_reg_write_burst_fix( - u8 _reg_addr, u8 *_data, s32 _size) -{ - return tcpal_cspi_reg_write_burst( - _reg_addr, _data, _size, FIXED_MODE); -} - -void tcpal_set_cspi_io_function(void) -{ - tcbd_cspi_io_funcs = tcbd_get_io_struct(); - - tcbd_cspi_io_funcs->open = tcpal_cspi_open; - tcbd_cspi_io_funcs->close = tcpal_cspi_close; - tcbd_cspi_io_funcs->reg_write = tcpal_cspi_reg_write; - tcbd_cspi_io_funcs->reg_read = tcpal_cspi_reg_read; - tcbd_cspi_io_funcs->reg_write_burst_cont = - tcpal_cspi_reg_write_burst_cont; - tcbd_cspi_io_funcs->reg_read_burst_cont = - tcpal_cspi_reg_read_burst_cont; - tcbd_cspi_io_funcs->reg_write_burst_fix = - tcpal_cspi_reg_write_burst_fix; - tcbd_cspi_io_funcs->reg_read_burst_fix = - tcpal_cspi_reg_read_burst_fix; -} -#endif /*__CSPI_ONLY__*/ diff --git a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_io_i2c.c b/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_io_i2c.c deleted file mode 100644 index 679c157..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_io_i2c.c +++ /dev/null @@ -1,309 +0,0 @@ -/* - * tcpal_io_i2c.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcbd_api_common.h" -#include "tcbd_drv_io.h" - -#include <linux/module.h> -#include <linux/semaphore.h> -#include <linux/delay.h> -#include <linux/slab.h> -#include <linux/interrupt.h> -#include <linux/i2c.h> - -#include <linux/io.h> -#include <asm/mach-types.h> - -#define MAX_I2C_BURST 512 -#define Bit7 0x00000080 - -#define I2C_BUS 1 -#define I2C_ADDR (0xA0>>1) - -#if defined(__I2C_STS__) - -static u8 static_buffer_i2c[MAX_I2C_BURST+4]; -static struct i2c_client *tcpal_i2c_client; - -static const struct i2c_device_id tcpal_i2c_id[] = { - {"tc317x", 0}, -}; - -static s32 tcpal_i2c_probe( - struct i2c_client *i2c, const struct i2c_device_id *id) -{ - s32 ret = 0; - tcpal_i2c_client = i2c; - tcbd_debug(DEBUG_TCPAL_I2C, "tcpal_i2c_client : %p\n", i2c); - return ret; -} - -static s32 tcpal_i2c_remove(struct i2c_client *client) -{ - tcbd_debug(DEBUG_TCPAL_I2C, "tcpal_i2c_client : %p\n", client); - return 0; -} - -MODULE_DEVICE_TABLE(i2c, tcpal_i2c_id); - -static struct i2c_driver tcpal_i2c_driver = { - .driver = { - .name = "tc317x", - .owner = THIS_MODULE, - }, - .probe = tcpal_i2c_probe, - .remove = tcpal_i2c_remove, - .id_table = tcpal_i2c_id, -}; - -static s32 tcpal_i2c_add_device(void) -{ - s32 ret; - struct i2c_board_info info; - struct i2c_adapter *adapter; - struct i2c_client *client; - - ret = i2c_add_driver(&tcpal_i2c_driver); - if (ret < 0) { - tcbd_debug(DEBUG_TCPAL_I2C, "can't add i2c driver\n"); - return ret; - } - - memset(&info, 0, sizeof(struct i2c_board_info)); - info.addr = I2C_ADDR; - strlcpy(info.type, "tc317x", I2C_NAME_SIZE); - - adapter = i2c_get_adapter(I2C_BUS); - if (!adapter) { - tcbd_debug(DEBUG_TCPAL_I2C, - "can't get i2c adapter :%d\n", I2C_BUS); - goto err_driver; - } - - client = i2c_new_device(adapter, &info); - i2c_put_adapter(adapter); - if (!client) { - tcbd_debug(DEBUG_TCPAL_I2C, - "can't add i2c device at 0x%X\n", info.addr); - goto err_driver; - } - - return 0; - -err_driver: - i2c_del_driver(&tcpal_i2c_driver); - return -ENODEV; -} - -static s32 tcpal_i2c_close(void) -{ - i2c_unregister_device(tcpal_i2c_client); - i2c_del_driver(&tcpal_i2c_driver); - return 0; -} - -static s32 tcpal_i2c_open(void) -{ - return tcpal_i2c_add_device(); -} - -static s32 tcpal_i2c_reg_read( - u8 _reg_addr, u8 *_data) -{ - s32 ret = 0; - - if (!tcpal_i2c_client) - return -TCERR_OS_DRIVER_FAIL; - - ret = i2c_master_send(tcpal_i2c_client, &_reg_addr, 1); - ret |= i2c_master_recv(tcpal_i2c_client, _data, 1); - if (ret < 0) { - tcbd_debug(DEBUG_TCPAL_I2C, - "I2C read error %d\n", ret); - return -TCERR_OS_DRIVER_FAIL; - } - return 0; -} - -static s32 tcpal_i2c_reg_write(u8 _reg_addr, u8 _data) -{ - s32 ret = 0; - u8 buf[2]; - - if (!tcpal_i2c_client) - return -TCERR_OS_DRIVER_FAIL; - - buf[0] = _reg_addr; - buf[1] = _data; - - ret = i2c_master_send(tcpal_i2c_client, buf, 2); - - if (ret < 0) - return -TCERR_OS_DRIVER_FAIL; - - return 0; -} - -static inline s32 tcpal_i2c_reg_read_burst( - u8 _reg_addr, u8 *_data, s32 _size) -{ - s32 i, ret = 0; - s32 num_chunk, remain, sent, recvd; - - num_chunk = _size / MAX_I2C_BURST; - remain = _size % MAX_I2C_BURST; - - if (!tcpal_i2c_client) - return -TCERR_OS_DRIVER_FAIL; - - for (i = 0; i < num_chunk; i++) { - sent = i2c_master_send(tcpal_i2c_client, &_reg_addr, 1); - if (sent < 1) { - tcbd_debug(DEBUG_TCPAL_I2C, - "I2C Multi read 8 Addr Error!! %d\n", sent); - return -TCERR_OS_DRIVER_FAIL; - } - - recvd = i2c_master_recv( - tcpal_i2c_client, - &_data[i*MAX_I2C_BURST], - MAX_I2C_BURST); - if (recvd < 0) { - tcbd_debug(DEBUG_TCPAL_I2C, - "I2C Multi read 8 data Error!! %d\n", recvd); - return -TCERR_OS_DRIVER_FAIL; - } - } - - if (remain) { - sent = i2c_master_send(tcpal_i2c_client, &_reg_addr, 1); - if (sent < 1) { - tcbd_debug(DEBUG_TCPAL_I2C, - "I2C Multi read 8 Addr Error!!, %d\n", sent); - return -TCERR_OS_DRIVER_FAIL; - } - ret = i2c_master_recv( - tcpal_i2c_client, - &_data[num_chunk * MAX_I2C_BURST], - remain); - if (ret < 0) { - tcbd_debug(DEBUG_TCPAL_I2C, - "I2C Multi read 8 data Error!!\n"); - return -TCERR_OS_DRIVER_FAIL; - } - } - - return 0; -} - -static inline s32 tcpal_i2c_reg_write_burst( - u8 _reg_addr, u8 *_data, s32 _size) -{ - s32 ret = 0; - s32 num_chunk, remain, sent; - s32 i; - - if (!tcpal_i2c_client) - return -TCERR_OS_DRIVER_FAIL; - - num_chunk = _size/MAX_I2C_BURST; - remain = _size%MAX_I2C_BURST; - - static_buffer_i2c[0] = _reg_addr; - for (i = 0; i < num_chunk; i++) { - memcpy(&static_buffer_i2c[1], &_data[i*MAX_I2C_BURST], - MAX_I2C_BURST); - sent = i2c_master_send( - tcpal_i2c_client, - static_buffer_i2c, - MAX_I2C_BURST+1); - if (ret < 0 || sent < 1) { - tcbd_debug(DEBUG_TCPAL_I2C, - "I2C write error %d\n", ret); - return -TCERR_OS_DRIVER_FAIL; - } - } - - if (remain) { - memcpy(&static_buffer_i2c[1], - &_data[num_chunk * MAX_I2C_BURST], - remain); - ret = i2c_master_send( - tcpal_i2c_client, - static_buffer_i2c, - remain+1); - if (ret < 1) { - tcbd_debug(DEBUG_TCPAL_I2C, "I2C write error!\n"); - return -TCERR_OS_DRIVER_FAIL; - } - } - - return 0; -} - -static s32 tcpal_i2c_reg_read_burst_fix( - u8 _reg_addr, u8 *_data, s32 _size) -{ - return tcpal_i2c_reg_read_burst(_reg_addr|Bit7, _data, _size); -} - -static s32 tcpal_i2c_reg_write_burst_fix( - u8 _reg_addr, u8 *_data, s32 _size) -{ - return tcpal_i2c_reg_write_burst(_reg_addr|Bit7, _data, _size); -} - -static s32 tcpal_i2c_reg_read_burst_cont( - u8 _reg_addr, u8 *_data, s32 _size) -{ - return tcpal_i2c_reg_read_burst(_reg_addr, _data, _size); -} - -static s32 tcpal_i2c_reg_write_burst_cont( - u8 _reg_addr, u8 *_data, s32 _size) -{ - return tcpal_i2c_reg_write_burst(_reg_addr, _data, _size); -} - -void tcpal_set_i2c_io_function(void) -{ - struct tcbd_io_data *tcbd_i2c_io_funcs = tcbd_get_io_struct(); - - tcbd_i2c_io_funcs->open = tcpal_i2c_open; - tcbd_i2c_io_funcs->close = tcpal_i2c_close; - tcbd_i2c_io_funcs->reg_write = tcpal_i2c_reg_write; - tcbd_i2c_io_funcs->reg_read = tcpal_i2c_reg_read; - tcbd_i2c_io_funcs->reg_write_burst_cont = - tcpal_i2c_reg_write_burst_cont; - tcbd_i2c_io_funcs->reg_read_burst_cont = - tcpal_i2c_reg_read_burst_cont; - tcbd_i2c_io_funcs->reg_write_burst_fix = - tcpal_i2c_reg_write_burst_fix; - tcbd_i2c_io_funcs->reg_read_burst_fix = - tcpal_i2c_reg_read_burst_fix; -} - -#endif /*__I2C_STS__ */ diff --git a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_irq_handler.c b/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_irq_handler.c deleted file mode 100644 index b6cadaa..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_irq_handler.c +++ /dev/null @@ -1,246 +0,0 @@ -/* - * tcpal_irq_handler.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include <linux/module.h> -#include <linux/interrupt.h> -#include <linux/workqueue.h> -#include <linux/io.h> -#include <asm/mach-types.h> - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcbd_api_common.h" -#include "tcbd_drv_ip.h" - -#include "tcbd_stream_parser.h" -#include "tcbd_diagnosis.h" -#include "tcc_fic_decoder.h" -#include "tcbd_hal.h" - -struct tcbd_irq_data { - struct work_struct work; - struct workqueue_struct *work_queue; - struct tcbd_device *device; - u64 start_tick; - s32 tcbd_irq; - s32 is_irq_en; -}; - -static struct tcbd_irq_data tcbd_irq_handler_data; - -#if defined(__CSPI_ONLY__) -static inline void tcpal_split_stream(struct tcbd_irq_data *irq_data) -{ - s32 size, ret = 0; - s8 irq_status; - s8 irq_error; - static u8 buff_read[TCBD_MAX_THRESHOLD*2]; - struct tcbd_device *device = irq_data->device; - - ret = tcbd_read_irq_status(device, &irq_status, &irq_error); - ret |= tcbd_clear_irq(device, irq_status); - - ret |= tcbd_read_stream(device, buff_read, &size); - if (ret == 0 && !irq_error) - tcbd_split_stream(0, buff_read, size); - else { - tcbd_debug(DEBUG_ERROR, "### buffer is full, skip the data " - "(ret:%d, status=0x%02X, error=0x%02X, %d) ###\n", - ret, irq_status, irq_error, - (s32)tcpal_diff_time(irq_data->start_tick)); - - tcbd_init_stream_data_config(device, - ENABLE_CMD_FIFO, - device->selected_buff, - device->intr_threshold); - /*tcbd_reset_ip(device, TCBD_SYS_COMP_ALL, TCBD_SYS_COMP_EP);*/ - tcbd_init_parser(0, NULL); - } -} - -static void tcpal_work_parse_stream(struct work_struct *_param) -{ - u64 diff = tcpal_diff_time(tcbd_irq_handler_data.start_tick); - struct tcbd_irq_data *irq_data = - container_of(_param, struct tcbd_irq_data, work); - - /* for checking delay of workqueue */ - if (diff > 10) - tcbd_debug(DEBUG_INTRRUPT, "diff work start and process :%d\n", - (s32)diff); - tcpal_split_stream(irq_data); - enable_irq(irq_data->tcbd_irq); -} - - -s32 start_tune; -static s32 tcpal_irq_stream_callback( - s32 _dev_idx, - u8 *_stream, - s32 _size, - u8 _subch_id, - u8 _type) -{ - /*static u64 time = 0;*/ - /*struct tcbd_status_data status;*/ - s32 ret, i = 0; - - switch (_type) { - case 0: /*MSC*/ - /* write your own code!!*/ - case 1: /*FIC*/ - /* write your own code!!*/ - if (!start_tune) /* set by tune_frequency*/ - goto skip_fic_parse; - - for (i = 0; i < _size / TCBD_FIC_SIZE; i++) { - ret = tcc_fic_run_decoder(_stream + (i * TCBD_FIC_SIZE), - MAX_FIC_SIZE); - if (ret > 0) { - tcc_fic_get_ensbl_info(1); - start_tune = 0; - tcc_fic_parser_init(); - } - } - /*tcbd_read_signal_info(tcbd_irq_handler_data.device, &status); - tcbd_debug(DEBUG_ERROR, - "PCBER:%d, SNR:%d, RSSI:%d, VBER:%d, TSPER:%d\n", - status.pcber, status.snr, status.rssi, - status.vber, status.tsper);*/ - /*if (tcpal_diff_time(time) > 1000) { - tcbd_check_dsp_status(tcbd_irq_handler_data.device); - time = tcpal_get_time(); - }*/ -skip_fic_parse: - /*tcbd_enqueue_data(_stream, _size, _subch_id, _type);*/ - break; - case 2: /*STATUS*/ - tcbd_debug(DEBUG_STATUS, "status size:%d\n", _size); - tcbd_update_status(_stream, _size, NULL); - break; - default: - break; - } - return 0; -} -#endif /*__CSPI_ONLY__*/ - -#if defined(__I2C_STS__) -static void tcpal_work_read_fic(struct work_struct *_param) -{ - s32 size = TCBD_FIC_SIZE, ret; - u8 buff[TCBD_FIC_SIZE]; - u64 diff; - struct tcbd_irq_data *irq_data = container_of(_param, - struct tcbd_irq_data, work); - struct tcbd_device *device = irq_data->device; - - diff = tcpal_diff_time(irq_data->start_tick); - tcbd_debug(DEBUG_INTRRUPT, "work delay :%d\n", (u32)diff); - - ret = tcbd_read_fic_data(device, buff, size); - if (ret < 0) { - tcbd_debug(DEBUG_ERROR, "failed to read fic! %d\n", ret); - goto exit_work; - } - - tcbd_enqueue_data(buff, size, 0, 1); - if (!start_tune) /* set by tune_frequency*/ - goto exit_work; - - ret = tcc_fic_run_decoder(buff, MAX_FIC_SIZE); - if (ret > 0) { - tcc_fic_get_ensbl_info(1); - start_tune = 0; - tcc_fic_parser_init(); - } -exit_work: - enable_irq(irq_data->tcbd_irq); -} -#endif /*__I2C_STS__*/ - -static irqreturn_t tcpal_irq_handler(s32 _irq, void *_param) -{ - struct tcbd_irq_data *irq_data = (struct tcbd_irq_data *)_param; - struct tcbd_device *device = irq_data->device; - - disable_irq_nosync(irq_data->tcbd_irq); - if (device->is_pal_irq_en) { - irq_data->start_tick = tcpal_get_time(); - queue_work(irq_data->work_queue, &irq_data->work); - tcbd_debug(DEBUG_INTRRUPT, "\n"); - } - return IRQ_HANDLED; -} - -s32 tcpal_irq_register_handler(void *_device) -{ - s32 ret; - - tcbd_irq_handler_data.work_queue = - create_singlethread_workqueue("tdmb_work"); - tcbd_irq_handler_data.device = (struct tcbd_device *)_device; -#if defined(__USE_TC_CPU__) - tcbd_irq_handler_data.tcbd_irq = IRQ_TC317X; -#endif /*__USE_TC_CPU__*/ - -#if defined(__I2C_STS__) - INIT_WORK(&tcbd_irq_handler_data.work, tcpal_work_read_fic); -#elif defined(__CSPI_ONLY__) - INIT_WORK(&tcbd_irq_handler_data.work, tcpal_work_parse_stream); - tcbd_init_parser(0, tcpal_irq_stream_callback); -#endif /*__CSPI_ONLY__*/ - - ret = request_irq(tcbd_irq_handler_data.tcbd_irq, tcpal_irq_handler, - IRQF_TRIGGER_FALLING | IRQF_DISABLED, - "tdmb_irq", &tcbd_irq_handler_data); - tcbd_debug(DEBUG_INTRRUPT, "request_irq : %d\n", (int)ret); - return ret; -} - -s32 tcpal_irq_unregister_handler(void) -{ - disable_irq(tcbd_irq_handler_data.tcbd_irq); - free_irq(tcbd_irq_handler_data.tcbd_irq, NULL); - flush_workqueue(tcbd_irq_handler_data.work_queue); - destroy_workqueue(tcbd_irq_handler_data.work_queue); - return 0; -} - -s32 tcpal_irq_enable(void) -{ -#if defined(__CSPI_ONLY__) - tcbd_init_parser(0, NULL); -#endif /*__CSPI_ONLY__*/ - tcbd_debug(DEBUG_INTRRUPT, "\n"); - /* enable_irq(tcbd_irq_handler_data.tcbd_irq); */ - return 0; -} - -s32 tcpal_irq_disable(void) -{ - tcbd_debug(DEBUG_INTRRUPT, "\n"); - /* disable_irq(tcbd_irq_handler_data.tcbd_irq); */ - return 0; -} diff --git a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_linux.c b/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_linux.c deleted file mode 100644 index 2647484..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_linux.c +++ /dev/null @@ -1,138 +0,0 @@ -/* - * tcpal_linux.c - * - * Author: <linux@telechips.com> - * Description: Telechips broadcast driver - * - * Copyright (c) Telechips, Inc. - * - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 as - * published by the Free Software Foundation. - * - * 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. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - */ - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include <linux/module.h> -#include <linux/semaphore.h> -#include <linux/delay.h> -#include <linux/slab.h> -#include <linux/interrupt.h> - -#include <linux/io.h> -#include <asm/mach-types.h> - -u64 tcpal_get_time(void) -{ - u64 tick; - struct timeval tv; - - do_gettimeofday(&tv); - tick = (u64)tv.tv_sec*1000 + tv.tv_usec/1000; - - return tick; -} - -u64 tcpal_diff_time(u64 _start_time) -{ - u64 interval; - u64 curr_time = tcpal_get_time(); - - if (curr_time > _start_time) - interval = curr_time - _start_time; - else - interval = (TCPAL_MAX_TIMECNT - _start_time) + curr_time + 1; - - return interval; -} - -void tcpal_msleep(s32 _ms) -{ - msleep(_ms); -} - -void tcpal_usleep(s32 _us) -{ - struct timeval pre_tv, tv; - s32 diff; - - do_gettimeofday(&pre_tv); - do { - do_gettimeofday(&tv); - if (tv.tv_usec > pre_tv.tv_usec) - diff = tv.tv_usec - pre_tv.tv_usec; - else - diff = (LONG_MAX - pre_tv.tv_usec) + tv.tv_usec; - } while (diff < _us); -} - -void *tcpal_malloc(u32 _size) -{ - return kmalloc(_size, GFP_KERNEL); -} - -void tcpal_free(void *_ptr) -{ - kfree(_ptr); -} - -s32 tcpal_create_lock( - u32 *_semaphore, - char *_name, - u32 _initialCount) -{ - struct mutex *lock = - (struct mutex *)tcpal_malloc(sizeof(struct mutex)); - tcbd_debug(DEBUG_TCPAL_OS, "\n"); - mutex_init(lock); - - *_semaphore = (u32)lock; - return 0; -} - -s32 tcpal_destroy_lock(u32 *_semaphore) -{ - struct mutex *lock = (struct mutex *)*_semaphore; - - if (lock == NULL) - return -1; - - tcpal_free(lock); - *_semaphore = 0; - tcbd_debug(DEBUG_TCPAL_OS, "\n"); - return 0; -} - -s32 tcpal_lock(u32 *_semaphore) -{ - struct mutex *lock = (struct mutex *)*_semaphore; - - if (lock == NULL) { - tcbd_debug(DEBUG_ERROR, "\n"); - return -1; - } - mutex_lock(lock); - return 0; -} - -s32 tcpal_unlock(u32 *_semaphore) -{ - struct mutex *lock = (struct mutex *)*_semaphore; - - if (lock == NULL) { - tcbd_debug(DEBUG_ERROR, "\n"); - return -1; - } - mutex_unlock(lock); - return 0; -} diff --git a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_queue.c b/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_queue.c deleted file mode 100644 index 3677a58..0000000 --- a/drivers/media/tdmb/tcc3170/src/tcpal_linux/tcpal_queue.c +++ /dev/null @@ -1,201 +0,0 @@ -/* -* -* File name : tcpal_queue.c -* -* Description : tdmb driver -* -* Copyright (C) (2012, Telechips. ) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - - -#include "tcpal_os.h" -#include "tcpal_debug.h" - -#include "tcbd_feature.h" -#include "tcpal_queue.h" - -s32 tcbd_queue_is_full(struct tcbd_queue *_queue) -{ - if (_queue->front == ((_queue->rear+1)%_queue->qsize)) - return 1; - return 0; -} - -s32 tcbd_queue_is_empty(struct tcbd_queue *_queue) -{ - if (_queue->front == _queue->rear) - return 1; - return 0; -} - -void tcbd_init_queue( - struct tcbd_queue *_queue, u8* _buffer, s32 _buff_size) -{ - memset((void *)_queue->q, 0, - sizeof(struct tcbd_queue_item) * TCBD_QUEUE_SIZE); - _queue->front = 0; - _queue->rear = 0; - _queue->qsize = TCBD_QUEUE_SIZE; - _queue->buff_size = _buff_size; - _queue->global_buffer = _buffer; - _queue->pointer = 0; - - tcpal_create_lock(&_queue->sem, "TcbdQueue", 0); -} - -void tcbd_deinit_queue(struct tcbd_queue *_queue) -{ - _queue->front = 0; - _queue->rear = 0; - _queue->qsize = 0; - _queue->buff_size = 0; - tcpal_destroy_lock(&_queue->sem); -} - -void tcbd_reset_queue(struct tcbd_queue *_queue) -{ - _queue->front = 0; - _queue->rear = 0; - _queue->pointer = 0; - memset(_queue->q, 0, - sizeof(struct tcbd_queue_item)*_queue->qsize); -} - -s32 tcbd_enqueue( - struct tcbd_queue *_queue, u8 *_chunk, s32 _size, - u8 _subch_id, s32 _type) -{ - if (_chunk == NULL || _size <= 0) { - tcbd_debug(DEBUG_ERROR, "Invalid argument!!\n"); - return -1; - } - - tcpal_lock(&_queue->sem); - - if (tcbd_queue_is_full(_queue)) { - tcbd_debug(DEBUG_ERROR, "Queue Full!!\n"); - _queue->pointer = 0; - } - - if (_queue->q[_queue->rear].buffer < - _queue->q[_queue->front].buffer) { - u32 next_pos_rear = - (u32)_queue->q[_queue->rear].buffer + _size; - u32 curr_pos_front = - (u32)_queue->q[_queue->front].buffer; - - if (next_pos_rear > curr_pos_front) { - tcbd_debug(DEBUG_ERROR, "Buffer overflow!!\n"); - tcbd_reset_queue(_queue); - tcpal_unlock(&_queue->sem); - return -1; - } - } - - _queue->q[_queue->rear].buffer = - _queue->global_buffer + _queue->pointer; - - if (_queue->pointer + _size >= _queue->buff_size) - _queue->pointer = 0; - else - _queue->pointer += _size; - memcpy(_queue->q[_queue->rear].buffer, _chunk, _size); - _queue->q[_queue->rear].size = _size; - _queue->q[_queue->rear].type = _type; - _queue->q[_queue->rear].subch_id = _subch_id; - - _queue->rear = (_queue->rear + 1) % _queue->qsize; - tcpal_unlock(&_queue->sem); - return 0; -} - -s32 tcbd_dequeue( - struct tcbd_queue *_queue, u8 *_chunk, s32 *_size, - u8 *_subch_id, s32 *_type) -{ - tcpal_lock(&_queue->sem); - if (tcbd_queue_is_empty(_queue)) { - tcbd_debug(0, "Queue Empty!!\n"); - tcpal_unlock(&_queue->sem); - return -1; - } - - if (_queue->q[_queue->front].size > *_size) { - tcbd_debug(DEBUG_ERROR, - "insufficient buffer!! size:%d, qsize:%d\n", - *_size, _queue->q[_queue->front].size); - - tcpal_unlock(&_queue->sem); - return -1; - } - - memcpy(_chunk, _queue->q[_queue->front].buffer, - _queue->q[_queue->front].size); - - *_size = _queue->q[_queue->front].size; - if (_type) - *_type = _queue->q[_queue->front].type; - if (_subch_id) - *_subch_id = _queue->q[_queue->front].subch_id; - - _queue->front = (_queue->front + 1) % _queue->qsize; - tcbd_debug(0, "pos:%d, size:%d\n", _queue->pointer, *_size); - tcpal_unlock(&_queue->sem); - return 0; -} - -s32 tcbd_dequeue_ptr( - struct tcbd_queue *_queue, u8 **_chunk, s32 *_size, s32 *_type) -{ - tcpal_lock(&_queue->sem); - if (tcbd_queue_is_empty(_queue)) { - tcbd_debug(0, "Queue Empty!!\n"); - tcpal_unlock(&_queue->sem); - return -1; - } - - if (_queue->q[_queue->front].size > *_size) { - tcbd_debug(DEBUG_ERROR, - "insufficient buffer!! size:%d, qsize:%d\n", - *_size, _queue->q[_queue->front].size); - tcpal_unlock(&_queue->sem); - return -1; - } - - *_chunk = _queue->q[_queue->front].buffer; - *_size = _queue->q[_queue->front].size; - if (_type) - *_type = _queue->q[_queue->front].type; - _queue->front = (_queue->front + 1) % _queue->qsize; - tcbd_debug(0, "pos:%d, size:%d\n", _queue->pointer, *_size); - tcpal_unlock(&_queue->sem); - return 0; -} - -s32 tcbd_get_first_queue_ptr( - struct tcbd_queue *_queue, u8 **_chunk, s32 *_size, s32 *_type) -{ - tcpal_lock(&_queue->sem); - if (tcbd_queue_is_empty(_queue)) { - tcbd_debug(0, "Queue Empty!!\n"); - tcpal_unlock(&_queue->sem); - return -1; - } - *_size = _queue->q[_queue->front].size; - *_chunk = _queue->q[_queue->front].buffer; - if (_type) - *_type = _queue->q[_queue->front].type; - tcbd_debug(0, "pos:%d, size:%d\n", _queue->pointer, *_size); - tcpal_unlock(&_queue->sem); - return 0; -} diff --git a/drivers/media/tdmb/tdmb.c b/drivers/media/tdmb/tdmb.c deleted file mode 100644 index b8f215a..0000000 --- a/drivers/media/tdmb/tdmb.c +++ /dev/null @@ -1,867 +0,0 @@ -/* -* -* drivers/media/tdmb/tdmb.c -* -* tdmb driver -* -* Copyright (C) (2011, Samsung Electronics) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include <linux/kernel.h> -#include <linux/fs.h> -#include <linux/errno.h> -#include <linux/device.h> -#include <linux/platform_device.h> -#include <linux/init.h> -#include <linux/module.h> -#include <linux/string.h> - -#include <linux/types.h> -#include <linux/fcntl.h> - -/* for delay(sleep) */ -#include <linux/delay.h> - -/* for mutex */ -#include <linux/mutex.h> - -/*using copy to user */ -#include <linux/uaccess.h> -#include <linux/clk.h> -#include <linux/mm.h> -#include <linux/slab.h> - -#include <linux/workqueue.h> -#include <linux/irq.h> -#include <asm/mach/irq.h> -#include <linux/interrupt.h> -#include <linux/vmalloc.h> - -#include <linux/io.h> -#include <mach/gpio.h> - -#if defined(CONFIG_TDMB_ANT_DET) -#include <linux/input.h> -#endif - -#ifdef CONFIG_MACH_C1 -#include <linux/wakelock.h> -static struct wake_lock tdmb_wlock; -#endif -#include "tdmb.h" -#define TDMB_PRE_MALLOC 1 - -static struct class *tdmb_class; - -/* ring buffer */ -char *ts_ring; -unsigned int *tdmb_ts_head; -unsigned int *tdmb_ts_tail; -char *tdmb_ts_buffer; -unsigned int tdmb_ts_size; - -unsigned int *cmd_head; -unsigned int *cmd_tail; -static char *cmd_buffer; -static unsigned int cmd_size; - -static unsigned long tdmb_last_ch; - -static struct tdmb_platform_data gpio_cfg; -static struct tdmb_drv_func *tdmbdrv_func; - -static bool tdmb_pwr_on; -static bool tdmb_power_on(void) -{ - if (tdmb_create_databuffer(tdmbdrv_func->get_int_size()) == false) { - DPRINTK("tdmb_create_databuffer fail\n"); - goto create_databuffer_fail; - } - if (tdmb_create_workqueue() == false) { - DPRINTK("tdmb_create_workqueue fail\n"); - goto create_workqueue_fail; - } - if (tdmbdrv_func->power_on() == false) { - DPRINTK("power_on fail\n"); - goto power_on_fail; - } - - DPRINTK("power_on success\n"); -#ifdef CONFIG_MACH_C1 - wake_lock(&tdmb_wlock); -#endif - tdmb_pwr_on = true; - return true; - -power_on_fail: - tdmb_destroy_workqueue(); -create_workqueue_fail: - tdmb_destroy_databuffer(); -create_databuffer_fail: - tdmb_pwr_on = false; - - return false; -} -static bool tdmb_power_off(void) -{ - DPRINTK("%s : tdmb_pwr_on(%d)\n", __func__, tdmb_pwr_on); - - if (tdmb_pwr_on) { - tdmbdrv_func->power_off(); - tdmb_destroy_workqueue(); - tdmb_destroy_databuffer(); -#ifdef CONFIG_MACH_C1 - wake_unlock(&tdmb_wlock); -#endif - tdmb_pwr_on = false; - } - tdmb_last_ch = 0; - return true; -} - -static int tdmb_open(struct inode *inode, struct file *filp) -{ - DPRINTK("tdmb_open!\n"); - return 0; -} - -static ssize_t -tdmb_read(struct file *file, char __user *buf, size_t nbytes, loff_t *ppos) -{ - DPRINTK("tdmb_read\n"); - - return 0; -} - -static int tdmb_release(struct inode *inode, struct file *filp) -{ - DPRINTK("tdmb_release\n"); - - tdmb_power_off(); - -#if TDMB_PRE_MALLOC - tdmb_ts_size = 0; - cmd_size = 0; -#else - if (ts_ring != 0) { - kfree(ts_ring); - ts_ring = 0; - tdmb_ts_size = 0; - cmd_size = 0; - } -#endif - - return 0; -} - -#if TDMB_PRE_MALLOC -static void tdmb_make_ring_buffer(void) -{ - size_t size = TDMB_RING_BUFFER_MAPPING_SIZE; - - /* size should aligned in PAGE_SIZE */ - if (size % PAGE_SIZE) /* klaatu hard coding */ - size = size + size % PAGE_SIZE; - - ts_ring = kmalloc(size, GFP_KERNEL); - DPRINTK("RING Buff Create OK\n"); -} - -#endif - -static int tdmb_mmap(struct file *filp, struct vm_area_struct *vma) -{ - size_t size; - unsigned long pfn; - - DPRINTK("%s\n", __func__); - - vma->vm_flags |= VM_RESERVED; - size = vma->vm_end - vma->vm_start; - DPRINTK("size given : %x\n", size); - -#if TDMB_PRE_MALLOC - size = TDMB_RING_BUFFER_MAPPING_SIZE; - if (!ts_ring) { - DPRINTK("RING Buff ReAlloc(%d)!!\n", size); -#endif - /* size should aligned in PAGE_SIZE */ - if (size % PAGE_SIZE) /* klaatu hard coding */ - size = size + size % PAGE_SIZE; - - ts_ring = kmalloc(size, GFP_KERNEL); -#if TDMB_PRE_MALLOC - } -#endif - - pfn = virt_to_phys(ts_ring) >> PAGE_SHIFT; - - DPRINTK("vm_start:%lx,ts_ring:%p,size:%x,prot:%lx,pfn:%lx\n", - vma->vm_start, ts_ring, size, vma->vm_page_prot, pfn); - - if (remap_pfn_range(vma, vma->vm_start, pfn, size, vma->vm_page_prot)) - return -EAGAIN; - - DPRINTK("succeeded\n"); - - tdmb_ts_head = (unsigned int *)ts_ring; - tdmb_ts_tail = (unsigned int *)(ts_ring + 4); - tdmb_ts_buffer = ts_ring + 8; - - *tdmb_ts_head = 0; - *tdmb_ts_tail = 0; - - tdmb_ts_size = size-8; /* klaatu hard coding */ - tdmb_ts_size - = ((tdmb_ts_size / DMB_TS_SIZE) * DMB_TS_SIZE) - (30 * DMB_TS_SIZE); - - DPRINTK("head : %x, tail : %x, buffer : %x, size : %x\n", - (unsigned int)tdmb_ts_head, (unsigned int)tdmb_ts_tail, - (unsigned int)tdmb_ts_buffer, tdmb_ts_size); - - cmd_buffer = tdmb_ts_buffer + tdmb_ts_size + 8; - cmd_head = (unsigned int *)(cmd_buffer - 8); - cmd_tail = (unsigned int *)(cmd_buffer - 4); - - *cmd_head = 0; - *cmd_tail = 0; - - cmd_size = 30 * DMB_TS_SIZE - 8; /* klaatu hard coding */ - - DPRINTK("cmd head : %x, tail : %x, buffer : %x, size : %x\n", - (unsigned int)cmd_head, (unsigned int)cmd_tail, - (unsigned int)cmd_buffer, cmd_size); - - return 0; -} - - -static int _tdmb_cmd_update( - unsigned char *cmd_header, - unsigned char cmd_header_size, - unsigned char *data, - unsigned short data_size) -{ - unsigned int size; - unsigned int head; - unsigned int tail; - unsigned int dist; - unsigned int temp_size; - unsigned int data_size_tmp; - - if (data_size > cmd_size) { - DPRINTK(" Error - cmd size too large\n"); - return false; - } - - head = *cmd_head; - tail = *cmd_tail; - size = cmd_size; - data_size_tmp = data_size + cmd_header_size; - - if (head >= tail) - dist = head-tail; - else - dist = size + head-tail; - - if (size - dist <= data_size_tmp) { - DPRINTK("too small space is left in Cmd Ring Buffer!!\n"); - return false; - } - - DPRINTK("%x head %d tail %d\n", (unsigned int)cmd_buffer, head, tail); - - if (head+data_size_tmp <= size) { - memcpy((cmd_buffer + head), - (char *)cmd_header, cmd_header_size); - memcpy((cmd_buffer + head + cmd_header_size), - (char *)data, data_size); - head += data_size_tmp; - if (head == size) - head = 0; - } else { - temp_size = size - head; - if (temp_size < cmd_header_size) { - memcpy((cmd_buffer+head), - (char *)cmd_header, temp_size); - memcpy((cmd_buffer), - (char *)cmd_header+temp_size, - (cmd_header_size - temp_size)); - head = cmd_header_size - temp_size; - } else { - memcpy((cmd_buffer+head), - (char *)cmd_header, cmd_header_size); - head += cmd_header_size; - if (head == size) - head = 0; - } - - temp_size = size - head; - if (temp_size < data_size) { - memcpy((cmd_buffer+head), - (char *)data, temp_size); - memcpy((cmd_buffer), - (char *)data+temp_size, - (data_size - temp_size)); - head = data_size - temp_size; - } else { - memcpy((cmd_buffer+head), - (char *)data, data_size); - head += data_size; - if (head == size) - head = 0; - } - } - - *cmd_head = head; - - return true; -} - -unsigned char tdmb_make_result( - unsigned char cmd, - unsigned short data_len, - unsigned char *data) -{ - unsigned char cmd_header[4] = {0,}; - - cmd_header[0] = TDMB_CMD_START_FLAG; - cmd_header[1] = cmd; - cmd_header[2] = (data_len>>8)&0xff; - cmd_header[3] = data_len&0xff; - - _tdmb_cmd_update(cmd_header, 4 , data, data_len); - - return true; -} - -unsigned long tdmb_get_chinfo(void) -{ - return tdmb_last_ch; -} - -void tdmb_pull_data(struct work_struct *work) -{ - tdmbdrv_func->pull_data(); -} - -bool tdmb_control_irq(bool set) -{ - bool ret = true; - int irq_ret; - if (set) { - irq_set_irq_type(gpio_cfg.irq, IRQ_TYPE_EDGE_FALLING); - irq_ret = request_irq(gpio_cfg.irq - , tdmb_irq_handler - , IRQF_DISABLED - , TDMB_DEV_NAME - , NULL); - if (irq_ret < 0) { - DPRINTK("request_irq failed !! \r\n"); - ret = false; - } - } else { - free_irq(gpio_cfg.irq, NULL); - } - - return ret; -} - -void tdmb_control_gpio(bool poweron) -{ - if (poweron) - gpio_cfg.gpio_on(); - else - gpio_cfg.gpio_off(); -} - -static long tdmb_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) -{ - int ret = 0; - unsigned long fig_freq = 0; - struct ensemble_info_type *ensemble_info; - struct tdmb_dm dm_buff; - - DPRINTK("call tdmb_ioctl : 0x%x\n", cmd); - - if (_IOC_TYPE(cmd) != IOCTL_MAGIC) { - DPRINTK("tdmb_ioctl : _IOC_TYPE error\n"); - return -EINVAL; - } - if (_IOC_NR(cmd) >= IOCTL_MAXNR) { - DPRINTK("tdmb_ioctl : _IOC_NR(cmd) 0x%x\n", _IOC_NR(cmd)); - return -EINVAL; - } - - switch (cmd) { - case IOCTL_TDMB_GET_DATA_BUFFSIZE: - DPRINTK("IOCTL_TDMB_GET_DATA_BUFFSIZE %d\n", tdmb_ts_size); - ret = copy_to_user((unsigned int *)arg, - &tdmb_ts_size, sizeof(unsigned int)); - break; - - case IOCTL_TDMB_GET_CMD_BUFFSIZE: - DPRINTK("IOCTL_TDMB_GET_CMD_BUFFSIZE %d\n", cmd_size); - ret = copy_to_user((unsigned int *)arg, - &cmd_size, sizeof(unsigned int)); - break; - - case IOCTL_TDMB_POWER_ON: - DPRINTK("IOCTL_TDMB_POWER_ON\n"); - ret = tdmb_power_on(); - break; - - case IOCTL_TDMB_POWER_OFF: - DPRINTK("IOCTL_TDMB_POWER_OFF\n"); - ret = tdmb_power_off(); - break; - - case IOCTL_TDMB_SCAN_FREQ_ASYNC: - DPRINTK("IOCTL_TDMB_SCAN_FREQ_ASYNC\n"); - - fig_freq = arg; - - ensemble_info = vmalloc(sizeof(struct ensemble_info_type)); - memset((char *)ensemble_info, 0x00\ - , sizeof(struct ensemble_info_type)); - - ret = tdmbdrv_func->scan_ch(ensemble_info, fig_freq); - if (ret == true) - tdmb_make_result(DMB_FIC_RESULT_DONE, - sizeof(struct ensemble_info_type), - (unsigned char *)ensemble_info); - else - tdmb_make_result(DMB_FIC_RESULT_FAIL, - sizeof(unsigned long), - (unsigned char *)&fig_freq); - - vfree(ensemble_info); - tdmb_last_ch = 0; - break; - - case IOCTL_TDMB_SCAN_FREQ_SYNC: - fig_freq = ((struct ensemble_info_type *)arg)->ensem_freq; - DPRINTK("IOCTL_TDMB_SCAN_FREQ_SYNC %ld\n", fig_freq); - - ensemble_info = vmalloc(sizeof(struct ensemble_info_type)); - memset((char *)ensemble_info, 0x00\ - , sizeof(struct ensemble_info_type)); - - ret = tdmbdrv_func->scan_ch(ensemble_info, fig_freq); - if (ret == true) { - if (copy_to_user((struct ensemble_info_type *)arg, - ensemble_info, - sizeof(struct ensemble_info_type)) - ) - DPRINTK("cmd(%x) : copy_to_user failed\n", cmd); - } - - vfree(ensemble_info); - tdmb_last_ch = 0; - break; - - case IOCTL_TDMB_SCANSTOP: - DPRINTK("IOCTL_TDMB_SCANSTOP\n"); - ret = false; - break; - - case IOCTL_TDMB_ASSIGN_CH: - DPRINTK("IOCTL_TDMB_ASSIGN_CH %ld\n", arg); - tdmb_init_data(); - ret = tdmbdrv_func->set_ch(arg, (arg % 1000), false); - if (ret == true) - tdmb_last_ch = arg; - else - tdmb_last_ch = 0; - break; - - case IOCTL_TDMB_ASSIGN_CH_TEST: - DPRINTK("IOCTL_TDMB_ASSIGN_CH_TEST %ld\n", arg); - tdmb_init_data(); - ret = tdmbdrv_func->set_ch(arg, (arg % 1000), true); - if (ret == true) - tdmb_last_ch = arg; - else - tdmb_last_ch = 0; - break; - - case IOCTL_TDMB_GET_DM: - tdmbdrv_func->get_dm(&dm_buff); - if (copy_to_user((struct tdmb_dm *)arg\ - , &dm_buff, sizeof(struct tdmb_dm))) - DPRINTK("IOCTL_TDMB_GET_DM : copy_to_user failed\n"); - ret = true; - DPRINTK("rssi %d, ber %d, ANT %d\n", - dm_buff.rssi, dm_buff.ber, dm_buff.antenna); - break; - } - - return ret; -} - -static const struct file_operations tdmb_ctl_fops = { - .owner = THIS_MODULE, - .open = tdmb_open, - .read = tdmb_read, - .unlocked_ioctl = tdmb_ioctl, - .mmap = tdmb_mmap, - .release = tdmb_release, - .llseek = no_llseek, -}; - -static struct tdmb_drv_func *tdmb_get_drv_func(void) -{ - struct tdmb_drv_func * (*func)(void); -#if defined(CONFIG_TDMB_T3900) && defined(CONFIG_TDMB_TCC3170) - if (system_rev >= 11) - func = tcc3170_drv_func; - else - func = t3900_drv_func; -#elif defined(CONFIG_TDMB_T3900) || defined(CONFIG_TDMB_T39F0) - func = t3900_drv_func; -#elif defined(CONFIG_TDMB_FC8050) - func = fc8050_drv_func; -#elif defined(CONFIG_TDMB_MTV318) - func = mtv318_drv_func; -#elif defined(CONFIG_TDMB_TCC3170) - func = tcc3170_drv_func; -#else - #error what??? -#endif - - return func(); -} - -#if defined(CONFIG_TDMB_ANT_DET) - -static struct input_dev *tdmb_ant_input; -static int tdmb_check_ant; -static int ant_prev_status; - -#define TDMB_ANT_CHECK_DURATION 500000 -#define TDMB_ANT_CHECK_COUNT 2 -static bool tdmb_ant_det_check_value(void) -{ - int loop = 0; - int cur_val = 0, prev_val = 0; - bool ret = false; - - tdmb_check_ant = 1; - - prev_val = ant_prev_status ? 0 : 1; - for (loop = 0; loop < TDMB_ANT_CHECK_COUNT; loop++) { - usleep_range(TDMB_ANT_CHECK_DURATION, TDMB_ANT_CHECK_DURATION); - cur_val = gpio_get_value_cansleep(gpio_cfg.gpio_ant_det); - if (prev_val != cur_val || ant_prev_status == cur_val) - break; - prev_val = cur_val; - } - - if (loop == TDMB_ANT_CHECK_COUNT) { - if (ant_prev_status == 0 && cur_val == 1) - ret = true; - - ant_prev_status = cur_val; - } - - tdmb_check_ant = 0; - - DPRINTK("%s cnt(%d) cur(%d) ret(%d)\n", __func__, loop, cur_val, ret); - - return ret; -} - -static int tdmb_ant_det_ignore_irq(void) -{ - DPRINTK("%s tdmb_check_ant=%d\n", __func__, tdmb_check_ant); - return tdmb_check_ant; -} - -static void tdmb_ant_det_work_func(struct work_struct *work) -{ - int val = 0; - - if (!tdmb_ant_input) { - DPRINTK("%s: input device is not registered\n", __func__); - return; - } - - if (tdmb_ant_det_check_value()) { - input_report_key(tdmb_ant_input, KEY_DMB_ANT_DET_UP, 1); - input_report_key(tdmb_ant_input, KEY_DMB_ANT_DET_UP, 0); - input_sync(tdmb_ant_input); - DPRINTK("%s: sys_rev:%d\n", __func__, system_rev); - } -} - -static struct workqueue_struct *tdmb_ant_det_wq; -static DECLARE_WORK(tdmb_ant_det_work, tdmb_ant_det_work_func); -static bool tdmb_ant_det_reg_input(struct platform_device *pdev) -{ - struct input_dev *input; - int err; - - DPRINTK("%s\n", __func__); - - input = input_allocate_device(); - if (!input) { - DPRINTK("Can't allocate input device\n"); - err = -ENOMEM; - } - set_bit(EV_KEY, input->evbit); - set_bit(KEY_DMB_ANT_DET_UP & KEY_MAX, input->keybit); - set_bit(KEY_DMB_ANT_DET_DOWN & KEY_MAX, input->keybit); - input->name = "sec_dmb_key"; - input->phys = "sec_dmb_key/input0"; - input->dev.parent = &pdev->dev; - - err = input_register_device(input); - if (err) { - DPRINTK("Can't register dmb_ant_det key: %d\n", err); - goto free_input_dev; - } - tdmb_ant_input = input; - ant_prev_status = gpio_get_value_cansleep(gpio_cfg.gpio_ant_det); - - return true; - -free_input_dev: - input_free_device(input); - return false; -} - -static void tdmb_ant_det_unreg_input(void) -{ - DPRINTK("%s\n", __func__); - if (tdmb_ant_input) { - input_unregister_device(tdmb_ant_input); - tdmb_ant_input = NULL; - } -} -static bool tdmb_ant_det_create_wq(void) -{ - DPRINTK("%s\n", __func__); - tdmb_ant_det_wq = create_singlethread_workqueue("tdmb_ant_det_wq"); - if (tdmb_ant_det_wq) - return true; - else - return false; -} - -static bool tdmb_ant_det_destroy_wq(void) -{ - DPRINTK("%s\n", __func__); - if (tdmb_ant_det_wq) { - flush_workqueue(tdmb_ant_det_wq); - destroy_workqueue(tdmb_ant_det_wq); - tdmb_ant_det_wq = NULL; - } - return true; -} - -static irqreturn_t tdmb_ant_det_irq_handler(int irq, void *dev_id) -{ - int ret = 0; - - if (tdmb_ant_det_ignore_irq()) - return IRQ_HANDLED; - - if (tdmb_ant_det_wq) { - ret = queue_work(tdmb_ant_det_wq, &tdmb_ant_det_work); - if (ret == 0) - DPRINTK("%s queue_work fail\n", __func__); - } - - return IRQ_HANDLED; -} - -static bool tdmb_ant_det_irq_set(bool set) -{ - bool ret = true; - int irq_ret; - DPRINTK("%s\n", __func__); - - if (set) { - if (system_rev >= 6) - irq_set_irq_type(gpio_cfg.irq_ant_det - , IRQ_TYPE_EDGE_BOTH); - else - irq_set_irq_type(gpio_cfg.irq_ant_det - , IRQ_TYPE_EDGE_RISING); - - irq_ret = request_irq(gpio_cfg.irq_ant_det - , tdmb_ant_det_irq_handler - , IRQF_DISABLED - , "tdmb_ant_det" - , NULL); - if (irq_ret < 0) { - DPRINTK("%s %d\r\n", __func__, irq_ret); - ret = false; - } - enable_irq_wake(gpio_cfg.irq_ant_det); - } else { - disable_irq_wake(gpio_cfg.irq_ant_det); - free_irq(gpio_cfg.irq_ant_det, NULL); - } - - return ret; -} -#endif - -static int tdmb_probe(struct platform_device *pdev) -{ - int ret; - struct device *tdmb_dev; - struct tdmb_platform_data *p = pdev->dev.platform_data; - - DPRINTK("call tdmb_probe\n"); - - ret = register_chrdev(TDMB_DEV_MAJOR, TDMB_DEV_NAME, &tdmb_ctl_fops); - if (ret < 0) - DPRINTK("register_chrdev(TDMB_DEV) failed!\n"); - - tdmb_class = class_create(THIS_MODULE, TDMB_DEV_NAME); - if (IS_ERR(tdmb_class)) { - unregister_chrdev(TDMB_DEV_MAJOR, TDMB_DEV_NAME); - class_destroy(tdmb_class); - DPRINTK("class_create failed!\n"); - - return -EFAULT; - } - - tdmb_dev = device_create(tdmb_class, NULL, - MKDEV(TDMB_DEV_MAJOR, TDMB_DEV_MINOR), - NULL, TDMB_DEV_NAME); - if (IS_ERR(tdmb_dev)) { - DPRINTK("device_create failed!\n"); - - unregister_chrdev(TDMB_DEV_MAJOR, TDMB_DEV_NAME); - class_destroy(tdmb_class); - - return -EFAULT; - } - - memcpy(&gpio_cfg, p, sizeof(struct tdmb_platform_data)); - - tdmb_init_bus(); - tdmbdrv_func = tdmb_get_drv_func(); - if (tdmbdrv_func->init) - tdmbdrv_func->init(); - -#if TDMB_PRE_MALLOC - tdmb_make_ring_buffer(); -#endif -#ifdef CONFIG_MACH_C1 - wake_lock_init(&tdmb_wlock, WAKE_LOCK_SUSPEND, "tdmb_wlock"); -#endif - -#if defined(CONFIG_TDMB_ANT_DET) - if (!tdmb_ant_det_reg_input(pdev)) - goto err_reg_input; - if (!tdmb_ant_det_create_wq()) - goto free_reg_input; - if (!tdmb_ant_det_irq_set(true)) - goto free_ant_det_wq; - - return 0; - -free_ant_det_wq: - tdmb_ant_det_destroy_wq(); -free_reg_input: - tdmb_ant_det_unreg_input(); -err_reg_input: - return -EFAULT; -#else - return 0; -#endif - -} - -static int tdmb_remove(struct platform_device *pdev) -{ - DPRINTK("tdmb_remove!\n"); -#if defined(CONFIG_TDMB_ANT_DET) - tdmb_ant_det_unreg_input(); - tdmb_ant_det_destroy_wq(); - tdmb_ant_det_irq_set(false); -#endif - return 0; -} - -static int tdmb_suspend(struct platform_device *pdev, pm_message_t mesg) -{ - return 0; -} - -static int tdmb_resume(struct platform_device *pdev) -{ - return 0; -} - -static struct platform_driver tdmb_driver = { - .probe = tdmb_probe, - .remove = tdmb_remove, - .suspend = tdmb_suspend, - .resume = tdmb_resume, - .driver = { - .owner = THIS_MODULE, - .name = "tdmb" - }, -}; - -static int __init tdmb_init(void) -{ - int ret; - -#ifdef CONFIG_BATTERY_SEC - if (is_lpcharging_state()) { - pr_info("%s : LPM Charging Mode! return 0\n", __func__); - return 0; - } -#endif - - DPRINTK("<klaatu TDMB> module init\n"); - ret = platform_driver_register(&tdmb_driver); - if (ret) - return ret; - - return 0; -} - -static void __exit tdmb_exit(void) -{ - DPRINTK("<klaatu TDMB> module exit\n"); -#if TDMB_PRE_MALLOC - if (ts_ring != 0) { - kfree(ts_ring); - ts_ring = 0; - } -#endif - unregister_chrdev(TDMB_DEV_MAJOR, "tdmb"); - device_destroy(tdmb_class, MKDEV(TDMB_DEV_MAJOR, TDMB_DEV_MINOR)); - class_destroy(tdmb_class); - - platform_driver_unregister(&tdmb_driver); - - tdmb_exit_bus(); -#ifdef CONFIG_MACH_C1 - wake_lock_destroy(&tdmb_wlock); -#endif -} - -module_init(tdmb_init); -module_exit(tdmb_exit); - -MODULE_AUTHOR("Samsung"); -MODULE_DESCRIPTION("TDMB Driver"); -MODULE_LICENSE("GPL v2"); diff --git a/drivers/media/tdmb/tdmb.h b/drivers/media/tdmb/tdmb.h deleted file mode 100644 index dc893dc..0000000 --- a/drivers/media/tdmb/tdmb.h +++ /dev/null @@ -1,181 +0,0 @@ -/* -* -* drivers/media/tdmb/tdmb.h -* -* tdmb driver -* -* Copyright (C) (2011, Samsung Electronics) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#ifndef _TDMB_H_ -#define _TDMB_H_ - -#include <linux/types.h> -#include <linux/irq.h> -#include <linux/interrupt.h> -#include <mach/tdmb_pdata.h> -#include <mach/gpio.h> - - -#define TDMB_DEBUG - -#ifdef TDMB_DEBUG -#define DPRINTK(x...) printk(KERN_DEBUG "TDMB " x) -#else -#define DPRINTK(x...) /* null */ -#endif - -#define TDMB_DEV_NAME "tdmb" -#define TDMB_DEV_MAJOR 225 -#define TDMB_DEV_MINOR 0 - -#define DMB_TS_SIZE 188 - -#define TDMB_RING_BUFFER_SIZE (188 * 150 + 4 + 4) -#define TDMB_RING_BUFFER_MAPPING_SIZE \ - (((TDMB_RING_BUFFER_SIZE - 1) / PAGE_SIZE + 1) * PAGE_SIZE) - -/* commands */ -#define IOCTL_MAGIC 't' -#define IOCTL_MAXNR 32 - -#define IOCTL_TDMB_GET_DATA_BUFFSIZE _IO(IOCTL_MAGIC, 0) -#define IOCTL_TDMB_GET_CMD_BUFFSIZE _IO(IOCTL_MAGIC, 1) -#define IOCTL_TDMB_POWER_ON _IO(IOCTL_MAGIC, 2) -#define IOCTL_TDMB_POWER_OFF _IO(IOCTL_MAGIC, 3) -#define IOCTL_TDMB_SCAN_FREQ_ASYNC _IO(IOCTL_MAGIC, 4) -#define IOCTL_TDMB_SCAN_FREQ_SYNC _IO(IOCTL_MAGIC, 5) -#define IOCTL_TDMB_SCANSTOP _IO(IOCTL_MAGIC, 6) -#define IOCTL_TDMB_ASSIGN_CH _IO(IOCTL_MAGIC, 7) -#define IOCTL_TDMB_GET_DM _IO(IOCTL_MAGIC, 8) -#define IOCTL_TDMB_ASSIGN_CH_TEST _IO(IOCTL_MAGIC, 9) - -struct tdmb_dm { - unsigned int rssi; - unsigned int ber; - unsigned int per; - unsigned int antenna; -} ; - -#define SUB_CH_NUM_MAX 64 - -#define ENSEMBLE_LABEL_MAX 16 -#define SVC_LABEL_MAX 16 - -enum { - TMID_MSC_STREAM_AUDIO = 0x00, - TMID_MSC_STREAM_DATA = 0x01, - TMID_FIDC = 0x02, - TMID_MSC_PACKET_DATA = 0x03 -}; - -enum { - DSCTy_TDMB = 0x18, - /* Used for All-Zero Test */ - DSCTy_UNSPECIFIED = 0x00 -}; - -struct sub_ch_info_type { - /* Sub Channel Information */ - unsigned char sub_ch_id; /* 6 bits */ - unsigned short start_addr; /* 10 bits */ - - /* FIG 0/2 */ - unsigned char tmid; /* 2 bits */ - unsigned char svc_type; /* 6 bits */ - unsigned long svc_id; /* 16/32 bits */ - unsigned char svc_label[SVC_LABEL_MAX+1]; /* 16*8 bits */ -} ; - -struct ensemble_info_type { - unsigned long ensem_freq; /* 4 bytes */ - unsigned char tot_sub_ch; /* MAX: 64 */ - - unsigned short ensem_id; - unsigned char ensem_label[ENSEMBLE_LABEL_MAX+1]; - struct sub_ch_info_type sub_ch[SUB_CH_NUM_MAX]; -} ; - - -#define TDMB_CMD_START_FLAG 0x7F -#define TDMB_CMD_END_FLAG 0x7E -#define TDMB_CMD_SIZE 30 - -/* Result Value */ -#define DMB_FIC_RESULT_FAIL 0x00 -#define DMB_FIC_RESULT_DONE 0x01 -#define DMB_TS_PACKET_RESYNC 0x02 - -int tdmb_init_bus(void); -void tdmb_exit_bus(void); -irqreturn_t tdmb_irq_handler(int irq, void *dev_id); -unsigned long tdmb_get_chinfo(void); -void tdmb_pull_data(struct work_struct *work); -bool tdmb_control_irq(bool set); -void tdmb_control_gpio(bool poweron); -bool tdmb_create_workqueue(void); -bool tdmb_destroy_workqueue(void); -bool tdmb_create_databuffer(unsigned long int_size); -void tdmb_destroy_databuffer(void); -void tdmb_init_data(void); -unsigned char tdmb_make_result -( - unsigned char cmd, - unsigned short data_len, - unsigned char *data -); -bool tdmb_store_data(unsigned char *data, unsigned long len); - -struct tdmb_drv_func { - bool (*init) (void); - bool (*power_on) (void); - void (*power_off) (void); - bool (*scan_ch) (struct ensemble_info_type *ensembleInfo, - unsigned long freq); - void (*get_dm) (struct tdmb_dm *info); - bool (*set_ch) (unsigned long freq, unsigned char subchid, - bool factory_test); - void (*pull_data) (void); - unsigned long (*get_int_size) (void); -}; - -extern unsigned int get_hw_rev(void); - -extern unsigned int *tdmb_ts_head; -extern unsigned int *tdmb_ts_tail; -extern char *tdmb_ts_buffer; -extern unsigned int tdmb_ts_size; - -#if defined(CONFIG_TDMB_T3900) || defined(CONFIG_TDMB_T39F0) -struct tdmb_drv_func *t3900_drv_func(void); -#endif -#if defined(CONFIG_TDMB_FC8050) -struct tdmb_drv_func *fc8050_drv_func(void); -#endif -#if defined(CONFIG_TDMB_MTV318) -struct tdmb_drv_func *mtv318_drv_func(void); -#endif -#if defined(CONFIG_TDMB_TCC3170) -struct tdmb_drv_func *tcc3170_drv_func(void); -extern struct tcbd_fic_ensbl *tcbd_fic_get_ensbl_info(s32 _disp); -#endif - -#if defined(CONFIG_TDMB_SPI) -struct spi_device *tdmb_get_spi_handle(void); -#endif - -#ifdef CONFIG_BATTERY_SEC -extern unsigned int is_lpcharging_state(void); -#endif - -#endif diff --git a/drivers/media/tdmb/tdmb_data.c b/drivers/media/tdmb/tdmb_data.c deleted file mode 100644 index 6f11ff8..0000000 --- a/drivers/media/tdmb/tdmb_data.c +++ /dev/null @@ -1,463 +0,0 @@ -/* -* -* drivers/media/tdmb/tdmb_data.c -* -* tdmb driver -* -* Copyright (C) (2011, Samsung Electronics) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include <linux/kernel.h> -#include <linux/fs.h> -#include <linux/errno.h> -#include <linux/device.h> -#include <linux/platform_device.h> -#include <linux/init.h> -#include <linux/module.h> -#include <linux/string.h> - -#include <linux/types.h> -#include <linux/fcntl.h> - -/* for delay(sleep) */ -#include <linux/delay.h> - -/* for mutex */ -#include <linux/mutex.h> - -/*using copy to user */ -#include <linux/uaccess.h> -#include <linux/clk.h> -#include <linux/mm.h> -#include <linux/slab.h> - -#include <linux/workqueue.h> -#include <linux/irq.h> -#include <asm/mach/irq.h> -#include <linux/interrupt.h> -#include <linux/vmalloc.h> - -#include <linux/io.h> -#include <mach/gpio.h> - -#include "tdmb.h" - -#define TS_PACKET_SIZE 188 -#define MSC_BUF_SIZE 1024 - -static unsigned char *msc_buff; -static unsigned char *ts_buff; - -static int ts_buff_size; -static int first_packet = 1; -static int ts_buff_pos; -static int msc_buff_pos; -static int mp2_len; -static const int bitrate_table[2][16] = { - /* MPEG1 for id=1*/ - {0, 32, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 256, 320, 384, 0}, - /* MPEG2 for id=0 */ - {0, 8, 16, 24, 32, 40, 48, 56, 64, 80, 96, 112, 128, 144, 160, 0} -}; - -static struct workqueue_struct *tdmb_workqueue; -static DECLARE_WORK(tdmb_work, tdmb_pull_data); - -irqreturn_t tdmb_irq_handler(int irq, void *dev_id) -{ - int ret = 0; - - if (tdmb_workqueue) { - ret = queue_work(tdmb_workqueue, &tdmb_work); - if (ret == 0) - DPRINTK("failed in queue_work\n"); - } - - return IRQ_HANDLED; -} - -bool tdmb_create_databuffer(unsigned long int_size) -{ - ts_buff_size = int_size * 2; - - msc_buff = vmalloc(MSC_BUF_SIZE); - ts_buff = vmalloc(ts_buff_size); - - if (msc_buff && ts_buff) { - return true; - } else { - if (msc_buff) - vfree(msc_buff); - if (ts_buff) - vfree(ts_buff); - - return false; - } -} - -void tdmb_destroy_databuffer(void) -{ - vfree(msc_buff); - vfree(ts_buff); -} - -bool tdmb_create_workqueue(void) -{ - tdmb_workqueue = create_singlethread_workqueue("ktdmbd"); - if (tdmb_workqueue) - return true; - else - return false; -} - -bool tdmb_destroy_workqueue(void) -{ - if (tdmb_workqueue) { - flush_workqueue(tdmb_workqueue); - destroy_workqueue(tdmb_workqueue); - tdmb_workqueue = NULL; - } - return true; -} - -void tdmb_init_data(void) -{ - first_packet = 1; - ts_buff_pos = 0; - msc_buff_pos = 0; - mp2_len = 0; -} - -static int __add_to_ringbuffer(unsigned char *data, unsigned long data_size) -{ - int ret = 0; - unsigned int size; - unsigned int head; - unsigned int tail; - unsigned int dist; - unsigned int temp_size; - - if (tdmb_ts_size == 0) - return 0; - - size = data_size; - head = *tdmb_ts_head; - tail = *tdmb_ts_tail; - - if (size > tdmb_ts_size) { - DPRINTK("Error - size too large\n"); - } else { - if (head >= tail) - dist = head-tail; - else - dist = tdmb_ts_size+head-tail; - - /* DPRINTK("dist: %x\n", dist); */ - - if ((tdmb_ts_size-dist) < size) { - DPRINTK("small space is left in ring(len:%d/free:%d)\n", - size, (tdmb_ts_size-dist)); - DPRINTK("ts_head:0x%x, ts_tail:0x%x/head:%d,tail:%d\n", - (unsigned int)tdmb_ts_head, - (unsigned int)tdmb_ts_tail, - (unsigned int)head, tail); - } else { - if (head+size <= tdmb_ts_size) { - memcpy((tdmb_ts_buffer+head), - (char *)data, size); - - head += size; - if (head == tdmb_ts_size) - head = 0; - } else { - temp_size = tdmb_ts_size-head; - temp_size = (temp_size/DMB_TS_SIZE)*DMB_TS_SIZE; - - if (temp_size > 0) - memcpy((tdmb_ts_buffer+head), - (char *)data, temp_size); - - memcpy(tdmb_ts_buffer, - (char *)(data+temp_size), - size-temp_size); - head = size-temp_size; - } - - /* - * DPRINTK("< data > %x, %x, %x, %x\n", - * *(tdmb_ts_buffer+ *tdmb_ts_head), - * *(tdmb_ts_buffer+ *tdmb_ts_head +1), - * *(tdmb_ts_buffer+ *tdmb_ts_head +2), - * *(tdmb_ts_buffer+ *tdmb_ts_head +3) ); - - * DPRINTK("exiting - head : %d\n",head); - */ - - *tdmb_ts_head = head; - } - } - - return ret; -} - - -static int __add_ts_data(unsigned char *data, unsigned long data_size) -{ - int j = 0; - int maxi = 0; - if (first_packet) { - DPRINTK("! first sync Size = %ld !\n", data_size); - - for (j = 0; j < data_size; j++) { - if (data[j] == 0x47) { - DPRINTK("!!!!! first sync j = %d !!!!!\n", j); - maxi = (data_size - j) / TS_PACKET_SIZE; - ts_buff_pos = (data_size - j) % TS_PACKET_SIZE; - __add_to_ringbuffer(&data[j], - maxi * TS_PACKET_SIZE); - if (ts_buff_pos > 0) - memcpy(ts_buff, - &data[j+maxi*TS_PACKET_SIZE], - ts_buff_pos); - first_packet = 0; - return 0; - } - } - } else { - maxi = (data_size) / TS_PACKET_SIZE; - - if (ts_buff_pos > 0) { - if (data[TS_PACKET_SIZE - ts_buff_pos] != 0x47) { - DPRINTK("! error 0x%x,0x%x !\n", - data[TS_PACKET_SIZE - ts_buff_pos], - data[TS_PACKET_SIZE - ts_buff_pos + 1]); - - memset(ts_buff, 0, ts_buff_size); - ts_buff_pos = 0; - first_packet = 1; - return -EPERM; - } - - memcpy(&ts_buff[ts_buff_pos], - data, TS_PACKET_SIZE-ts_buff_pos); - __add_to_ringbuffer(ts_buff, TS_PACKET_SIZE); - __add_to_ringbuffer(&data[TS_PACKET_SIZE - ts_buff_pos], - data_size - TS_PACKET_SIZE); - memcpy(ts_buff, - &data[data_size-ts_buff_pos], - ts_buff_pos); - } else { - if (data[0] != 0x47) { - DPRINTK("!! error 0x%x,0x%x!!\n", - data[0], - data[1]); - - memset(ts_buff, 0, ts_buff_size); - ts_buff_pos = 0; - first_packet = 1; - return -EPERM; - } - - __add_to_ringbuffer(data, data_size); - } - } - return 0; -} - -static int __get_mp2_len(unsigned char *pkt) -{ - int id; - int layer_index; - int bitrate_index; - int fs_index; - int samplerate; - int protection; - int bitrate; - int length; - - id = (pkt[1]>>3)&0x01; /* 1: ISO/IEC 11172-3, 0:ISO/IEC 13818-3 */ - layer_index = (pkt[1]>>1)&0x03; /* 2 */ - protection = pkt[1]&0x1; -/* - if (protection != 0) { - ; - } -*/ - bitrate_index = (pkt[2]>>4); - fs_index = (pkt[2]>>2)&0x3; /* 1 */ - - /* sync word check */ - if (pkt[0] == 0xff && (pkt[1]>>4) == 0xf) { - if ((bitrate_index > 0 && bitrate_index < 15) - && (layer_index == 2) && (fs_index == 1)) { - - if (id == 1 && layer_index == 2) { - /* Fs==48 KHz*/ - bitrate = 1000*bitrate_table[0][bitrate_index]; - samplerate = 48000; - } else if (id == 0 && layer_index == 2) { - /* Fs=24 KHz */ - bitrate = 1000*bitrate_table[1][bitrate_index]; - samplerate = 24000; - } else - return -EPERM; - - } else - return -EPERM; - } else - return -EPERM; - - if ((pkt[2]&0x02) != 0) { /* padding bit */ - return -EPERM; - } - - length = (144*bitrate)/(samplerate); - - return length; -} - -static int -__add_msc_data(unsigned char *data, unsigned long data_size, int sub_ch_id) -{ - int j; - int readpos = 0; - unsigned char pOutAddr[TS_PACKET_SIZE]; - int remainbyte = 0; - static int first = 1; - - if (first_packet) { - for (j = 0; j < data_size-4; j++) { - if (data[j] == 0xFF && ((data[j+1]>>4) == 0xF)) { - mp2_len = __get_mp2_len(&data[j]); - DPRINTK("first sync mp2_len= %d\n", mp2_len); - if (mp2_len <= 0 || mp2_len > MSC_BUF_SIZE) - return -EPERM; - - memcpy(msc_buff, &data[j], data_size-j); - msc_buff_pos = data_size-j; - first_packet = 0; - first = 1; - return 0; - } - } - } else { - if (mp2_len <= 0 || mp2_len > MSC_BUF_SIZE) { - msc_buff_pos = 0; - first_packet = 1; - return -EPERM; - } - - remainbyte = data_size; - if ((mp2_len-msc_buff_pos) >= data_size) { - memcpy(msc_buff+msc_buff_pos, data, data_size); - msc_buff_pos += data_size; - remainbyte = 0; - } else if (mp2_len-msc_buff_pos > 0) { - memcpy(msc_buff+msc_buff_pos, - data, (mp2_len - msc_buff_pos)); - remainbyte = data_size - (mp2_len - msc_buff_pos); - msc_buff_pos = mp2_len; - } - - if (msc_buff_pos == mp2_len) { - while (msc_buff_pos > readpos) { - if (first) { - pOutAddr[0] = 0xDF; - pOutAddr[1] = 0xDF; - pOutAddr[2] = (sub_ch_id<<2); - pOutAddr[2] |= - (((msc_buff_pos>>3)>>8)&0x03); - pOutAddr[3] = (msc_buff_pos>>3)&0xFF; - - if (!(msc_buff[0] == 0xFF - && ((msc_buff[1]>>4) == 0xF))) { - DPRINTK("!!error 0x%x,0x%x!!\n", - msc_buff[0], - msc_buff[1]); - memset(msc_buff, - 0, - MSC_BUF_SIZE); - msc_buff_pos = 0; - first_packet = 1; - return -EPERM; - } - - memcpy(pOutAddr+4, msc_buff, 184); - readpos = 184; - first = 0; - } else { - pOutAddr[0] = 0xDF; - pOutAddr[1] = 0xD0; - if (msc_buff_pos-readpos >= 184) { - memcpy(pOutAddr+4, - msc_buff+readpos, - 184); - readpos += 184; - } else { - memcpy(pOutAddr+4, - msc_buff+readpos, - msc_buff_pos-readpos); - readpos - += (msc_buff_pos-readpos); - } - } - __add_to_ringbuffer(pOutAddr, TS_PACKET_SIZE); - } - - first = 1; - msc_buff_pos = 0; - if (remainbyte > 0) { - memcpy(msc_buff - , data+data_size-remainbyte - , remainbyte); - msc_buff_pos = remainbyte; - } - } else if (msc_buff_pos > mp2_len) { - DPRINTK("! Error msc_buff_pos=%d, mp2_len =%d!\n", - msc_buff_pos, mp2_len); - memset(msc_buff, 0, MSC_BUF_SIZE); - msc_buff_pos = 0; - first_packet = 1; - return -EPERM; - } - } - - return 0; -} - -bool tdmb_store_data(unsigned char *data, unsigned long len) -{ - unsigned long i; - unsigned long maxi; - unsigned long subch_id = tdmb_get_chinfo(); - - if (subch_id == 0) { - return false; - } else { - subch_id = subch_id % 1000; - - if (subch_id >= 64) { - __add_ts_data(data, len); - } else { - maxi = len/TS_PACKET_SIZE; - for (i = 0 ; i < maxi ; i++) { - __add_msc_data(data, TS_PACKET_SIZE, subch_id); - data += TS_PACKET_SIZE; - } - if (len - maxi * TS_PACKET_SIZE) - __add_msc_data(data,\ - len - maxi * TS_PACKET_SIZE, subch_id); - } - return true; - } -} diff --git a/drivers/media/tdmb/tdmb_ebi.c b/drivers/media/tdmb/tdmb_ebi.c deleted file mode 100644 index 36c86f7..0000000 --- a/drivers/media/tdmb/tdmb_ebi.c +++ /dev/null @@ -1,36 +0,0 @@ -/* -* -* drivers/media/tdmb/tdmb_ebi.c -* -* tdmb driver -* -* Copyright (C) (2011, Samsung Electronics) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include <linux/io.h> -#include "tdmb.h" - -#define TDMB_BASE_ADDR_PHYS 0x98000000 -void *addr_tdmb_cs4_v; - -int tdmb_init_bus(void) -{ - addr_tdmb_cs4_v = ioremap(TDMB_BASE_ADDR_PHYS, PAGE_SIZE); - DPRINTK("TDMB EBI2 Init addr_tdmb_cs4_v(0x%x)\n", addr_tdmb_cs4_v); - return 0; -} - -void tdmb_exit_bus(void) -{ - addr_tdmb_cs4_v = NULL; -} diff --git a/drivers/media/tdmb/tdmb_port_fc8050.c b/drivers/media/tdmb/tdmb_port_fc8050.c deleted file mode 100644 index 639a648..0000000 --- a/drivers/media/tdmb/tdmb_port_fc8050.c +++ /dev/null @@ -1,220 +0,0 @@ -/* -* -* drivers/media/tdmb/tdmb_port_fc8050.c -* -* tdmb driver -* -* Copyright (C) (2011, Samsung Electronics) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/device.h> -#include <linux/init.h> -#include <linux/types.h> -#include <linux/fcntl.h> - -#include <linux/workqueue.h> -#include <linux/irq.h> -#include <linux/interrupt.h> -#include <linux/io.h> - -#include <linux/fs.h> -#include <linux/uaccess.h> - -#include <linux/time.h> -#include <linux/timer.h> - -#include <linux/vmalloc.h> - -#include "tdmb.h" -#include "dmbdrv_wrap_fc8050.h" - -static bool fc8050_on_air; -static bool fc8050_pwr_on; - -static bool __get_ensemble_info(struct ensemble_info_type *e_info - , unsigned long freq) -{ - int i; - int j; - int sub_i = 0; - int cnt; - const char *ensembleName = NULL; - struct sub_channel_info_type *fci_sub_info; - - DPRINTK("%s : freq(%ld)\n", __func__, freq); - - e_info->tot_sub_ch - = dmb_drv_get_dmb_sub_ch_cnt() + dmb_drv_get_dab_sub_ch_cnt(); - DPRINTK("total subchannel number : %d\n", e_info->tot_sub_ch); - - if (e_info->tot_sub_ch > 0) { - ensembleName = (char *)dmb_drv_get_ensemble_label(); - - if (ensembleName) - strncpy((char *)e_info->ensem_label, - (char *)ensembleName, - ENSEMBLE_LABEL_MAX); - - e_info->ensem_freq = freq; - - for (i = 0; i < 2; i++) { - cnt = (i == 0) - ? dmb_drv_get_dmb_sub_ch_cnt() - : dmb_drv_get_dab_sub_ch_cnt(); - - for (j = 0; j < cnt; j++, sub_i++) { - fci_sub_info = (i == 0) - ? dmb_drv_get_fic_dmb(j) - : dmb_drv_get_fic_dab(j); - - e_info->ensem_id - = fci_sub_info->uiEnsembleID; - e_info->sub_ch[sub_i].sub_ch_id - = fci_sub_info->ucSubchID; - e_info->sub_ch[sub_i].start_addr - = fci_sub_info->uiStartAddress; - e_info->sub_ch[sub_i].tmid - = fci_sub_info->ucTMId; - e_info->sub_ch[sub_i].svc_type - = fci_sub_info->ucServiceType; - e_info->sub_ch[sub_i].svc_id - = fci_sub_info->ulServiceID; - if (i == 0) - memcpy( - e_info->sub_ch[sub_i].svc_label, - dmb_drv_get_sub_ch_dmb_label(j), - SVC_LABEL_MAX); - else - memcpy(e_info->sub_ch[sub_i].svc_label, - dmb_drv_get_sub_ch_dab_label(j), - SVC_LABEL_MAX); - - } - } - return true; - } else { - return false; - } -} - -static void fc8050_power_off(void) -{ - DPRINTK("call TDMB_PowerOff !\n"); - - if (fc8050_pwr_on) { - fc8050_on_air = false; - - dmb_drv_deinit(); - - tdmb_control_irq(false); - tdmb_control_gpio(false); - - fc8050_pwr_on = false; - } -} - -static bool fc8050_power_on(void) -{ - DPRINTK("fc8050_power_on\n"); - - if (fc8050_pwr_on) { - return true; - } else { - tdmb_control_gpio(true); - - if (dmb_drv_init() == TDMB_FAIL) { - tdmb_control_gpio(false); - return false; - } else { - tdmb_control_irq(true); - fc8050_pwr_on = true; - return true; - } - } -} -static void fc8050_get_dm(struct tdmb_dm *info) -{ - if (fc8050_pwr_on == true && fc8050_on_air == true) { - info->rssi = dmb_drv_get_rssi(); - info->ber = dmb_drv_get_ber(); - info->antenna = dmb_drv_get_ant(); - info->per = 0; - } else { - info->rssi = 100; - info->ber = 2000; - info->per = 0; - info->antenna = 0; - } -} - -static bool fc8050_set_ch(unsigned long freq, - unsigned char sub_ch_id, - bool factory_test) -{ - unsigned long freq_temp = freq / 1000; - unsigned char sub_ch_id_temp = sub_ch_id % 1000; - unsigned char svc_type_temp = 0x0; - - if (sub_ch_id_temp >= 64) { - sub_ch_id_temp -= 64; - svc_type_temp = 0x18; - } - - DPRINTK("fc8050_set_ch freq:%ld, sub_ch_id:%d, svc_type:%d\n", - freq_temp, sub_ch_id_temp, svc_type_temp); - - fc8050_on_air = false; - - if (dmb_drv_set_ch(freq_temp, sub_ch_id_temp, svc_type_temp) == 1) { - DPRINTK("dmb_drv_set_ch Success\n"); - fc8050_on_air = true; - return true; - } else { - DPRINTK("dmb_drv_set_ch Fail\n"); - return false; - } -} - -static bool fc8050_scan_ch(struct ensemble_info_type *e_info - , unsigned long freq) -{ - if (fc8050_pwr_on == false || e_info == NULL) - return false; - else if (dmb_drv_scan_ch((freq / 1000)) == TDMB_SUCCESS) - return __get_ensemble_info(e_info, freq); - else - return false; -} - -static unsigned long fc8050_int_size(void) -{ - return 188*40; -} - -static struct tdmb_drv_func fci_fc8050_drv_func = { - .power_on = fc8050_power_on, - .power_off = fc8050_power_off, - .scan_ch = fc8050_scan_ch, - .get_dm = fc8050_get_dm, - .set_ch = fc8050_set_ch, - .pull_data = dmb_drv_isr, - .get_int_size = fc8050_int_size, -}; - -struct tdmb_drv_func *fc8050_drv_func(void) -{ - DPRINTK("tdmb_get_drv_func : fc8050\n"); - return &fci_fc8050_drv_func; -} diff --git a/drivers/media/tdmb/tdmb_port_mtv318.c b/drivers/media/tdmb/tdmb_port_mtv318.c deleted file mode 100644 index aa29a9b..0000000 --- a/drivers/media/tdmb/tdmb_port_mtv318.c +++ /dev/null @@ -1,257 +0,0 @@ -/* -* -* drivers/media/tdmb/tdmb_port_mtv318.c -* -* tdmb driver -* -* Copyright (C) (2011, Samsung Electronics) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/device.h> -#include <linux/init.h> -#include <linux/types.h> -#include <linux/fcntl.h> - -#include <linux/workqueue.h> -#include <linux/irq.h> -#include <linux/interrupt.h> -#include <linux/io.h> - -#include <linux/fs.h> -#include <linux/uaccess.h> - -#include <linux/time.h> -#include <linux/timer.h> - -#include <linux/vmalloc.h> - -#include "raontv.h" -#include "raontv_internal.h" -#include "raontv_ficdec_internal.h" -#include "raontv_ficdec.h" - -#include "tdmb.h" - -#define MTV318_INTERRUPT_SIZE (188*10) -/* #define TDMB_DEBUG_SCAN */ - -static bool mtv318_on_air; -static bool mtv318_pwr_on; -static unsigned char stream_buff[MTV318_INTERRUPT_SIZE + 1]; - -static void __print_ensemble_info(struct ensemble_info_type *e_info) -{ - int i = 0; - - DPRINTK("ensem_freq(%ld)\n", e_info->ensem_freq); - DPRINTK("ensem_label(%s)\n", e_info->ensem_label); - for (i = 0; i < e_info->tot_sub_ch; i++) { - DPRINTK("sub_ch_id(0x%x)\n", e_info->sub_ch[i].sub_ch_id); - DPRINTK("start_addr(0x%x)\n", e_info->sub_ch[i].start_addr); - DPRINTK("tmid(0x%x)\n", e_info->sub_ch[i].tmid); - DPRINTK("svc_type(0x%x)\n", e_info->sub_ch[i].svc_type); - DPRINTK("svc_label(%s)\n", e_info->sub_ch[i].svc_label); - } -} - -static bool __get_ensemble_info(struct ensemble_info_type *e_info - , unsigned long freq) -{ - DPRINTK("%s\n", __func__); - memcpy(e_info, - rtvFICDEC_GetEnsembleInfo(freq), - sizeof(struct ensemble_info_type)); - - if (e_info->tot_sub_ch) { -#ifdef TDMB_DEBUG_SCAN - __print_ensemble_info(e_info); -#endif - return true; - } else { - return false; - } -} - -static void mtv318_power_off(void) -{ - DPRINTK("mtv318_power_off\n"); - - if (mtv318_pwr_on) { - mtv318_on_air = false; - tdmb_control_irq(false); - tdmb_control_gpio(false); - - mtv318_pwr_on = false; - - RTV_GUARD_DEINIT; - } -} - -static bool mtv318_power_on(void) -{ - DPRINTK("mtv318_power_on\n"); - - if (mtv318_pwr_on) { - return true; - } else { - tdmb_control_gpio(true); - - if (rtvTDMB_Initialize(RTV_COUNTRY_BAND_KOREA) != RTV_SUCCESS) { - tdmb_control_gpio(false); - return false; - } else { - tdmb_control_irq(true); - mtv318_pwr_on = true; - return true; - } - } -} - -static void mtv318_get_dm(struct tdmb_dm *info) -{ - if (mtv318_pwr_on == true && mtv318_on_air == true) { - info->rssi = (rtvTDMB_GetRSSI() / RTV_TDMB_RSSI_DIVIDER); - info->per = rtvTDMB_GetPER(); - info->ber = rtvTDMB_GetCER(); - info->antenna = rtvTDMB_GetAntennaLevel(info->ber); - } else { - info->rssi = 100; - info->ber = 2000; - info->per = 0; - info->antenna = 0; - } -} - -static bool mtv318_set_ch(unsigned long freq - , unsigned char subchid - , bool factory_test) -{ - bool ret = false; - enum E_RTV_TDMB_SERVICE_TYPE eServiceType; - - DPRINTK("%s : %ld %d\n", __func__, freq, subchid); - - if (mtv318_pwr_on) { - if (subchid >= 64) { - subchid -= 64; - eServiceType = RTV_TDMB_SERVICE_VIDEO; - } else { - eServiceType = RTV_TDMB_SERVICE_AUDIO; - } - - ret = rtvTDMB_OpenSubChannel((freq/1000), - subchid, - eServiceType, - MTV318_INTERRUPT_SIZE); - if (ret == RTV_SUCCESS || ret == RTV_NO_MORE_SUB_CHANNEL) { - mtv318_on_air = true; - ret = TRUE; - DPRINTK("mtv318_set_ch Success\n"); - } else { - DPRINTK("mtv318_set_ch Fail\n"); - } - } - - return ret; -} - -static bool mtv318_scan_ch(struct ensemble_info_type *e_info - , unsigned long freq) -{ - bool ret = false; - - if (mtv318_pwr_on == true && e_info != NULL) { - if (rtvTDMB_ScanFrequency(freq/1000) == RTV_SUCCESS) { - rtvTDMB_OpenFIC(); - ret = rtvFICDEC_Decode(freq/1000); - rtvTDMB_CloseFIC(); - if (ret == true) - __get_ensemble_info(e_info, (freq)); - } - } - - return ret; -} - -static void mtv318_pull_data(void) -{ - unsigned char int_type_val1; - unsigned char int_type_val2; - - RTV_GUARD_LOCK; - - RTV_REG_MAP_SEL(DD_PAGE); - int_type_val1 = RTV_REG_GET(INT_E_STATL); - int_type_val2 = RTV_REG_GET(INT_E_STATH); - - /*=========================================== - * Processing MSC1 interrupt. - * T-DMB/DAB: 1 VIDEO data or 1 AUDIO data - * 1 seg: 1 VIDEO data - * FM: PCM data - *===========================================*/ - /* MSC1 memory overflow or under run */ - if (int_type_val1&(MSC1_E_INT|MSC1_E_OVER_FLOW|MSC1_E_UNDER_FLOW)) { - if (int_type_val1 & (MSC1_E_OVER_FLOW|MSC1_E_UNDER_FLOW)) { - rtv_ClearAndSetupMemory_MSC1(); - /* MSC1 Interrupt status clear */ - RTV_REG_SET(INT_E_UCLRL, 0x04); - DPRINTK("%s : int_type 0x%x\n", - __func__, int_type_val1); - } else { - /* Get the frame data using CPU or DMA. - RTV_REG_BURST_GET() macro should implemented by user. */ - RTV_REG_MAP_SEL(MSC1_PAGE); - RTV_REG_BURST_GET(0x10, stream_buff, - MTV318_INTERRUPT_SIZE+1); - - RTV_REG_MAP_SEL(DD_PAGE); - /* MSC1 Interrupt status clear */ - RTV_REG_SET(INT_E_UCLRL, 0x04); - - tdmb_store_data(&stream_buff[1], MTV318_INTERRUPT_SIZE); - } - } - - RTV_GUARD_FREE; -} - -static unsigned long mtv318_int_size(void) -{ - return MTV318_INTERRUPT_SIZE; -} - -static bool mtv318_init(void) -{ - RTV_GUARD_INIT; - return true; -} - -static struct tdmb_drv_func raontech_mtv318_drv_func = { - .init = mtv318_init, - .power_on = mtv318_power_on, - .power_off = mtv318_power_off, - .scan_ch = mtv318_scan_ch, - .get_dm = mtv318_get_dm, - .set_ch = mtv318_set_ch, - .pull_data = mtv318_pull_data, - .get_int_size = mtv318_int_size, -}; - -struct tdmb_drv_func *mtv318_drv_func(void) -{ - DPRINTK("tdmb_get_drv_func : mtv318\n"); - return &raontech_mtv318_drv_func; -} diff --git a/drivers/media/tdmb/tdmb_port_t3900.c b/drivers/media/tdmb/tdmb_port_t3900.c deleted file mode 100644 index ac40d73..0000000 --- a/drivers/media/tdmb/tdmb_port_t3900.c +++ /dev/null @@ -1,291 +0,0 @@ -/* -* -* drivers/media/tdmb/tdmb_port_t3900.c -* -* tdmb driver -* -* Copyright (C) (2011, Samsung Electronics) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/device.h> -#include <linux/init.h> -#include <linux/types.h> -#include <linux/fcntl.h> - -#include <linux/workqueue.h> -#include <linux/irq.h> -#include <linux/interrupt.h> -#include <linux/io.h> - -#include <linux/fs.h> -#include <linux/uaccess.h> - -#include <linux/time.h> -#include <linux/timer.h> - -#include <linux/vmalloc.h> - -#include "tdmb.h" -#include "INC_INCLUDES.h" - -static struct ST_SUBCH_INFO *st_ch_info; -static bool t3900_on_air; -static bool t3900_pwr_on; -static unsigned char stream_buff[INC_INTERRUPT_SIZE+188]; - -static bool __get_ensemble_info(struct ensemble_info_type *e_info - , unsigned long freq) -{ - int i; - int j; - int sub_i = 0; - int cnt; - const char *e_name = NULL; - struct INC_CHANNEL_INFO *inc_sub_info; - - DPRINTK("t3900_get_ensemble_info - freq(%ld)\n", freq); - - e_info->tot_sub_ch = - INTERFACE_GETDMB_CNT() + INTERFACE_GETDAB_CNT(); - DPRINTK("total subchannel number : %d\n" - , e_info->tot_sub_ch); - - if (e_info->tot_sub_ch > 0) { - e_name = - (char *)INTERFACE_GETENSEMBLE_LABEL(TDMB_I2C_ID80); - - if (e_name) - strncpy((char *)e_info->ensem_label, - (char *)e_name, - ENSEMBLE_LABEL_MAX); - - e_info->ensem_freq = freq; - - for (i = 0; i < 2; i++) { - cnt = (i == 0) ? INTERFACE_GETDMB_CNT() - : INTERFACE_GETDAB_CNT(); - - for (j = 0; j < cnt; j++, sub_i++) { - inc_sub_info = (i == 0) - ? INTERFACE_GETDB_DMB(j) - : INTERFACE_GETDB_DAB(j); - e_info->sub_ch[sub_i].sub_ch_id - = inc_sub_info->ucSubChID; - e_info->sub_ch[sub_i].start_addr - = inc_sub_info->uiStarAddr; - e_info->sub_ch[sub_i].tmid - = inc_sub_info->uiTmID; - e_info->sub_ch[sub_i].svc_type - = inc_sub_info->ucServiceType; - e_info->sub_ch[sub_i].svc_id - = inc_sub_info->ulServiceID; - memcpy(e_info->sub_ch[sub_i].svc_label, - inc_sub_info->aucLabel, - SVC_LABEL_MAX); - - } - } - return true; - } else { - return false; - } -} - -static void t3900_power_off(void) -{ - DPRINTK("t3900_power_off\n"); - - if (t3900_pwr_on) { - t3900_on_air = false; - - INC_STOP(TDMB_I2C_ID80); - - tdmb_control_irq(false); - tdmb_control_gpio(false); - - vfree(st_ch_info); - st_ch_info = NULL; - - t3900_pwr_on = false; - } -} - -static bool t3900_power_on(void) -{ - DPRINTK("t3900_power_on\n"); - - if (t3900_pwr_on) { - return true; - } else { - st_ch_info = vmalloc(sizeof(struct ST_SUBCH_INFO)); - if (st_ch_info == NULL) { - return false; - } else { - tdmb_control_gpio(true); - - if (INTERFACE_INIT(TDMB_I2C_ID80) != INC_SUCCESS) { - tdmb_control_gpio(false); - - vfree(st_ch_info); - st_ch_info = NULL; - - return false; - } else { - tdmb_control_irq(true); - t3900_pwr_on = true; - return true; - } - } - } -} - -static void t3900_get_dm(struct tdmb_dm *info) -{ - if (t3900_pwr_on == true && t3900_on_air == true) { - INC_STATUS_CHECK(TDMB_I2C_ID80); - info->rssi = INC_GET_RSSI(TDMB_I2C_ID80); - info->ber = INC_GET_SAMSUNG_BER(TDMB_I2C_ID80); - info->antenna = INC_GET_SAMSUNG_ANT_LEVEL(TDMB_I2C_ID80); - info->per = 0; - } else { - info->rssi = 100; - info->ber = 2000; - info->per = 0; - info->antenna = 0; - } -} - -static bool t3900_set_ch(unsigned long freq - , unsigned char subchid - , bool factory_test) -{ - unsigned char ret_err; - bool ret = false; - - if (t3900_pwr_on) { - st_ch_info->nSetCnt = 1; - st_ch_info->astSubChInfo[0].ulRFFreq = freq / 1000; - st_ch_info->astSubChInfo[0].ucSubChID = subchid; - st_ch_info->astSubChInfo[0].ucServiceType = 0x0; - if (st_ch_info->astSubChInfo[0].ucSubChID >= 64) { - st_ch_info->astSubChInfo[0].ucSubChID -= 64; - st_ch_info->astSubChInfo[0].ucServiceType = 0x18; - } - - t3900_on_air = false; - - if (factory_test == false) - ret_err = INTERFACE_START( - TDMB_I2C_ID80, st_ch_info); - else - ret_err = INTERFACE_START_TEST( - TDMB_I2C_ID80, st_ch_info); - - if (ret_err == INC_SUCCESS) { - /* TODO Ensemble good code .... */ - t3900_on_air = true; - ret = true; - } else if (ret_err == INC_RETRY) { - DPRINTK("IOCTL_TDMB_ASSIGN_CH retry\n"); - - t3900_power_off(); - t3900_power_on(); - - if (factory_test == false) - ret_err = INTERFACE_START( - TDMB_I2C_ID80, st_ch_info); - else - ret_err = INTERFACE_START_TEST( - TDMB_I2C_ID80, st_ch_info); - - if (ret_err == INC_SUCCESS) { - /* TODO Ensemble good code .... */ - t3900_on_air = true; - ret = true; - } - } - } - - return ret; -} - -static bool t3900_scan_ch(struct ensemble_info_type *e_info - , unsigned long freq) -{ - if (t3900_pwr_on == false || e_info == NULL) - return false; - else if (INTERFACE_SCAN(TDMB_I2C_ID80, (freq / 1000)) == INC_SUCCESS) - return __get_ensemble_info(e_info, freq); - else - return false; -} - -static void t3900_pull_data(void) -{ - unsigned short remain_len = INC_INTERRUPT_SIZE; -#if !(INC_INTERRUPT_SIZE <= 0xFFF) - unsigned short idx = 0; - unsigned short spi_size = 0xFFF; -#endif - - memset(stream_buff, 0, sizeof(stream_buff)); - -#if (INC_INTERRUPT_SIZE <= 0xFFF) - INC_CMD_READ_BURST( - TDMB_I2C_ID80, APB_STREAM_BASE - , stream_buff - , remain_len); -#else - while (remain_len) { - if (remain_len >= spi_size) { - INC_CMD_READ_BURST( - TDMB_I2C_ID80, APB_STREAM_BASE - , &stream_buff[idx*spi_size] - , spi_size); - idx++; - remain_len -= spi_size; - } else { - INC_CMD_READ_BURST( - TDMB_I2C_ID80, APB_STREAM_BASE - , &stream_buff[idx*spi_size] - , remain_len); - remain_len = 0; - } - } -#endif - - tdmb_store_data(stream_buff, INC_INTERRUPT_SIZE); -} - -static unsigned long t3900_int_size(void) -{ - return INC_INTERRUPT_SIZE; -} - -static struct tdmb_drv_func inc_t3900_drv_func = { - .power_on = t3900_power_on, - .power_off = t3900_power_off, - .scan_ch = t3900_scan_ch, - .get_dm = t3900_get_dm, - .set_ch = t3900_set_ch, - .pull_data = t3900_pull_data, - .get_int_size = t3900_int_size, -}; - -struct tdmb_drv_func *t3900_drv_func(void) -{ - DPRINTK("tdmb_get_drv_func : t3900\n"); - return &inc_t3900_drv_func; -} diff --git a/drivers/media/tdmb/tdmb_port_tcc3170.c b/drivers/media/tdmb/tdmb_port_tcc3170.c deleted file mode 100644 index b6e6abe..0000000 --- a/drivers/media/tdmb/tdmb_port_tcc3170.c +++ /dev/null @@ -1,478 +0,0 @@ -/* -* -* drivers/media/tdmb/tdmb_port_tcc3170.c -* -* tdmb driver -* -* Copyright (C) (2011, Samsung Electronics) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include <linux/kernel.h> -#include <linux/errno.h> -#include <linux/device.h> -#include <linux/init.h> -#include <linux/types.h> -#include <linux/fcntl.h> - -#include <linux/workqueue.h> -#include <linux/irq.h> -#include <linux/interrupt.h> -#include <linux/io.h> - -#include <linux/fs.h> -#include <linux/uaccess.h> - -#include <linux/time.h> -#include <linux/timer.h> - -#include <linux/vmalloc.h> -#include <linux/delay.h> -#include <linux/sched.h> -#include <linux/wait.h> - -#include "tdmb.h" - -#include "tcpal_os.h" -#include "tcpal_queue.h" - -#include "tcbd_feature.h" -#include "tcbd_api_common.h" -#include "tcbd_drv_io.h" -#include "tcbd_stream_parser.h" -#include "tcc_fic_decoder.h" -#include "tcbd_drv_ip.h" -#include "tcc_fic_decoder.h" - -#include "tcbd_hal.h" - -/* #define TDMB_DEBUG_SCAN */ - -static DEFINE_MUTEX(tcc3170_mutex); - -static DECLARE_WAIT_QUEUE_HEAD(wq); -static bool scan_done; - -static bool tcc3170_on_air; -static bool tcc3170_pwr_on; -static struct tcbd_device tcc3170_device; -static unsigned char prev_subch = 0xFF; - -#ifdef TDMB_DEBUG_SCAN -static void __print_ensemble_info(struct ensemble_info_type *e_info) -{ - int i = 0; - - DPRINTK("ensem_freq(%ld)\n", e_info->ensem_freq); - DPRINTK("ensem_label(%s)\n", e_info->ensem_label); - for (i = 0; i < e_info->tot_sub_ch; i++) { - DPRINTK("[%d]\n", i); - DPRINTK("svc_label(%s)\n", e_info->sub_ch[i].svc_label); - DPRINTK("sub_ch_id(0x%x)\n", e_info->sub_ch[i].sub_ch_id); - DPRINTK("start_addr(0x%x)\n", e_info->sub_ch[i].start_addr); - DPRINTK("tmid(0x%x)\n", e_info->sub_ch[i].tmid); - DPRINTK("svc_type(0x%x)\n", e_info->sub_ch[i].svc_type); - } -} -#endif - -static bool __get_ensemble_info(struct ensemble_info_type *e_info - , unsigned long freq) -{ - struct tcc_ensemble_info *ensbl_info; - struct tcc_ensemble *esbl = &ensbl_info->ensbl; - struct tcc_service_info *svc_info; - struct tcc_service_comp_info *svc_comp_info; - - unsigned char i; - unsigned char cnt = 0; - - ensbl_info = tcc_fic_get_ensbl_info(1); - esbl = &ensbl_info->ensbl; - - memset(e_info, 0, sizeof(e_info)); - - e_info->ensem_freq = freq; - e_info->ensem_id = esbl->eid; - strncpy(e_info->ensem_label, esbl->label, \ - ENSEMBLE_LABEL_MAX); - - for (i = 0; i < esbl->num_svc; i++) { - svc_info = &ensbl_info->svc_info[i]; - svc_comp_info = &svc_info->svc_comp_info[0]; - if ((svc_comp_info->svc_comp.tmid == 0x00 && - svc_comp_info->svc_comp.ascty_dscty == 0x00) || - (svc_comp_info->svc_comp.tmid == 0x01 && - svc_comp_info->svc_comp.ascty_dscty == 0x18)) { - e_info->sub_ch[cnt].sub_ch_id = \ - svc_comp_info->sub_ch.subch_id; - e_info->sub_ch[cnt].start_addr = \ - svc_comp_info->sub_ch.start_cu; - e_info->sub_ch[cnt].tmid = \ - svc_comp_info->svc_comp.tmid; - e_info->sub_ch[cnt].svc_type = \ - svc_comp_info->svc_comp.ascty_dscty; - e_info->sub_ch[cnt].svc_id = \ - svc_comp_info->svc_comp.scid; - strncpy(e_info->sub_ch[cnt].svc_label, \ - svc_info->svc.svc_label, SVC_LABEL_MAX); - cnt++; - } - } - e_info->tot_sub_ch = cnt; - -#ifdef TDMB_DEBUG_SCAN - __print_ensemble_info(e_info); -#endif - - return (e_info->tot_sub_ch > 0) ? true : false; -} - -static void tcc3170_power_off(void) -{ - DPRINTK("call TDMB_PowerOff !\n"); - - mutex_lock(&tcc3170_mutex); - - if (tcc3170_pwr_on) { - tcc3170_on_air = false; - - if (prev_subch != 0xFF) { - tcbd_unregister_service(&tcc3170_device, prev_subch); - prev_subch = 0xFF; - } - - tcbd_io_close(&tcc3170_device); - - tdmb_control_irq(false); - tdmb_control_gpio(false); - - tcc3170_pwr_on = false; - } - - mutex_unlock(&tcc3170_mutex); - -} - -static bool tcc3170_power_on(void) -{ - unsigned char chip_id = 0; - s32 ret; - - DPRINTK("tcc3170_power_on\n"); - - if (tcc3170_pwr_on) { - return true; - } else { - tdmb_control_gpio(true); - - /* command io open */ - ret = tcbd_io_open(&tcc3170_device); - if (ret < 0) { - DPRINTK("failed io open %d\n", (int)ret); - tdmb_control_gpio(false); - return false; - } - - /* check chip id */ - tcbd_reg_read(&tcc3170_device, TCBD_CHIPID, &chip_id); - DPRINTK("chip id : 0X%X\n", chip_id); - if (chip_id != TCBD_CHIPID_VALUE) { - DPRINTK("invalid chip id !!! exit!\n"); - tcbd_io_close(&tcc3170_device); - tdmb_control_gpio(false); - return false; - } else { -#ifdef CONFIG_TDMB_SPI - tcbd_select_peri(&tcc3170_device, PERI_TYPE_SPI_ONLY); - tcbd_change_irq_mode \ - (&tcc3170_device, INTR_MODE_LEVEL_LOW); -#else -#error -#endif /* CONFIG_TDMB_SPI */ - if (tcbd_device_start \ - (&tcc3170_device, CLOCK_19200KHZ) < 0) { - DPRINTK("could not start device!!\n"); - tcbd_io_close(&tcc3170_device); - tdmb_control_gpio(false); - return false; - } else { - tdmb_control_irq(true); - tcc3170_pwr_on = true; - return true; - } - } - } -} - - -static s32 tcbd_get_ant_level(u32 pcber, s32 rssi) -{ - s32 ant_level = 0; - - s32 ant75[] = {300, 450, 600, 800, 950, 1150, }; - s32 ant80[] = {-1, 450, 600, 800, 950, 1150, }; - s32 ant85[] = {-1, -1, 600, 800, 900, 1150, }; - s32 ant90[] = {-1, -1, -1, 800, 950, 1150, }; - s32 ant100[] = {-1, -1, -1, -1, 950, 1150, }; - s32 *ant = ant75; - - if (rssi > -75) - ant = ant75; - else if (rssi > -80) - ant = ant80; - else if (rssi > -85) - ant = ant85; - else if (rssi > -90) - ant = ant90; - else if (rssi > -100) - ant = ant100; - - if ((s32)pcber <= ant[0]) - ant_level = 6; - else if ((s32)pcber <= ant[1]) - ant_level = 5; - else if ((s32)pcber <= ant[2]) - ant_level = 4; - else if ((s32)pcber <= ant[3]) - ant_level = 3; - else if ((s32)pcber <= ant[4]) - ant_level = 2; - else if ((s32)pcber <= ant[5]) - ant_level = 1; - else if ((s32)pcber > ant[5]) - ant_level = 0; - - return ant_level; -} - -static void tcc3170_get_dm(struct tdmb_dm *info) -{ - struct tcbd_status_data status; - - if (tcc3170_pwr_on == true && tcc3170_on_air == true) { - tcbd_read_signal_info(&tcc3170_device, &status); - - info->ber = status.pcber_moving_avg; - info->rssi = status.rssi; - info->antenna = tcbd_get_ant_level(status.pcber, status.rssi); - info->per = status.tsper; - } else { - info->rssi = 100; - info->ber = 3000; - info->per = 100; - info->antenna = 0; - } -} - -static s32 __set_frequency(unsigned long freqKHz, bool scan_mode) -{ - s32 ret = 0; - u8 status; - - tcbd_disable_irq(&tcc3170_device, 0); - tcc_fic_parser_init(); - ret = tcbd_tune_frequency(&tcc3170_device, freqKHz, 1500); - if (ret < 0) { - DPRINTK("tcbd_tune_frequency fail %d\n", ret); - return -EFAULT; - } - - if (scan_mode) { - ret = tcbd_wait_tune(&tcc3170_device, &status); - if (ret < 0) { - DPRINTK("wait_tune fail status:0x%02X, ret:0x%x\n", \ - status, ret); - ret = -EFAULT; - } - } - DPRINTK("%s : status:0x%02X, ret:0x%x\n", __func__, status, ret); - - if (ret == TCERR_SUCCESS) { -#if defined(__CSPI_ONLY__) - tcbd_enable_irq(&tcc3170_device, TCBD_IRQ_EN_DATAINT); -#else -#error -#endif - } - return ret; -} - -static bool tcc3170_set_ch(unsigned long freq, - unsigned char sub_ch_id, - bool factory_test) -{ - unsigned long freq_temp = freq / 1000; - unsigned char sub_ch_id_temp = sub_ch_id % 1000; - s32 ret; - - DPRINTK("tcc3170_set_ch freq:%ld, sub_ch_id:%d\n", - freq_temp, sub_ch_id_temp); - - tcc3170_on_air = false; - - if (prev_subch != 0xFF) { - tcbd_unregister_service(&tcc3170_device, prev_subch); - prev_subch = 0xFF; - } - - if (__set_frequency((freq/1000), true) == TCERR_SUCCESS) { - if (sub_ch_id_temp >= 64) { - sub_ch_id_temp -= 64; - ret = tcbd_register_service( - &tcc3170_device, sub_ch_id_temp, 1); - } else { - ret = tcbd_register_service( - &tcc3170_device, sub_ch_id_temp, 0); - } - if (ret == TCERR_SUCCESS) { - DPRINTK("dmb_drv_set_ch Success\n"); - prev_subch = sub_ch_id_temp - 64; - tcc3170_on_air = true; - } - } - - if (tcc3170_on_air == false) - DPRINTK("dmb_drv_set_ch Fail\n"); - - return tcc3170_on_air; -} - -static bool tcc3170_scan_ch(struct ensemble_info_type *e_info - , unsigned long freq) -{ - bool ret = false; - - if (tcc3170_pwr_on == true && e_info != NULL) { - if (prev_subch != 0xFF) { - tcbd_unregister_service(&tcc3170_device, prev_subch); - prev_subch = 0xFF; - } - - tcc_fic_parser_init(); - scan_done = false; - if (__set_frequency((freq/1000), true) == TCERR_SUCCESS) { - msleep(1200); /* optimize this point */ - - if (scan_done == true) - ret = __get_ensemble_info(e_info, freq); - } - } - - return ret; -} - -static unsigned long tcc3170_int_size(void) -{ - return TCBD_MAX_THRESHOLD * 2; -} - -static void tcc3170_pull_data(void) -{ - s32 size, ret = 0; - s8 irq_status; - s8 irq_error; - static u8 buff_read[TCBD_MAX_THRESHOLD*2]; - - if (!tcc3170_pwr_on) - return; - - mutex_lock(&tcc3170_mutex); - - ret = tcbd_read_irq_status(&tcc3170_device, &irq_status, &irq_error); - ret |= tcbd_clear_irq(&tcc3170_device, irq_status); - ret |= tcbd_read_stream(&tcc3170_device, buff_read, &size); - if (ret == 0 && !irq_error) { - tcbd_split_stream(0, buff_read, size); - } else { - DPRINTK("### buffer is full, skip the data " - "(ret:%d, status=0x%02X, error=0x%02X) ###\n", - ret, irq_status, irq_error); - - tcbd_init_stream_data_config(&tcc3170_device, - ENABLE_CMD_FIFO, - tcc3170_device.selected_buff, - tcc3170_device.intr_threshold); - /*tcbd_reset_ip(device, TCBD_SYS_COMP_ALL, TCBD_SYS_COMP_EP);*/ - tcbd_init_parser(0, NULL); - } - mutex_unlock(&tcc3170_mutex); -} - -static s32 __stream_callback( - s32 _dev_idx, - u8 *_stream, - s32 _size, - u8 _subch_id, - u8 _type) -{ - u8 *stream; - s32 size; - s32 ret, i = 0; - -#ifdef __CALLBACK_BUFFER_HEADER__ - stream = _stream + SIZE_BUFF_HEADER; - size = _size - SIZE_BUFF_HEADER; -#else - stream = _stream; - size = _size; -#endif - - /* DPRINTK("%s : _type %d size %d\n", __func__, _type, size); */ - - switch (_type) { - case DATA_TYPE_FIC: /*FIC*/ - for (i = 0; i < size/TCBD_FIC_SIZE; i++) { - ret = tcc_fic_run_decoder(stream + (i*TCBD_FIC_SIZE), - MAX_FIC_SIZE); - if (ret > 0) - scan_done = true; - } - break; - case DATA_TYPE_MSC: /*MSC*/ - tdmb_store_data(stream, size); - break; - case DATA_TYPE_STATUS: /*STATUS*/ - tcbd_update_status(stream, size, NULL); - default: - break; - } - return 0; -} -static bool tcc3170_init(void) -{ -#if defined(__CSPI_ONLY__) - tcpal_set_cspi_io_function(); -#else -#error -#endif - tcbd_init_parser(0, __stream_callback); - - return true; -} - -static struct tdmb_drv_func telechips_tcc3170_drv_func = { - .init = tcc3170_init, - .power_on = tcc3170_power_on, - .power_off = tcc3170_power_off, - .scan_ch = tcc3170_scan_ch, - .get_dm = tcc3170_get_dm, - .set_ch = tcc3170_set_ch, - .pull_data = tcc3170_pull_data, - .get_int_size = tcc3170_int_size, -}; - -struct tdmb_drv_func *tcc3170_drv_func(void) -{ - DPRINTK("tdmb_get_drv_func : tcc3170\n"); - return &telechips_tcc3170_drv_func; -} diff --git a/drivers/media/tdmb/tdmb_spi.c b/drivers/media/tdmb/tdmb_spi.c deleted file mode 100644 index 014fd00..0000000 --- a/drivers/media/tdmb/tdmb_spi.c +++ /dev/null @@ -1,72 +0,0 @@ -/* -* -* drivers/media/tdmb/tdmb_spi.c -* -* tdmb driver -* -* Copyright (C) (2011, Samsung Electronics) -* -* 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 version 2. -* -* This program is distributed "as is" WITHOUT ANY WARRANTY of any -* kind, whether express or implied; without even the implied warranty -* of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -* GNU General Public License for more details. -* -*/ - -#include <linux/spi/spi.h> -#include "tdmb.h" - -struct spi_device *spi_dmb; - -static int tdmbspi_probe(struct spi_device *spi) -{ - int ret; - - spi_dmb = spi; - - DPRINTK("tdmbspi_probe() spi_dmb : 0x%x\n", (unsigned int)spi_dmb); - - spi->mode = SPI_MODE_0; - spi->bits_per_word = 8; - ret = spi_setup(spi); - if (ret < 0) { - DPRINTK("spi_setup() fail ret : %d\n", ret); - return ret; - } - - return 0; -} - -static int __devexit tdmbspi_remove(struct spi_device *spi) -{ - return 0; -} - -static struct spi_driver tdmbspi_driver = { - .driver = { - .name = "tdmbspi", - .bus = &spi_bus_type, - .owner = THIS_MODULE, - }, - .probe = tdmbspi_probe, - .remove = __devexit_p(tdmbspi_remove), -}; - -int tdmb_init_bus(void) -{ - return spi_register_driver(&tdmbspi_driver); -} - -void tdmb_exit_bus(void) -{ - spi_unregister_driver(&tdmbspi_driver); -} - -struct spi_device *tdmb_get_spi_handle(void) -{ - return spi_dmb; -} |