Пример #1
0
signed int dtvd_tuner_cn_com_symcount_set
(
    unsigned char symcount  
)
{
    signed int ret;
    DTVD_TUNER_COM_I2C_DATA_t i2c_data;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    i2c_data.adr = D_DTVD_TUNER_REG_FEC_SUBA;
    i2c_data.data= D_DTVD_TUNER_REG_FEC_SUBD;
    ret = dtvd_tuner_com_dev_i2c_write( D_DTVD_TUNER_REG_NO1, &i2c_data );
    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_EXIT();
        return D_DTVD_TUNER_NG;
    }

    i2c_data.adr = D_DTVD_TUNER_REG_FEC_SUBD;
    i2c_data.data= symcount;
    ret = dtvd_tuner_com_dev_i2c_write( D_DTVD_TUNER_REG_NO1, &i2c_data );
    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_EXIT();
        return D_DTVD_TUNER_NG;
    }

    DTVD_DEBUG_MSG_EXIT();
    return D_DTVD_TUNER_OK;

}
Пример #2
0
void dtvd_tuner_cn_mtx_001_msg_core_measure( void )
{
    signed int ret;

    DTVD_TUNER_INEVT_CN_CORE_MEASURE_t *data = &tdtvd_tuner_msg.buff.in_cn_core_measure;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    ret = dtvd_tuner_cn_com_start_set();
    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_ENTER( 1, 0, 0 );

        dtvd_tuner_cn_inevt_core_deverr();

        DTVD_DEBUG_MSG_EXIT();

        return;

    }

    dtvd_tuner_timer_start( D_DTVD_TUNER_TIMER_MEASURE_CN_FST,
                            tdtvd_tuner_cn.wait_time );

    tdtvd_tuner_cn.stabilize_times = 0;

    tdtvd_tuner_cn.seq_id = data->seq_id;

    dtvd_tuner_cn_com_set_status( D_DTVD_TUNER_CN_002 );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #3
0
void dtvd_tuner_ber_mtx_001_msg_core_start( void )
{

   signed int ret;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    ret = dtvd_tuner_ber_com_start_set();
    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_ENTER( 1, 0, 0 );

        dtvd_tuner_ber_inevt_core_deverr();

        DTVD_DEBUG_MSG_EXIT();
        return;
    }

    tdtvd_tuner_monitor.rx.ber.state = D_DTVD_TUNER_MEASURE_STATE_OFF;

    dtvd_tuner_timer_start( D_DTVD_TUNER_TIMER_MEASURE_BER_FST,
		                    tdtvd_tuner_ber.wait_time );

    dtvd_tuner_ber_com_set_status( D_DTVD_TUNER_BER_002 );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #4
0
signed int dtvd_tuner_ber_com_stop_set_ext_omt( void )
{

    signed int ret;
    DTVD_TUNER_COM_I2C_DATA_t i2c_data;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    i2c_data.adr = D_DTVD_TUNER_REG_FEC_SUBA;
    i2c_data.data= 0xD7;
    ret = dtvd_tuner_com_dev_i2c_write( D_DTVD_TUNER_REG_NO1, &i2c_data );
    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_EXIT();
        return D_DTVD_TUNER_NG;
    }

    i2c_data.adr = D_DTVD_TUNER_REG_FEC_SUBD;
    i2c_data.data= 0xB9;
    ret = dtvd_tuner_com_dev_i2c_write( D_DTVD_TUNER_REG_NO1, &i2c_data );
    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_EXIT();
        return D_DTVD_TUNER_NG;
    }

    DTVD_DEBUG_MSG_EXIT();

    return D_DTVD_TUNER_OK;
}
Пример #5
0
signed int dtvd_tuner_ber_com_start_set( void )
{
    signed int ret;
    DTVD_TUNER_COM_I2C_DATA_t i2c_data;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    i2c_data.adr = D_DTVD_TUNER_REG_RSBERXRST;
    i2c_data.data= 0x00;

    ret = dtvd_tuner_com_dev_i2c_write( D_DTVD_TUNER_REG_NO1, &i2c_data );
    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_EXIT();
        return D_DTVD_TUNER_NG;
    }

    i2c_data.adr = D_DTVD_TUNER_REG_RSBERXRST;
    i2c_data.data= 0x01;
    ret = dtvd_tuner_com_dev_i2c_write( D_DTVD_TUNER_REG_NO1, &i2c_data );
    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_EXIT();
        return D_DTVD_TUNER_NG;
    }

    DTVD_DEBUG_MSG_EXIT();
    return D_DTVD_TUNER_OK;
}
Пример #6
0
void dtvd_tuner_timer_sleep_on_timeout
(
    signed long   count        
)
{
    signed long             res;
    DTVD_TUNER_CONTROL_t    *info = &tdtvd_tuner_info;

    int event_flag = 0;        

    DTVD_DEBUG_MSG_ENTER( (int)count, 0, 0 );

    if( count <= 0 )
    {
        DTVD_DEBUG_MSG_EXIT();
        return;
    }

    res = count;
    while( res > 0 )
    {

        res = wait_event_interruptible_timeout( info->wait_queue, event_flag !=0 ,(res * HZ / 1000) );
        event_flag = 0;
    }

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #7
0
void dtvd_tuner_agc_mtx_007_msg_core_measure_omt( void )
{
    signed int ret;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    ret = dtvd_tuner_agc_com_read();

    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_ENTER( 1, 0, 0 );

        dtvd_tuner_agc_inevt_core_measure_omt( D_DTVD_TUNER_NG );

        DTVD_DEBUG_MSG_EXIT();
        return;
    }

    tdtvd_tuner_monitor.rx.agc.state = D_DTVD_TUNER_MEASURE_STATE_ON;

    dtvd_tuner_agc_inevt_core_measure_omt( D_DTVD_TUNER_OK );

    DTVD_DEBUG_MSG_EXIT();

    return;
}
Пример #8
0
void dtvd_tuner_ber_mtx_001_msg_core_start_omt( void )
{
    signed int ret;
    DTVD_TUNER_INEVT_BER_CORE_START_OMT_t *data;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    data = &tdtvd_tuner_msg.buff.in_ber_core_start_omt;

    if( data->out == D_DTVD_TUNER_BER_MEASURE_OUT_ON )
    {
        DTVD_DEBUG_MSG_ENTER( 1, 0, 0 );

        ret = dtvd_tuner_ber_com_start_set_ext_omt();
        if( ret != D_DTVD_TUNER_OK )
        {
            DTVD_DEBUG_MSG_ENTER( 2, 0, 0 );

            dtvd_tuner_ber_inevt_core_start_omt( D_DTVD_TUNER_NG );

            DTVD_DEBUG_MSG_EXIT();
            return;
        }

        dtvd_tuner_ber_com_set_status( D_DTVD_TUNER_BER_006 );
    }
    else
    {
        DTVD_DEBUG_MSG_ENTER( 3, 0, 0 );

        ret = dtvd_tuner_ber_com_start_set_init( &data->period );
        if( ret != D_DTVD_TUNER_OK )
        {
            DTVD_DEBUG_MSG_ENTER( 4, 0, 0 );

            dtvd_tuner_ber_inevt_core_start_omt( D_DTVD_TUNER_NG );

            DTVD_DEBUG_MSG_EXIT();
            return;
        }

        dtvd_tuner_ber_com_set_status( D_DTVD_TUNER_BER_004 );
    }

    dtvd_tuner_ber_inevt_core_start_omt( D_DTVD_TUNER_OK );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #9
0
void dtvd_tuner_cn_com_symcount_chg_timer
(
    unsigned char symcount  
)
{
    unsigned int count;
    unsigned int symcount_max;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    symcount_max = ( sizeof( c_symcount ) / sizeof( c_symcount[0]) );

    for( count = 0; count < symcount_max; count++ )
    {
        if( c_symcount[count].symcount == symcount )
        {

            tdtvd_tuner_cn.measure_time = c_symcount[count].timer;
            break;
        }
    }

    if ( count >= symcount_max )
    {

        DTVD_TUNER_SYSERR_RANK_A( D_DTVD_TUNER_SYSERR_DRV_PARAM,
                                  DTVD_TUNER_CN_COM,
                                  0, 0, 0, 0, 0, 0 );
        return;
    }

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #10
0
signed int dtvd_tuner_ber_com_read_flag( unsigned char *data )
{
    signed int ret;
    unsigned long length;
    unsigned char addr;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    ret = D_DTVD_TUNER_OK;

    length = D_DTVD_TUNER_REG_NO1;

    addr = D_DTVD_TUNER_REG_RSBERCEFLG;

    ret = dtvd_tuner_com_dev_i2c_read( length,
                                       &addr,
                                       data  );

    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_EXIT();
        return ret;
    }

    return ret;
}
Пример #11
0
void dtvd_tuner_timer_stop
(
    unsigned long funcid               
)
{
    signed int ret;

    DTVD_TUNER_TIMER_t *timer_info = &tdtvd_tuner_main.timer;

    DTVD_DEBUG_MSG_ENTER( (int)funcid, 0, 0 );

    if( funcid >= D_DTVD_TUNER_TIMER_MAX )
    {

        DTVD_TUNER_SYSERR_RANK_A( D_DTVD_TUNER_SYSERR_DRV_PARAM,
                                  DTVD_TUNER_TIMER,
                                  funcid, 0, 0, 0, 0, 0 );
        return;
    }

    if( timer_info->list[funcid].state == D_DTVD_TUNER_TIMER_STOP )
    {
        DTVD_DEBUG_MSG_EXIT();
        return;
    }

#ifdef DTVD_NO_HRTIMER
    ret = del_timer( &timer_info->list[funcid].info );
#else
	ret = hrtimer_cancel( &timer_info->list[funcid].info );
#endif 

    if( ret < 0 )
    {

        DTVD_TUNER_SYSERR_RANK_A( D_DTVD_TUNER_SYSERR_DRV_SYSTEM,
                                  DTVD_TUNER_TIMER,
                                  0, 0, 0, 0, 0, 0 );
        return;
    }

    timer_info->list[funcid].state = D_DTVD_TUNER_TIMER_STOP;

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #12
0
void dtvd_tuner_ber_mtx_001_msg_core_set( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    DTVD_DEBUG_MSG_EXIT();
    return;

}
Пример #13
0
void dtvd_tuner_timer_handler
(
    unsigned long data               
)
{
    unsigned int      cnt;
    unsigned long   funcid;
    unsigned long   mask;
    unsigned char   need_toevt=D_DTVD_TUNER_TRUE;

    DTVD_DEBUG_MSG_ENTER( (int)data, 0, 0 );

    funcid = data >> ( 32 - D_DTVD_TUNER_TIMER_MAX_NUM );
    if( funcid > D_DTVD_TUNER_TIMER_BIT_MAX )
    {
        DTVD_TUNER_SYSERR_RANK_B( D_DTVD_TUNER_SYSERR_DRV_ETC,
                                  DTVD_TUNER_TIMER,
                                  funcid, 0, 0, 0, 0, 0 );
        return;
    }

    dtvd_tuner_timer_handler_callfunc( funcid , &need_toevt);

    if( need_toevt != D_DTVD_TUNER_TRUE )
    {

        DTVD_DEBUG_MSG_EXIT();
        return;
    }

    for( cnt=0; cnt<D_DTVD_TUNER_TIMER_MAX; cnt++ )
    {
        mask = (unsigned long)( 0x0001 << cnt );
        if( ( funcid & mask ) == mask )
        {

            tdtvd_tuner_timer_tasklet[cnt]->data = data;
            tasklet_schedule( tdtvd_tuner_timer_tasklet[cnt] );
            break;
        }
    }

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #14
0
void dtvd_tuner_tmcc_mtx_001_msg_tuner_stop( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_tmcc_inevt_tuner_stop();

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #15
0
void dtvd_tuner_cn_com_measure_time_set( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    tdtvd_tuner_cn.measure_time = tdtvd_tuner_nonvola.cn_cycle;

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #16
0
void dtvd_tuner_cn_mtx_001_msg_core_stop( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_cn_inevt_core_stop();

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #17
0
void dtvd_tuner_core_mtx_008_msg_agc_stop( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_core_inevt_tuner_stop();

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #18
0
void dtvd_tuner_core_mtx_013_msg_cn_stop_omt( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_core_inevt_agc_stop_omt();

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #19
0
signed int dtvd_tuner_autoeco_init( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    tdtvd_tuner_autoeco.status = D_DTVD_TUNER_AUTOECO_000;

    DTVD_DEBUG_MSG_EXIT();
    return D_DTVD_TUNER_OK;
}
Пример #20
0
void dtvd_tuner_tmcc_mtx_001_msg_tuner_end( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_tmcc_com_set_status( D_DTVD_TUNER_TMCC_000 );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #21
0
void dtvd_tuner_agc_mtx_007_msg_core_start_omt( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_agc_inevt_core_start_omt( D_DTVD_TUNER_OK );

    DTVD_DEBUG_MSG_EXIT();

    return;
}
Пример #22
0
signed int dtvd_tuner_cn_init( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    tdtvd_tuner_cn.status = D_DTVD_TUNER_CN_000;
    tdtvd_tuner_cn.seq_id = 0;

    DTVD_DEBUG_MSG_EXIT();
    return D_DTVD_TUNER_OK;
}
Пример #23
0
void dtvd_tuner_cn_com_watch_timer_start( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_timer_start( D_DTVD_TUNER_TIMER_WATCH_CN,
                            tdtvd_tuner_cn.cycle_time );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #24
0
void dtvd_tuner_cn_mtx_001_msg_core_start_omt( void )
{
    signed int ret;
    DTVD_TUNER_INEVT_CN_CORE_START_OMT_t *data;

    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    data = &tdtvd_tuner_msg.buff.in_cn_core_start_omt;

    ret = dtvd_tuner_cn_com_symcount_read();

    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_ENTER( 1, 0, 0 );

        dtvd_tuner_cn_inevt_core_start_omt( D_DTVD_TUNER_NG );

        DTVD_DEBUG_MSG_EXIT();
        return;
    }

    dtvd_tuner_cn_com_symcount_chg_timer( data->carrier );

    ret = dtvd_tuner_cn_com_symcount_set( data->carrier );

    if( ret != D_DTVD_TUNER_OK )
    {
        DTVD_DEBUG_MSG_ENTER( 2, 0, 0 );

        dtvd_tuner_cn_inevt_core_start_omt( D_DTVD_TUNER_NG );

        DTVD_DEBUG_MSG_EXIT();
        return;
    }

    dtvd_tuner_cn_inevt_core_start_omt( D_DTVD_TUNER_OK );

    dtvd_tuner_cn_com_set_status( D_DTVD_TUNER_CN_005 );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #25
0
void dtvd_tuner_autoeco_mtx_002_msg_core_stop( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    tdtvd_tuner_autoeco.autoeco_flg = D_DTVD_TUNER_OFF;

    dtvd_tuner_autoeco_com_set_status( D_DTVD_TUNER_AUTOECO_001 );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #26
0
void dtvd_tuner_ber_mtx_001_msg_core_end( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_ber_inevt_core_end();

    dtvd_tuner_ber_com_set_status( D_DTVD_TUNER_BER_000 );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #27
0
void dtvd_tuner_tmcc_mtx_001_msg_tuner_infoget( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_tmcc_com_get_timer_start();

    dtvd_tuner_tmcc_com_set_status( D_DTVD_TUNER_TMCC_002 );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #28
0
void dtvd_tuner_core_mtx_013_agc_start_omt( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_core_set_result( D_DTVD_TUNER_NG );

    dtvd_tuner_core_wakeup( D_DTVD_TUNER_WAKEUP_AGC_START_OMT );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #29
0
void dtvd_tuner_core_mtx_013_cnr_stop_omt( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_core_set_result( D_DTVD_TUNER_NG );

    dtvd_tuner_core_wakeup( D_DTVD_TUNER_WAKEUP_CNR_STOP_OMT );

    DTVD_DEBUG_MSG_EXIT();
    return;
}
Пример #30
0
void dtvd_tuner_core_mtx_013_ber_get_omt( void )
{
    DTVD_DEBUG_MSG_ENTER( 0, 0, 0 );

    dtvd_tuner_core_set_result( D_DTVD_TUNER_NG );

    dtvd_tuner_core_wakeup( D_DTVD_TUNER_WAKEUP_BER_GET_OMT );

    DTVD_DEBUG_MSG_EXIT();
    return;
}