INT rtv_InitSystem(E_RTV_TV_MODE_TYPE eTvMode, E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType)
{
	INT nRet;
	int i;
	
	g_afRtvChannelChange[RaonTvChipIdx] = FALSE;
	
	g_afRtvStreamEnabled[RaonTvChipIdx] = FALSE;

#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2)
	g_abRtvIntrMaskRegL[RaonTvChipIdx] = 0xFF;
#else	
   #if defined(RTV_TDMB_ENABLE) && !defined(RTV_TDMB_MULTI_SUB_CHANNEL_ENABLE) /* Single sub channel mode */
	g_abRtvIntrMaskRegL[RaonTvChipIdx] = 0xFF;
   #endif
#endif	

	/* In case of SPI interface or FIC interrupt mode for T-DMB, we should lock the register page. */
	RTV_GUARD_INIT;

	for(i=0; i<100; i++)
	{
//RTV_DBGMSG0("[rtv_InitSystem] 1\n");

		RTV_REG_MAP_SEL(HOST_PAGE);

//RTV_DBGMSG0("[rtv_InitSystem] 2\n");
		

		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);

	if((nRet=rtvRF_ConfigureAdcClock(eTvMode, eAdcClkFreqType)) != RTV_SUCCESS)
		return nRet;
		
	return RTV_SUCCESS;
}
예제 #2
0
INT rtv_InitSystem(E_RTV_TV_MODE_TYPE eTvMode,
		E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType)
{
	INT nRet;

	g_fRtvChannelChange = FALSE;
	g_fRtvStreamEnabled = FALSE;

	g_bRtvIntrMaskRegL = 0xFF;

	nRet = rtv_InitBoot();
	if (nRet == RTV_SUCCESS)
	{
		rtvRF_ConfigurePowerType(eTvMode);

		nRet = rtvRF_ChangeAdcClock(eTvMode, eAdcClkFreqType, 500);
	}

	return nRet;
}
INT rtv_InitSystem(E_RTV_TV_MODE_TYPE eTvMode,
		E_RTV_ADC_CLK_FREQ_TYPE eAdcClkFreqType)
{
	INT nRet;
	int i;
	U8 read0, read1;

	g_fRtvChannelChange = FALSE;
	g_fRtvStreamEnabled = FALSE;

	g_bRtvIntrMaskRegL = 0xFF;

#if defined(RTV_IF_SPI) || defined(RTV_IF_EBI2)
	#ifdef RTV_IF_SPI
	#define WR27_VAL	0x11
	#else
	#define WR27_VAL	0x13
	#endif

	#define WR29_VAL	0x31

	RTV_REG_MAP_SEL(SPI_CTRL_PAGE);

	for (i = 0; i < 100; i++) {
		RTV_REG_SET(0x29, WR29_VAL); /* BUFSEL first! */
		RTV_REG_SET(0x27, WR27_VAL);

		read0 = RTV_REG_GET(0x27);
		read1 = RTV_REG_GET(0x29);
		RTV_DBGMSG2("read27(0x%02X), read29(0x%02X)\n", read0, read1);

		if ((read0 == WR27_VAL) && (read1 == WR29_VAL))
			goto RTV_POWER_ON_SUCCESS;

		RTV_DBGMSG1("[rtv_InitSystem] Power On wait: %d\n", i);
		RTV_DELAY_MS(5);
	}
#else
	RTV_REG_MAP_SEL(HOST_PAGE);
	for (i = 0; i < 100; i++) {
		read0 = RTV_REG_GET(0x00);
		read1 = RTV_REG_GET(0x01);
		RTV_DBGMSG2("read27(0x%02X), read29(0x%02X)\n", read0, read1);

		if ((read0 == 0xC6) && (read1 == 0x43))
			goto RTV_POWER_ON_SUCCESS;

		RTV_DBGMSG1("[rtv_InitSystem] Power On wait: %d\n", i);
		RTV_DELAY_MS(5);
	}
#endif

	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_ChangeAdcClock(eTvMode, eAdcClkFreqType, 500);
	if (nRet != RTV_SUCCESS)
		return nRet;

	return RTV_SUCCESS;
}