Sweep2wake and Doubletap2wake for the Nexus 7 (flo)

Signed-off-by: flar2 <asegaert@gmail.com>
New sweep2wake/doubletap2wake options

/sys/android_touch/orientation controls whether sweep2sleep works in portrait, landscape, or both
0 = both
1 = portrait only
2 = landscape only

/sys/android_touch/pwrkey_suspend  makes the power button toggle s2w/dt2w
If set to 1, pressing power button to turn off screen disables s2w/dt2w and pressing the power button to turn on screen re-enables s2w/dt2w

Signed-off-by: flar2 <asegaert@gmail.com>
Input: Send events one packet at a time

On heavy event loads, such as a multitouch driver, the irqsoff latency
can be as high as 250 us.  By accumulating a frame worth of data
before passing it on, the latency can be dramatically reduced.  As a
side effect, the special EV_SYN handling can be removed, since the
frame is now atomic.

This patch adds the events() handler callback and uses it if it
exists. The latency is improved by 50 us even without the callback.

Change-Id: Iebd9b1868ae6300a922a45b6d104e7c2b38e4cf5
Cc: Daniel Kurtz <djkurtz@chromium.org>
Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Tested-by: Ping Cheng <pingc@wacom.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>

Input: Improve the events-per-packet estimate

The events-per-packet estimate has so far been used by MT devices
only. This patch adjusts the packet buffer size to also accomodate the
KEY and MSC events.  Keyboards normally send one or two keys at a
time. MT devices normally send a number of button keys along with the
MT information.  The buffer size chosen here covers those cases, and
matches the default buffer size in evdev. Since the input estimate is
now preferred, remove the special input-mt estimate.

Reviewed-and-tested-by: Ping Cheng <pingc@wacom.com>
Tested-by: Benjamin Tissoires <benjamin.tissoires@enac.fr>
Acked-by: Dmitry Torokhov <dmitry.torokhov@gmail.com>
Signed-off-by: Henrik Rydberg <rydberg@euromail.se>
Signed-off-by: franciscofranco <franciscofranco.1990@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
drivers/input/touchscreen/ektf3k: auto retry 10 times on i2c reads The i2c devices we are connecting to may not be ready yet, or just busy. Retry with a 10ms pause in order to still obtain i2c data. This improves overall i2c data robustness

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
drivers/input/touchscreen/ektf3k: auto retry 10 times on i2c reads The i2c devices we are connecting to may not be ready yet, or just busy. Retry with a 10ms pause in order to still obtain i2c data. This improves overall i2c data robustness

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>
[sweep2wake]: adjust shortsweep distance
[doubletap2wake]: get rid of min timeout
[doubletap2wake]: make some adjustments
Wake Gestures: fix sweep2sleep not working if sweep2wake is disabled