summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--fts.c26
-rw-r--r--fts.h19
2 files changed, 38 insertions, 7 deletions
diff --git a/fts.c b/fts.c
index c4b373e..0f57e71 100644
--- a/fts.c
+++ b/fts.c
@@ -1516,7 +1516,9 @@ static void touchsim_work(struct work_struct *work)
input_sync(info->input_dev);
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
heatmap_read(&info->v4l2, ktime_to_ns(timestamp));
+#endif
pm_qos_update_request(&info->pm_qos_req, PM_QOS_DEFAULT_VALUE);
}
@@ -2643,6 +2645,7 @@ END:
* 1 = FTS_HEATMAP_PARTIAL
* 2 = FTS_HEATMAP_FULL
*/
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
static ssize_t fts_heatmap_mode_store(struct device *dev,
struct device_attribute *attr,
const char *buf, size_t count)
@@ -2670,6 +2673,7 @@ static ssize_t fts_heatmap_mode_show(struct device *dev,
return scnprintf(buf, PAGE_SIZE, "%d\n",
info->heatmap_mode);
}
+#endif
static DEVICE_ATTR(infoblock_getdata, (0444),
fts_infoblock_getdata_show, NULL);
@@ -2681,8 +2685,10 @@ static DEVICE_ATTR(fw_file_test, 0444, fts_fw_test_show, NULL);
static DEVICE_ATTR(status, 0444, fts_status_show, NULL);
static DEVICE_ATTR(stm_fts_cmd, 0664, stm_fts_cmd_show,
stm_fts_cmd_store);
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
static DEVICE_ATTR(heatmap_mode, 0664, fts_heatmap_mode_show,
fts_heatmap_mode_store);
+#endif
#ifdef USE_ONE_FILE_NODE
static DEVICE_ATTR(feature_enable, 0664,
fts_feature_enable_show, fts_feature_enable_store);
@@ -2741,7 +2747,9 @@ static struct attribute *fts_attr_group[] = {
&dev_attr_fw_file_test.attr,
&dev_attr_status.attr,
&dev_attr_stm_fts_cmd.attr,
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
&dev_attr_heatmap_mode.attr,
+#endif
#ifdef USE_ONE_FILE_NODE
&dev_attr_feature_enable.attr,
#else
@@ -3644,6 +3652,7 @@ static bool fts_user_report_event_handler(struct fts_ts_info *info, unsigned
return false;
}
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
static void heatmap_enable(void)
{
u8 command[] = {FTS_CMD_SYSTEM, SYS_CMD_LOAD_DATA,
@@ -3776,6 +3785,7 @@ static bool read_heatmap_raw(struct v4l2_heatmap *v4l2, strength_t *data)
return true;
}
+#endif
/* Update a state machine used to toggle control of the touch IC's motion
* filter.
@@ -3906,8 +3916,10 @@ static irqreturn_t fts_interrupt_handler(int irq, void *handle)
input_sync(info->input_dev);
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
if (processed_pointer_event)
heatmap_read(&info->v4l2, ktime_to_ns(info->timestamp));
+#endif
/* Disable the firmware motion filter during single touch */
update_motion_filter(info);
@@ -4581,7 +4593,9 @@ static int fts_init_sensing(struct fts_ts_info *info)
pr_err("%s Init after Probe error (ERROR = %08X)\n",
__func__, error);
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
heatmap_enable();
+#endif
return error;
}
@@ -4823,8 +4837,10 @@ static void fts_resume_work(struct work_struct *work)
info->sensor_sleep = false;
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
/* heatmap must be enabled after every chip reset (fts_system_reset) */
heatmap_enable();
+#endif
fts_enableInterrupt(true);
@@ -5279,11 +5295,13 @@ static int parse_dt(struct device *dev, struct fts_hw_platform_data *bdata)
pr_info("Automatic firmware update disabled\n");
}
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
bdata->heatmap_mode_full_init = false;
if (of_property_read_bool(np, "st,heatmap_mode_full")) {
bdata->heatmap_mode_full_init = true;
pr_info("Full heatmap enabled\n");
}
+#endif
if (panel && panel->funcs && panel->funcs->get_timings &&
panel->funcs->get_timings(panel, 1, &timing) > 0) {
@@ -5559,10 +5577,12 @@ static int fts_probe(struct spi_device *client)
/* Set initial heatmap mode based on the device tree configuration.
* Default is partial heatmap mode.
*/
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
if (info->board->heatmap_mode_full_init)
info->heatmap_mode = FTS_HEATMAP_FULL;
else
info->heatmap_mode = FTS_HEATMAP_PARTIAL;
+#endif
/* init motion filter mode */
info->use_default_mf = false;
@@ -5587,6 +5607,7 @@ static int fts_probe(struct spi_device *client)
goto ProbeErrorExit_6;
}
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
/*
* Heatmap_probe must be called before irq routine is registered,
* because heatmap_read is called from interrupt context.
@@ -5606,6 +5627,7 @@ static int fts_probe(struct spi_device *client)
error = heatmap_probe(&info->v4l2);
if (error < OK)
goto ProbeErrorExit_6;
+#endif
#if defined(FW_UPDATE_ON_PROBE) && defined(FW_H_FILE)
pr_info("FW Update and Sensing Initialization:\n");
@@ -5669,7 +5691,9 @@ ProbeErrorExit_7:
msm_drm_unregister_client(&info->notifier);
#endif
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
heatmap_remove(&info->v4l2);
+#endif
ProbeErrorExit_6:
pm_qos_remove_request(&info->pm_qos_req);
@@ -5733,7 +5757,9 @@ static int fts_remove(struct spi_device *client)
/* remove interrupt and event handlers */
fts_interrupt_uninstall(info);
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
heatmap_remove(&info->v4l2);
+#endif
pm_qos_remove_request(&info->pm_qos_req);
diff --git a/fts.h b/fts.h
index 8f8de99..977afb7 100644
--- a/fts.h
+++ b/fts.h
@@ -33,7 +33,9 @@
#define _LINUX_FTS_I2C_H_
#include <linux/device.h>
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
#include <linux/input/heatmap.h>
+#endif
#include <linux/pm_qos.h>
#include <drm/drm_panel.h>
#include "fts_lib/ftsSoftware.h"
@@ -204,7 +206,7 @@
/**@}*/
/*********************************************************/
-
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
/* **** LOCAL HEATMAP FEATURE *** */
#define LOCAL_HEATMAP_WIDTH 7
#define LOCAL_HEATMAP_HEIGHT 7
@@ -223,7 +225,7 @@ struct heatmap_report {
strength_t data[LOCAL_HEATMAP_WIDTH * LOCAL_HEATMAP_HEIGHT];
} __attribute__((packed));
/* **** END **** */
-
+#endif
/*
* Configuration mode
*
@@ -289,7 +291,9 @@ struct fts_hw_platform_data {
int x_axis_max;
int y_axis_max;
bool auto_fw_update;
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
bool heatmap_mode_full_init;
+#endif
struct drm_panel *panel;
u32 initial_panel_index;
};
@@ -320,12 +324,13 @@ typedef enum {
* (LOCAL_HEATMAP_WIDTH * LOCAL_HEATMAP_HEIGHT)
* FTS_HEATMAP_FULL - read full mutual sense strength frame
*/
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
enum {
FTS_HEATMAP_OFF = 0,
FTS_HEATMAP_PARTIAL = 1,
FTS_HEATMAP_FULL = 2
};
-
+#endif
/*
* Forward declaration
*/
@@ -400,9 +405,9 @@ struct fts_ts_info {
struct completion bus_resumed; /* resume_work complete */
struct pm_qos_request pm_qos_req;
-
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
struct v4l2_heatmap v4l2;
-
+#endif
struct delayed_work fwu_work; /* Work for fw update */
struct workqueue_struct *fwu_workqueue; /* Fw update work queue */
event_dispatch_handler_t *event_dispatch_table; /* Dispatch table */
@@ -453,9 +458,9 @@ struct fts_ts_info {
int stylus_enabled; /* Stylus mode */
int cover_enabled; /* Cover mode */
int grip_enabled; /* Grip mode */
-
+#ifdef CONFIG_TOUCHSCREEN_HEATMAP
int heatmap_mode; /* heatmap mode*/
-
+#endif
/* Stop changing motion filter and keep fw design */
bool use_default_mf;
/* Motion filter finite state machine (FSM) state */