/***************************************************************************** 函 数 名 : hi6xxx_tsensor_shutdown 功能描述 : tsensor driver shutdown函数 输入参数 : pdev:设备句柄 输出参数 : 无 返 回 值 : 无 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2013年5月6日 作 者 : 刘龙 00217270 修改内容 : 新生成函数 *****************************************************************************/ static void hi6xxx_tsensor_shutdown(struct platform_device *pdev) { struct tsensor_devinfo *devinfo = platform_get_drvdata(pdev); printk(KERN_INFO"hi6xxx_tsensor_shutdown\n"); if (devinfo == NULL) { dev_err(&pdev->dev, "devinfo is null\n"); return ; } cancel_delayed_work_sync(&tsensor_gov->tsensor_late_init_work); /*取消tsensor温度监控*/ cancel_delayed_work_sync(&tsensor_gov->tsensor_monitor_work); unregister_reboot_notifier(&tsensor_reboot_nb); /*tsensor挂起 */ tsensor_suspend(); kfree(devinfo); devinfo = NULL; platform_set_drvdata(pdev, NULL); printk("hi6xxx_tsensor_shutdown\n"); return; }
/***************************************************************************** 函 数 名 : hi6xxx_tsensor_remove 功能描述 : tsensor driver remote函数 输入参数 : pdev:设备句柄 输出参数 : 无 返 回 值 : 无 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2013年5月6日 作 者 : 刘龙 00217270 修改内容 : 新生成函数 *****************************************************************************/ static int hi6xxx_tsensor_remove(struct platform_device *pdev) { struct tsensor_devinfo *devinfo = platform_get_drvdata(pdev); printk(KERN_INFO"hi6xxx_tsensor_remove\n"); if (devinfo == NULL) { dev_err(&pdev->dev, "devinfo is null\n"); return -ENODEV; } /*取消定时监控 */ cancel_delayed_work_sync(&tsensor_gov->tsensor_monitor_work); /*tsensor挂起*/ tsensor_suspend(); kfree(devinfo); kfree(tsensor_gov); tsensor_gov = NULL; platform_set_drvdata(pdev, NULL); return 0; }
/***************************************************************************** 函 数 名 : hi6xxx_tsensor_suspend 功能描述 : tsensor driver suspend函数 输入参数 : pdev:设备句柄 state:pm状态 输出参数 : 无 返 回 值 : 无 调用函数 : 被调函数 : 修改历史 : 1.日 期 : 2013年5月6日 作 者 : 刘龙 00217270 修改内容 : 新生成函数 *****************************************************************************/ static int hi6xxx_tsensor_suspend(struct platform_device *pdev, pm_message_t state) { /*取消定时监控 */ cancel_delayed_work_sync(&tsensor_gov->tsensor_monitor_work); tsensor_suspend(); dev_info(&pdev->dev, "tsensor suspend successfully\n"); return 0; }
void tsensor_switch(int on_or_off) { if(TSENSOR_FEATURES_ON == on_or_off) { tsensor_resume(); } else if (TSENSOR_FEATURES_OFF == on_or_off) { tsensor_suspend(); } gstTempPrtInfo.enable = on_or_off; }
static int __devexit hi6620_tsensor_remove(struct platform_device *pdev) { struct tsensor_devinfo *devinfo = platform_get_drvdata(pdev); printk(KERN_INFO"hi6620_tsensor_remove\n"); if (devinfo == NULL) { dev_err(&pdev->dev, "devinfo is null\n"); return -ENODEV; } /*tsensor挂起*/ tsensor_suspend(); kfree(devinfo); kfree(tsensor_gov); tsensor_gov = NULL; platform_set_drvdata(pdev, NULL); return 0; }