Пример #1
0
/* Sweep2wake main function */
void detect_sweep2wake(int sweep_coord, int sweep_height, unsigned long time, int i)
{
	int swap_temp1, swap_temp2;

        //int prev_coord = 0, next_coord = 0;
        bool single_touch = is_single_touch();
#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
        pr_info("line : %d | func : %s\n", __LINE__, __func__);
		swap_temp1 = sweep_coord;
		swap_temp2 = sweep_height;

		sweep_height = swap_temp1;
		sweep_coord = swap_temp2;
	}

    //left->right
    if ((scr_suspended == true) && (sweep2wake > 0) && sweep_height > s2w_height_adjust) {
        printk("[sweep2wake]:left to right x,y(%d,%d) jiffies:%lu\n", sweep_coord, sweep_height, time);
        if (sweep_coord < 100) {
        tripon = 1;
        triptime = time;
        } else if (tripon == 1 && sweep_coord > 100 && time - triptime < 25) {
            tripon = 2;
        } else if (tripon == 2 && sweep_coord > 200 && time - triptime < 50) {
            tripon = 3;
        } else if (tripon == 3 && sweep_coord > 300 && time - triptime < S2W_TIMEOUT) {
            printk(KERN_INFO "[sweep2wake]: ON");
            sweep2wake_pwrtrigger();
        }
    //right->left
    } else if ((scr_suspended == false) && (sweep2wake > 1) && sweep_height > s2w_height_adjust) {
        printk("[sweep2wake]:right to left x,y(%d,%d) jiffies:%lu\n", sweep_coord, sweep_height, time);
        if (sweep_coord > 400) {
            tripoff = 1;
            triptime = time;
        } else if (tripoff == 1 && sweep_coord < 400 && time - triptime < 25) {
            tripoff = 2;
        } else if (tripoff == 2 && sweep_coord < 300 && time - triptime < 50) {
            tripoff = 3;
        } else if (tripoff == 3 && sweep_coord < 200 && (time - triptime < S2W_TIMEOUT)) {
            printk(KERN_INFO "[sweep2wake]: OFF");
            sweep2wake_pwrtrigger();
        }
    }
}
Пример #2
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;
						}
					}
				}
			}
		}
	}
}
Пример #3
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;
						}
					}
				}
			}
		}
	}
}