From 8481d870a07492d5c00ec2879c256c9169a41ede Mon Sep 17 00:00:00 2001 From: Karthik Jayakumar Date: Mon, 11 Nov 2019 17:52:04 -0800 Subject: [PATCH] msm: camera: isp: Update camera timestamps to ktime API Old API's returning struct timeval and struct timespec will be deprecated in future kernel versions as their tv_sec members will overflow in the year 2038 on 32-bit arhitectures. CRs-Fixed: 2564616 Change-Id: I6e3e37cf957daca992b66cad1134f49dd78961f5 Signed-off-by: Karthik Jayakumar --- drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c | 2 +- .../cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c | 2 +- drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c index c9548fe42a6d..5e129731ec8d 100644 --- a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +++ b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c @@ -2795,7 +2795,7 @@ static int cam_ife_mgr_acquire_hw(void *hw_mgr_priv, void *acquire_hw_args) acquire_args->valid_acquired_hw = acquire_hw_info->num_inputs; - getnstimeofday64(&ife_ctx->ts); + ktime_get_real_ts64(&ife_ctx->ts); CAM_INFO(CAM_ISP, "Acquire HW success with total_pix: %u total_rdi: %u is_dual: %u in ctx: %u", total_pix_port, total_rdi_port, diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c index 5c887c0ad329..64c7d0bcb50e 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_core.c @@ -3004,7 +3004,7 @@ static int cam_ife_csid_get_time_stamp( CAM_IFE_CSID_QTIMER_DIV_FACTOR); if (!csid_hw->prev_boot_timestamp) { - get_monotonic_boottime64(&ts); + ktime_get_boottime_ts64(&ts); time_stamp->boot_timestamp = (uint64_t)((ts.tv_sec * 1000000000) + ts.tv_nsec); diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c index 11d6a602117c..a640353b6b5e 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/cam_vfe_core.c @@ -381,7 +381,7 @@ void cam_isp_hw_get_timestamp(struct cam_isp_timestamp *time_stamp) { struct timespec ts; - get_monotonic_boottime(&ts); + ts = ktime_to_timespec(ktime_get_boottime()); time_stamp->mono_time.tv_sec = ts.tv_sec; time_stamp->mono_time.tv_usec = ts.tv_nsec/1000; }