• Janusz Krzysztofik's avatar
    media: ov6650: Simplify clock divisor calculation · d898692e
    Janusz Krzysztofik authored
    As appears from an analysis of to_clkrc() helper code after its
    pclk_limit argument has been dropped, its result no longer depends on
    another argument - pclk_max.  Moreover, assuming that a constant value
    of FRAME_RATE_MAX is always used as a denominator of the only
    significant argument left - a struct v4l2_fract, the result in fact
    depends only on the numerator value of that argument.  As a further
    consequence, it no longer makes sense to recalculate frame intervals by
    converting them forth and back with a GET_CLKRC_DIV(to_clkrc(tpf))
    construct.
    
    Drop use of GET_CLKRC_DIV() on results of to_clkrc() where possible -
    use the frame interval value directly.  Furthermore, replace the
    to_clkrc() helper function with a simple macro and update its users to
    always use FRAME_RATE_MAX as frame interval denominator and pass only
    its numerator as an argument.
    Signed-off-by: default avatarJanusz Krzysztofik <jmkrzyszt@gmail.com>
    Signed-off-by: default avatarSakari Ailus <sakari.ailus@linux.intel.com>
    Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
    d898692e
ov6650.c 26.7 KB