From 8e45550cb95e228cd649fc0b05139ff10faa6f5b Mon Sep 17 00:00:00 2001 From: Ivan Vecera Date: Mon, 28 Oct 2024 22:25:13 +0100 Subject: [PATCH] drivers: input: touchscreen: Extend common touchpanel interface by fp_state * Add fp_state attribute to common touch panel interface that will be used by touchscreen drivers to notify userspace when finger is in FOD area. This sysfs knob is used to implement UDFPS sensor sub-HAL Signed-off-by: Ivan Vecera Change-Id: Ic5fb0cf389779854a1c3b13833bcc1137e67c817 --- drivers/input/touchscreen/tp_common.c | 8 ++++++++ include/linux/input/tp_common.h | 2 ++ 2 files changed, 10 insertions(+) diff --git a/drivers/input/touchscreen/tp_common.c b/drivers/input/touchscreen/tp_common.c index 3a4ae266114b..bd1af27fad55 100644 --- a/drivers/input/touchscreen/tp_common.c +++ b/drivers/input/touchscreen/tp_common.c @@ -13,10 +13,18 @@ struct kobject *touchpanel_kobj; return sysfs_create_file(touchpanel_kobj, &kattr.attr); \ } +#define TS_ENABLE_NOTIFY(type) \ + void tp_common_notify_##type(void) \ + { \ + sysfs_notify(touchpanel_kobj, NULL, __stringify(type)); \ + } + TS_ENABLE_FOPS(capacitive_keys) TS_ENABLE_FOPS(double_tap) TS_ENABLE_FOPS(fod_status) +TS_ENABLE_FOPS(fp_state) TS_ENABLE_FOPS(reversed_keys) +TS_ENABLE_NOTIFY(fp_state) static int __init tp_common_init(void) { diff --git a/include/linux/input/tp_common.h b/include/linux/input/tp_common.h index 776a43f78eac..ae24c68a6f3d 100644 --- a/include/linux/input/tp_common.h +++ b/include/linux/input/tp_common.h @@ -10,7 +10,9 @@ struct tp_common_ops { const char *buf, size_t count); }; +void tp_common_notify_fp_state(void); int tp_common_set_capacitive_keys_ops(struct tp_common_ops *ops); int tp_common_set_double_tap_ops(struct tp_common_ops *ops); int tp_common_set_fod_status_ops(struct tp_common_ops *ops); +int tp_common_set_fp_state_ops(struct tp_common_ops *ops); int tp_common_set_reversed_keys_ops(struct tp_common_ops *ops);