Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3ba2a4fa authored by Harsh Shah's avatar Harsh Shah
Browse files

msm: camera: isp: Change timestamp from QTimer to nanosecond



All subsystems are using timestamps in seconds, so to keep AV
sync camera also needs to change QTimer ticks to time domain.

Change-Id: I55fe8cf796d577e182177b11aa7a715595c5aa14
Signed-off-by: default avatarHarsh Shah <harshs@codeaurora.org>
parent 34dc2654
Loading
Loading
Loading
Loading
+14 −0
Original line number Diff line number Diff line
@@ -32,6 +32,15 @@
#define CAM_IFE_CSID_TIMEOUT_SLEEP_US                  1000
#define CAM_IFE_CSID_TIMEOUT_ALL_US                    1000000

/*
 * Constant Factors needed to change QTimer ticks to nanoseconds
 * QTimer Freq = 19.2 MHz
 * Time(us) = ticks/19.2
 * Time(ns) = ticks/19.2 * 1000
 */
#define CAM_IFE_CSID_QTIMER_MUL_FACTOR                 10000
#define CAM_IFE_CSID_QTIMER_DIV_FACTOR                 192

static int cam_ife_csid_is_ipp_format_supported(
	uint32_t in_format)
{
@@ -1972,6 +1981,11 @@ static int cam_ife_csid_get_time_stamp(
		time_stamp->time_stamp_val |= time_32;
	}

	time_stamp->time_stamp_val = mul_u64_u32_div(
		time_stamp->time_stamp_val,
		CAM_IFE_CSID_QTIMER_MUL_FACTOR,
		CAM_IFE_CSID_QTIMER_DIV_FACTOR);

	return 0;
}