mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-14 16:46:15 -04:00
ili9882_mmi: support panel gesture config
Capri ilitek touch: some panel need enable partial gesture mode for ESD case Add new panel config for gesture NO_PROP_NEEDED Change-Id: I4e0Montana83e9c36cb82f2eea6971797f67781d8f25 Reviewed-on: https://gerrit.mot.com/1789290 SLTApproved: Slta Waiver SME-Granted: SME Approvals Granted Tested-by: Jira Key Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com> Submit-Approved: Jira Key
This commit is contained in:
parent
efda4a150a
commit
52adf4eb13
5 changed files with 68 additions and 3 deletions
|
|
@ -25,6 +25,12 @@ ifeq ($(ILITEK_GESTURE),true)
|
|||
KERNEL_CFLAGS += CONFIG_ILITEK_GESTURE=y
|
||||
endif
|
||||
|
||||
# enable gesture mode by panel config
|
||||
# not all panels need enable gesture mode for some products
|
||||
ifeq ($(ILITEK_PANEL_GESTURE),true)
|
||||
KERNEL_CFLAGS += CONFIG_ILITEK_PANEL_GESTURE=y
|
||||
endif
|
||||
|
||||
include $(CLEAR_VARS)
|
||||
LOCAL_MODULE := ili9882_mmi.ko
|
||||
LOCAL_MODULE_TAGS := optional
|
||||
|
|
|
|||
|
|
@ -27,6 +27,10 @@ ifneq ($(filter m y,$(CONFIG_ILITEK_GESTURE)),)
|
|||
EXTRA_CFLAGS += -DILI_CONFIG_GESTURE
|
||||
endif
|
||||
|
||||
ifneq ($(filter m y,$(CONFIG_ILITEK_PANEL_GESTURE)),)
|
||||
EXTRA_CFLAGS += -DILI_CONFIG_PANEL_GESTURE
|
||||
endif
|
||||
|
||||
ili9882_mmi-objs += ili9882.o
|
||||
ili9882_mmi-objs += ili9882_spi.o
|
||||
ili9882_mmi-objs += ili9882_qcom.o
|
||||
|
|
|
|||
|
|
@ -135,7 +135,7 @@
|
|||
#define ENABLE_WQ_ESD DISABLE
|
||||
#endif
|
||||
#define ENABLE_WQ_BAT DISABLE
|
||||
#ifdef ILI_CONFIG_GESTURE
|
||||
#if defined(ILI_CONFIG_GESTURE) || defined(ILI_CONFIG_PANEL_GESTURE)
|
||||
#define ENABLE_GESTURE ENABLE
|
||||
#else
|
||||
#define ENABLE_GESTURE DISABLE
|
||||
|
|
@ -864,6 +864,7 @@ struct ilitek_ts_data {
|
|||
bool wq_esd_ctrl;
|
||||
bool wq_bat_ctrl;
|
||||
|
||||
bool panel_gesture_enable;
|
||||
bool netlink;
|
||||
bool report;
|
||||
bool gesture;
|
||||
|
|
|
|||
|
|
@ -444,6 +444,20 @@ static int ilitek_plat_notifier_fb(struct notifier_block *self, unsigned long ev
|
|||
if (event == DRM_PANEL_EARLY_EVENT_BLANK)
|
||||
{
|
||||
#if ENABLE_GESTURE
|
||||
#ifdef ILI_CONFIG_PANEL_GESTURE
|
||||
if (ilits->panel_gesture_enable) {
|
||||
if (ili_sleep_handler(TP_SUSPEND) < 0)
|
||||
ILI_ERR("TP suspend failed!\n");
|
||||
else
|
||||
ILI_INFO("TP suspend!\n");
|
||||
} else {
|
||||
//enter deep sleep when panel not config gesture
|
||||
if (ili_sleep_handler(TP_DEEP_SLEEP) < 0)
|
||||
ILI_ERR("TP deep sleep in failed!\n");
|
||||
else
|
||||
ILI_INFO("TP in deep sleep!\n");
|
||||
}
|
||||
#else
|
||||
if (ilits->tp_module == MODEL_TM) {
|
||||
if (ili_sleep_handler(TP_DEEP_SLEEP) < 0)
|
||||
ILI_ERR("TP deep sleep in failed\n");
|
||||
|
|
@ -451,6 +465,7 @@ static int ilitek_plat_notifier_fb(struct notifier_block *self, unsigned long ev
|
|||
if (ili_sleep_handler(TP_SUSPEND) < 0)
|
||||
ILI_ERR("TP suspend failed\n");
|
||||
}
|
||||
#endif
|
||||
#else
|
||||
//enter deep sleep when not enable gesture
|
||||
if (ili_sleep_handler(TP_DEEP_SLEEP) < 0)
|
||||
|
|
@ -461,7 +476,7 @@ static int ilitek_plat_notifier_fb(struct notifier_block *self, unsigned long ev
|
|||
}
|
||||
#endif
|
||||
|
||||
#ifdef ILI_CONFIG_GESTURE
|
||||
#if defined(ILI_CONFIG_GESTURE) || defined(ILI_CONFIG_PANEL_GESTURE)
|
||||
touch_set_state(TOUCH_LOW_POWER_STATE, TOUCH_PANEL_IDX_PRIMARY);
|
||||
#endif
|
||||
}
|
||||
|
|
|
|||
|
|
@ -511,6 +511,36 @@ static int check_dt(struct device_node *np)
|
|||
pr_err("%s: %s not actived\n", __func__, node->name);
|
||||
return -ENODEV;
|
||||
}
|
||||
|
||||
static int parse_dt(struct device_node *np)
|
||||
{
|
||||
int32_t ret = 0;
|
||||
|
||||
#ifdef ILI_CONFIG_PANEL_GESTURE
|
||||
//parse gesture by panel config
|
||||
if (active_panel_name) {
|
||||
const char *panel_gesture;
|
||||
int panel_num = of_property_count_strings(np, "ilitek,gesture_panel");
|
||||
if (panel_num > 0) {
|
||||
int i;
|
||||
ILI_INFO("%s: get ilitek,gesture_panel count=%d", __func__, panel_num);
|
||||
for (i = 0; i < panel_num; i++) {
|
||||
ret = of_property_read_string_index(np, "ilitek,gesture_panel", i, &panel_gesture);
|
||||
if (ret < 0) {
|
||||
ILI_INFO("%s: cannot parse gesture_panel, ret=%d\n", __func__, ret);
|
||||
break;
|
||||
} else if (panel_gesture && strstr(active_panel_name, panel_gesture)) {
|
||||
ILI_INFO("%s: panel %s gesture enabled", __func__, panel_gesture);
|
||||
ilits->panel_gesture_enable = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
return ret;
|
||||
}
|
||||
#endif
|
||||
|
||||
static int ilitek_spi_probe(struct spi_device *spi)
|
||||
|
|
@ -626,8 +656,15 @@ static int ilitek_spi_probe(struct spi_device *spi)
|
|||
ilits->info_from_hex = ENABLE;
|
||||
ilits->wait_int_timeout = AP_INT_TIMEOUT;
|
||||
|
||||
//---parse dts---
|
||||
#ifdef CONFIG_DRM
|
||||
parse_dt(spi->dev.of_node);
|
||||
#endif
|
||||
|
||||
#if ENABLE_GESTURE
|
||||
#ifdef ILI_CONFIG_GESTURE
|
||||
#ifdef ILI_CONFIG_PANEL_GESTURE
|
||||
if (ilits->panel_gesture_enable)
|
||||
#elif defined(ILI_CONFIG_GESTURE)
|
||||
if (MODEL_HLT == tp_module)
|
||||
#endif
|
||||
{
|
||||
|
|
@ -651,6 +688,8 @@ static int ilitek_spi_probe(struct spi_device *spi)
|
|||
ilits->ges_sym.alphabet_two_line_2_bottom = ALPHABET_TWO_LINE_2_BOTTOM;
|
||||
ilits->ges_sym.alphabet_F = ALPHABET_F;
|
||||
ilits->ges_sym.alphabet_AT = ALPHABET_AT;
|
||||
|
||||
ILI_INFO("ilitek: gesture eanble:%d\n", ilits->gesture);
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue