void vSetHDMITxPLL(u8 bResIndex, u8 bdeepmode)
{
	u8 u4Feq = 0;
	MT8193_PLL_FUNC();

	vWriteHdmiDGIMsk(dgi0_anaif_ctrl1, dgi1_pad_clk_en,
			 anaif_dig1_clk_sel | dgi1_pad_clk_en | clk_sel_tv_mode | data_in_tv_mode |
			 dgi1_clk_pad_sel_tv_mode | tv_mode_clk_en);

	if ((bResIndex == HDMI_VIDEO_720x480p_60Hz) || (bResIndex == HDMI_VIDEO_720x576p_50Hz))
		u4Feq = 0;	/* 27M */
	else if ((bResIndex == HDMI_VIDEO_1920x1080p_60Hz)
		 || (bResIndex == HDMI_VIDEO_1920x1080p_50Hz))
		u4Feq = 2;	/* 148M */
	else
		u4Feq = 1;	/* 74M */

	if (((bResIndex == HDMI_VIDEO_1920x1080p_60Hz) || (bResIndex == HDMI_VIDEO_1920x1080p_50Hz))
	    && (bdeepmode == HDMI_DEEP_COLOR_12_BIT))
		vVideoPLLInit_1080P_36BIT();
	else
		vVideoPLLInit();

	udelay(10);
	if (bdeepmode == HDMI_NO_DEEP_COLOR) {
		vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL2, (HDMI_PLL_SETTING[u4Feq][0]), 0xFF);
		vWriteHdmiSYS(HDMI_SYS_PLLCTRL3,
			      (HDMI_PLL_SETTING[u4Feq][1]) | (HDMI_PLL_SETTING[u4Feq][2] << 8) |
			      (HDMI_PLL_SETTING[u4Feq][3] << 16) | (HDMI_PLL_SETTING[u4Feq][4] <<
								    24));
	} else if (bdeepmode == HDMI_DEEP_COLOR_10_BIT) {
		vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL2, (HDMI_PLL_SETTING_X_1_25[u4Feq][0]), 0xFF);
		vWriteHdmiSYS(HDMI_SYS_PLLCTRL3,
			      (HDMI_PLL_SETTING_X_1_25[u4Feq][1]) |
			      (HDMI_PLL_SETTING_X_1_25[u4Feq][2] << 8) |
			      (HDMI_PLL_SETTING_X_1_25[u4Feq][3] << 16) |
			      (HDMI_PLL_SETTING_X_1_25[u4Feq][4] << 24));
	} else if (bdeepmode == HDMI_DEEP_COLOR_12_BIT) {
		vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL2, (HDMI_PLL_SETTING_X_1_5[u4Feq][0]), 0xFF);
		vWriteHdmiSYS(HDMI_SYS_PLLCTRL3,
			      (HDMI_PLL_SETTING_X_1_5[u4Feq][1]) | (HDMI_PLL_SETTING_X_1_5[u4Feq][2]
								    << 8) |
			      (HDMI_PLL_SETTING_X_1_5[u4Feq][3] << 16) |
			      (HDMI_PLL_SETTING_X_1_5[u4Feq][4] << 24));
	}
	vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL6, RG_CK148M_EN, RG_CK148M_EN);


}
void vSetHDMITxPLL(u8 bResIndex, u8 bdeepmode)
{
  u8 u4Feq=0;
  MT8193_PLL_FUNC();
  
  if((bResIndex==HDMI_VIDEO_720x480p_60Hz)||(bResIndex==HDMI_VIDEO_720x576p_50Hz))
   u4Feq = 0; //27M
  else if((bResIndex==HDMI_VIDEO_1920x1080p_60Hz)||(bResIndex==HDMI_VIDEO_1920x1080p_50Hz))
   u4Feq = 2; //148M
  else
   u4Feq = 1; //74M
		
  if(((bResIndex==HDMI_VIDEO_1920x1080p_60Hz)||(bResIndex==HDMI_VIDEO_1920x1080p_50Hz))&&(bdeepmode==HDMI_DEEP_COLOR_12_BIT))
   vVideoPLLInit_1080P_36BIT();
  else
   vVideoPLLInit();	

  udelay(10);		
  if(bdeepmode==HDMI_NO_DEEP_COLOR)  
  {
   vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL2,(HDMI_PLL_SETTING[u4Feq][0]), 0xFF);	
   vWriteHdmiSYS(HDMI_SYS_PLLCTRL3,(HDMI_PLL_SETTING[u4Feq][1])|(HDMI_PLL_SETTING[u4Feq][2]<<8)|(HDMI_PLL_SETTING[u4Feq][3]<<16)|(HDMI_PLL_SETTING[u4Feq][4]<<24));      
  }
  else if(bdeepmode==HDMI_DEEP_COLOR_10_BIT)  
  {
   vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL2,(HDMI_PLL_SETTING_X_1_25[u4Feq][0]), 0xFF);	
   vWriteHdmiSYS(HDMI_SYS_PLLCTRL3,(HDMI_PLL_SETTING_X_1_25[u4Feq][1])|(HDMI_PLL_SETTING_X_1_25[u4Feq][2]<<8)|(HDMI_PLL_SETTING_X_1_25[u4Feq][3]<<16)|(HDMI_PLL_SETTING_X_1_25[u4Feq][4]<<24));      
  }
  else if(bdeepmode==HDMI_DEEP_COLOR_12_BIT)  
  {
   vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL2,(HDMI_PLL_SETTING_X_1_5[u4Feq][0]), 0xFF);	
   vWriteHdmiSYS(HDMI_SYS_PLLCTRL3,(HDMI_PLL_SETTING_X_1_5[u4Feq][1])|(HDMI_PLL_SETTING_X_1_5[u4Feq][2]<<8)|(HDMI_PLL_SETTING_X_1_5[u4Feq][3]<<16)|(HDMI_PLL_SETTING_X_1_5[u4Feq][4]<<24));      
  }
  vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL6, RG_CK148M_EN, RG_CK148M_EN);
  
  vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL2,POW_HDMITX, POW_HDMITX|POW_PLL_L);	
  udelay(20);
  vWriteHdmiSYSMsk(HDMI_SYS_PLLCTRL2,POW_HDMITX|POW_PLL_L, POW_HDMITX|POW_PLL_L);	

}