Example #1
0
int rk610_hdmi_sys_init(struct hdmi *hdmi)
{
	// System power power off
	HDMIWrReg(SYS_CTRL, v_REG_CLK_SOURCE_IIS | v_PWR_OFF | v_INT_POL_HIGH);
	
	//Synchronize analog module.
//	HDMIWrReg(PHY_SYNC, 0x00);
//	HDMIWrReg(PHY_SYNC, 0x01);
	
	// set hdmi phy parameters
	// driver mode
	HDMIWrReg(PHY_DRIVER, v_MAIN_DRIVER(8)| v_PRE_DRIVER(0) | v_TX_ENABLE(0));
//	HDMIWrReg(PHY_PRE_EMPHASIS, 0x04);
	HDMIWrReg(PHY_PRE_EMPHASIS, v_PRE_EMPHASIS(0) | v_TMDS_PWRDOWN(1));	//Driver power down	
	// pll mode
	HDMIWrReg(0xe8, 0x10);
	HDMIWrReg(0xe6, 0x2c);
#if 0
	HDMIWrReg(PHY_PLL_CTRL, 0);
#else
	HDMIWrReg(PHY_PLL_CTRL, v_PLL_DISABLE(1) | v_PLL_RESET(1) | v_TMDS_RESET(1));
	HDMIWrReg(PHY_PLL_LDO_PWR, v_LDO_PWR_DOWN(1));
	HDMIWrReg(PHY_BANDGAP_PWR, v_BANDGAP_PWR_DOWN);
#endif

	// Enable Hotplug interrupt
	HDMIWrReg(INTERRUPT_MASK1, m_INT_HOTPLUG);
	return HDMI_ERROR_SUCESS;
}
Example #2
0
int rk610_hdmi_sys_remove(struct hdmi *hdmi)
{
	if(rk610_hdmi->hdcp_power_off_cb)
		rk610_hdmi->hdcp_power_off_cb();
	HDMIWrReg(PHY_DRIVER, v_MAIN_DRIVER(8)| v_PRE_DRIVER(0) | v_TX_ENABLE(0));
	HDMIWrReg(PHY_PRE_EMPHASIS, v_PRE_EMPHASIS(0) | v_TMDS_PWRDOWN(1));	//Driver power down	
	HDMIWrReg(PHY_PLL_CTRL, v_PLL_DISABLE(1) | v_PLL_RESET(1) | v_TMDS_RESET(1));
	HDMIWrReg(PHY_PLL_LDO_PWR, v_LDO_PWR_DOWN(1));
	HDMIWrReg(PHY_BANDGAP_PWR, v_BANDGAP_PWR_DOWN);
	return 0;
}
int rk610_hdmi_sys_remove(void)
{
	hdmi_dbg(hdmi->dev, "%s \n", __FUNCTION__);
	if(hdmi->hdcp_power_off_cb)
		hdmi->hdcp_power_off_cb();
	HDMIWrReg(PHY_DRIVER, v_MAIN_DRIVER(8)| v_PRE_DRIVER(0) | v_TX_ENABLE(0));
	HDMIWrReg(PHY_PRE_EMPHASIS, v_PRE_EMPHASIS(0) | v_TMDS_PWRDOWN(1));	//Driver power down	
	HDMIWrReg(PHY_PLL_CTRL, v_PLL_DISABLE(1) | v_PLL_RESET(1) | v_TMDS_RESET(1));
	HDMIWrReg(PHY_PLL_LDO_PWR, v_LDO_PWR_DOWN(1));
	HDMIWrReg(PHY_BANDGAP_PWR, v_BANDGAP_PWR_DOWN);
	return 0;
}