summaryrefslogtreecommitdiff
path: root/drivers/clk/ti/clkctrl.c
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2017-10-11 17:56:10 +0300
committerTero Kristo <t-kristo@ti.com>2017-12-01 15:17:09 +0200
commit49eec6fbe125d691944d077f6155c3ccac3a0e71 (patch)
tree4f9aaf72c73c970ae4488af7bf4f58b5a99a7849 /drivers/clk/ti/clkctrl.c
parent729e13bf58e643b9accd2a14c55b555958702fb0 (diff)
clk: ti: clkctrl: fix flags for mux and divider opt clocks
Flag handling was missing for these two, so add it. Signed-off-by: Tero Kristo <t-kristo@ti.com>
Diffstat (limited to 'drivers/clk/ti/clkctrl.c')
-rw-r--r--drivers/clk/ti/clkctrl.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
index 7d82fff25d5b..3bab88e4fffa 100644
--- a/drivers/clk/ti/clkctrl.c
+++ b/drivers/clk/ti/clkctrl.c
@@ -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;
@@ -354,6 +357,7 @@ _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)
@@ -361,9 +365,13 @@ _ti_clkctrl_setup_div(struct omap_clkctrl_provider *provider,
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);