mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-13 00:00:00 -04:00
nio: input touch add edge suppression
add edge suppression function for device rotate NO_PROP_NEEDED Change-Id: Id1e324765977086b70a6f6abe5bfe996d791bbc1 Signed-off-by: dengwei1 <dengwei1@motorola.com> Reviewed-on: https://gerrit.mot.com/1866826 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Reviewed-by: Jun Weng <wengjun1@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
6c96df253f
commit
d1b533390b
6 changed files with 82 additions and 3 deletions
|
|
@ -46,6 +46,9 @@ endif
|
|||
ifneq ($(BOARD_USES_STYLUS_PALM_RANGE),)
|
||||
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_0FLASH_MMI_STYLUS_PALM_RANGE=y
|
||||
endif
|
||||
ifneq ($(BOARD_USES_EDGE_SUPPRESSION),)
|
||||
KERNEL_CFLAGS += CONFIG_INPUT_NOVA_EDGE_SUPPRESSION=y
|
||||
endif
|
||||
include $(CLEAR_VARS)
|
||||
ifneq ($(BOARD_USES_DOUBLE_TAP),)
|
||||
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/sensors_class.ko
|
||||
|
|
|
|||
|
|
@ -43,6 +43,10 @@ ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_0FLASH_MMI_PEN_NOTIFIER)),)
|
|||
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../../../misc/pen/$(GKI_OBJ_MODULE_DIR)/Module.symvers
|
||||
EXTRA_CFLAGS += -DNOVATECH_PEN_NOTIFIER
|
||||
endif
|
||||
ifneq ($(filter m y,$(CONFIG_INPUT_NOVA_EDGE_SUPPRESSION)),)
|
||||
EXTRA_CFLAGS += -DEDGE_SUPPRESSION
|
||||
endif
|
||||
|
||||
nova_0flash_mmi-objs += nt36xxx.o
|
||||
nova_0flash_mmi-objs += nt36xxx_ext_proc.o
|
||||
nova_0flash_mmi-objs += nt36xxx_fw_update.o
|
||||
|
|
|
|||
|
|
@ -2014,12 +2014,47 @@ static ssize_t nvt_palm_settings_store(struct device *dev,
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef EDGE_SUPPRESSION
|
||||
static ssize_t nvt_edge_reject_store(struct device *dev,
|
||||
struct device_attribute *attr, const char *buf, size_t count) {
|
||||
int res = 0;
|
||||
uint8_t state;
|
||||
|
||||
res = kstrtou8(buf, 0, &state);
|
||||
if (res < 0)
|
||||
return res;
|
||||
|
||||
ts->edge_reject_state = state;
|
||||
|
||||
NVT_LOG("edge_reject_state %d!\n", state);
|
||||
nvt_edge_reject_set(ts->edge_reject_state);
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
static ssize_t nvt_edge_reject_show(struct device *dev,
|
||||
struct device_attribute *attr, char *buf) {
|
||||
|
||||
if(ts->edge_reject_state == VERTICAL)
|
||||
return scnprintf(buf, PAGE_SIZE, "VERTICAL\n");
|
||||
else if(ts->edge_reject_state == LEFT_UP)
|
||||
return scnprintf(buf, PAGE_SIZE, "LEFT_UP\n");
|
||||
else if(ts->edge_reject_state == RIGHT_UP)
|
||||
return scnprintf(buf, PAGE_SIZE, "RIGHT_UP\n");
|
||||
else
|
||||
return scnprintf(buf, PAGE_SIZE, "Not Support!\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
static struct device_attribute touchscreen_attributes[] = {
|
||||
__ATTR_RO(path),
|
||||
__ATTR_RO(vendor),
|
||||
__ATTR_RO(ic_ver),
|
||||
#ifdef PALM_GESTURE
|
||||
__ATTR(palm_settings, S_IRUGO | S_IWUSR | S_IWGRP, nvt_palm_settings_show, nvt_palm_settings_store),
|
||||
#endif
|
||||
#ifdef EDGE_SUPPRESSION
|
||||
__ATTR(rotate, S_IRUGO | S_IWUSR | S_IWGRP, nvt_edge_reject_show, nvt_edge_reject_store),
|
||||
#endif
|
||||
__ATTR_NULL
|
||||
};
|
||||
|
|
@ -2046,7 +2081,7 @@ int32_t nvt_fw_class_init(bool create)
|
|||
static int minor;
|
||||
|
||||
if (create) {
|
||||
#ifdef PALM_GESTURE
|
||||
#if defined (PALM_GESTURE) || defined (EDGE_SUPPRESSION)
|
||||
ret = alloc_chrdev_region(&devno, 0, 1, NVT_PRIMARY_NAME);
|
||||
#else
|
||||
ret = alloc_chrdev_region(&devno, 0, 1, NVT_SPI_NAME);
|
||||
|
|
@ -2066,7 +2101,7 @@ int32_t nvt_fw_class_init(bool create)
|
|||
|
||||
ts_class_dev = device_create(touchscreen_class, NULL,
|
||||
devno,
|
||||
#ifdef PALM_GESTURE
|
||||
#if defined (PALM_GESTURE) || defined (EDGE_SUPPRESSION)
|
||||
ts, NVT_PRIMARY_NAME);
|
||||
#else
|
||||
ts, NVT_SPI_NAME);
|
||||
|
|
@ -2086,7 +2121,7 @@ int32_t nvt_fw_class_init(bool create)
|
|||
if (error)
|
||||
goto device_destroy;
|
||||
else
|
||||
#ifdef PALM_GESTURE
|
||||
#if defined (PALM_GESTURE) || defined (EDGE_SUPPRESSION)
|
||||
NVT_LOG("create /sys/class/touchscreen/%s Succeeded!\n", NVT_PRIMARY_NAME);
|
||||
#else
|
||||
NVT_LOG("create /sys/class/touchscreen/%s Succeeded!\n", NVT_SPI_NAME);
|
||||
|
|
@ -2330,6 +2365,9 @@ static int32_t nvt_ts_probe(struct spi_device *client)
|
|||
#ifdef PALM_GESTURE
|
||||
ts->palm_enabled = false;
|
||||
#endif
|
||||
#ifdef EDGE_SUPPRESSION
|
||||
ts->edge_reject_state = VERTICAL;
|
||||
#endif
|
||||
|
||||
sprintf(ts->phys, "input/ts");
|
||||
ts->input_dev->name = NVT_TS_NAME;
|
||||
|
|
|
|||
|
|
@ -102,6 +102,12 @@ extern const uint16_t touch_key_array[TOUCH_KEY_NUM];
|
|||
#define PANEL_REAL_HEIGHT 15768
|
||||
#endif
|
||||
#endif
|
||||
#define EDGE_REJECT_VERTICLE_CMD 0xBA
|
||||
#define EDGE_REJECT_LEFT_UP 0xBB
|
||||
#define EDGE_REJECT_RIGHT_UP 0xBC
|
||||
#define VERTICAL 1
|
||||
#define LEFT_UP 2
|
||||
#define RIGHT_UP 3
|
||||
|
||||
/* Enable only when module have tp reset pin and connected to host */
|
||||
#define NVT_TOUCH_SUPPORT_HW_RST 0
|
||||
|
|
@ -220,6 +226,9 @@ struct nvt_ts_data {
|
|||
#endif
|
||||
#ifdef PALM_GESTURE
|
||||
bool palm_enabled;
|
||||
#endif
|
||||
#ifdef EDGE_SUPPRESSION
|
||||
uint32_t edge_reject_state;
|
||||
#endif
|
||||
char product_id[10];
|
||||
uint8_t fw_type;
|
||||
|
|
@ -329,4 +338,7 @@ extern int nvt_mcu_pen_detect_set(uint8_t pen_detect);
|
|||
#ifdef PALM_GESTURE
|
||||
extern int nvt_palm_set(bool enabled);
|
||||
#endif
|
||||
#ifdef EDGE_SUPPRESSION
|
||||
extern int32_t nvt_edge_reject_set(uint32_t status);
|
||||
#endif
|
||||
#endif /* _LINUX_NVT_TOUCH_H */
|
||||
|
|
|
|||
|
|
@ -681,6 +681,25 @@ int nvt_palm_set(bool enabled) {
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef EDGE_SUPPRESSION
|
||||
int32_t nvt_edge_reject_set(uint32_t status) {
|
||||
int ret = 0;
|
||||
|
||||
if(status == VERTICAL)// 0 180
|
||||
ret = nvt_cmd_store(EDGE_REJECT_VERTICLE_CMD);
|
||||
else if(status == LEFT_UP) //90
|
||||
ret = nvt_cmd_store(EDGE_REJECT_LEFT_UP);
|
||||
else if(status == RIGHT_UP) //270
|
||||
ret = nvt_cmd_store(EDGE_REJECT_RIGHT_UP);
|
||||
else {
|
||||
NVT_ERR("Invalid parameter %d!\n", status);
|
||||
ret = -1;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int nvt_monitor_control_show(struct seq_file *sfile, void *v)
|
||||
{
|
||||
if(monitor_control_status == 1)
|
||||
|
|
|
|||
|
|
@ -1040,5 +1040,8 @@ void Boot_Update_Firmware(struct work_struct *work)
|
|||
#ifdef PALM_GESTURE
|
||||
nvt_palm_set(ts->palm_enabled);
|
||||
#endif
|
||||
#ifdef EDGE_SUPPRESSION
|
||||
ts->edge_reject_state = VERTICAL;
|
||||
#endif
|
||||
}
|
||||
#endif /* BOOT_UPDATE_FIRMWARE */
|
||||
|
|
|
|||
Loading…
Reference in a new issue