Add a macro to control if cli_gesture created

Add a macro to control if cli_gesture created,only if CLI touch supports
double tap gesture,this node should be created to receive gesture type
notifications.

Change-Id: I2a877b4257c758c1129c1bb3353cfbe59f2a452d
Signed-off-by: Wenge Zhu <zhuwg1@motorola.com>
Reviewed-on: https://gerrit.mot.com/2391205
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Shicheng Gong <gongsc1@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
Wenge Zhu 2022-09-26 11:34:26 +08:00 • committed by zhuwg1
commit f2192684df
6 changed files with 17 additions and 2 deletions

View file

@ -37,6 +37,10 @@ ifeq ($(BOARD_USES_DOUBLE_TAP_CTRL),true)
KBUILD_OPTIONS += CONFIG_BOARD_USES_DOUBLE_TAP_CTRL=y
endif
ifeq ($(BOARD_USES_CLI_DOUBLE_TAP_CTRL),true)
KBUILD_OPTIONS += CONFIG_BOARD_USES_CLI_DOUBLE_TAP_CTRL=y
endif
include $(CLEAR_VARS)
LOCAL_MODULE := touchscreen_mmi.ko
LOCAL_MODULE_TAGS := optional

View file

@ -32,6 +32,9 @@ endif
ifneq ($(filter m y, $(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL)),)
EXTRA_CFLAGS += -DCONFIG_BOARD_USES_DOUBLE_TAP_CTRL
endif
ifneq ($(filter m y, $(CONFIG_BOARD_USES_CLI_DOUBLE_TAP_CTRL)),)
EXTRA_CFLAGS += -DCONFIG_BOARD_USES_CLI_DOUBLE_TAP_CTRL
endif
obj-m := touchscreen_mmi.o
touchscreen_mmi-objs := touchscreen_mmi_class.o touchscreen_mmi_panel.o touchscreen_mmi_notif.o touchscreen_mmi_gesture.o

View file

@ -386,7 +386,9 @@ static ssize_t gesture_store(struct device *dev,
return size;
}
static DEVICE_ATTR(gesture, (S_IWUSR | S_IWGRP | S_IRUGO), gesture_show, gesture_store);
#endif
#ifdef CONFIG_BOARD_USES_CLI_DOUBLE_TAP_CTRL
/*
* cli_gesture value used to indicate which gesture mode type is enabled
*/
@ -482,6 +484,8 @@ static struct attribute *sysfs_class_attrs[] = {
#endif
#ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
&dev_attr_gesture.attr,
#endif
#ifdef CONFIG_BOARD_USES_CLI_DOUBLE_TAP_CTRL
&dev_attr_cli_gesture.attr,
#endif
NULL,

View file

@ -382,7 +382,8 @@ bool ts_mmi_is_sensor_enable(void)
static int ts_mmi_sensor_set_enable(struct sensors_classdev *sensors_cdev,
unsigned int enable)
{
#ifndef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
#if !defined(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL) && \
!defined(CONFIG_BOARD_USES_CLI_DOUBLE_TAP_CTRL)
struct ts_mmi_sensor_platform_data *sensor_pdata = container_of(
sensors_cdev, struct ts_mmi_sensor_platform_data, ps_cdev);
struct ts_mmi_dev *touch_cdev = sensor_pdata->touch_cdev;

View file

@ -60,7 +60,8 @@ static int ts_mmi_panel_off(struct ts_mmi_dev *touch_cdev) {
TRY_TO_CALL(pre_suspend);
if (touch_cdev->pdata.gestures_enabled || touch_cdev->pdata.cli_gestures_enabled) {
#ifdef CONFIG_BOARD_USES_DOUBLE_TAP_CTRL
#if defined(CONFIG_BOARD_USES_DOUBLE_TAP_CTRL) || \
defined(CONFIG_BOARD_USES_CLI_DOUBLE_TAP_CTRL)
if(touch_cdev->gesture_mode_type != 0) {
if(touch_cdev->gesture_mode_type & 0x01) {
dev_info(DEV_MMI, "%s: try to enter zero Gesture mode\n", __func__);

View file

@ -165,7 +165,9 @@ int ts_mmi_parse_dt(struct ts_mmi_dev *touch_cdev,
if (!of_property_read_u32(of_node, "mmi,supported_gesture_type", &ppdata->supported_gesture_type))
dev_info(DEV_TS, "%s: supported_gesture_type property %02x\n",
__func__, ppdata->supported_gesture_type);
#endif
#ifdef CONFIG_BOARD_USES_CLI_DOUBLE_TAP_CTRL
if (!of_property_read_u32(of_node, "mmi,cli_supported_gesture_type", &ppdata->cli_supported_gesture_type))
dev_info(DEV_TS, "%s: cli_supported_gesture_type property %02x\n",
__func__, ppdata->cli_supported_gesture_type);