The image turning green previously was caused by the rgb stats not being
sampled continously (only every 100 frames) coupled with only happening
on snapshot. As such, any algorithm causing the fps to slow down would
lower the update freq. The new average solution ensures that the rgb
average is smoothed over many frames and only keeps the last 250ms of
history.
This allows drivers to override standard resolutions,
or use custom ones, without affecting other CSIs.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This patch decouples the clock from the main CSI state,
further separating the CSI instance from the port's CSI
driver. Additionally, it allows CSIs to use different clocks,
in theory, though they must first be detected somehow in
order to switch clocks.
As a side effect of sharing the clock, set_frequency will be
called more frequently (the default call plus once per CSI).
However, the frequency is now checked, and the clock is only
reconfigured if the new frequency exceeds a configurable
tolerance.
Finally, get_clk_frequency now accepts a boolean to return
either the exact clock frequency, for sensors that require
it, or the nominal frequency.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
Simplify the detection logic and handle the case where
all detected sensors (one or more) are auxiliary.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
Detection flag should be set after CSIs are detected in
the scanning code, and functions that loop over CSIs
should check it.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>
This should be much faster as it starts with the most common
config: power-down active low, reset active low.
Signed-off-by: iabdalkader <i.abdalkader@gmail.com>