Skip to content

Commit

Permalink
clk: ti: clkctrl: fix flags for mux and divider opt clocks
Browse files Browse the repository at this point in the history
Flag handling was missing for these two, so add it.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
  • Loading branch information
Tero Kristo committed Dec 1, 2017
1 parent 729e13b commit 49eec6f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
12 changes: 10 additions & 2 deletions drivers/clk/ti/clkctrl.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,6 +335,9 @@ _ti_clkctrl_setup_mux(struct omap_clkctrl_provider *provider,
}

mux->mask = num_parents;
if (!(mux->flags & CLK_MUX_INDEX_ONE))
mux->mask--;

mux->mask = (1 << fls(mux->mask)) - 1;

mux->shift = data->bit;
Expand All @@ -354,16 +357,21 @@ _ti_clkctrl_setup_div(struct omap_clkctrl_provider *provider,
{
struct clk_omap_divider *div;
const struct omap_clkctrl_div_data *div_data = data->data;
u8 div_flags = 0;

div = kzalloc(sizeof(*div), GFP_KERNEL);
if (!div)
return;

div->reg.ptr = reg;
div->shift = data->bit;
div->flags = div_data->flags;

if (div->flags & CLK_DIVIDER_POWER_OF_TWO)
div_flags |= CLKF_INDEX_POWER_OF_TWO;

if (ti_clk_parse_divider_data((int *)div_data->dividers,
div_data->max_div, 0, 0,
if (ti_clk_parse_divider_data((int *)div_data->dividers, 0,
div_data->max_div, div_flags,
&div->width, &div->table)) {
pr_err("%s: Data parsing for %pOF:%04x:%d failed\n", __func__,
node, offset, data->bit);
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/ti/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ struct ti_dt_clk {
struct omap_clkctrl_div_data {
const int *dividers;
int max_div;
u32 flags;
};

struct omap_clkctrl_bit_data {
Expand Down

0 comments on commit 49eec6f

Please sign in to comment.