input: cyttsp-i2c: Add support for disabling ghost touch detection

Add support to treat ghost touches as normal touches incase firmware
reports all touches as ghost touches.

Signed-off-by: Mohan Pallaka <mpallaka@codeaurora.org>
diff --git a/drivers/input/touchscreen/cyttsp-i2c.c b/drivers/input/touchscreen/cyttsp-i2c.c
index d26a86f..9e50ee0 100644
--- a/drivers/input/touchscreen/cyttsp-i2c.c
+++ b/drivers/input/touchscreen/cyttsp-i2c.c
@@ -1060,6 +1060,10 @@
 		cyttsp_testdat(&g_xy_data, &tt_gen2_testray, \
 			sizeof(struct cyttsp_gen3_xydata_t));
 
+		if (ts->platform_data->disable_ghost_det &&
+				(cur_tch == CY_GEN2_GHOST))
+			cur_tch = CY_GEN2_2TOUCH;
+
 		if (pxy_gen2_data->evnt_idx == CY_GEN2_NOTOUCH) {
 			cur_tch = 0;
 		} else if (cur_tch == CY_GEN2_GHOST) {
diff --git a/include/linux/cyttsp.h b/include/linux/cyttsp.h
index d34542c..8d69031 100644
--- a/include/linux/cyttsp.h
+++ b/include/linux/cyttsp.h
@@ -480,6 +480,7 @@
 	struct cyttsp_regulator *regulator_info;
 	u8 num_regulators;
 	const char *fw_fname;
+	bool disable_ghost_det;
 #ifdef CY_USE_I2C_DRIVER
 	s32 (*init)(struct i2c_client *client);
 	s32 (*resume)(struct i2c_client *client);