input: touchscreen: fts_spi: Report fp_state to sysfs
Change-Id: If5a7ab3adfdbbf44ea9940450fa388c4d03fa2ad
This commit is contained in:
@@ -533,6 +533,22 @@ static struct tp_common_ops double_tap_ops = {
|
||||
.show = double_tap_show,
|
||||
.store = double_tap_store,
|
||||
};
|
||||
|
||||
#ifdef CONFIG_TOUCHSCREEN_FOD
|
||||
static ssize_t fp_state_show(struct kobject *kobj,
|
||||
struct kobj_attribute *attr, char *buf)
|
||||
{
|
||||
if (!fts_info)
|
||||
return -EINVAL;
|
||||
|
||||
return sprintf(buf, "%d,%d,%d\n", fts_info->fod_pressed_x, fts_info->fod_pressed_y,
|
||||
fts_info->fod_pressed);
|
||||
}
|
||||
|
||||
static struct tp_common_ops fp_state_ops = {
|
||||
.show = fp_state_show,
|
||||
};
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef GRIP_MODE
|
||||
@@ -4328,6 +4344,9 @@ static void fts_gesture_event_handler(struct fts_ts_info *info,
|
||||
!info->sleep_finger) ||
|
||||
!info->sensor_sleep) {
|
||||
info->fod_pressed = true;
|
||||
info->fod_pressed_x = x;
|
||||
info->fod_pressed_y = y;
|
||||
tp_common_notify_fp_state();
|
||||
input_report_key(info->input_dev,
|
||||
BTN_INFO, 1);
|
||||
input_sync(info->input_dev);
|
||||
@@ -4422,6 +4441,9 @@ static void fts_gesture_event_handler(struct fts_ts_info *info,
|
||||
info->sleep_finger = 0;
|
||||
info->fod_overlap = 0;
|
||||
info->fod_pressed = false;
|
||||
info->fod_pressed_x = 0;
|
||||
info->fod_pressed_y = 0;
|
||||
tp_common_notify_fp_state();
|
||||
goto gesture_done;
|
||||
}
|
||||
#endif
|
||||
@@ -8241,6 +8263,7 @@ static int fts_probe(struct spi_device *client)
|
||||
tp_common_set_double_tap_ops(&double_tap_ops);
|
||||
#ifdef CONFIG_TOUCHSCREEN_FOD
|
||||
tp_common_set_fod_status_ops(&fod_status_ops);
|
||||
tp_common_set_fp_state_ops(&fp_state_ops);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@@ -387,6 +387,8 @@ struct fts_ts_info {
|
||||
unsigned long fod_id;
|
||||
unsigned long fod_x;
|
||||
unsigned long fod_y;
|
||||
unsigned long fod_pressed_x;
|
||||
unsigned long fod_pressed_y;
|
||||
struct mutex fod_mutex;
|
||||
struct mutex cmd_update_mutex;
|
||||
bool fod_coordinate_update;
|
||||
|
||||
Reference in New Issue
Block a user