channel input: add nova touch support rmmod

add nova touch support rmmod
rmmod and insmod work well

Change-Id: I36b43461fd584bcee1e191db256ec89c1ffe6fba
Signed-off-by: dengwei1 <dengwei1@motorola.com>
Reviewed-on: https://gerrit.mot.com/1245946
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Xiangpo Zhao <zhaoxp3@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
dengwei1 2018-09-25 11:22:58 +08:00 • committed by Wei Deng
commit 5147d1ce01
3 changed files with 75 additions and 1 deletions

View file

@ -66,6 +66,7 @@ uint8_t esd_retry_max = 5;
#if NVT_TOUCH_EXT_PROC
extern int32_t nvt_extra_proc_init(void);
extern void nvt_extra_proc_remove(void);
#endif
#if NVT_TOUCH_FW
@ -75,6 +76,7 @@ extern int32_t nvt_fw_sysfs_deinit(void);
#if NVT_TOUCH_MP
extern int32_t nvt_mp_proc_init(void);
extern void nvt_mp_proc_remove(void);
#endif
struct nvt_ts_data *ts;
@ -627,6 +629,15 @@ static int32_t nvt_flash_proc_init(void)
}
#endif
static void nvt_flash_proc_remove(void)
{
if (NVT_proc_entry != NULL) {
remove_proc_entry(DEVICE_NAME, NULL);
NVT_LOG("Removed %s under /proc\n",
DEVICE_NAME);
}
}
#if WAKEUP_GESTURE
#define GESTURE_WORD_C 12
#define GESTURE_WORD_W 13
@ -1535,6 +1546,24 @@ static int32_t nvt_ts_remove(struct i2c_client *client)
NVT_LOG("Removing driver...\n");
free_irq(client->irq, ts);
if (gpio_is_valid(ts->irq_gpio)) {
gpio_free(ts->irq_gpio);
}
#if NVT_TOUCH_SUPPORT_HW_RST
if (gpio_is_valid(ts->reset_gpio))
gpio_free(ts->reset_gpio);
#endif
#if NVT_TOUCH_PROC
nvt_flash_proc_remove();
#endif
#if NVT_TOUCH_MP
nvt_mp_proc_remove();
#endif
#if NVT_TOUCH_EXT_PROC
nvt_extra_proc_remove();
#endif
input_unregister_device(ts->input_dev);
i2c_set_clientdata(client, NULL);
kfree(ts);
@ -1925,8 +1954,11 @@ static void __exit nvt_driver_exit(void)
#endif
#if NVT_TOUCH_ESD_PROTECT
if (nvt_esd_check_wq)
if (nvt_esd_check_wq) {
cancel_delayed_work_sync(&nvt_esd_check_work);
flush_workqueue(nvt_esd_check_wq);
destroy_workqueue(nvt_esd_check_wq);
}
#endif /* #if NVT_TOUCH_ESD_PROTECT */
}

View file

@ -691,4 +691,31 @@ int32_t nvt_extra_proc_init(void)
return 0;
}
void nvt_extra_proc_remove(void)
{
if (NVT_proc_fw_version_entry != NULL) {
remove_proc_entry(NVT_FW_VERSION, NULL);
NVT_LOG("Removed %s under /proc\n",
NVT_FW_VERSION);
}
if (NVT_proc_baseline_entry != NULL) {
remove_proc_entry(NVT_BASELINE, NULL);
NVT_LOG("Removed %s under /proc\n",
NVT_BASELINE);
}
if (NVT_proc_raw_entry != NULL) {
remove_proc_entry(NVT_RAW, NULL);
NVT_LOG("Removed %s under /proc\n",
NVT_RAW);
}
if (NVT_proc_diff_entry != NULL) {
remove_proc_entry(NVT_DIFF, NULL);
NVT_LOG("Removed %s under /proc\n",
NVT_DIFF);
}
}
#endif

View file

@ -1898,4 +1898,19 @@ int32_t nvt_mp_proc_init(void)
return ret;
}
void nvt_mp_proc_remove(void)
{
if (NVT_proc_selftest_entry != NULL) {
remove_proc_entry("nvt_selftest", NULL);
NVT_LOG("Removed %s under /proc\n",
"nvt_selftest");
}
#if NVT_TOUCH_MP_LENOVO
if (NVT_proc_selftest_read_data != NULL) {
remove_proc_entry("nvt_read_data", NULL);
NVT_LOG("Removed %s under /proc\n",
"nvt_read_data");
}
#endif
}
#endif /* #if NVT_TOUCH_MP */