• Stephen Boyd's avatar
    clk: divider: Cap table divider values to 'width' member · fab88ca7
    Stephen Boyd authored
    When we use a clk divider with a divider table, we limit the
    maximum divider value in divider_get_val() to the
    div_mask(width), but when we calculate the divider in
    divider_round_rate() we don't consider that the maximum divider
    may be limited by the width. Pass the width along to
    _get_table_maxdiv() so that we only return the maximum divider
    that is valid. This is useful for clocks that want to share the
    same divider table while limiting the available dividers to some
    subset of the table depending on the width of the bitfield.
    
    Cc: Rajendra Nayak <rnayak@codeaurora.org>
    Signed-off-by: default avatarStephen Boyd <sboyd@codeaurora.org>
    fab88ca7
clk-divider.c 13.8 KB