Skip to content

Commit

Permalink
Tap2Unlock - a new screen wake feature similar to d2w and s2w
Browse files Browse the repository at this point in the history
But with patterns here
How it works ?
Divide your screen vertically and horizontally , you get four divisions
They are numbered as
          1 | 2
          -----
          3 | 4
The pattern is stored in sysfs file sys/android_touch/tap2unlock_pattern
You tap the right combination to open your screen
Pressing the power button will turn your display on but not the touch sensor.

version 1.0
-Ability - 4 number pattern (will be improved)
-Currently the pattern gets rstored to 1234 after every boot
(This can only be fixed if a kernel mod app provides support for it in the future.)

All copyrights of t2u is reserved with goutamniwas <goutamniwas@gmail.com>
Many credits to showp-1984 for his D2w which made this possible.
  • Loading branch information
goutamniwas committed Dec 7, 2014
1 parent 7335101 commit 3ebee96
Show file tree
Hide file tree
Showing 10 changed files with 592 additions and 6 deletions.
1 change: 1 addition & 0 deletions arch/arm/configs/cm_condor_defconfig
Expand Up @@ -296,6 +296,7 @@ CONFIG_INPUT_GPIO=m
CONFIG_TOUCHSCREEN_PREVENT_SLEEP=y
CONFIG_TOUCHSCREEN_SWEEP2WAKE=y
CONFIG_TOUCHSCREEN_DOUBLETAP2WAKE=y
CONFIG_TOUCHSCREEN_TAP2UNLOCK=y
#CONFIG_INPUT_MOUSEDEV is not set
CONFIG_INPUT_CT406=y
CONFIG_INPUT_KEYCHORD=y
Expand Down
5 changes: 5 additions & 0 deletions drivers/input/touchscreen/Kconfig
Expand Up @@ -1135,6 +1135,11 @@ config TOUCHSCREEN_DOUBLETAP2WAKE
select TOUCHSCREEN_PREVENT_SLEEP
default y

config TOUCHSCREEN_TAP2UNLOCK
tristate "Tap to unlock for touchscreens"
select TOUCHSCREEN_PREVENT_SLEEP
default y

config TOUCHSCREEN_POWERSUSPEND
tristate "powersuspend for dtw and s2w"
default y
Expand Down
2 changes: 1 addition & 1 deletion drivers/input/touchscreen/Makefile
@@ -1,4 +1,3 @@
#
# Makefile for the touchscreen drivers.
#

Expand Down Expand Up @@ -103,3 +102,4 @@ obj-$(CONFIG_TOUCHSCREEN_SYNAPTICS_DSX_FW_UPDATE_MMI) += synaptics_dsx_fw_update
obj-$(CONFIG_TOUCHSCREEN_SWEEP2WAKE) += sweep2wake.o
# for doubletap2wake, leave 1st to avoid merge issues at the end of the file
obj-$(CONFIG_TOUCHSCREEN_DOUBLETAP2WAKE) += doubletap2wake.o
obj-$(CONFIG_TOUCHSCREEN_TAP2UNLOCK) += tap2unlock.o
1 change: 1 addition & 0 deletions drivers/input/touchscreen/doubletap2wake.c
Expand Up @@ -421,3 +421,4 @@ static void __exit doubletap2wake_exit(void)
module_init(doubletap2wake_init);
module_exit(doubletap2wake_exit);


28 changes: 25 additions & 3 deletions drivers/input/touchscreen/synaptics_dsx_i2c.c
Expand Up @@ -47,6 +47,9 @@ extern bool prox_covered;
#ifdef CONFIG_TOUCHSCREEN_DOUBLETAP2WAKE
#include <linux/input/doubletap2wake.h>
#endif
#ifdef CONFIG_TOUCHSCREEN_TAP2UNLOCK
#include <linux/input/tap2unlock.h>
#endif
#endif

#define DRIVER_NAME "synaptics_dsx_i2c"
Expand Down Expand Up @@ -3700,8 +3703,15 @@ static int synaptics_rmi4_suspend(struct device *dev)
const struct synaptics_dsx_platform_data *platform_data =
rmi4_data->board;
#ifdef CONFIG_TOUCHSCREEN_PREVENT_SLEEP
if (s2w_switch > 0 || dt2w_switch > 0) {
pr_info("t2u :suspend called ,t2u_allow %d , t2u_scr_suspended %d ", t2u_allow, t2u_scr_suspended);
if (t2u_switch > 0 && t2u_allow == false && t2u_scr_suspended == false) {
pr_info("t2u : going to t2u_force_suspend");
goto t2u_force_suspend;
}
if (s2w_switch > 0 || dt2w_switch > 0 || t2u_switch > 0) {

if (prox_covered) {
t2u_force_suspend:
#endif

synaptics_dsx_sensor_state(rmi4_data, STATE_SUSPEND);
Expand All @@ -3726,15 +3736,16 @@ static int synaptics_rmi4_suspend(struct device *dev)
rmi4_data->touch_stopped = true;
}
#ifdef CONFIG_TOUCHSCREEN_PREVENT_SLEEP
} else {
} else {
pr_info("suspend avoided!\n");
return 0;
}
}
}
#endif

return 0;
}

#ifdef CONFIG_TOUCHSCREEN_PREVENT_SLEEP
void touch_suspend(void)
{
Expand All @@ -3756,6 +3767,15 @@ static int synaptics_rmi4_resume(struct device *dev)
{
struct synaptics_rmi4_data *rmi4_data = dev_get_drvdata(dev);

#ifdef CONFIG_TOUCHSCREEN_PREVENT_SLEEP
pr_info("t2u :suspend called ,t2u_allow %d , t2u_scr_suspended %d ", t2u_allow, t2u_scr_suspended);
if (t2u_switch > 0 && t2u_allow == false && t2u_scr_suspended == false) {
pr_info("t2u : touch sensor awake blocked by t2u protect");
return 0;
}
#endif


synaptics_dsx_resumeinfo_start(rmi4_data);

if (rmi4_data->touch_stopped) {
Expand Down Expand Up @@ -3808,6 +3828,8 @@ static int synaptics_rmi4_resume(struct device *dev)
synaptics_dsx_resumeinfo_finish(rmi4_data);

return 0;


}

#ifdef CONFIG_TOUCHSCREEN_PREVENT_SLEEP
Expand Down

0 comments on commit 3ebee96

Please sign in to comment.