Modify samsung compilation errors for v(CR).

TP:
do_gettimeofday function is not in google whitelist. And all interfaces
returning a 'struct timeval' or 'struct timespec' have been replaced
because the tv_sec member overflows in year 2038 on 32-bit architectures.

Change-Id: I9659d84485f29b47d722bca8c0b3a2fe8d4974d2
Reviewed-on: https://gerrit.mot.com/1718149
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Jichao Zou <zoujc@motorola.com>
Reviewed-by: Konstantin Makariev <kmakariev@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
litong 2020-08-19 16:28:37 +08:00 • committed by litong20
commit 5db8ba69b3
5 changed files with 43 additions and 8 deletions

View file

@ -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)

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/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

View file

@ -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);

View file

@ -36,6 +36,7 @@
#include <linux/uaccess.h>
#include <linux/vmalloc.h>
#include <linux/workqueue.h>
#include <linux/mmi_kernel_common.h>
#if defined(CONFIG_INPUT_TOUCHSCREEN_MMI)
#include <linux/touchscreen_mmi.h>
@ -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;

View file

@ -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 <linux/list.h>
#include <linux/version.h>
#include <linux/kernel.h>
#include <linux/time.h>
#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*/