diff --git a/drivers/input/touchscreen/stm/fts5cu56a/fts_ts.c b/drivers/input/touchscreen/stm/fts5cu56a/fts_ts.c index 3afff1502275..59648fcb43e1 100755 --- a/drivers/input/touchscreen/stm/fts5cu56a/fts_ts.c +++ b/drivers/input/touchscreen/stm/fts5cu56a/fts_ts.c @@ -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__); diff --git a/drivers/input/touchscreen/stm/fts5cu56a/fts_ts.h b/drivers/input/touchscreen/stm/fts5cu56a/fts_ts.h index 77a774c9e338..cf7c710ca33c 100755 --- a/drivers/input/touchscreen/stm/fts5cu56a/fts_ts.h +++ b/drivers/input/touchscreen/stm/fts5cu56a/fts_ts.h @@ -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;