diff --git a/drivers/input/touchscreen/sec_mmi/Android.mk b/drivers/input/touchscreen/sec_mmi/Android.mk index 9b238b5309a0..f83450f7fad5 100644 --- a/drivers/input/touchscreen/sec_mmi/Android.mk +++ b/drivers/input/touchscreen/sec_mmi/Android.mk @@ -3,6 +3,7 @@ LOCAL_PATH := $(call my-dir) ifneq ($(findstring touchscreen_mmi.ko,$(BOARD_VENDOR_KERNEL_MODULES)),) KERNEL_CFLAGS += CONFIG_INPUT_TOUCHSCREEN_MMI=y + LOCAL_ADDITIONAL_DEPENDENCIES := $(KERNEL_MODULES_OUT)/touchscreen_mmi.ko endif include $(CLEAR_VARS) diff --git a/drivers/input/touchscreen/sec_mmi/Kbuild b/drivers/input/touchscreen/sec_mmi/Kbuild index e81e931b661d..92bcb003d8ca 100644 --- a/drivers/input/touchscreen/sec_mmi/Kbuild +++ b/drivers/input/touchscreen/sec_mmi/Kbuild @@ -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/sec_mmi +EXTRA_CFLAGS += -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/include \ + -I$(ANDROID_BUILD_TOP)/motorola/kernel/modules/drivers/input/touchscreen/sec_mmi ifneq (,$(filter racer% burton%,$(TARGET_PRODUCT))) EXTRA_CFLAGS += -DCONFIG_DRM_DYNAMIC_REFRESH_RATE @@ -14,6 +14,7 @@ ifneq ($(filter m y,$(CONFIG_INPUT_TOUCHSCREEN_MMI)),) EXTRA_CFLAGS += -DCONFIG_PANEL_NOTIFICATIONS -DCONFIG_INPUT_TOUCHSCREEN_MMI \ -DCONFIG_PM sec_mmi-objs += sec_ts_mmi_class.o + KBUILD_EXTRA_SYMBOLS += $(CURDIR)/$(KBUILD_EXTMOD)/../touchscreen_mmi/Module.symvers else EXTRA_CFLAGS += -DUSE_STUBS sec_mmi-objs += sec_ts_mmi.o diff --git a/drivers/input/touchscreen/sec_mmi/sec_ts.c b/drivers/input/touchscreen/sec_mmi/sec_ts.c index f2b94c6cfafa..f3dee27d0ba1 100644 --- a/drivers/input/touchscreen/sec_mmi/sec_ts.c +++ b/drivers/input/touchscreen/sec_mmi/sec_ts.c @@ -781,7 +781,7 @@ static void sec_ts_read_event(struct sec_ts_data *ts) if (ts->coord[t_id].action == SEC_TS_COORDINATE_ACTION_RELEASE) { - do_gettimeofday(&ts->time_released[t_id]); + GET_TIME_OF_DAY(&ts->time_released[t_id]); if (ts->time_longest < (ts->time_released[t_id].tv_sec - ts->time_pressed[t_id].tv_sec)) ts->time_longest = (ts->time_released[t_id].tv_sec - ts->time_pressed[t_id].tv_sec); @@ -827,7 +827,7 @@ static void sec_ts_read_event(struct sec_ts_data *ts) } else if (ts->coord[t_id].action == SEC_TS_COORDINATE_ACTION_PRESS) { - do_gettimeofday(&ts->time_pressed[t_id]); + GET_TIME_OF_DAY(&ts->time_pressed[t_id]); ts->touch_count++; ts->all_finger_count++; @@ -2026,7 +2026,7 @@ void sec_ts_unlocked_release_all_finger(struct sec_ts_data *ts) ts->cal_status, ts->tspid_val, ts->tspicid_val, ts->coord[i].palm_count); - do_gettimeofday(&ts->time_released[i]); + GET_TIME_OF_DAY(&ts->time_released[i]); if (ts->time_longest < (ts->time_released[i].tv_sec - ts->time_pressed[i].tv_sec)) ts->time_longest = (ts->time_released[i].tv_sec - ts->time_pressed[i].tv_sec); @@ -2078,7 +2078,7 @@ void sec_ts_locked_release_all_finger(struct sec_ts_data *ts) ts->plat_data->img_version_of_ic[3], ts->cal_status, ts->tspid_val, ts->tspicid_val, ts->coord[i].palm_count); - do_gettimeofday(&ts->time_released[i]); + GET_TIME_OF_DAY(&ts->time_released[i]); if (ts->time_longest < (ts->time_released[i].tv_sec - ts->time_pressed[i].tv_sec)) ts->time_longest = (ts->time_released[i].tv_sec - ts->time_pressed[i].tv_sec); diff --git a/drivers/input/touchscreen/sec_mmi/sec_ts.h b/drivers/input/touchscreen/sec_mmi/sec_ts.h index ca3cab0c3115..3af114de3dda 100644 --- a/drivers/input/touchscreen/sec_mmi/sec_ts.h +++ b/drivers/input/touchscreen/sec_mmi/sec_ts.h @@ -36,6 +36,7 @@ #include #include #include +#include #if defined(CONFIG_INPUT_TOUCHSCREEN_MMI) #include @@ -617,8 +618,8 @@ struct sec_ts_data { struct sec_ts_plat_data *plat_data; struct sec_ts_coordinate coord[MAX_SUPPORT_TOUCH_COUNT + MAX_SUPPORT_HOVER_COUNT]; - struct timeval time_pressed[MAX_SUPPORT_TOUCH_COUNT + MAX_SUPPORT_HOVER_COUNT]; - struct timeval time_released[MAX_SUPPORT_TOUCH_COUNT + MAX_SUPPORT_HOVER_COUNT]; + struct TIME_TYPE time_pressed[MAX_SUPPORT_TOUCH_COUNT + MAX_SUPPORT_HOVER_COUNT]; + struct TIME_TYPE time_released[MAX_SUPPORT_TOUCH_COUNT + MAX_SUPPORT_HOVER_COUNT]; long time_longest; u8 lowpower_mode; diff --git a/include/linux/mmi_kernel_common.h b/include/linux/mmi_kernel_common.h new file mode 100644 index 000000000000..0719ffd5743c --- /dev/null +++ b/include/linux/mmi_kernel_common.h @@ -0,0 +1,32 @@ +/* Copyright (c) 2020-2021, The Linux Foundation. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 and + * only version 2 as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +#ifndef _MMI_KERNEL_COMMON_H +#define _MMI_KERNEL_COMMON_H + +#include +#include +#include +#include + +#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 4, 0)) +#define TIME_TYPE timespec64 +#define GET_TIME_OF_DAY(_timeval) \ + ktime_get_real_ts64(_timeval); +#else +#define TIME_TYPE timeval +#define GET_TIME_OF_DAY(_timeval) \ + do_gettimeofday(_timeval); + +#endif + +#endif /*_MMI_KERNEL_COMMON_H*/