input: nova_0flash_mmi: use touchscreen mmi to support pen

nova_0flash_mmi:
- Use touchscreen mmi to support passive pen sys node.
- fix kernel 5.10 compile error

Change-Id: I06f2feaa9832eb104dffa6185d2d7d5888e3e28b
Signed-off-by: wangyq13 <wangyq13@lenovo.com>
Reviewed-on: https://gerrit.mot.com/2395162
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: <lvxj4@motorola.com>
Reviewed-by: Jing Hu <hujing3@lenovo.com>
Reviewed-by: Huosheng Liao <liaohs@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
wangyq13 2022-09-30 10:14:10 +08:00 • committed by Yeqing Wang
commit 919ab28073
4 changed files with 55 additions and 5 deletions

View file

@ -36,15 +36,15 @@ ifeq ($(CONFIG_INPUT_NOVA_LCM_FAST_LIGHTUP),true)
endif
ifneq ($(BOARD_USES_PEN_NOTIFIER),)
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_0FLASH_MMI_PEN_NOTIFIER=y
KBUILD_OPTIONS += CONFIG_INPUT_NOVA_0FLASH_MMI_PEN_NOTIFIER=y
endif
ifneq ($(BOARD_USES_STYLUS_PALM),)
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_0FLASH_MMI_STYLUS_PALM=y
KBUILD_OPTIONS += CONFIG_INPUT_NOVA_0FLASH_MMI_STYLUS_PALM=y
endif
ifneq ($(BOARD_USES_STYLUS_PALM_RANGE),)
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_0FLASH_MMI_STYLUS_PALM_RANGE=y
KBUILD_OPTIONS += CONFIG_INPUT_NOVA_0FLASH_MMI_STYLUS_PALM_RANGE=y
endif
ifneq ($(BOARD_USES_EDGE_SUPPRESSION),)
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_EDGE_SUPPRESSION=y
@ -73,6 +73,7 @@ endif
LOCAL_MODULE := nova_0flash_mmi.ko
LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/mmi_info.ko
ifneq ($(findstring touchscreen_mmi.ko,$(BOARD_VENDOR_KERNEL_MODULES)),)
KBUILD_OPTIONS += CONFIG_INPUT_TOUCHSCREEN_MMI=y
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/touchscreen_mmi.ko

View file

@ -15,3 +15,4 @@ clean:
KBUILD_EXTRA_SYMBOLS += $(M)/../../../mmi_info/$(GKI_OBJ_MODULE_DIR)/Module.symvers
KBUILD_EXTRA_SYMBOLS += $(M)/../touchscreen_mmi/$(GKI_OBJ_MODULE_DIR)/Module.symvers
KBUILD_EXTRA_SYMBOLS += $(M)/../../../misc/pen/$(GKI_OBJ_MODULE_DIR)/Module.symvers

View file

@ -223,13 +223,13 @@ struct nvt_ts_data {
bool gesture_enabled;
bool wakeable;
#endif
#ifdef NVT_SENSOR_EN
bool should_enable_gesture;
#ifdef NOVATECH_PEN_NOTIFIER
bool fw_ready_flag;
int nvt_pen_detect_flag;
struct notifier_block pen_notif;
#endif
#ifdef NVT_SENSOR_EN
bool should_enable_gesture;
enum display_state screen_state;
struct mutex state_mutex;
struct nvt_sensor_platform_data *sensor_pdata;

View file

@ -84,6 +84,50 @@ static struct attribute_group ext_attr_group = {
.attrs = ext_attributes,
};
#ifdef PALM_GESTURE
static ssize_t nvt_palm_settings_show(struct device *dev,
struct device_attribute *attr, char *buf)
{
return scnprintf(buf, PAGE_SIZE, "%d", ts->palm_enabled);
}
static ssize_t nvt_palm_settings_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
{
int value;
int err = 0;
if (count > 2)
return -EINVAL;
if (sscanf(buf, "%d", &value) != 1)
return -EINVAL;
err = count;
switch (value) {
case 0:
ts->palm_enabled = false;
break;
case 1:
ts->palm_enabled = true;
break;
default:
err = -EINVAL;
ts->palm_enabled = false;
NVT_ERR("Invalid Value! %d\n", value);
break;
}
nvt_palm_set(ts->palm_enabled);
return err;
}
static DEVICE_ATTR(palm_settings, S_IRUGO | S_IWUSR | S_IWGRP, nvt_palm_settings_show, nvt_palm_settings_store);
#endif
static int nvt_mmi_extend_attribute_group(struct device *dev, struct attribute_group **group)
{
int idx = 0;
@ -100,6 +144,10 @@ static int nvt_mmi_extend_attribute_group(struct device *dev, struct attribute_g
if (ts->edge_ctrl)
ADD_ATTR(edge);
#ifdef PALM_GESTURE
ADD_ATTR(palm_settings);
#endif
if (idx) {
ext_attributes[idx] = NULL;
*group = &ext_attr_group;