/* enable C8825D and U8825 huawei fir */
audio_property_type get_audio_fir_enabled(void)
{
    /* add the fir enabl for C8833D U8833D U8833 */
    /* add the fir for c8812e */
    /* add fir enable for G510U */
    if(machine_is_msm8x25_C8825D()
       || machine_is_msm8x25_U8825D()
       || machine_is_msm8x25_U8825()
       || machine_is_msm8x25_C8813()
       || machine_is_msm8x25_U8951()
       || machine_is_msm8x25_U8951D()
       || machine_is_msm8x25_H881C()
       || machine_is_msm8x25_C8812P()
       || machine_is_msm7x27a_C8820()
       || machine_is_msm7x27a_H867G()
       || machine_is_msm7x27a_H868C()
       || machine_is_msm8x25_C8833D()
       || machine_is_msm8x25_U8833D()
       || machine_is_msm8x25_U8833()
       )
    {
        return FIR_ENABLE;
    }
    else
    {
        return FIR_DISABLE;
    }
}
/* get bt device model by board id */
hw_bt_device_model get_hw_bt_device_model(void)
{
    if(machine_is_msm8x25_U8950D()
	  || machine_is_msm8x25_U8950()
      || machine_is_msm7x27a_H867G()
      || machine_is_msm8x25_H881C()
      || machine_is_msm7x27a_H868C()	
      || machine_is_msm8x25_C8950D())
    {
        return BT_BCM4330;
    }
    else if(machine_is_msm8x25_U8825()
      || machine_is_msm8x25_U8825D()
      || machine_is_msm8x25_C8825D()
      || machine_is_msm8x25_C8833D()
      || machine_is_msm8x25_U8951D()
      || machine_is_msm8x25_U8951()
      || machine_is_msm8x25_U8833D()
      || machine_is_msm8x25_U8833()
      || machine_is_msm8x25_C8813()
      || machine_is_msm8x25_C8812P())
    {
        return BT_WCN2243;
    }
    else
    {
        return BT_UNKNOWN;
    }
}
/*  FUNCTION  get_hw_wifi_device_model
 *  DEPENDENCIES 
 *      get wifi device model.
 *      affect app_info.
 *  RETURN VALUE
 *      wifi device model:WIFI_QUALCOMM_6005 or WIFI_BROADCOM_4329 ro WIFI_BROADCOM_4330
 */
hw_wifi_device_model get_hw_wifi_device_model(void)
{
  if(machine_is_msm7x27a_U8185()|| machine_is_msm7x27a_U8661()|| machine_is_msm7x27a_C8668D()
        || machine_is_msm8x25_C8825D()
        || machine_is_msm8x25_U8825D() 
        || machine_is_msm8x25_U8825()
        || machine_is_msm8x25_C8833D()
        || machine_is_msm8x25_U8951D()
        || machine_is_msm8x25_U8951()
        || machine_is_msm8x25_U8833D()
        || machine_is_msm8x25_U8833()        
        || machine_is_msm8x25_C8813()
        || machine_is_msm8x25_C8812P())
  {
      return WIFI_QUALCOMM_6005;
  }
  else if(machine_is_msm8255_u8860() 
		|| machine_is_msm8255_c8860() 
		|| machine_is_msm8255_u8860lp()
        || machine_is_msm8255_u8860_r()
		|| machine_is_msm8255_u8860_92()
		|| machine_is_msm8255_u8860_51())
  {
      return WIFI_BROADCOM_4329;
  }
  else
  {
      return WIFI_BROADCOM_4330;
  }
}
/*===========================================================================


FUNCTION     audio_property_type get_audio_mic_type

DESCRIPTION
       This function descripe the fluence of dual mic arithmetic is enable or disable

DEPENDENCIES
  
RETURN VALUE
  SINGLE_MIC  or DUAL_MIC

SIDE EFFECTS
  None
===========================================================================*/
audio_property_type get_audio_mic_type(void)
{
  if(machine_is_msm7x27a_U8185()
     || (machine_is_msm7x27a_C8820() && (HW_VER_SUB_VC <= get_hw_sub_board_id()))
     || machine_is_msm8x25_U8825()
     || machine_is_msm8x25_U8825D()
     || machine_is_msm8x25_C8950D()
     || machine_is_msm8x25_U8950()
     || machine_is_msm8x25_U8950D()
     || machine_is_msm8x25_C8825D()
     || machine_is_msm8x25_C8833D()
     || machine_is_msm8x25_U8951D()
     || machine_is_msm8x25_U8951()
     || machine_is_msm8x25_U8833D()
     || machine_is_msm8x25_U8833()     
     || machine_is_msm8x25_C8813()
     || machine_is_msm8x25_C8812P()
    )
  {
      return SINGLE_MIC;
  }
  else
  {
      return DUAL_MIC;
  }  
}
hw_camera_type get_hw_camera_mirror_type(void)
{
    hw_camera_type ret = HW_CAMERA_NONES;
    if( machine_is_msm7x27a_C8820() || machine_is_msm7x27a_U8661() 
    ||machine_is_msm8x25_U8951()||machine_is_msm8x25_U8951D())
    {
        ret = HW_MIRROR_AND_FLIP;
    }
    else
    {
      ret = HW_NOT_MIRROR_OR_FLIP;
    }
  return ret;
}
/*===========================================================================


FUNCTION     audio_property_type get_audio_dts_enable

DESCRIPTION
           This function descripe if dts audio effect is enabled.

DEPENDENCIES
  
RETURN VALUE
  DTS_ENABLE or DTS_DISABLE

SIDE EFFECTS
  None
===========================================================================*/
audio_property_type get_audio_dts_enable(void)
{
    if( machine_is_msm8x25_U8825()
      || machine_is_msm8x25_U8825D()
      || machine_is_msm8x25_C8950D()
      || machine_is_msm8x25_U8950()
      || machine_is_msm8x25_U8950D()
      || machine_is_msm8x25_U8951D()
      || machine_is_msm8x25_U8951())
    {
        return DTS_ENABLE;
    }
    else
    {
        return DTS_DISABLE;
    }
}
/*  FUNCTION  get_touch_type
 *  DEPENDENCIES 
 *      get tp project type.
 *  RETURN VALUE
 *      TP_COB: use cob code auto upgreade FW.
 *      TP_COF: Not use cob code, use before code.
 */
tp_type get_touch_type(void)
{
	if(machine_is_msm8x25_C8833D()
	    || machine_is_msm8x25_U8951D()
        || machine_is_msm8x25_U8951()
        || machine_is_msm8x25_U8833D()
        || machine_is_msm8x25_U8833()        
        || machine_is_msm8x25_C8951()
       )
	{
		return TP_COB;
	}
	else
	{
		return TP_COF;
	}
}
hw_camera_type get_hw_camera_mirror_type(void)
{
    hw_camera_type ret = HW_NOT_MIRROR_OR_FLIP;
    if( machine_is_msm7x27a_C8820() || machine_is_msm7x27a_U8661() 
    || machine_is_msm7x27a_U8655_EMMC()
    || machine_is_msm7x27a_H867G()
    || machine_is_msm7x27a_H868C())
    {
        /*back camera should mirror and flip*/
        ret |= HW_MIRROR_AND_FLIP;
    }
    if(machine_is_msm8x25_U8951()
    ||machine_is_msm8x25_U8951D())
    {
        /*front camera should mirror and flip*/
        ret |= HW_MIRROR_AND_FLIP << 1;
    }
  return ret;
}
audio_property_type get_audio_fm_type(void)
{
   if (machine_is_msm7x27a_U8185()
      || machine_is_msm8x25_U8825()
      || machine_is_msm8x25_U8825D()
      || machine_is_msm8x25_U8951D()
      || machine_is_msm8x25_U8951()
      || machine_is_msm8x25_C8825D()
      || machine_is_msm7x27a_U8661() 
      || machine_is_msm7x27a_C8668D()
      || machine_is_msm8x25_C8833D()
      || machine_is_msm8x25_U8833D()
      || machine_is_msm8x25_U8833()      
      || machine_is_msm8x25_C8813()
      || machine_is_msm8x25_C8812P())
   {
       return FM_QUALCOMM;
   }
   else
   {
       return FM_BROADCOM;
   }
}
/*  FUNCTION  get_hw_wifi_device_type
 *  DEPENDENCIES 
 *      get wifi device type.
 *      affect wifi and camer.
 *  RETURN VALUE
 *      wifi device type:WIFI_QUALCOMM or WIFI_BROADCOM
 */
hw_wifi_device_type get_hw_wifi_device_type(void)
{
  if (machine_is_msm7x27a_U8185()
    || machine_is_msm7x27a_U8661() 
    || machine_is_msm8x25_C8825D() 
    || machine_is_msm8x25_U8825()
    || machine_is_msm8x25_U8825D()
    || machine_is_msm7x27a_C8668D()
    || machine_is_msm8x25_C8833D()
    || machine_is_msm8x25_U8951D()
    || machine_is_msm8x25_U8951()
    || machine_is_msm8x25_U8833D()
    || machine_is_msm8x25_U8833()    
    || machine_is_msm8x25_C8813()
    || machine_is_msm8x25_C8812P())
  {
      return WIFI_QUALCOMM;
  }
  else
  {
      return WIFI_BROADCOM;
  }
}
/*===========================================================================


FUNCTION     get_compass_gs_position

DESCRIPTION
  This function probe which G-sensor & Campass status type should be used

DEPENDENCIES
  
RETURN VALUE
  None

SIDE EFFECTS
  None
===========================================================================*/
compass_gs_position_type  get_compass_gs_position(void)
{
	compass_gs_position_type compass_gs_position=COMPASS_TOP_GS_TOP;
	/* modify compass and gs position by board id */
    //move C8820\25D define from TOP to BOTTOM
    if (machine_is_msm7x27a_surf() 
        || machine_is_msm7x27a_ffa() 
        || machine_is_msm7x27a_U8815()
        || machine_is_msm8x25_C8950D()
        || (machine_is_msm8x25_U8950() && (HW_VER_SUB_VB <= get_hw_sub_board_id()))
        || machine_is_msm8x25_H881C()
        || machine_is_msm8x25_U8950D()
        )
	{
		compass_gs_position=COMPASS_TOP_GS_TOP;
	}
	/*version A and version B has compass, since version C don't have compass*/
	else if(machine_is_msm7x27a_C8820() && (HW_VER_SUB_VC <= get_hw_sub_board_id()))
	{
		compass_gs_position=COMPASS_NONE_GS_BOTTOM;
	}
	/* add U8655_EMMC, use the u8655 configuration */
	else if (machine_is_msm7x27a_U8655() 
		  || machine_is_msm7x27a_U8655_EMMC()  
		  || machine_is_msm7x27a_C8655_NAND()  
		  || machine_is_msm7x27a_M660()  
		  || machine_is_msm7x27a_U8661()    
		  || machine_is_msm7x27a_C8820()   
		  || machine_is_msm7x27a_H867G()
		  || machine_is_msm7x27a_H868C()
		  || machine_is_msm8x25_C8825D()
		  || machine_is_msm7x30_u8800()
		  || machine_is_msm7x30_u8820() 
		  || machine_is_msm7x30_u8800_51()
		  || machine_is_msm8255_u8800_pro()
		  || machine_is_msm8255_u8860() 
		  || machine_is_msm8255_c8860()
		  || machine_is_msm8x25_U8951()
		  || machine_is_msm8x25_U8825()
          || machine_is_msm8x25_U8825D()
		  || (machine_is_msm8x25_U8950() && (HW_VER_SUB_VA == get_hw_sub_board_id()))
		  || machine_is_msm8255_u8860lp()
          || machine_is_msm8255_u8860_r()
		  || machine_is_msm8255_u8860_92()            
		  || machine_is_msm8255_u8860_51())
	{
		compass_gs_position=COMPASS_BOTTOM_GS_BOTTOM;
	}
	else if (machine_is_msm7x27a_U8185())	
	{
		compass_gs_position=COMPASS_NONE_GS_TOP;
	}
	else if(machine_is_msm8255_u8680() 
	     || machine_is_msm8255_u8730())
	{
	    compass_gs_position=COMPASS_TOP_GS_TOP;
	}
    else if (machine_is_msm7x27a_C8668D() 
		|| machine_is_msm8x25_C8833D()
        || machine_is_msm8x25_U8833D()
        || machine_is_msm8x25_U8833()
		)	
	{
		compass_gs_position = COMPASS_BOTTOM_GS_TOP;
	}
    else if (machine_is_msm8x25_C8812P()
         || machine_is_msm8x25_C8813()
	     || machine_is_msm8x25_U8951D() )
	{
		compass_gs_position=COMPASS_NONE_GS_BOTTOM;
	}
	return compass_gs_position;
}
/*modify lcd name*/
lcd_panel_type get_lcd_panel_type(void)
{
	lcd_panel_type hw_lcd_panel = LCD_NONE;
	/*remove two products to adjust new LCD type*/
	/* separate Y300 from 8825 serials and make sure it can run BOE LCD well */
	/* Add Oem LCD driver */
	if ( machine_is_msm8x25_C8833D() 
		|| machine_is_msm8x25_U8833D()	
		|| machine_is_msm8x25_U8833()
	)
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_CMD_OTM8009A_CHIMEI_WVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_CMD_HX8369A_TIANMA_WVGA;
				break;
			case LCD_HW_ID2:
				hw_lcd_panel = MIPI_VIDEO_HX8369B_TIANMA_WVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_CMD_NT35510_BOE_WVGA;
				break;
			/*Add nt35512 video mode for byd*/
			case LCD_HW_ID6:
				hw_lcd_panel = MIPI_VIDEO_NT35512_BYD_WVGA;
				break;
			/*Add otm8018b for video mode*/
			case LCD_HW_ID8:
				hw_lcd_panel = MIPI_VIDEO_OTM8018B_CHIMEI_WVGA;
				break;
			/*Add nt35512 for video mode*/
			case LCD_HW_ID9:
				hw_lcd_panel = MIPI_VIDEO_NT35512_BOE_WVGA;
				break;
            case LCD_HW_IDA:
                hw_lcd_panel = MIPI_CMD_NT35510_CHIMEI_WVGA;
				break;
			default:
				hw_lcd_panel = MIPI_CMD_NT35510_BOE_WVGA;
				break;
		}
	}
	else if (machine_is_msm8x25_H881C())
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_CMD_NT35510_CHIMEI_WVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_CMD_HX8369A_TIANMA_WVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_CMD_NT35510_BOE_WVGA;
				break;
			default:
				hw_lcd_panel = MIPI_CMD_NT35510_BOE_WVGA;
				break;
		}
	}
	else if(  machine_is_msm8x25_U8825()
		|| machine_is_msm8x25_U8825D()	
		|| machine_is_msm8x25_C8825D()
		|| machine_is_msm8x25_C8812P()
	)
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_CMD_RSP61408_CHIMEI_WVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_CMD_HX8369A_TIANMA_WVGA;
				break;
			case LCD_HW_ID4:
				hw_lcd_panel = MIPI_CMD_RSP61408_BYD_WVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_CMD_RSP61408_TRULY_WVGA;
				break;
			case LCD_HW_IDA:
				hw_lcd_panel = MIPI_CMD_NT35510_BOE_WVGA;
				break;
			default:
				hw_lcd_panel = MIPI_CMD_NT35510_BOE_WVGA;
				break;
		}
	}
	else if (machine_is_msm8x25_C8950D()
		|| machine_is_msm8x25_U8950()
		|| machine_is_msm8x25_U8950D())  
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_CMD_NT35516_CHIMEI_QHD;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_CMD_NT35516_TIANMA_QHD;
				break;
			default: 
				hw_lcd_panel = MIPI_CMD_NT35516_TIANMA_QHD;
				break;
		}
	}
	else if ( machine_is_msm8x25_U8951D()
        || machine_is_msm8x25_C8813()
		|| machine_is_msm8x25_U8951())
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_CMD_NT35510_BOE_FWVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_CMD_HX8369A_TIANMA_FWVGA;
				break;
			case LCD_HW_ID4:
				hw_lcd_panel = MIPI_CMD_OTM8009A_CHIMEI_FWVGA;
				break;
			default:
				hw_lcd_panel = MIPI_CMD_HX8369A_TIANMA_FWVGA;
				break;
		}
	}
	else if( machine_is_msm7x27a_U8815() 
		|| machine_is_msm7x27a_C8820())

	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_CMD_RSP61408_CHIMEI_WVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_CMD_HX8369A_TIANMA_WVGA;
				break;
			case LCD_HW_ID4:
				hw_lcd_panel = MIPI_CMD_RSP61408_BYD_WVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_CMD_RSP61408_TRULY_WVGA;
				break;
			default:
				/*no mipi LCD lead to block, so default lcd RGB */
				hw_lcd_panel = LCD_HX8357B_TIANMA_HVGA;
				break;
		}
	}
	else if( machine_is_msm7x27a_U8655_EMMC())
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_CMD_HX8357C_CHIMEI_HVGA;
				break;
			case LCD_HW_ID1:
			    hw_lcd_panel = MIPI_CMD_HX8357C_TIANMA_IPS_HVGA;
				break;
			case LCD_HW_ID4:
				hw_lcd_panel = MIPI_CMD_HX8357C_CHIMEI_IPS_HVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_CMD_HX8357C_TIANMA_HVGA;
				break;
			default: 
				/*no mipi LCD lead to block, so default lcd RGB */
				hw_lcd_panel = MIPI_CMD_HX8357C_CHIMEI_IPS_HVGA;
				break;
		}
	}
	else if(machine_is_msm7x27a_H867G())
	{
		/* U8686 is H867G ver.E,use tianma IPS and chimei IPS LCD */
		if(HW_VER_SUB_VE == get_hw_sub_board_id())
		{
			switch (lcd_id)
			{
				case LCD_HW_ID0:
					hw_lcd_panel = MIPI_CMD_NT35310_BYD_HVGA;
					break;
				case LCD_HW_ID1:
					hw_lcd_panel = MIPI_CMD_HX8357C_TIANMA_IPS_HVGA;
					break;
				case LCD_HW_ID4:
					hw_lcd_panel = MIPI_CMD_HX8357C_CHIMEI_IPS_HVGA;
					break;
				case LCD_HW_ID5:
					hw_lcd_panel = MIPI_CMD_NT35310_BOE_HVGA;
					break;
				default:
					hw_lcd_panel = MIPI_CMD_NT35310_BOE_HVGA;
					break;
			}
		}
		else
		{
			switch (lcd_id)
			{
				case LCD_HW_ID0:
					hw_lcd_panel = MIPI_CMD_NT35310_BYD_HVGA;
					break;
				case LCD_HW_ID1:
					hw_lcd_panel = MIPI_CMD_NT35310_TIANMA_HVGA;
					break;
				case LCD_HW_ID5:
					hw_lcd_panel = MIPI_CMD_NT35310_BOE_HVGA;
					break;
				default:
					hw_lcd_panel = MIPI_CMD_NT35310_BOE_HVGA;
					break;
			}
		}
	}
	else if(machine_is_msm7x27a_H868C())
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_CMD_NT35310_BYD_HVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_CMD_NT35310_TIANMA_HVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_CMD_NT35310_BOE_HVGA;
				break;
			default:
				hw_lcd_panel = MIPI_CMD_NT35310_BOE_HVGA;
				break;
		}
	}
	else
	{
		hw_lcd_panel = LCD_HX8357B_TIANMA_HVGA;
	}
	return hw_lcd_panel;
}
/*
 *brief: get lcd panel resolution
 */
lcd_type get_hw_lcd_resolution_type(void)
{
    lcd_type lcd_resolution = LCD_IS_HVGA;

/* add 8x55 paltform products */
    /*delete some lines for changing the lcd resolution of C8950D/U8950*/
    /*remove two products to adjust new LCD type*/
    if ( machine_is_msm7x27a_U8815() 
        || machine_is_msm8x25_U8825()
        || machine_is_msm8x25_U8825D()
        || machine_is_msm7x27a_C8820()
        || machine_is_msm8x25_C8825D()
        || machine_is_msm7x30_u8800()
        || machine_is_msm7x30_u8820() 
        || machine_is_msm7x30_u8800_51() 
        || machine_is_msm8255_u8800_pro()
        || machine_is_msm8255_u8680()
        || machine_is_msm8255_u8730()
        || machine_is_msm8x25_C8833D()
        || machine_is_msm8x25_U8833D()
        || machine_is_msm8x25_U8833()        
        || machine_is_msm8x25_H881C()
        || machine_is_msm8x25_C8812P())
	{
		lcd_resolution = LCD_IS_WVGA;
	}
	else if (machine_is_msm8x25_C8950D()
		|| machine_is_msm8x25_U8950()
		|| machine_is_msm8x25_U8950D())
	{
		lcd_resolution = LCD_IS_QHD;
	}
	else if (machine_is_msm8255_u8860() 
		|| machine_is_msm8255_c8860() 
		|| machine_is_msm8255_u8860lp()
        || machine_is_msm8255_u8860_r()
		|| machine_is_msm8255_u8860_92()
        || machine_is_msm8x25_C8813()
		|| machine_is_msm8255_u8860_51()
		|| machine_is_msm8x25_U8951D()
		|| machine_is_msm8x25_U8951())
	{
		lcd_resolution = LCD_IS_FWVGA;
	}
	/* C8668D uses HVGA. */
	else if ( machine_is_msm7x27a_M660() 
		|| machine_is_msm7x27a_U8655()	
		|| machine_is_msm7x27a_U8655_EMMC()
		|| machine_is_msm7x27a_C8655_NAND()
		|| machine_is_msm8255_u8667()
		|| machine_is_msm7x27a_U8661()
		|| machine_is_msm7x27a_H867G()
		|| machine_is_msm7x27a_H868C()
		|| machine_is_msm7x27a_C8668D())
	{
		lcd_resolution = LCD_IS_HVGA;
	}
	else if (machine_is_msm7x27a_U8185())
	{
		lcd_resolution = LCD_IS_QVGA;
	}
	else
	{
		lcd_resolution = LCD_IS_HVGA;
	}

    return lcd_resolution;
}
/*change get config method */
uint8_t *get_tp_version_config(int module_id,u16 ic_type)
{
    uint8_t * temp_config = NULL;
	/*Move Y301_A1 down*/
	if (machine_is_msm8x25_U8833D()
	    || machine_is_msm8x25_U8833()
		|| machine_is_msm8x25_H881C()
	    || machine_is_msm8x25_C8833D())
	{
	    if (IC_TYPE_2202 == ic_type)
	    {
			switch(module_id)
			{
				case TP_COB_ID0:
				     temp_config = tp_y300_ofilm_config;
				     break;
				case TP_COB_ID2:
				     temp_config = tp_y300_ecw_config;
				     break;
				case TP_COB_ID8:   
				     temp_config = tp_y300_truly_config;
				     break;
				default: 
				     temp_config = tp_default_4_config;	
				     break;
			}  
		}
		else
		{
			 temp_config = tp_default_4_config;
		}
		
	}
	else if (machine_is_msm8x25_U8951D()
	         || machine_is_msm8x25_U8951()
	         || machine_is_msm8x25_C8813())
	{
		if (IC_TYPE_2202 == ic_type)
	    {
			switch(module_id)
			{
				case TP_COB_ID0:
				     temp_config = tp_g510_ofilm_config;
				     break;
				case TP_COB_ID8:
				     temp_config = tp_g510_truly_config;
				     break;
				case TP_COB_IDA:   
				     temp_config = tp_g510_jdc_config;
				     break;
				default: 
				     temp_config = tp_default_45_config;	
				     break;
			}  
		}
		else
		{
			 temp_config = tp_default_45_config;
		}
	}
	else if (machine_is_msm8x25_Y301_A1())
	{
		if (IC_TYPE_2202 == ic_type)
		{
			switch(module_id)
			{
				case TP_COB_ID0:
					 temp_config = tp_y301_a1_ofilm_config;
					 break;
				default: 
					 temp_config = tp_default_btn4_config; 
					 break;
			}  
		}
		else
		{
			 temp_config = tp_default_btn4_config;
		}
	}
	else
	{
		if (IC_TYPE_2202 == ic_type)
	    {
			switch(module_id)
			{
				case TP_COB_ID0:
				     temp_config = tp_y300_ofilm_config;
				     break;
				case TP_COB_ID2:
				     temp_config = tp_y300_ecw_config;
				     break;
				case TP_COB_ID8:   
				     temp_config = tp_y300_truly_config;
				     break;
				default: 
				     temp_config = tp_default_4_config;	
				     break;
			}  
		}
		else
		{
			 temp_config = tp_default_4_config;
		}
		printk(KERN_WARNING "COB matching config failed! now select the default config\n");
	}
	return temp_config;
}
static void __init virtualkeys_init(void)
{
    struct kobject *properties_kobj;
    int ret=0;
    /*Modify the virtualkeys of touchsreen*/
    if(machine_is_msm7x27a_U8815()
        || machine_is_msm8x25_U8825()
        || machine_is_msm8x25_U8825D()
        || machine_is_msm8x25_C8825D()
        || machine_is_msm8x25_C8833D()
        || machine_is_msm8x25_U8833D()
        || machine_is_msm8x25_U8833()
		|| machine_is_msm7x27a_C8820()
        || machine_is_msm8x25_H881C()
        || machine_is_msm8x25_C8812P())
    {
    	buf_vkey_size = sprintf(buf_virtualkey,
        			__stringify(EV_KEY) ":" __stringify(KEY_BACK)  ":57:850:100:80"
        		   ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME)   ":240:850:100:80"
        		   ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":423:850:100:80"
        		   "\n"); 
    }

    else if(machine_is_msm8x25_C8950D()
        || machine_is_msm8x25_U8950D()
        || machine_is_msm8x25_U8950())
    {
        buf_vkey_size = sprintf(buf_virtualkey,
        			__stringify(EV_KEY) ":" __stringify(KEY_BACK)  ":80:1035:160:80"
        		   ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME)   ":270:1035:160:80"
        		   ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":460:1035:160:80"
        		   "\n"); 
    }
    /*New add FWVGA virtual keys */
    else if (machine_is_msm8x25_U8951D()
        || machine_is_msm8x25_C8813()
        || machine_is_msm8x25_U8951())
	/* modify the area of virtualkeys */
    {
    	buf_vkey_size = sprintf(buf_virtualkey,
        			__stringify(EV_KEY) ":" __stringify(KEY_BACK)  ":71:900:142:80"
        		   ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME)   ":240:900:142:80"
        		   ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":409:900:142:80"
        		   "\n"); 
    }
    else if (machine_is_msm7x27a_H867G()
           ||machine_is_msm7x27a_H868C()
           )
    {
	    /* 3 key configuration for 3.5" TP */
    /*calibrate virtualkey for H867G and H868C*/
        buf_vkey_size = sprintf(buf_virtualkey,
                  __stringify(EV_KEY) ":" __stringify(KEY_BACK)  ":50:510:80:50"
                  ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME)   ":160:510:80:50"
                  ":" __stringify(EV_KEY) ":" __stringify(KEY_MENU) ":270:510:80:50"
                  "\n");
    }
    else if (machine_is_msm7x27a_U8655_EMMC())
    {
    	/*4 virtual keys for att */
    	if (HW_VER_SUB_VE <= get_hw_sub_board_id())
    	{
    	    buf_vkey_size = sprintf(buf_virtualkey,
        		          __stringify(EV_KEY) ":" __stringify(KEY_MENU)  ":30:510:60:50"
        		          ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME)   ":115:510:80:50"
        		          ":" __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":205:510:80:50"
        		          ":" __stringify(EV_KEY) ":" __stringify(KEY_SEARCH) ":290:510:60:50"
        		          "\n"); 
    	}
    	else
    	{
            buf_vkey_size = sprintf(buf_virtualkey,
        		          __stringify(EV_KEY) ":" __stringify(KEY_MENU)  ":30:510:60:50"
        		          ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME)   ":165:510:100:50"
        		          ":" __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":290:510:60:50"
        		          "\n"); 
    	}
    }
    else
    {
    	buf_vkey_size = sprintf(buf_virtualkey,
        			__stringify(EV_KEY) ":" __stringify(KEY_MENU)  ":57:850:100:80"
        		   ":" __stringify(EV_KEY) ":" __stringify(KEY_HOME)   ":240:850:100:80"
        		   ":" __stringify(EV_KEY) ":" __stringify(KEY_BACK) ":423:850:100:80"
        		   "\n"); 
    }

    properties_kobj = kobject_create_and_add("board_properties", NULL);
	if (properties_kobj)
		ret = sysfs_create_group(properties_kobj,
					 &virtualkey_properties_attr_group);
	if (!properties_kobj || ret)
		pr_err("failed to create board_properties\n");
}
lcd_panel_type get_lcd_panel_type(void)
{
	lcd_panel_type hw_lcd_panel = LCD_NONE;
	/*remove two products to adjust new LCD type*/
	/* separate Y300 from 8825 serials and make sure it can run BOE LCD well */
	if ( machine_is_msm8x25_C8833D() 
        || machine_is_msm8x25_U8833D()
        || machine_is_msm8x25_U8833()
       )
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_OTM8009A_CHIMEI_WVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_HX8369A_TIANMA_WVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_NT35510_BOE_WVGA;
				break;
			default:
				hw_lcd_panel = MIPI_NT35510_BOE_WVGA;
				break;
		}
	}
	else if(  machine_is_msm8x25_U8825()
		|| machine_is_msm8x25_U8825D()
		
		|| machine_is_msm8x25_C8825D()
		|| machine_is_msm8x25_C8812P()
		)
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_RSP61408_CHIMEI_WVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_HX8369A_TIANMA_WVGA;
				break;
			case LCD_HW_ID4:
				hw_lcd_panel = MIPI_RSP61408_BYD_WVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_RSP61408_TRULY_WVGA;
				break;
			case LCD_HW_IDA:
				hw_lcd_panel = MIPI_NT35510_BOE_WVGA;
				break;
			default:
				hw_lcd_panel = MIPI_NT35510_BOE_WVGA;
				break;
		}
	}
	else if (machine_is_msm8x25_C8950D()
		|| machine_is_msm8x25_U8950()
		|| machine_is_msm8x25_U8950D())  
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_NT35516_CHIMEI_QHD;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_NT35516_TIANMA_QHD;
				break;
			default: 
				hw_lcd_panel = MIPI_NT35516_TIANMA_QHD;
				break;
		}
	}
	else if ( machine_is_msm8x25_U8951D()
        || machine_is_msm8x25_C8951()
		|| machine_is_msm8x25_U8951())
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_NT35510_BOE_FWVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_HX8369A_TIANMA_FWVGA;
				break;
			default:
				hw_lcd_panel = MIPI_HX8369A_TIANMA_FWVGA;
				break;
		}
	}
	else if( machine_is_msm7x27a_U8815() 
		|| machine_is_msm7x27a_C8820())

	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_RSP61408_CHIMEI_WVGA;
				break;
			case LCD_HW_ID1:
				hw_lcd_panel = MIPI_HX8369A_TIANMA_WVGA;
				break;
			case LCD_HW_ID4:
				hw_lcd_panel = MIPI_RSP61408_BYD_WVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_RSP61408_TRULY_WVGA;
				break;
			default:
				/*no mipi LCD lead to block, so default lcd RGB */
				hw_lcd_panel = LCD_HX8357B_TIANMA_HVGA;
				break;
		}
	}
	else if( machine_is_msm7x27a_U8655_EMMC())
	{
		switch (lcd_id)
		{
			case LCD_HW_ID0:
				hw_lcd_panel = MIPI_HX8357C_CHIMEI_HVGA;
				break;
			case LCD_HW_ID1:
			    hw_lcd_panel = MIPI_HX8357C_TIANMA_IPS_HVGA;
				break;
			case LCD_HW_ID4:
				hw_lcd_panel = MIPI_HX8357C_CHIMEI_IPS_HVGA;
				break;
			case LCD_HW_ID5:
				hw_lcd_panel = MIPI_HX8357C_TIANMA_HVGA;
				break;
			default: 
				/*no mipi LCD lead to block, so default lcd RGB */
				hw_lcd_panel = MIPI_HX8357C_CHIMEI_IPS_HVGA;
				break;
		}
	}
	else
	{
		hw_lcd_panel = LCD_HX8357B_TIANMA_HVGA;
	}
	return hw_lcd_panel;
}