vl53l1: Make do_gettimeofday compatible to new Kernel version

do_gettimeofday is not supported in new Kernel version, redefine
it if it is not supported for compatible compilation of stmvl53l1
DLKM module.

Change-Id: I718eedf4d8cd8479f0d34fca8a78e7e1e39e49ec
Signed-off-by: yanyh2 <yanyh2@motorola.com>
Reviewed-on: https://gerrit.mot.com/1679227
SME-Granted: SME Approvals Granted
SLTApproved: Slta Waiver
Tested-by: Jira Key
Reviewed-by: Yuecai Liu <liuyc20@motorola.com>
Reviewed-by: Jianqi Yang <yangj@motorola.com>
Submit-Approved: Jira Key
This commit is contained in:
yanyh2 2020-07-13 16:41:44 +08:00 • committed by Yonghua Yan
commit a0f5f44356

View file

@ -94,6 +94,16 @@
extern int stmvl53l1_enable_debug;
#ifndef do_gettimeofday
#define do_gettimeofday(target_time, ...) \
do { \
struct timespec64 now_time; \
ktime_get_real_ts64(&now_time); \
(target_time)->tv_sec = now_time.tv_sec; \
(target_time)->tv_usec = now_time.tv_nsec/1000; \
} while (0)
#endif
#ifdef DEBUG
# ifdef FORCE_CONSOLE_DEBUG
#define vl53l1_dbgmsg(str, ...) do { \