static void s2w_input_callback(struct work_struct *unused) { detect_sweep2wake_h(touch_x, touch_y, true, scr_suspended()); detect_sweep2wake_v(touch_x, touch_y, true, scr_suspended()); return; }
static void wg_input_event(struct input_handle *handle, unsigned int type, unsigned int code, int value) { if (scr_suspended() && code == ABS_MT_POSITION_X) { value -= 5000; } #if WG_DEBUG pr_info("wg: code: %s|%u, val: %i\n", ((code==ABS_MT_POSITION_X) ? "X" : (code==ABS_MT_POSITION_Y) ? "Y" : (code==ABS_MT_TRACKING_ID) ? "ID" : "undef"), code, value); #endif if (code == ABS_MT_SLOT) { sweep2wake_reset(); doubletap2wake_reset(); return; } if (code == ABS_MT_TRACKING_ID && value == -1) { sweep2wake_reset(); touch_cnt = true; queue_work_on(0, dt2w_input_wq, &dt2w_input_work); return; } if (code == ABS_MT_POSITION_X) { touch_x = value; touch_x_called = true; } if (code == ABS_MT_POSITION_Y) { touch_y = value; touch_y_called = true; } if (touch_x_called && touch_y_called) { touch_x_called = false; touch_y_called = false; queue_work_on(0, s2w_input_wq, &s2w_input_work); } else if (!scr_suspended() && touch_x_called && !touch_y_called) { touch_x_called = false; touch_y_called = false; queue_work_on(0, s2w_input_wq, &s2w_input_work); } }
static void dt2w_input_callback(struct work_struct *unused) { if (scr_suspended() && s2w_switch > 0 && dt2w_switch) detect_doubletap2wake(touch_x, touch_y, true); return; }
static ssize_t camera_gesture_dump(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { sscanf(buf, "%d ", &camera_switch_temp); if (camera_switch_temp < 0 || camera_switch_temp > 1) camera_switch_temp = 0; if (!scr_suspended()) camera_switch = camera_switch_temp; else camera_switch_changed = true; if (scr_suspended() && (!s2w_switch || !s2w_switch_temp) && (!dt2w_switch || !dt2w_switch_temp) && !camera_switch_temp) { timeout_pwrtrigger(); } return count; }
static ssize_t doubletap2wake_dump(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { sscanf(buf, "%d ", &dt2w_switch_temp); if (dt2w_switch_temp < 0 || dt2w_switch_temp > 1) dt2w_switch_temp = 0; if (!scr_suspended()) dt2w_switch = dt2w_switch_temp; else dt2w_switch_changed = true; if (scr_suspended() && (!s2w_switch || !s2w_switch_temp) && (!camera_switch || !camera_switch_temp) && !dt2w_switch_temp) { timeout_pwrtrigger(); } return count; }
static ssize_t sweep2wake_dump(struct device *dev, struct device_attribute *attr, const char *buf, size_t count) { sscanf(buf, "%d ", &s2w_switch_temp); if (s2w_switch_temp < 0 || s2w_switch_temp > 15) s2w_switch_temp = 0; if (s2w_switch_temp == 0) set_internal_dt(dt2w_switch); else { set_internal_dt(false); } if (!scr_suspended()) s2w_switch = s2w_switch_temp; return count; }