Skip to content

Commit

Permalink
SQUASHED: doubletap2wake and sweep2wake implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
emceethemouth committed Jan 7, 2014
1 parent c3e3328 commit 3be3268
Show file tree
Hide file tree
Showing 11 changed files with 1,227 additions and 34 deletions.
5 changes: 5 additions & 0 deletions arch/arm/configs/gnome_mako_defconfig
Expand Up @@ -537,3 +537,8 @@ CONFIG_DEFAULT_BFQ=y
CONFIG_KEXEC=y
CONFIG_KEXEC_HARDBOOT=y
CONFIG_ATAGS_PROC=y

# Add Doubletap2wake and sweep2wake
CONFIG_TOUCHSCREEN_SWEEP2WAKE=y
CONFIG_TOUCHSCREEN_DOUBLETAP2WAKE=y
CONFIG_TOUCHSCREEN_PREVENT_SLEEP=y
22 changes: 22 additions & 0 deletions drivers/input/input.c
Expand Up @@ -28,12 +28,23 @@
#include <linux/rcupdate.h>
#include "input-compat.h"

#ifdef CONFIG_PWRKEY_SUSPEND
#include <linux/input/pmic8xxx-pwrkey.h>
#endif

MODULE_AUTHOR("Vojtech Pavlik <vojtech@suse.cz>");
MODULE_DESCRIPTION("Input core");
MODULE_LICENSE("GPL");

#define INPUT_DEVICES 256

#ifdef CONFIG_PWRKEY_SUSPEND
bool pwrkey_pressed = false;
bool pwrkey_suspend = false;
static int cnt = 0;
module_param(pwrkey_suspend, bool, 0755);
#endif

static LIST_HEAD(input_dev_list);
static LIST_HEAD(input_handler_list);

Expand Down Expand Up @@ -243,6 +254,17 @@ static void input_handle_event(struct input_dev *dev,
if (is_event_supported(code, dev->keybit, KEY_MAX) &&
!!test_bit(code, dev->key) != value) {

#ifdef CONFIG_PWRKEY_SUSPEND
if (pwrkey_suspend) {
if (code == KEY_POWER && cnt == 0) {
pwrkey_pressed = true;
cnt++;
} else {
cnt = 0;
}
}
#endif

if (value != 2) {
__change_bit(code, dev->key);
if (value)
Expand Down
9 changes: 9 additions & 0 deletions drivers/input/misc/pmic8xxx-pwrkey.c
Expand Up @@ -193,6 +193,15 @@ static int __devinit pmic8xxx_pwrkey_probe(struct platform_device *pdev)
input_report_key(pwrkey->pwr, KEY_POWER, 1);
input_sync(pwrkey->pwr);
}
#ifdef CONFIG_TOUCHSCREEN_PREVENT_SLEEP
#ifdef CONFIG_TOUCHSCREEN_SWEEP2WAKE
power_on_display(pwr);
pr_info("[wake_up_display]: set device %s\n", pwr->name);
#else
power_on_display_dt2w(pwr);
pr_info("[wake_up_display]: set device %s\n", pwr->name);
#endif
#endif

err = request_any_context_irq(key_press_irq, pwrkey_press_irq,
IRQF_TRIGGER_RISING, "pmic8xxx_pwrkey_press", pwrkey);
Expand Down
17 changes: 17 additions & 0 deletions drivers/input/touchscreen/Kconfig
Expand Up @@ -977,5 +977,22 @@ config TOUCHSCREEN_CHARGER_NOTIFY
The touch firmware will use this information to decide whether
a new algorithm to reduce the noise impact needs to be applied
or not.

config TOUCHSCREEN_SWEEP2WAKE
tristate "Sweep2Wake for touchscreens"
select TOUCHSCREEN_PREVENT_SLEEP
default n

config TOUCHSCREEN_DOUBLETAP2WAKE
tristate "DoubleTap2Wake for touchscreens"
select TOUCHSCREEN_PREVENT_SLEEP
default n

config TOUCHSCREEN_PREVENT_SLEEP
bool "Inihibit sleep on modified touchscreen drivers"
default n
help
This disables the sleep function of modified touchscreen drivers.

endif

5 changes: 5 additions & 0 deletions drivers/input/touchscreen/Makefile
Expand Up @@ -6,6 +6,11 @@

wm97xx-ts-y := wm97xx-core.o

# for sweep2wake, leave 1st to avoid merge issues at the end of the file
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_88PM860X) += 88pm860x-ts.o
obj-$(CONFIG_TOUCHSCREEN_AD7877) += ad7877.o
obj-$(CONFIG_TOUCHSCREEN_AD7879) += ad7879.o
Expand Down

0 comments on commit 3be3268

Please sign in to comment.