Ejemplo n.º 1
0
/* Sweep2wake main function */
static void detect_sweep2wake_v(int x, int y, bool st)
{
	int prevy = 0, nexty = 0;
        bool single_touch = st;

	if (firsty == 0) {
		firsty = y;
		firsty_time = jiffies;
	}

	if (x > 100 && x < 980) {
		//up
		if (firsty > 960 && single_touch && (s2w_switch & SWEEP_UP)) {
			prevy = firsty;
			nexty = prevy - S2W_Y_NEXT;
			if (barriery[0] == true || (y < prevy && y > nexty)) {
				prevy = nexty;
				nexty -= S2W_Y_NEXT;
				barriery[0] = true;
				if (barriery[1] == true || (y < prevy && y > nexty)) {
					prevy = nexty;
					barriery[1] = true;
					if (y < prevy) {
						if (y < (nexty - S2W_Y_NEXT)) {
							if (exec_county && (jiffies - firsty_time < SWEEP_TIMEOUT)) {
								pr_info(LOGTAG"sweep up\n");
								if (gestures_switch) {
									report_gesture(3);
								} else {
						                        sweep2wake_pwrtrigger();
								}
								exec_county = false;
							}
						}
					}
				}
			}
		//down
		} else if (firsty <= 960 && single_touch && (s2w_switch & SWEEP_DOWN)) {
			prevy = firsty;
			nexty = prevy + S2W_Y_NEXT;
			if (barriery[0] == true || (y > prevy && y < nexty)) {
				prevy = nexty;
				nexty += S2W_Y_NEXT;
				barriery[0] = true;
				if (barriery[1] == true || (y > prevy && y < nexty)) {
					prevy = nexty;
					barriery[1] = true;
					if (y > prevy) {
						if (y > (nexty + S2W_Y_NEXT)) {
							if (exec_county && (jiffies - firsty_time < SWEEP_TIMEOUT)) {
								pr_info(LOGTAG"sweep down\n");
								if (gestures_switch) {
									report_gesture(4);
								} else {
						                        sweep2wake_pwrtrigger();
								}
								exec_county = false;
							}
						}
					}
				}
			}
		}
	}
}
/* Sweep2wake main function */
static void detect_sweep2wake(int x, int y, bool st)
{
        int prevx = 0, nextx = 0;
        bool single_touch = st;
#if S2W_DEBUG
        pr_info(LOGTAG"x,y(%4d,%4d) single:%s\n",
                x, y, (single_touch) ? "true" : "false");
#endif
	//left->right
	if ((single_touch) && (scr_suspended == true) && (s2w_switch > 0 && !s2w_s2sonly)) {
		prevx = 0;
		nextx = S2W_X_B1;
		if ((barrier[0] == true) ||
		   ((x > prevx) &&
		    (x < nextx) &&
		    (y > 0))) {
			prevx = nextx;
			nextx = S2W_X_B2;
			barrier[0] = true;
			if ((barrier[1] == true) ||
			   ((x > prevx) &&
			    (x < nextx) &&
			    (y > 0))) {
				prevx = nextx;
				barrier[1] = true;
				if ((x > prevx) &&
				    (y > 0)) {
					if (x > (S2W_X_MAX - S2W_X_FINAL)) {
						if (exec_count) {
							pr_info(LOGTAG"ON\n");
							sweep2wake_pwrtrigger();
							exec_count = false;
						}
					}
				}
			}
		}
	//right->left
	} else if ((single_touch) && (scr_suspended == false) && (s2w_switch > 0)) {
		scr_on_touch=true;
		prevx = (S2W_X_MAX - S2W_X_FINAL);
		nextx = S2W_X_B2;
		if ((barrier[0] == true) ||
		   ((x < prevx) &&
		    (x > nextx) &&
		    (y > S2W_Y_LIMIT))) {
			prevx = nextx;
			nextx = S2W_X_B1;
			barrier[0] = true;
			if ((barrier[1] == true) ||
			   ((x < prevx) &&
			    (x > nextx) &&
			    (y > S2W_Y_LIMIT))) {
				prevx = nextx;
				barrier[1] = true;
				if ((x < prevx) &&
				    (y > S2W_Y_LIMIT)) {
					if (x < S2W_X_FINAL) {
						if (exec_count) {
							pr_info(LOGTAG"OFF\n");
							sweep2wake_pwrtrigger();
							exec_count = false;
						}
					}
				}
			}
		}
	}
}
Ejemplo n.º 3
0
/* Sweep2wake main function */
void detect_sweep2wake(int sweep_coord, int sweep_height, struct lge_touch_data *ts)
{
	int swap_temp1, swap_temp2;

        int prev_coord = 0, next_coord = 0;
        bool single_touch = is_single_touch(ts);
#if DEBUG
        pr_info("[sweep2wake]: sweep_coord,sweep_height(%4d,%4d) single:%s\n",
                sweep_coord, sweep_height, (single_touch) ? "true" : "false");
#endif

	if (s2w_swap_coord == 1) {
		//swap the coordinate system
		swap_temp1 = sweep_coord;
		swap_temp2 = sweep_height;

		sweep_height = swap_temp1;
		sweep_coord = swap_temp2;
	}

	//power on
	if ((single_touch) && (scr_suspended == true) && (s2w_switch > 0)) {
		prev_coord = 0;
		next_coord = s2w_start_posn;
		if ((barrier[0] == true) ||
		   ((sweep_coord > prev_coord) &&
		    (sweep_coord < next_coord))) {
			prev_coord = next_coord;
			next_coord = s2w_mid_posn;
			barrier[0] = true;
			if ((barrier[1] == true) ||
			   ((sweep_coord > prev_coord) &&
			    (sweep_coord < next_coord))) {
				prev_coord = next_coord;
				barrier[1] = true;
				if ((sweep_coord > prev_coord)) {
					if (sweep_coord > s2w_end_posn) {
						if (exec_count) {
							printk(KERN_INFO "[sweep2wake]: ON");
							sweep2wake_pwrtrigger();
							exec_count = false;
						}
					}
				}
			}
		}
	//power off
	} else if ((single_touch) && (scr_suspended == false) && (s2w_switch > 0)) {
		if (s2w_swap_coord == 1) {
			//swap back for off scenario ONLY
			swap_temp1 = sweep_coord;
			swap_temp2 = sweep_height;

			sweep_height = swap_temp1;
			sweep_coord = swap_temp2;
		}

		scr_on_touch=true;
		prev_coord = (DEFAULT_S2W_X_MAX - DEFAULT_S2W_X_FINAL);
		next_coord = DEFAULT_S2W_X_B2;
		if ((barrier[0] == true) ||
		   ((sweep_coord < prev_coord) &&
		    (sweep_coord > next_coord) &&
		    (sweep_height > DEFAULT_S2W_Y_LIMIT))) {
			prev_coord = next_coord;
			next_coord = DEFAULT_S2W_X_B1;
			barrier[0] = true;
			if ((barrier[1] == true) ||
			   ((sweep_coord < prev_coord) &&
			    (sweep_coord > next_coord) &&
			    (sweep_height > DEFAULT_S2W_Y_LIMIT))) {
				prev_coord = next_coord;
				barrier[1] = true;
				if ((sweep_coord < prev_coord) &&
				    (sweep_height > DEFAULT_S2W_Y_LIMIT)) {
					if (sweep_coord < DEFAULT_S2W_X_FINAL) {
						if (exec_count) {
							printk(KERN_INFO "[sweep2wake]: OFF");
							sweep2wake_pwrtrigger();
							exec_count = false;
						}
					}
				}
			}
		}
	}
}
Ejemplo n.º 4
0
/* Sweep2wake main function */
void detect_sweep2wake(int x, int y, bool st)
{
        int prevx = 0, nextx = 0;
        bool single_touch = st;

	if (!s2w_switch)
		return;

	if(!single_touch){
		s2w_reset();
		return;
	}
#if DEBUG
        pr_info("[sweep2wake]: x,y(%4d,%4d) single:%s\n",
                x, y, (single_touch) ? "true" : "false");
#endif
	//left->right
	if ((single_touch) && (scr_suspended || is_lpm) && (s2w_switch > 0)) {
		prevx = 0;
		nextx = S2W_X_B1;
		if ((barrier[0] == true) ||
		   ((x > prevx) &&
		    (x < nextx) &&
		    (y > 0))) {
			prevx = nextx;
			nextx = S2W_X_B2;
			barrier[0] = true;
			if ((barrier[1] == true) ||
			   ((x > prevx) &&
			    (x < nextx) &&
			    (y > 0))) {
				prevx = nextx;
				barrier[1] = true;
				if ((x > prevx) &&
				    (y > 0)) {
					if (x > (S2W_X_MAX - S2W_X_FINAL)) {
						if (exec_count) {
;
							sweep2wake_pwrtrigger();
							exec_count = false;
						}
					}
				}
			}
		}
	//right->left
	} else if ((single_touch) && (scr_suspended == false) && (s2w_switch > 0)) {
		scr_on_touch=true;
		prevx = (S2W_X_MAX - S2W_X_FINAL);
		nextx = S2W_X_B2;
		if ((barrier[0] == true) ||
		   ((x < prevx) &&
		    (x > nextx) &&
		    (y > S2W_Y_LIMIT))) {
			prevx = nextx;
			nextx = S2W_X_B1;
			barrier[0] = true;
			if ((barrier[1] == true) ||
			   ((x < prevx) &&
			    (x > nextx) &&
			    (y > S2W_Y_LIMIT))) {
				prevx = nextx;
				barrier[1] = true;
				if ((x < prevx) &&
				    (y > S2W_Y_LIMIT)) {
					if (x < S2W_X_FINAL) {
						if (exec_count) {
;
							sweep2wake_pwrtrigger();
							exec_count = false;
						}
					}
				}
			}
		}
	}
}
Ejemplo n.º 5
0
/* Sweep2wake main function */
void detect_sweep2wake(int x, int y, struct lge_touch_data *ts)
{
        int prevx = 0, nextx = 0;
        bool single_touch = is_single_touch(ts);
#if DEBUG
        pr_info("[sweep2wake]: x,y(%4d,%4d) single:%s\n",
                x, y, (single_touch) ? "true" : "false");
#endif
	//left->right
	if ((single_touch) && (scr_suspended == true) && (s2w_switch > 0)) {
		prevx = 0;
		nextx = S2W_X_B1;
		if ((barrier[0] == true) ||
		   ((x > prevx) &&
		    (x < nextx) &&
		    (y > 0))) {
			prevx = nextx;
			nextx = S2W_X_B2;
			barrier[0] = true;
			if ((barrier[1] == true) ||
			   ((x > prevx) &&
			    (x < nextx) &&
			    (y > 0))) {
				prevx = nextx;
				barrier[1] = true;
				if ((x > prevx) &&
				    (y > 0)) {
					if (x > (S2W_X_MAX - S2W_X_FINAL)) {
						if (exec_count) {
							printk(KERN_INFO "[sweep2wake]: ON");
							sweep2wake_pwrtrigger();
							exec_count = false;
						}
					}
				}
			}
		}
	//right->left
	} else if ((single_touch) && (scr_suspended == false) && (s2w_switch > 0)) {
		scr_on_touch=true;
		prevx = (S2W_X_MAX - S2W_X_FINAL);
		nextx = S2W_X_B2;
		if ((barrier[0] == true) ||
		   ((x < prevx) &&
		    (x > nextx) &&
		    (y > S2W_Y_LIMIT))) {
			prevx = nextx;
			nextx = S2W_X_B1;
			barrier[0] = true;
			if ((barrier[1] == true) ||
			   ((x < prevx) &&
			    (x > nextx) &&
			    (y > S2W_Y_LIMIT))) {
				prevx = nextx;
				barrier[1] = true;
				if ((x < prevx) &&
				    (y > S2W_Y_LIMIT)) {
					if (x < S2W_X_FINAL) {
						if (exec_count) {
							printk(KERN_INFO "[sweep2wake]: OFF");
							sweep2wake_pwrtrigger();
							exec_count = false;
						}
					}
				}
			}
		}
	}
}