Merge "touch: goodix: set ESD check disabled as default"

This commit is contained in:
qctecmdr
2022-05-19 23:00:30 -07:00
committed by Gerrit - the friendly Code Review server
2 changed files with 12 additions and 5 deletions

View File

@@ -61,6 +61,8 @@ static void goodix_register_for_panel_events(struct device_node *dp,
struct goodix_module goodix_modules; struct goodix_module goodix_modules;
int core_module_prob_sate = CORE_MODULE_UNPROBED; int core_module_prob_sate = CORE_MODULE_UNPROBED;
int goodix_ts_esd_init(struct goodix_ts_core *cd);
static int goodix_send_ic_config(struct goodix_ts_core *cd, int type); static int goodix_send_ic_config(struct goodix_ts_core *cd, int type);
/** /**
* __do_register_ext_module - register external module * __do_register_ext_module - register external module
@@ -725,13 +727,19 @@ static ssize_t goodix_ts_esd_info_store(struct device *dev,
struct device_attribute *attr, struct device_attribute *attr,
const char *buf, size_t count) const char *buf, size_t count)
{ {
struct goodix_ts_core *core_data = dev_get_drvdata(dev);
if (!buf || count <= 0) if (!buf || count <= 0)
return -EINVAL; return -EINVAL;
if (buf[0] != '0') if (buf[0] != '0') {
if (!core_data->esd_initialized)
goodix_ts_esd_init(core_data);
goodix_ts_blocking_notify(NOTIFY_ESD_ON, NULL); goodix_ts_blocking_notify(NOTIFY_ESD_ON, NULL);
else } else if (core_data->esd_initialized) {
goodix_ts_blocking_notify(NOTIFY_ESD_OFF, NULL); goodix_ts_blocking_notify(NOTIFY_ESD_OFF, NULL);
}
return count; return count;
} }
@@ -1703,6 +1711,7 @@ int goodix_ts_esd_init(struct goodix_ts_core *cd)
ts_esd->esd_notifier.notifier_call = goodix_esd_notifier_callback; ts_esd->esd_notifier.notifier_call = goodix_esd_notifier_callback;
goodix_ts_register_notifier(&ts_esd->esd_notifier); goodix_ts_register_notifier(&ts_esd->esd_notifier);
goodix_ts_esd_on(cd); goodix_ts_esd_on(cd);
cd->esd_initialized = true;
return 0; return 0;
} }
@@ -2046,9 +2055,6 @@ skip_goodix_ts_irq_setup:
/* create procfs files */ /* create procfs files */
goodix_ts_procfs_init(cd); goodix_ts_procfs_init(cd);
/* esd protector */
goodix_ts_esd_init(cd);
/* gesture init */ /* gesture init */
gesture_module_init(); gesture_module_init();

View File

@@ -504,6 +504,7 @@ struct goodix_ts_core {
struct notifier_block ts_notifier; struct notifier_block ts_notifier;
struct goodix_ts_esd ts_esd; struct goodix_ts_esd ts_esd;
bool esd_initialized;
#if defined(CONFIG_DRM) #if defined(CONFIG_DRM)
struct notifier_block fb_notifier; struct notifier_block fb_notifier;