Bringup stmicro_mmi touch module in kernel-5.10

1. warning: ftsFrame.c: comparison of array 'data' equal to a null
pointer is always false.
2. error: fts_proc.c: incompatible pointer types passing 'const struct file_operations *'
to paramet proc_create(DRIVER_TEST_FILE_NODE, 0777, fts_dir, &fts_driver_test_ops);
3. use timespec64 instead of timespec type.

Change-Id: I46604d6c23b0b69238638f162f390a76ef08eeb6
Reviewed-on: https://gerrit.mot.com/1990708
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jun Weng <wengjun1@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong20 2021-06-25 14:13:35 +08:00 • committed by litong
commit bfda841cba
7 changed files with 38 additions and 19 deletions

View file

@ -2,13 +2,17 @@ DLKM_DIR := motorola/kernel/modules
LOCAL_PATH := $(call my-dir)
ifeq ($(DRM_PANEL_NOTIFICATIONS),true)
KERNEL_CFLAGS += CONFIG_DRM_PANEL_NOTIFICATIONS=y
KBUILD_OPTIONS += CONFIG_DRM_PANEL_NOTIFICATIONS=y
endif
ifeq ($(DRM_PANEL_EVENT_NOTIFICATIONS),true)
KBUILD_OPTIONS += CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS=y
endif
ifeq ($(ST_LIMIT_USE_SUPPLIER),true)
KERNEL_CFLAGS += CONFIG_ST_LIMIT_USE_SUPPLIER=y
KBUILD_OPTIONS += CONFIG_ST_LIMIT_USE_SUPPLIER=y
ifeq ($(TOUCHCLASS_MMI_MULTIWAY_UPDATE_FW),true)
KERNEL_CFLAGS += CONFIG_TOUCHCLASS_MMI_MULTIWAY_UPDATE_FW=y
KBUILD_OPTIONS += CONFIG_TOUCHCLASS_MMI_MULTIWAY_UPDATE_FW=y
endif
endif
@ -18,7 +22,7 @@ LOCAL_MODULE_TAGS := optional
LOCAL_MODULE_PATH := $(KERNEL_MODULES_OUT)
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/mmi_info.ko
ifneq ($(findstring touchscreen_mmi.ko,$(BOARD_VENDOR_KERNEL_MODULES)),)
KERNEL_CFLAGS += CONFIG_INPUT_TOUCHSCREEN_MMI=y
KBUILD_OPTIONS += CONFIG_INPUT_TOUCHSCREEN_MMI=y
LOCAL_ADDITIONAL_DEPENDENCIES += $(KERNEL_MODULES_OUT)/touchscreen_mmi.ko
endif
KBUILD_OPTIONS_GKI += GKI_OBJ_MODULE_DIR=gki

View file

@ -20,6 +20,10 @@ ifneq ($(filter m y,$(CONFIG_DRM_PANEL_NOTIFICATIONS)),)
EXTRA_CFLAGS += -DCONFIG_DRM_PANEL_NOTIFICATIONS
endif
ifneq ($(filter m y, $(CONFIG_DRM_PANEL_EVENT_NOTIFICATIONS)),)
EXTRA_CFLAGS += -DCONFIG_DRM_PANEL_EVENT_NOTIFICATIONS
endif
ifneq ($(filter m y,$(CONFIG_ST_LIMIT_USE_SUPPLIER)),)
EXTRA_CFLAGS += -DCONFIG_ST_LIMIT_USE_SUPPLIER
endif

View file

@ -1,10 +1,17 @@
KERNEL_SRC ?= /lib/modules/$(shell uname -r)/build
all: modules
all:
$(MAKE) -C $(KERNEL_SRC) M=$(shell pwd) modules $(KBUILD_OPTIONS)
modules:
$(MAKE) -C $(KERNEL_SRC) M=$(M) modules $(KBUILD_OPTIONS)
modules_install:
$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(shell pwd) modules_install
$(MAKE) INSTALL_MOD_STRIP=1 -C $(KERNEL_SRC) M=$(M) modules_install
%:
$(MAKE) -C $(KERNEL_SRC) M=$(M) $@ $(KBUILD_OPTIONS)
clean:
$(MAKE) -C $(KERNEL_SRC) M=$(PWD) clean
rm -f *.o *.ko *.mod.c *.mod.o *~ .*.cmd Module.symvers
rm -rf .tmp_versions
KBUILD_EXTRA_SYMBOLS += $(M)/../touchscreen_mmi/$(GKI_OBJ_MODULE_DIR)/Module.symvers
KBUILD_EXTRA_SYMBOLS += $(M)/../../../mmi_info/$(GKI_OBJ_MODULE_DIR)/Module.symvers

View file

@ -57,12 +57,6 @@ int getChannelsLength(void)
int ret;
u8 data[2];
if (data == NULL) {
logError(1, "%s getChannelsLength: ERROR %08X\n", tag,
ERROR_ALLOC);
return ERROR_ALLOC;
}
ret = readConfig(ADDR_CONFIG_SENSE_LEN, data, 2);
if (ret < OK) {
logError(1, "%s getChannelsLength: ERROR %08X\n", tag, ret);

View file

@ -39,7 +39,7 @@
*/
void startStopWatch(StopWatch *w)
{
ktime_get_ts(&w->start);
ktime_get_ts64(&w->start);
}
/**
@ -48,7 +48,7 @@ void startStopWatch(StopWatch *w)
*/
void stopStopWatch(StopWatch *w)
{
ktime_get_ts(&w->end);
ktime_get_ts64(&w->end);
}
/**

View file

@ -60,8 +60,8 @@
* Struct used to measure the time elapsed between a starting and ending point.
*/
typedef struct {
struct timespec start; /* /< store the starting time */
struct timespec end; /* /< store the finishing time */
struct timespec64 start; /* /< store the starting time */
struct timespec64 end; /* /< store the finishing time */
} StopWatch;

View file

@ -3033,6 +3033,15 @@ ERROR:
* file_operations struct which define the functions for the canonical
*operation on a device file node (open. read, write etc.)
*/
#if KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE
static const struct proc_ops fts_driver_test_ops = {
.proc_open = fts_open,
.proc_read = seq_read,
.proc_write = fts_driver_test_write,
.proc_lseek = seq_lseek,
.proc_release = seq_release
};
#else
static const struct file_operations fts_driver_test_ops = {
.open = fts_open,
.read = seq_read,
@ -3040,6 +3049,7 @@ static const struct file_operations fts_driver_test_ops = {
.llseek = seq_lseek,
.release = seq_release
};
#endif
/*****************************************************************************/