.. | .. |
---|
1087 | 1087 | static int goodix_ts_resume(struct device *dev); |
---|
1088 | 1088 | extern void gt9xx_resume_extern(void); |
---|
1089 | 1089 | extern void gt9xx_suspend_extern(void); |
---|
1090 | | -struct goodix_ts_data *cur_ts; |
---|
| 1090 | +struct goodix_ts_data *cur_ts= NULL; |
---|
1091 | 1091 | |
---|
1092 | 1092 | void gt9xx_suspend_extern(void) |
---|
1093 | 1093 | { |
---|
1094 | 1094 | // goodix_ts_suspend(config_info.dev); |
---|
1095 | | - |
---|
1096 | | - gtp_irq_disable(cur_ts); |
---|
1097 | | - cancel_work_sync(&goodix_resume_work); |
---|
1098 | | - flush_workqueue(goodix_resume_wq); |
---|
1099 | | - cancel_work_sync(&cur_ts->work); |
---|
1100 | | - flush_workqueue(goodix_wq); |
---|
| 1095 | + if (cur_ts == NULL) {return;} |
---|
| 1096 | + else { |
---|
| 1097 | + gtp_irq_disable(cur_ts); |
---|
| 1098 | + cancel_work_sync(&goodix_resume_work); |
---|
| 1099 | + flush_workqueue(goodix_resume_wq); |
---|
| 1100 | + cancel_work_sync(&cur_ts->work); |
---|
| 1101 | + flush_workqueue(goodix_wq); |
---|
| 1102 | + } |
---|
1101 | 1103 | |
---|
1102 | 1104 | } |
---|
1103 | 1105 | EXPORT_SYMBOL(gt9xx_suspend_extern); |
---|
.. | .. |
---|
1105 | 1107 | void gt9xx_resume_extern(void) |
---|
1106 | 1108 | { |
---|
1107 | 1109 | // goodix_ts_resume(config_info.dev); |
---|
1108 | | - printk("%s goodix_ts_resume v1\n", goodix_ts_name); |
---|
1109 | | - __gpio_set_value(config_info.wakeup_gpio.gpio, 1); |
---|
1110 | | - input_set_power_enable(&(config_info.input_type), 1); |
---|
1111 | | - msleep(10); |
---|
1112 | | - // goodix_resume_events |
---|
1113 | | - queue_work(goodix_resume_wq, &goodix_resume_work);//gandy |
---|
1114 | | - |
---|
| 1110 | + if (cur_ts == NULL) {return;} |
---|
| 1111 | + else { |
---|
| 1112 | + printk("%s goodix_ts_resume v1\n", goodix_ts_name); |
---|
| 1113 | + __gpio_set_value(config_info.wakeup_gpio.gpio, 1); |
---|
| 1114 | + input_set_power_enable(&(config_info.input_type), 1); |
---|
| 1115 | + msleep(10); |
---|
| 1116 | + // goodix_resume_events |
---|
| 1117 | + queue_work(goodix_resume_wq, &goodix_resume_work);//gandy |
---|
| 1118 | + } |
---|
1115 | 1119 | } |
---|
1116 | 1120 | EXPORT_SYMBOL(gt9xx_resume_extern); |
---|
1117 | 1121 | |
---|