Skip to content

Commit

Permalink
clk: versatile: pass a name to ICST clock provider
Browse files Browse the repository at this point in the history
When we have more than one of these clocks in a system (such as
on the IM-PD1) we need a mechanism to pass a name for the clock.
Refactor to add this as an argument.

Acked-by: Mike Turquette <mturquette@linaro.org>
Signed-off-by: Linus Walleij <linus.walleij@linaro.org>
  • Loading branch information
Linus Walleij committed Jan 3, 2014
1 parent 8f6344f commit ae6e694
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 6 deletions.
3 changes: 2 additions & 1 deletion drivers/clk/versatile/clk-icst.c
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ static const struct clk_ops icst_ops = {

struct clk *icst_clk_register(struct device *dev,
const struct clk_icst_desc *desc,
const char *name,
void __iomem *base)
{
struct clk *clk;
Expand All @@ -130,7 +131,7 @@ struct clk *icst_clk_register(struct device *dev,
pr_err("could not allocate ICST clock!\n");
return ERR_PTR(-ENOMEM);
}
init.name = "icst";
init.name = name;
init.ops = &icst_ops;
init.flags = CLK_IS_ROOT;
init.parent_names = NULL;
Expand Down
1 change: 1 addition & 0 deletions drivers/clk/versatile/clk-icst.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,5 @@ struct clk_icst_desc {

struct clk *icst_clk_register(struct device *dev,
const struct clk_icst_desc *desc,
const char *name,
void __iomem *base);
4 changes: 2 additions & 2 deletions drivers/clk/versatile/clk-impd1.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ void integrator_impd1_clk_init(void __iomem *base, unsigned int id)
}
imc = &impd1_clks[id];

clk = icst_clk_register(NULL, &impd1_icst1_desc, base);
imc->vcoclk = clk;
clk = icst_clk_register(NULL, &impd1_icst1_desc, "icst1", base);
imc->vco1clk = clk;
imc->clks[0] = clkdev_alloc(clk, NULL, "lm%x:01000", id);

/* UART reference clock */
Expand Down
2 changes: 1 addition & 1 deletion drivers/clk/versatile/clk-integrator.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ void __init integrator_clk_init(bool is_cp)
clk_register_clkdev(clk, NULL, "sp804");

/* ICST VCO clock used on the Integrator/CP CLCD */
clk = icst_clk_register(NULL, &cp_icst_desc,
clk = icst_clk_register(NULL, &cp_icst_desc, "icst",
__io_address(INTEGRATOR_HDR_BASE));
clk_register_clkdev(clk, NULL, "clcd");
}
6 changes: 4 additions & 2 deletions drivers/clk/versatile/clk-realview.c
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,11 @@ void __init realview_clk_init(void __iomem *sysbase, bool is_pb1176)

/* ICST VCO clock */
if (is_pb1176)
clk = icst_clk_register(NULL, &realview_osc0_desc, sysbase);
clk = icst_clk_register(NULL, &realview_osc0_desc,
"osc0", sysbase);
else
clk = icst_clk_register(NULL, &realview_osc4_desc, sysbase);
clk = icst_clk_register(NULL, &realview_osc4_desc,
"osc4", sysbase);

clk_register_clkdev(clk, NULL, "dev:clcd");
clk_register_clkdev(clk, NULL, "issp:clcd");
Expand Down

0 comments on commit ae6e694

Please sign in to comment.