• Chen-Yu Tsai's avatar
    clk: sunxi-ng: mux: Fix determine_rate for mux clocks with pre-dividers · ed48205f
    Chen-Yu Tsai authored
    The determine_rate helper used ccu_mux_helper_adjust_parent_for_prediv()
    to adjust the parent_rate to account for pre-dividers, but then passed
    the pristine parent clock rate from clk_hw_get_rate() to the round()
    callback, thereby ignoring the pre-divider adjustment. In addition,
    it was saving the adjusted parent rate back into struct
    clk_rate_request.
    
    This patch fixes this by saving the pristine parent clock rate, and
    adding a copy that is adjusted and passed to the round() callback.
    The pristine copy, if it is the best solution, would be saved back
    to struct clk_rate_request.
    Signed-off-by: default avatarChen-Yu Tsai <wens@csie.org>
    Signed-off-by: default avatarMaxime Ripard <maxime.ripard@free-electrons.com>
    ed48205f
ccu_mux.c 5.86 KB