drivers/input/touchscreen/touch_synaptics_ds5.c: No suspend irq

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit b376f1aec24c0c41b3bc69e4025ff6142dbc6d08)
add sweep2wake source files

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit 5a2fa7cd1f3c2215877678fdf41022ae0a22c45c)
sweep2wake: add qpnp-power-on hooks for the power key

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit d62f56a6887578f053e1f8a54fc2b7eb079b8f59)
drivers/input/touchscreen/touch_synaptics_ds5: add is_single_touch & s2w detection hook

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit de32062fb6ff88adc3fac58d8c5d9c6eecca58f9)
sweep2wake: backport per device settings from sweep2wake2 (like pwr btn choice too)

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit 7cf90d4aeed91844f33d24809108453b5b430c7f)
drivers/input/touchscreen/touch_synaptics_ds5: disable suspend if sweep2wake is enabled

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit 13510d259e74c9c908bc85f3b3f5377d75ac3705)
drivers/input/touchscreen/touch_synaptics_ds5: add reset code on finger release

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit f0f7488e96874e7a9b144b5c3b133a675c9e14ef)
drivers/input/touchscreen/touch_synaptics_ds5: add screen suspend indicator

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit e39a7b8d4e64fcc84b51fbe2b32e3220b3776a6d)
sweep2wake: add irq_wake indicator

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit a9c007e060c9f861aa417b64e06766c933851179)
drivers/input/touchscreen/touch_synaptics_ds5: re-add android_touch kobj

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit 0ec5d612e5d6fc79478c057ba20901a2efb9be89)
drivers/input/touchscreen/touch_synaptics_ds5: add missing irq_wake controls and fix c&p typo

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit b76d0aa731610631524f331d335ceb227120234a)
drivers/input/touchscreen/touch_synaptics: patch with sweep2wake hooks as well

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit 42444657fdd35217cad5212e16e2d9fd531a19c9)
drivers/input/touchscreen/touch_synaptics_ds5: fix epic c&p fails for irq_wake indicator

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit 81c2cefc8e1e02b50776f342ed071881d28e335f)
mdss_dsi: do not power down panel when sweep2wake is enabled In order to detect touches during suspend, the panel must be powered on. When sweep2wake is enabled, change one of the panel-off-cmds in mdss_dsi_panel.c from 0x10 to 0x11.

Signed-off-by: flar2 <asegaert@gmail.com>
Signed-off-by: LaboDJ <jacopolabardi@gmail.com>

(cherry picked from commit 0073884cd8f3945fb26d5186477a9968ffefcd75)
mdss_dsi_panel: keep the panel gpio active and don't trigger a reset

This way we will suffer minimum leakage when sweep2wake is being used.
All that is kept online here is the chip controlling the panel and touch panel.
That chip is probably some pmic but either way, keeping it online will cause
minimum leakage. This is an improvement upon the original patch by flar2 which
led to massive leakage from the display regulators since all were kept online.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit a6cc9a4ffc982039c4c7bbda95f01650fb4047f4)
sweep2wake: massive update, bring on par with s2w2 except algorithm

This patches sweep2wake on par with s2w2, minus the detection algorithm.
Changes in detail:
- Remove dependency on a power key setter, use a dummy device.
- Remove dependency on a touchscreen driver, use an input callback
- Remove dependency on external sysfs functions
- Remove dependency on external reset calls
- Migrate all of this into sweep2wake

Porting to new devices is now easier than ever:
1. Define your device parameters in the Sweep2wake tuneables
2. Check if the android_touch_kobj is already used by your touchscreen driver
2a. If it is export it and define S2W_ANDROID_TOUCH_DECLARED
(This will prevent s2w from spawning it's own kobj)
3. Force the touchscreen driver to deliver signals in suspend and you are done.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit def93c5fb9ec97c5d384fb9daba669c0f326bb55)
sweep2wake & touchscreens: replaced flawed irq_wake procedures with linux functions Also init device wakeup in init to be able to use those functions in the first place

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit 4a483bc3348e46c66308ce0bd33951da54b7679d)
sweep2wake: we no longer need irq_wake. remove it. Also clean up variable declariation to save some space

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit 7d023f55735cd87a7b4d3e6d2c5832f38a588af2)
touch_synaptics: bring on par with touch_synaptics_ds5

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit ad71ef1113b71f1884571e28127430b3f8d5060c)
touch_synaptics: i2c_read: auto retry 10 times before erroring out 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 touch data. This improves overall touch data robustness, but the main thing it does: WE CAN FINALLY GET TOUCH DATA IN SUSPEND ALL THE TIME.

Signed-off-by: Dennis Rassmann <showp1984@gmail.com>
Signed-off-by: flar2 <asegaert@gmail.com>

(cherry picked from commit 4d6a4d88feafb9a609a7bb2f6cd22c8eeeb258d1)