msm: mdss: Adding lcd notifier

Supports notifier for start&end of LCD power on&off

Change-Id: Idaa685a2c554286da5f764519305d830c4d1a1bd
Signed-off-by: Se Hun Kim <sean2.kim@lge.com>
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
Signed-off-by: Devin Kim <dojip.kim@lge.com>

Conflicts:
	drivers/video/msm/mdss/mdss_dsi.c
input: touch_synaptics: add incell s3350 driver

Change-Id: I66aa0ba20fe6d699024f5f2a3dd0cb65b6d2efcb
Signed-off-by: Kwangwoon Baek <kwangwoon.baek@lge.com>
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>

Conflicts:
	drivers/input/touchscreen/Kconfig
	drivers/input/touchscreen/Makefile
	drivers/input/touchscreen/touch_synaptics.c
	drivers/input/touchscreen/touch_synaptics_ds4_fw_upgrade.c
	drivers/input/touchscreen/touch_synaptics_ds5_fw_upgrade.c
	include/linux/input/touch_synaptics.h
input: touch_synaptics: Remove undeclared functions

Change-Id: Ie2e2e88d28e8c805e438be4127d45389ecf8fe66
Signed-off-by: Devin Kim <dojip.kim@lge.com>
input: touch_synaptics_ds5: multi-touch enable and fix the coordinate

Multi-touch is enabled and y-coordinate is modified at touch firmware E002.

Change-Id: Ib8ce7772b9deae59434043a8ec0761dea81b2313
Signed-off-by: Kwangwoon Baek <kwangwoon.baek@lge.com>
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics_ds5: use reset instead of power off when error

Since we are sharing 1.8V with LCD, we should not turn off the power
when there is touch error.

Just reset the touch device instead of controlling power when error detected.

Change-Id: I4bc0f95f2cf7897449b6747e9ca718b8ba7c278c
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics_ds5: remove unbalanced regulator disables warning

Although the power is turned on by bootloader during boot,
the touch driver should call power on API to sync with the
initial regulator state.

This power on call won't affect any signal set by bootloader.

Without this call, the regulator core will display unbalanced disable
warning message for the next power off.

Change-Id: I0c5a0a733dfe3c7889dd8d4770e221333b5226a0
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics: use work func to recover touch

Use work function to recover the touch device when the
interrupt handler detects error in the touch device.

Change-Id: I9349057157e426478a20dba80db1b35605290fc0
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics: remove early suspend

Use FB callback to control the touch device.

Change-Id: I3e4e759f236609e478dcb9eb38637a0390c152a7
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics_ds5: Firmware E002

Change-Id: I185d062e8d68c9986314651eb0aa464afdd26814
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics_ds5: enable firmware download

Removed multiple firmware support because the product ID
is not matched between touch controller and firmware.
Make the firmware supports only one entry for incell.

Change-Id: Ib8b3c8cf7c0da7fea4d458dcc8101d6fbc150043
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics: use lcd notifier to control touch/lcd power

Previous implementation using fb notifier has some side effects
with splash display and caused display issue for off-mode-charging
and recovery more UI.

Instead of using fb notifier, use the new lcd notifier to control
touch power only when LCD power is on and off.

Change-Id: Ic8a7fec89981d66fe766bf9a370ff84f7da73f20
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics_ds5: remove unused regster setting

Remove unused register for synaptics s3350 in init_panel

Change-Id: Iefbd78ea011e9c3ef1f18c119ce2f5420ae2f89b
Signed-off-by: yejini.lee <yejini.lee@lge.com>
Signed-off-by: kwangwoon.baek <kwangwoon.baek@lge.com>
input: touch_synaptics_ds5: enable irq after touch init

Previous code enabled touch interrupt before initializing the touch IC,
and sometimes unnecessary touch interrupt could've happened during IC init
and caused unnecessary reset of the touch controller when the driver
detected the interrupt as an error.

Also, removed codes for checking the interrupt pin in the initialization
because the interrupt pin could be changed when user touch the device
during initialization, which couldn't be used for error detection.

Change-Id: Ie3ce807da00318dff5ee98d5f7db4567ac6c60b6
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics_ds5: use I2C RESET COMMAND if possible

Only GPIO RESET was used to reset the touch controller when
there is an error in the touch operation, but controlling
RESET GPIO makes the LCD tearing effect.

Changed to use GPIO RESET only if the I2C command reset is failed.
Because I2C command reset doesn't make the LCD tearing effect,
this will lower the frequency of the LCD tearing issue.

Change-Id: Id0f528f069e1363f2c7da4b6ca22f0b80aad2dfe
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics: Do not set the regulator voltage

Voltage may be board specific value. We can set the voltage via the
device tree or board init. So we don't need hardcoded voltage settings
in the driver.

Change-Id: I90c6323a11c325fbfef6bf9e6540c18188c9900e
Signed-off-by: Devin Kim <dojip.kim@lge.com>
input: touch_synaptics_ds5: sync irq with touch init

When the touch is turned off before touch init workqueue
is executed, the touch interrupt might remain disabled
when the init workqueue is cancelled.
So, we need to protect the touch init function with
the mutex and disable the interrupt only when there is
no work thread cancelled.

Change-Id: Id50651f392664b0571d0cedffbb278baa5645581
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
input: touch_synaptics_ds5: support firmware for new panel

Added "synaptics,type" node to select novatek/orise panel.

The firmware E011 was applied for both old/new panel now.

The new device with orise must define the below in DT.

i2c@f9924000 {
	synaptics_s3350@70 {
		synaptics,type = <1>;
	};
};

0 (default) -> Novatek
1           -> Orise

Change-Id: I53295aa82527a1f58f4ffc41e4d934be1a34b875
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>

Conflicts:
	drivers/input/touchscreen/SynaImage_ds5.h
input: SynaImage_ds5: Firmware E024 (ORISE)

Change-Id: I975aec777d8eaaf89d86c0e55e60b6d1fd96b2fb
Signed-off-by: kwangwoon.baek <kwangwoon.baek@lge.com>
Signed-off-by: Jongrak Kwon <jongrak.kwon@lge.com>
hammerhead: touch: synaptics: remove some code
Revert "input: SynaImage_ds5: Firmware E024 (ORISE)"

This reverts commit afe45ac574ec7cdad45f2f2c6bd1eda613d568f8.

Signed-off-by: Patrick Tjin <pattjin@google.com>