void MsDrvInterfaceTouchDeviceResume(struct early_suspend *pSuspend)
{
    DBG("*** %s() ***\n", __func__);
	
#ifdef CONFIG_ENABLE_GESTURE_WAKEUP
    if (g_GestureWakeupFlag == 1)
    {
        DrvIcFwLyrCloseGestureWakeup();
    }
    else
    {
        DrvPlatformLyrEnableFingerTouchReport(); 
    }
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
    
    DrvPlatformLyrTouchDevicePowerOn();
    
#ifdef CONFIG_ENABLE_FIRMWARE_DATA_LOG
//    DrvIcFwLyrRestoreFirmwareModeToLogDataMode(); // Mark this function call for avoiding device driver may spend longer time to resume from suspend state.
#endif //CONFIG_ENABLE_FIRMWARE_DATA_LOG

#ifndef CONFIG_ENABLE_GESTURE_WAKEUP
    DrvPlatformLyrEnableFingerTouchReport(); 
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
}
void MsDrvInterfaceTouchDeviceResume(struct early_suspend *pSuspend)
{
    DBG("*** %s() ***\n", __func__);

    if(program_over ==0)
		return;
#ifdef CONFIG_ENABLE_GESTURE_WAKEUP
    if (g_GestureWakeupFlag == 1)
    {
        DrvIcFwLyrCloseGestureWakeup();
    }
    else
    {
        DrvPlatformLyrEnableFingerTouchReport(); 
    }
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
    
    DrvPlatformLyrTouchDevicePowerOn();
/*
    DrvPlatformLyrFingerTouchReleased(0, 0);
    input_sync(g_InputDevice);
*/    
#ifdef CONFIG_ENABLE_FIRMWARE_DATA_LOG
    DrvIcFwLyrRestoreFirmwareModeToLogDataMode();
#endif //CONFIG_ENABLE_FIRMWARE_DATA_LOG

#ifndef CONFIG_ENABLE_GESTURE_WAKEUP
    DrvPlatformLyrEnableFingerTouchReport(); 
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
}
/* probe function is used for matching and initializing input device */
s32 /*__devinit*/ MsDrvInterfaceTouchDeviceProbe(struct i2c_client *pClient, const struct i2c_device_id *pDeviceId)
{
    s32 nRetVal = 0;

    DBG("*** %s() ***\n", __func__);

    DrvPlatformLyrInputDeviceInitialize(pClient);
  
    DrvPlatformLyrTouchDeviceRequestGPIO();
	
    DrvPlatformLyrTouchDeviceRegisterFingerTouchInterruptHandler();
	
#ifdef CONFIG_ENABLE_REGULATOR_POWER_ON
    DrvPlatformLyrTouchDeviceRegulatorPowerOn();
#endif //CONFIG_ENABLE_REGULATOR_POWER_ON

    DrvPlatformLyrTouchDevicePowerOn();

    nRetVal = DrvMainTouchDeviceInitialize();
    if (nRetVal == -ENODEV)
    {
        DrvPlatformLyrTouchDeviceRemove(pClient);
        return nRetVal;
    }
#ifdef CONFIG_ENABLE_GESTURE_WAKEUP
#ifdef CONFIG_ENABLE_GESTURE_INFORMATION_MODE
    mstar_create_proc();
#endif
#endif


#if defined(CONFIG_FB)
    call_back_functions_init();
#endif

#ifndef CONFIG_UPDATE_FIRMWARE_BY_SW_ID
    DrvPlatformLyrEnableFingerTouchReport();
#endif	
    DBG("*** MStar touch driver registered ***\n");
//modify by pangle at 20150228 begin
#ifdef CONFIG_UPDATE_FIRMWARE_BY_SW_ID
	 program_over = 1;
#endif
//modify by pangle at 20150228 end
    return nRetVal;
}
/* probe function is used for matching and initializing input device */
s32 /*__devinit*/ MsDrvInterfaceTouchDeviceProbe(struct i2c_client *pClient,
		const struct i2c_device_id *pDeviceId)
{
	s32 nRetVal = 0;

	DBG("*** %s() ***\n", __func__);

#ifdef CONFIG_OF
	DrvPlatformLyrDts(pClient);
#endif

	DrvPlatformLyrInputDeviceInitialize(pClient);

	DrvPlatformLyrTouchDeviceRequestGPIO();

#ifdef CONFIG_ENABLE_REGULATOR_POWER_ON
	DrvPlatformLyrTouchDeviceRegulatorPowerOn();
#endif /* CONFIG_ENABLE_REGULATOR_POWER_ON */

	DrvPlatformLyrTouchDevicePowerOn();

	nRetVal = DrvMainTouchDeviceInitialize();
	if (nRetVal == -ENODEV) {
		DrvPlatformLyrTouchDeviceRemove(pClient);
		return nRetVal;
	}

	DrvPlatformLyrTouchDeviceRegisterFingerTouchInterruptHandler();

	DrvPlatformLyrTouchDeviceRegisterEarlySuspend();

#ifdef CONFIG_HIPAD_FIRMWARE_UPGRADE
	nRetVal = msg2238_create_fw_mdev(&mdev);
	if (nRetVal)
		fw_mdev_err("msg2238_create_fw_mdev ERROR = %d\n", nRetVal);
#endif

	DBG("*** MStar touch driver registered ***\n");

	return nRetVal;
}
/* probe function is used for matching and initializing input device */
s32 /*__devinit*/ MsDrvInterfaceTouchDeviceProbe(struct i2c_client *pClient, const struct i2c_device_id *pDeviceId)
{
    s32 nRetVal = 0;

    DBG("*** %s() ***\n", __func__);
  
    DrvPlatformLyrInputDeviceInitialize(pClient);
  
    DrvPlatformLyrTouchDeviceRequestGPIO();

#ifdef CONFIG_ENABLE_REGULATOR_POWER_ON
    DrvPlatformLyrTouchDeviceRegulatorPowerOn();
#endif //CONFIG_ENABLE_REGULATOR_POWER_ON

    DrvPlatformLyrTouchDevicePowerOn();

	g_ChipType = DrvIcFwLyrGetChipType();
	
	 //if (g_ChipType != CHIP_TYPE_MSG21XX &&   // (0x01) 
         //     g_ChipType != CHIP_TYPE_MSG21XXA &&  // (0x02) 
        //      g_ChipType != CHIP_TYPE_MSG26XXM &&  // (0x03) 
         //     g_ChipType != CHIP_TYPE_MSG22XX)     // (0x7A) 
	if (g_ChipType != CHIP_TYPE_MSG22XX)     // (0x7A) 
	{
			return -1;
	}
    DrvMainTouchDeviceInitialize();

    DrvPlatformLyrTouchDeviceRegisterFingerTouchInterruptHandler();

    DrvPlatformLyrTouchDeviceRegisterEarlySuspend();

    DrvPlatformLyrTouchDeviceResetHw();

    DrvPlatformLyrEnableFingerTouchReport();

    DBG("*** MStar touch driver registered ***\n");
    
    return nRetVal;
}
static int msg_ts_resume(struct device *dev)
{
	DBG("*** %s() ***\n", __func__);

	DBG("resume bSuspendRuned=%d\n", bSuspendRuned);
	if (bSuspendRuned == 0)
		return 0;
	bSuspendRuned = 0;

#ifdef CONFIG_ENABLE_GESTURE_WAKEUP
#ifdef CONFIG_ENABLE_GESTURE_DEBUG_MODE
	if (g_GestureDebugMode == 1)
		DrvIcFwLyrCloseGestureDebugMode();
#endif /* CONFIG_ENABLE_GESTURE_DEBUG_MODE */

	if (g_GestureWakeupFlag == 1)
		DrvIcFwLyrCloseGestureWakeup();
	else
		DrvPlatformLyrEnableFingerTouchReport();
#endif /* CONFIG_ENABLE_GESTURE_WAKEUP */
#ifdef CONFIG_ENABLE_REGULATOR_POWER_ON
	DrvPlatformLyrTouchDeviceRegulatorPowerOn();
#endif
	DrvPlatformLyrTouchDevicePowerOn();

#ifdef CONFIG_ENABLE_FIRMWARE_DATA_LOG
	/*
	 * Mark this function call for avoiding device driver
	 * may spend longer time to resume from suspend state.
	 */
	DrvIcFwLyrRestoreFirmwareModeToLogDataMode();
#endif /* CONFIG_ENABLE_FIRMWARE_DATA_LOG */

#ifndef CONFIG_ENABLE_GESTURE_WAKEUP
	DrvPlatformLyrEnableFingerTouchReport();
#endif /* CONFIG_ENABLE_GESTURE_WAKEUP */
	return 0;
}
void MsDrvInterfaceTouchDeviceResume(void)
{
    DBG("*** %s() ***\n", __func__);
#ifdef CONFIG_UPDATE_FIRMWARE_BY_SW_ID
    if(program_over ==0)
		return;
#endif
    if(!tp_suspend_flag){
        DBG("*** Mstar is already resumed! ***\n");
        return;
    }
    tp_suspend_flag = 0;
#ifdef CONFIG_ENABLE_GESTURE_WAKEUP
    if (g_GestureWakeupFlag == 1)
    {
        DrvIcFwLyrCloseGestureWakeup();
//	 printk(KERN_ERR"Msg2238 enter DrvIcFwLyrCloseGestureWakeup\n");
    }
    else
    {
        DrvPlatformLyrEnableFingerTouchReport(); 
    }
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
    
    DrvPlatformLyrTouchDevicePowerOn();
/*
    DrvPlatformLyrFingerTouchReleased(0, 0);
    input_sync(g_InputDevice);
*/    
#ifdef CONFIG_ENABLE_FIRMWARE_DATA_LOG
    DrvIcFwLyrRestoreFirmwareModeToLogDataMode();
#endif //CONFIG_ENABLE_FIRMWARE_DATA_LOG

#ifndef CONFIG_ENABLE_GESTURE_WAKEUP
    DrvPlatformLyrEnableFingerTouchReport(); 
#endif //CONFIG_ENABLE_GESTURE_WAKEUP
}