sm7125: input: touchscreen: fts5cu56a: Add sysfs to track FOD pressed state

/sys/class/sec/tsp/input/fod_pressed
0 -> not pressed
1 -> pressed

Change-Id: Ifb2f432b1286bfc2a76a7c462326562569942ae5
tirimbino
Simon1511 3 years ago
parent e1db4898cd
commit 87795c59fd
  1. 18
      drivers/input/touchscreen/stm/fts5cu56a/fts_ts.c
  2. 1
      drivers/input/touchscreen/stm/fts5cu56a/fts_ts.h

@ -106,6 +106,9 @@ static ssize_t fts_secure_touch_enable_store(struct device *dev,
static ssize_t fts_secure_touch_show(struct device *dev,
struct device_attribute *attr, char *buf);
static ssize_t fts_fod_pressed_show(struct device *dev,
struct device_attribute *attr, char *buf);
static struct device_attribute attrs[] = {
__ATTR(secure_touch_enable, (0664),
fts_secure_touch_enable_show,
@ -113,6 +116,9 @@ static struct device_attribute attrs[] = {
__ATTR(secure_touch, (0444),
fts_secure_touch_show,
NULL),
__ATTR(fod_pressed, (0444),
fts_fod_pressed_show,
NULL),
};
static ssize_t fts_secure_touch_enable_show(struct device *dev,
@ -287,6 +293,14 @@ static void fts_secure_touch_stop(struct fts_ts_info *info, int blocking)
mutex_unlock(&info->st_lock);
}
static ssize_t fts_fod_pressed_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
struct fts_ts_info *info = dev_get_drvdata(dev);
return snprintf(buf, PAGE_SIZE, "%u\n", info->fod_pressed);
}
static irqreturn_t fts_filter_interrupt(struct fts_ts_info *info)
{
if (atomic_read(&info->st_enabled)) {
@ -2110,9 +2124,13 @@ static u8 fts_event_handler_type_b(struct fts_ts_info *info)
info->scrub_id = SPONGE_EVENT_TYPE_FOD;
input_info(true, &info->client->dev, "%s: FOD %sPRESS\n",
__func__, p_gesture_status->gesture_id ? "" : "LONG");
info->fod_pressed = true;
sysfs_notify(&info->input_dev->dev.kobj, NULL, "fod_pressed");
} else if (p_gesture_status->gesture_id == FTS_SPONGE_EVENT_GESTURE_ID_FOD_RELEASE) {
info->scrub_id = SPONGE_EVENT_TYPE_FOD_RELEASE;
input_info(true, &info->client->dev, "%s: FOD RELEASE\n", __func__);
info->fod_pressed = false;
sysfs_notify(&info->input_dev->dev.kobj, NULL, "fod_pressed");
} else if (p_gesture_status->gesture_id == FTS_SPONGE_EVENT_GESTURE_ID_FOD_OUT) {
info->scrub_id = SPONGE_EVENT_TYPE_FOD_OUT;
input_info(true, &info->client->dev, "%s: FOD OUT\n", __func__);

@ -908,6 +908,7 @@ struct fts_ts_info {
int fod_y;
int fod_vi_size;
u8 *fod_vi_data;
int fod_pressed;
#if defined(CONFIG_INPUT_SEC_SECURE_TOUCH)
atomic_t st_enabled;

Loading…
Cancel
Save