Modify synaptics compile error on V(CR).

TP:
1. Modify synaptics compile error on V(CR).
2. get_pid_task is more safer than pid_task, and get_pis_task
in the whitelist of google Andorid 11.

Change-Id: I7e6836db375bb8e80b6753afd400bb7db179cc18
Reviewed-on: https://gerrit.mot.com/1718097
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong 2020-08-21 20:09:16 +08:00 • committed by litong20
commit 1ff9cf183b
7 changed files with 26 additions and 5 deletions

View file

@ -1,7 +1,7 @@
# add -Wall to try to catch everything we can.
EXTRA_CFLAGS += -Wall
EXTRA_CFLAGS += -I$(TOP)/motorola/kernel/modules/include \
-I$(TOP)/motorola/kernel/modules/drivers/input/touchscreen/synaptics_tcm_mmi_v2
EXTRA_CFLAGS += -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include \
-I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/drivers/input/touchscreen/synaptics_tcm_mmi_v2
obj-m += synaptics_spi.o
obj-m += synaptics_i2c.o
@ -17,4 +17,5 @@ synaptics_core_module-objs := synaptics_core.o synaptics_touch.o
ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),)
EXTRA_CFLAGS += -DCONFIG_INPUT_TOUCHSCREEN_MMI
synaptics_core_module-objs += synaptics_ts_mmi.o
KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../touchscreen_mmi/Module.symvers
endif

View file

@ -3443,7 +3443,7 @@ int syna_tcm_suspend(struct device *dev)
}
#endif
#ifdef CONFIG_FB
#if defined (CONFIG_FB) || defined (CONFIG_INPUT_TOUCHSCREEN_MMI)
int syna_tcm_early_suspend(struct device *dev)
{
int retval;
@ -3491,7 +3491,9 @@ int syna_tcm_early_suspend(struct device *dev)
return 0;
}
#endif
#if defined (CONFIG_FB) || !defined (CONFIG_INPUT_TOUCHSCREEN_MMI)
static int syna_tcm_fb_notifier_cb(struct notifier_block *nb,
unsigned long action, void *data)
{

View file

@ -44,6 +44,8 @@
#include <linux/delay.h>
#include <linux/platform_device.h>
#include "synaptics_tcm.h"
#include <linux/slab.h>
#include <linux/vmalloc.h>
#ifdef CONFIG_FB
#include <linux/fb.h>
#include <linux/notifier.h>

View file

@ -35,6 +35,8 @@
*/
#include "synaptics_core.h"
#include <linux/sched/signal.h>
#include <linux/mmi_kernel_common.h>
#define SYSFS_DIR_NAME "diagnostics"
@ -48,7 +50,7 @@ struct diag_hcd {
unsigned char report_type;
enum pingpong_state state;
struct kobject *sysfs_dir;
struct siginfo sigio;
struct SIGINFO sigio;
struct task_struct *task;
struct syna_tcm_buffer ping;
struct syna_tcm_buffer pong;
@ -105,7 +107,7 @@ static ssize_t diag_sysfs_pid_store(struct device *dev,
diag_hcd->pid = input;
if (diag_hcd->pid) {
diag_hcd->task = pid_task(find_vpid(diag_hcd->pid),
diag_hcd->task = get_pid_task(find_vpid(diag_hcd->pid),
PIDTYPE_PID);
if (!diag_hcd->task) {
LOGE(tcm_hcd->pdev->dev.parent,

View file

@ -311,6 +311,7 @@ static struct bin_attribute bin_attrs[] = {
},
};
#ifdef CONFIG_INPUT_TOUCHSCREEN_MMI
static int syna_ts_set_fwname(const char* fw_name) {
if (fw_name != NULL) {
strlcpy(reflash_hcd->fw_name, fw_name,
@ -338,6 +339,7 @@ static int syna_ts_do_reflash(void)
return retval;
}
#endif
static ssize_t reflash_sysfs_reflash_store(struct device *dev,
struct device_attribute *attr, const char *buf, size_t count)
@ -2442,8 +2444,10 @@ static int reflash_init(struct syna_tcm_hcd *tcm_hcd)
reflash_hcd->tcm_hcd = tcm_hcd;
reflash_hcd->force_update = FORCE_REFLASH;
#ifdef CONFIG_INPUT_TOUCHSCREEN_MMI
tcm_hcd->set_fw_name = syna_ts_set_fwname;
tcm_hcd->do_fw_update = syna_ts_do_reflash;
#endif
mutex_init(&reflash_hcd->reflash_mutex);

View file

@ -761,6 +761,7 @@ static void touch_report(void)
switch (status) {
case LIFT:
#ifdef TYPE_B_PROTOCOL
#if defined(CONFIG_INPUT_TOUCHSCREEN_MMI)
if (tcm_hcd->imports && tcm_hcd->imports->report_touch_event) {
struct touch_event_data touch_event;
memset(&touch_event, 0, sizeof(touch_event));
@ -774,6 +775,7 @@ static void touch_report(void)
break;
}
}
#endif
input_mt_slot(touch_hcd->input_dev, idx);
input_mt_report_slot_state(touch_hcd->input_dev,
MT_TOOL_FINGER, 0);
@ -800,6 +802,7 @@ static void touch_report(void)
if (bdata->y_flip)
y = touch_hcd->input_params.max_y - y;
#if defined(CONFIG_INPUT_TOUCHSCREEN_MMI)
if (tcm_hcd->imports && tcm_hcd->imports->report_touch_event) {
struct touch_event_data touch_event;
memset(&touch_event, 0, sizeof(touch_event));
@ -821,6 +824,7 @@ static void touch_report(void)
break;
}
}
#endif
#ifdef TYPE_B_PROTOCOL
input_mt_slot(touch_hcd->input_dev, idx);

View file

@ -29,4 +29,10 @@
#endif
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
#define SIGINFO kernel_siginfo
#else
#define SIGINFO siginfo
#endif
#endif /*_MMI_KERNEL_COMMON_H*/