.. | .. |
---|
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 | |
---|
.. | .. |
---|
1579 | 1583 | return ret; |
---|
1580 | 1584 | } |
---|
1581 | 1585 | #else |
---|
1582 | | - //ret = of_property_read_u32(np, "ctp_screen_max_x", &screen_max_x); |
---|
1583 | | - //of_property_read_u32(np, "ctp_screen_max_y", &screen_max_y); |
---|
1584 | | - //of_property_read_u32(np, "ctp_revert_x_flag", &revert_x_flag); |
---|
1585 | | - //of_property_read_u32(np, "ctp_revert_y_flag", &revert_y_flag); |
---|
1586 | | - //of_property_read_u32(np, "ctp_exchange_x_y_flag", &exchange_x_y_flag); |
---|
| 1586 | + ret = of_property_read_u32(np, "ctp_screen_max_x", &screen_max_x); |
---|
| 1587 | + of_property_read_u32(np, "ctp_screen_max_y", &screen_max_y); |
---|
| 1588 | + of_property_read_u32(np, "ctp_revert_x_flag", &revert_x_flag); |
---|
| 1589 | + of_property_read_u32(np, "ctp_revert_y_flag", &revert_y_flag); |
---|
| 1590 | + of_property_read_u32(np, "ctp_exchange_x_y_flag", &exchange_x_y_flag); |
---|
1587 | 1591 | #endif |
---|
1588 | 1592 | sunxi_gpio_to_name(CTP_IRQ_NUMBER,irq_pin_name); |
---|
1589 | 1593 | pr_err("gt %s, line:%d irq_pin_name = %s \n",__FUNCTION__, __LINE__, irq_pin_name); |
---|