lge_touch_core.c: Fix broken indent

Fix broken indent and coding style in lge_touch_core.c.
dt2w: Fix touchpad not working if dt2w is enabled when the screen is off

If doubletap_to_wake is set while the touch device is off, the driver
thinks there's no need to enable to device on resume operation.

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
dt2w: Fix detection of double touch

The double touch detection was not working since there is no state
ABS_RELEASE.

This patch tries another approach: we rely on the fact that the first
touch event has a nul state ("DO_NOT_ANYTHING" [sic]).

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
dt2w: Add a parameter to control the doubletap_to_wake timeout value

Add sysfs entry "doubletap_delay" to let userspace change the doubletap
timeout.

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
dt2w: Add an option to disable d2tw when the power button is used

This patch adds the variable doubletap_pwrkey_suspend to prevent the
touch device from staying enabled when the power button is used.

It has been inspired by the implementation for the Nexus 5 (Hammerhead)
by "flar2" <asegaert@gmail.com> and "showp1984" <showp1984@gmail.com>.

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
dt2w: Restrict the touchscreen area used to wake up the device

Only the bottom area of the screen can be "double-tapped" to wake up the
device; this should reduce false positives.
Left and right margins are excluded as well.

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
dt2w: Add option to use the whole screen for dt2w

This patch adds the /sys entry "doubletap_full_window".

When its value is true, the whole touchscreen can be used to wake up the
device.

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
dt2w: Add an option to enable doubletap2wake when on charger

The sys option "doubletap_charger" can have 3 values:
- 0 (default): no check on charger's presence;
- 1: same as default behaviour, but dt2w is also enable when charger is
  present;
- 2: dt2w is enabled only when charger is present.

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
dt2w: Release TS events before suspend and on resume

Let's release the TS events on late resume when the touch device was
not suspended.  Hopefully it will fix casual extra touch events on wake
up.

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
lge_touch_core: i2c_read: retry a few times before erroring out

Patch from Dennis Rassmann (showp1984) -- I've reduced the number of
retries to 4.

Initial commit message:

--
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: Mikael Berthe <mikael@lilotux.net>
dt2w: Add an option to specify the dt2w touch area

The previous option doubletap_full_window is replaced with a more
generic option: "doubletap_area" can have 3 values:
- 0 (default): no check on touch area (i.e. full screen);
- 1: bottom area (left/right margins excluded);
- 2: top area (left/right margins excluded);
- 3: center of the screen.

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
Remove old FIXMEs

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
lge_touch_core.c: Remove unused global variable

Signed-off-by: Mikael Berthe <mikael@lilotux.net>
dt2w: Check the second tap is close to the first one

Signed-off-by: Mikael Berthe <mikael@lilotux.net>