summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authordavidycchen <davidycchen@google.com>2019-08-21 15:48:36 +0800
committerDavid Chen <davidycchen@google.com>2019-09-16 16:16:21 +0000
commit3bf0f5843aa42b12d272ed434b0b3f5b4cdbebdd (patch)
tree8154bafbf0102ec07ae86b0379d6fcc5a606c690
parentb325a982ec4dfe56ba2463fff6248614e2abbc56 (diff)
downloadfts_touch-3bf0f5843aa42b12d272ed434b0b3f5b4cdbebdd.tar.gz
touchscreen:fts: add CONFIG_DRM in touch driver
Add CONFIG_DRM flag in touch driver. Undefine CONFIG_DRM first for bring up stage. Bug: 138816997 Change-Id: Icc3b35317018a59fdae2c9701c03306335f28ccb Signed-off-by: davidycchen <davidycchen@google.com>
-rw-r--r--fts.c10
-rw-r--r--fts.h6
2 files changed, 16 insertions, 0 deletions
diff --git a/fts.c b/fts.c
index f73705e..550ad5c 100644
--- a/fts.c
+++ b/fts.c
@@ -4560,9 +4560,11 @@ static int fts_init_sensing(struct fts_ts_info *info)
{
int error = 0;
+#ifdef CONFIG_DRM
error |= msm_drm_register_client(&info->notifier);/* register the
* suspend/resume
* function */
+#endif
error |= fts_interrupt_install(info); /* register event handler */
error |= fts_mode_handler(info, 0); /* enable the features and
* sensing */
@@ -4932,6 +4934,7 @@ int fts_set_bus_ref(struct fts_ts_info *info, u16 ref, bool enable)
* This function schedule a suspend or resume work according to the event
* received.
*/
+#ifdef CONFIG_DRM
static int fts_screen_state_chg_callback(struct notifier_block *nb,
unsigned long val, void *data)
{
@@ -4982,6 +4985,7 @@ static int fts_screen_state_chg_callback(struct notifier_block *nb,
static struct notifier_block fts_noti_block = {
.notifier_call = fts_screen_state_chg_callback,
};
+#endif
/**
* From the name of the power regulator get/put the actual regulator structs
@@ -5541,7 +5545,9 @@ static int fts_probe(struct spi_device *client)
info->grip_enabled = 0;
info->resume_bit = 1;
+#ifdef CONFIG_DRM
info->notifier = fts_noti_block;
+#endif
/* Set initial heatmap mode based on the device tree configuration.
* Default is partial heatmap mode.
@@ -5652,7 +5658,9 @@ ProbeErrorExit_7:
if(info->touchsim.wq)
destroy_workqueue(info->touchsim.wq);
+#ifdef CONFIG_DRM
msm_drm_unregister_client(&info->notifier);
+#endif
heatmap_remove(&info->v4l2);
@@ -5722,7 +5730,9 @@ static int fts_remove(struct spi_device *client)
pm_qos_remove_request(&info->pm_qos_req);
+#ifdef CONFIG_DRM
msm_drm_unregister_client(&info->notifier);
+#endif
/* unregister the device */
input_unregister_device(info->input_dev);
diff --git a/fts.h b/fts.h
index 51f0e03..8f8de99 100644
--- a/fts.h
+++ b/fts.h
@@ -43,6 +43,10 @@
#include <linux/input/touch_bus_negotiator.h>
#endif
+#ifdef CONFIG_DRM
+#undef CONFIG_DRM
+#endif
+
/****************** CONFIGURATION SECTION ******************/
/** @defgroup conf_section Driver Configuration Section
@@ -432,7 +436,9 @@ struct fts_ts_info {
struct fts_disp_extinfo extinfo; /* Display extended info */
+#ifdef CONFIG_DRM
struct notifier_block notifier; /* Notify on suspend/resume */
+#endif
int display_refresh_rate; /* Display rate in Hz */
bool sensor_sleep; /* True if suspend called */
struct wakeup_source wakesrc; /* Wake Lock struct */