mirror of
git://nv-tegra.nvidia.com/linux-nv-oot.git
synced 2025-12-24 02:01:36 +03:00
tegra: cam_fsync: fix precise freq add extra ticks for all generators
Extra ticks must be added for all generator Bug 4951965 Change-Id: Ie3a7bdb52fd2f06188b32a1c90896c6ba4aa12cc Signed-off-by: Mohit Ingale <mohiti@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3249235 GVS: buildbot_gerritrpt <buildbot_gerritrpt@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/c/linux-nv-oot/+/3251915 Reviewed-by: Frank Chen <frankc@nvidia.com> Reviewed-by: Jagadeesh Kinni <jkinni@nvidia.com> Reviewed-by: Ian Kaszubski <ikaszubski@nvidia.com>
This commit is contained in:
@@ -467,24 +467,22 @@ static int cam_fsync_program_group_generator_edges(struct fsync_generator_group
|
||||
struct cam_fsync_extra_ticks_and_period extra = {0, 1};
|
||||
bool const can_generate_precise_freq = cam_fsync_can_generate_precise_freq(group);
|
||||
|
||||
/**
|
||||
* Generating a freq with period that is not multiple of TSC unit will
|
||||
* cause the signal to drift over time. To avoid this, if precise signal
|
||||
* is supported, calculate the extra ticks over the number of periods
|
||||
* using @ref getextra_ticksAndPeriodFor30Hz() for accurate phase alignment.
|
||||
* If the signal is not precise, set the extra ticks to 0 and number of
|
||||
* periods to 1 which is the default case.
|
||||
*/
|
||||
if (can_generate_precise_freq)
|
||||
cam_fsync_get_extra_ticks_and_period_for_30hz(&extra,
|
||||
ticks_per_hz);
|
||||
|
||||
list_for_each_entry(generator, &group->generators, list) {
|
||||
u32 ticks_in_period = 0;
|
||||
u32 ticks_active = 0;
|
||||
u32 ticks_inactive = 0;
|
||||
u32 const edge_reg_offset = 8U;
|
||||
u32 i = 0;
|
||||
/**
|
||||
* Generating a freq with period that is not multiple of TSC unit will
|
||||
* cause the signal to drift over time. To avoid this, if precise signal
|
||||
* is supported, calculate the extra ticks over the number of periods
|
||||
* using @ref getextra_ticksAndPeriodFor30Hz() for accurate phase alignment.
|
||||
* If the signal is not precise, set the extra ticks to 0 and number of
|
||||
* periods to 1 which is the default case.
|
||||
*/
|
||||
if (can_generate_precise_freq)
|
||||
cam_fsync_get_extra_ticks_and_period_for_30hz(&extra, ticks_per_hz);
|
||||
|
||||
if (group->features->rational_locking.enforced) {
|
||||
ticks_in_period = DIV_ROUND_CLOSEST(ticks_per_hz,
|
||||
|
||||
Reference in New Issue
Block a user