Пример #1
0
static int	AVL6211_Set_Voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage)
{
    struct aml_fe *afe = fe->demodulator_priv;
    struct aml_fe_dev *dev = afe->dtv_demod;
    AVL_DVBSx_ErrorCode r=AVL_DVBSx_EC_OK;
    AVL_uchar nValue = 1;

    if(voltage == SEC_VOLTAGE_OFF) {
        AVL6211_Lnb_Power_Ctrl(dev->lnb_power_gpio, 0);//lnb power off
        return 0;
    }

    if(voltage ==  SEC_VOLTAGE_13)
        nValue = 1;
    else if(voltage ==SEC_VOLTAGE_18)
        nValue = 0;
    else;

    AVL6211_Lnb_Power_Ctrl(dev->lnb_power_gpio, 1);//lnb power on
    r=AVL_DVBSx_IDiseqc_SetLNBOut(nValue,pAVLChip_all);
    if(r!=AVL_DVBSx_EC_OK)
    {
        pr_dbg("[AVL6211_LNB_PIO_Control] set nPIN_Index:0x%x,Err\n",r);
    }
    return r;
}
static int	AVL6211_Set_Voltage(struct dvb_frontend* fe, fe_sec_voltage_t voltage)
{
	AVL_DVBSx_ErrorCode r=AVL_DVBSx_EC_OK;	
	AVL_uchar nValue = 1;
	if(voltage == SEC_VOLTAGE_OFF){
		AVL6211_Lnb_Power_Ctrl(0);//lnb power off
		return 0;
	}

	if(voltage ==  SEC_VOLTAGE_13)
		nValue = 0;
	else if(voltage ==SEC_VOLTAGE_18)
		nValue = 1;
	else;	
	
	AVL6211_Lnb_Power_Ctrl(1);//lnb power on

	if(1==nValue)
		r=AVL_DVBSx_IDiseqc_SetLNBOut(1, pAVLChip_all);	//set LNB0_PIN59 1: Hight 
	else
		r=AVL_DVBSx_IDiseqc_SetLNBOut(0, pAVLChip_all);	//set LNB0_PIN59 1: Low 

	return r;
}