From a0f5f4435658a910667dda8fac4568822ae445df Mon Sep 17 00:00:00 2001 From: yanyh2 Date: Mon, 13 Jul 2020 16:41:44 +0800 Subject: [PATCH] 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 Reviewed-on: https://gerrit.mot.com/1679227 SME-Granted: SME Approvals Granted SLTApproved: Slta Waiver Tested-by: Jira Key Reviewed-by: Yuecai Liu Reviewed-by: Jianqi Yang Submit-Approved: Jira Key --- drivers/input/misc/vl53L1/stmvl53l1.h | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/drivers/input/misc/vl53L1/stmvl53l1.h b/drivers/input/misc/vl53L1/stmvl53l1.h index 49ab90855da8..84e27cba41b9 100644 --- a/drivers/input/misc/vl53L1/stmvl53l1.h +++ b/drivers/input/misc/vl53L1/stmvl53l1.h @@ -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 { \