예제 #1
0
static int hdmi_drv_video_config(HDMI_VIDEO_RESOLUTION vformat, HDMI_VIDEO_INPUT_FORMAT vin, HDMI_VIDEO_OUTPUT_FORMAT vout)
{
	if(vformat == HDMI_VIDEO_720x480p_60Hz)
	{
		HDMI_LOG("[hdmi_drv]480p\n");
		siHdmiTx_VideoSel(HDMI_480P60_4X3);
	}
	else if(vformat == HDMI_VIDEO_1280x720p_60Hz)
	{
		HDMI_LOG("[hdmi_drv]720p\n");
		siHdmiTx_VideoSel(HDMI_720P60);
	}
	else if(vformat == HDMI_VIDEO_1920x1080p_30Hz)
	{
		HDMI_LOG("[hdmi_drv]1080p_30 %p\n", si_dev_context);
		siHdmiTx_VideoSel(HDMI_1080P30);
	}
	else if(vformat == HDMI_VIDEO_1920x1080p_60Hz)
	{
		HDMI_LOG("[hdmi_drv]1080p_60 %p\n", si_dev_context);
		siHdmiTx_VideoSel(HDMI_1080P60);
	}
	else
	{
		HDMI_LOG("%s, video format not support now\n", __func__);
	}
	
    if(si_dev_context)
    	si_mhl_tx_set_path_en_I(si_dev_context);
    return 0;
}
예제 #2
0
static int hdmi_drv_video_config(HDMI_VIDEO_RESOLUTION vformat, HDMI_VIDEO_INPUT_FORMAT vin, HDMI_VIDEO_OUTPUT_FORMAT vout)
#endif
{
	if(vformat == HDMI_VIDEO_720x480p_60Hz)
	{
		MHL_DBG("[video_config]480p\n");
		siHdmiTx_VideoSel(HDMI_480P60_4X3);
	}
	else if(vformat == HDMI_VIDEO_1280x720p_60Hz)
	{
		MHL_DBG("[video_config]720p\n");
		siHdmiTx_VideoSel(HDMI_720P60);
	}
	else if(vformat == HDMI_VIDEO_1920x1080p_30Hz)
	{
		MHL_DBG("[video_config]1080p_30 %p\n", si_dev_context);
		siHdmiTx_VideoSel(HDMI_1080P30);
	}
	else if(vformat == HDMI_VIDEO_1920x1080p_60Hz)
	{
		MHL_DBG("[video_config]1080p_60 %p\n", si_dev_context);
		siHdmiTx_VideoSel(HDMI_1080P60);
	}
	else
	{
		MHL_DBG("%s, video format not support now\n", __func__);
	}

#ifdef CONFIG_MTK_HDMI_3D_SUPPORT
	if(vout & HDMI_VOUT_FORMAT_3D_SBS)
        MHL_3D_format=VIDEO_3D_SS;
	else if(vout & HDMI_VOUT_FORMAT_3D_TAB)
	    MHL_3D_format=VIDEO_3D_TB;
    else
	    MHL_3D_format = VIDEO_3D_NONE;
	    
	if(si_dev_context)
	{	    
        MHL_DBG("video format  -- %d, 0x%x, %d\n", MHL_3D_Support, vout, MHL_3D_format);
		if(vformat < HDMI_VIDEO_RESOLUTION_NUM)
		{
		    ///if(MHL_3D_Support && (MHL_3D_format > 0))
		    si_mhl_tx_drv_video_3d(si_dev_context, MHL_3D_format);			
            si_mhl_tx_set_path_en_I(si_dev_context);
		}
		else
		    si_mhl_tx_drv_video_3d_update(si_dev_context, MHL_3D_format);
 	}
 #else
    if(si_dev_context)
    	si_mhl_tx_set_path_en_I(si_dev_context);
 #endif
    return 0;
}
예제 #3
0
int hdmi_drv_power_on(void)
{
    int ret = 0;
	HDMI_FUNC();
	mt65xx_eint_mask(CUST_EINT_MHL_NUM);

#if 1
	SiiMhlTxHwGpioResume();
	//pmic_config_interface(0x87,0x1,0x01,0x0);
/* Vanzo:lubaoquan on: Tue, 21 May 2013 22:35:29 +0800
 * TODO: replace this line with your comment
 */
	hwPowerOn(MT65XX_POWER_LDO_VGP5, VOL_1200, "HDMI");
// End of Vanzo: lubaoquan
#endif

	//msleep(100);
    SiiMhlTxHwReset(5,5);

	//xuecheng
	HalInstallCheckDeviceCB(SiiCheckDevice);
    HalAcquireIsrLock();
    siHdmiTx_VideoSel(HDMI_720P60);
    siHdmiTx_AudioSel(I2S_44);
    ret = SiiMhlTxInitialize(EVENT_POLL_INTERVAL_MS);
    HalReleaseIsrLock();
	mt65xx_eint_unmask(CUST_EINT_MHL_NUM);
    return ret;
}
예제 #4
0
int sii9022xSetMode(int num)
{
	int ret;
	siHdmiTx_VideoSel(num);
	ret = siHdmiTx_VideoSet();
	i2cWriteReg(SII9022A_I2C_ADDRESS,0x63,0);
	return ret;
}
예제 #5
0
static int hdmi_drv_video_config(HDMI_VIDEO_RESOLUTION vformat, HDMI_VIDEO_INPUT_FORMAT vin, HDMI_VIDEO_OUTPUT_FORMAT vout)
{

	if(vformat == HDMI_VIDEO_720x480p_60Hz)
	{
		HDMI_LOG("[hdmi_drv]480p\n");
		siHdmiTx_VideoSel(HDMI_480P60_4X3);
	}
	else if(vformat == HDMI_VIDEO_1280x720p_60Hz)
	{
		HDMI_LOG("[hdmi_drv]720p\n");
		siHdmiTx_VideoSel(HDMI_720P60);
	}
	else
	{
		HDMI_LOG("%s, video format not support now\n", __func__);
	}
    return 0;
}
예제 #6
0
void hdmi_drv_power_on(void)
{
	HDMI_FUNC();
	mt65xx_eint_mask(CUST_EINT_HDMI_HPD_NUM);
	SiiMhlTxHwGpioResume();
	pmic_config_interface(0x87,0x1,0x01,0x0);
	//msleep(100);
    SiiMhlTxHwReset(50,200);

	//xuecheng
	HalInstallCheckDeviceCB(SiiCheckDevice);
    HalAcquireIsrLock();
    siHdmiTx_VideoSel(HDMI_720P60);
    siHdmiTx_AudioSel(I2S_44);
    SiiMhlTxInitialize(EVENT_POLL_INTERVAL_MS);
    HalReleaseIsrLock();
	mt65xx_eint_unmask(CUST_EINT_HDMI_HPD_NUM);
}
int32_t ResumeMhlTxDevice(void)
{
	//halReturn_t		halStatus;
	//SiiOsStatus_t	osalStatus;
    printk("Starting %s\n", MHL_PART_NAME);

	SiiMhlTxHwReset(10,200);  
    if(!SiiCraInitialize())
    {
    	SII_DEBUG_PRINT(SII_OSAL_DEBUG_TRACE,"Initialization of CRA layer failed!\n");
    	return -EIO;
    }
   
	//msleep(200);

    HalInstallCheckDeviceCB(SiiCheckDevice);
	HalAcquireIsrLock();
	siHdmiTx_VideoSel(HDMI_720P60);
	siHdmiTx_AudioSel(I2S_44);
    SiiMhlTxInitialize(EVENT_POLL_INTERVAL_MS);
    HalReleaseIsrLock();
    return 0;
}
int32_t StartMhlTxDevice(void)
{
	halReturn_t		halStatus;
	SiiOsStatus_t	osalStatus;
    printk("Starting %s\n", MHL_PART_NAME);

	SiiMhlTxHwReset(10,200);  
    if(!SiiCraInitialize())
    {
    	SII_DEBUG_PRINT(SII_OSAL_DEBUG_TRACE,"Initialization of CRA layer failed!\n");
    	return -EIO;
    }
    osalStatus = SiiOsInit(0);
    if (osalStatus != SII_OS_STATUS_SUCCESS)
    {
    	SII_DEBUG_PRINT(SII_OSAL_DEBUG_TRACE,"Initialization of OSAL failed, error code: %d\n",osalStatus);
    	return -EIO;
    }
    halStatus = HalInit();
    if (halStatus != HAL_RET_SUCCESS)
    {
    	SII_DEBUG_PRINT(SII_OSAL_DEBUG_TRACE,"Initialization of HAL failed, error code: %d\n",halStatus);
    	SiiOsTerm();
    	return -EIO;
    }

//#if MTK_project
    //xuecheng
    //I2c_Init();
//#endif
  
    halStatus = HalOpenI2cDevice(MHL_PART_NAME, MHL_DRIVER_NAME);
    if (halStatus != HAL_RET_SUCCESS)
    {
    	SII_DEBUG_PRINT(SII_OSAL_DEBUG_TRACE,"Opening of I2c device %s failed, error code: %d\n",
    			MHL_PART_NAME, halStatus);
    	HalTerm();
    	SiiOsTerm();
    	return -EIO;
    }
		

	msleep(200);
	
#ifdef SiI8338DRIVER_INTERRUPT_MODE
    halStatus = HalInstallIrqHandler(SiiMhlTxDeviceIsr);
    if (halStatus != HAL_RET_SUCCESS)
    {
    	SII_DEBUG_PRINT(SII_OSAL_DEBUG_TRACE,"Initialization of HAL interrupt support failed, error code: %d\n",
    			halStatus);
    	HalCloseI2cDevice();
    	HalTerm();
    	SiiOsTerm();
    	return -EIO;
    }

#else
		StartEventThread();		/* begin monitoring for events if using polling mode*/
#endif
    //xuecheng

    HalInstallCheckDeviceCB(SiiCheckDevice);
	HalAcquireIsrLock();
	siHdmiTx_VideoSel(HDMI_720P60);
	siHdmiTx_AudioSel(I2S_44);
    SiiMhlTxInitialize(EVENT_POLL_INTERVAL_MS);
    HalReleaseIsrLock();
    return 0;
}