dubai: bring up goodix fingerprint for android R

Modify:
bring up goodix fingerprint for android R
mq@@r-shm2018.xml *NOT* needed on the branch(es) above just ignore R2D2.

Change-Id: I4e488dc03830f8dc00eac9b9e9cd745680db28fc
Signed-off-by: daiss1 <daiss1@lenovo.com>
Reviewed-on: https://gerrit.mot.com/1724630
Tested-by: Jira Key
SLTApproved: Slta Waiver
SME-Granted: SME Approvals Granted
Reviewed-by: Guobin Zhang <zhanggb@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
daiss1 2020-08-17 18:21:18 +08:00 • committed by Shanshan Dai
commit 4889cd93b0
2 changed files with 18 additions and 5 deletions

View file

@ -1,6 +1,6 @@
# add -Wall to try to catch everything we can.
EXTRA_CFLAGS += -Wall
EXTRA_CFLAGS += -I$(TOP)/motorola/kernel/modules/include \
EXTRA_CFLAGS += -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include \
goodix_fod_mmi-y += gf_spi.o netlink.o platform.o

View file

@ -50,6 +50,7 @@
#elif defined(USE_PLATFORM_BUS)
#include <linux/platform_device.h>
#endif
#include <linux/version.h>
#define VER_MAJOR 1
#define VER_MINOR 2
@ -470,10 +471,20 @@ static long gf_ioctl(struct file *filp, unsigned int cmd, unsigned long arg)
if (_IOC_TYPE(cmd) != GF_IOC_MAGIC)
return -ENODEV;
if (_IOC_DIR(cmd) & _IOC_READ)
retval = !access_ok(VERIFY_WRITE, (void __user *)arg, _IOC_SIZE(cmd));
else if (_IOC_DIR(cmd) & _IOC_WRITE)
retval = !access_ok(VERIFY_READ, (void __user *)arg, _IOC_SIZE(cmd));
if (_IOC_DIR(cmd) & _IOC_READ){
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
retval = !access_ok((void __user *)arg, _IOC_SIZE(cmd));
#else
retval = !access_ok(VERIFY_WRITE, (void __user *)arg, _IOC_SIZE(cmd));
#endif
}
else if (_IOC_DIR(cmd) & _IOC_WRITE){
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0))
retval = !access_ok((void __user *)arg, _IOC_SIZE(cmd));
#else
retval = !access_ok(VERIFY_WRITE, (void __user *)arg, _IOC_SIZE(cmd));
#endif
}
if (retval)
return -EFAULT;
@ -708,6 +719,7 @@ static const struct file_operations gf_fops = {
static int goodix_fb_state_chg_callback(struct notifier_block *nb,
unsigned long val, void *data)
{
#if 0
struct gf_dev *gf_dev;
struct fb_event *evdata = data;
int blank;
@ -748,6 +760,7 @@ static int goodix_fb_state_chg_callback(struct notifier_block *nb,
break;
}
}
#endif
return NOTIFY_OK;
}