aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTero Kristo <t-kristo@ti.com>2017-09-18 14:02:24 -0400
committerTero Kristo <t-kristo@ti.com>2017-12-01 08:15:17 -0500
commitddfb183e2e434acf9361d3e8b37bdf22656561e4 (patch)
treeeee0e6735885b3a516019f5282a2c67efb0146bf
parentc2c296c34c98f3a430ba7a38da96a256d28c203f (diff)
clk: ti: clkctrl: add support for clkdm init for clkctrl clocks
Clkctrl clocks now support clockdomain init also. This will be needed so that hwmod core can drop the support for clockdomain handling. Signed-off-by: Tero Kristo <t-kristo@ti.com>
-rw-r--r--drivers/clk/ti/clkctrl.c22
-rw-r--r--drivers/clk/ti/clock.h1
2 files changed, 23 insertions, 0 deletions
diff --git a/drivers/clk/ti/clkctrl.c b/drivers/clk/ti/clkctrl.c
index 2db7d4080f25..284ba449615c 100644
--- a/drivers/clk/ti/clkctrl.c
+++ b/drivers/clk/ti/clkctrl.c
@@ -46,6 +46,7 @@ static bool _early_timeout = true;
46struct omap_clkctrl_provider { 46struct omap_clkctrl_provider {
47 void __iomem *base; 47 void __iomem *base;
48 struct list_head clocks; 48 struct list_head clocks;
49 char *clkdm_name;
49}; 50};
50 51
51struct omap_clkctrl_clk { 52struct omap_clkctrl_clk {
@@ -208,6 +209,7 @@ static const struct clk_ops omap4_clkctrl_clk_ops = {
208 .enable = _omap4_clkctrl_clk_enable, 209 .enable = _omap4_clkctrl_clk_enable,
209 .disable = _omap4_clkctrl_clk_disable, 210 .disable = _omap4_clkctrl_clk_disable,
210 .is_enabled = _omap4_clkctrl_clk_is_enabled, 211 .is_enabled = _omap4_clkctrl_clk_is_enabled,
212 .init = omap2_init_clk_clkdm,
211}; 213};
212 214
213static struct clk_hw *_ti_omap4_clkctrl_xlate(struct of_phandle_args *clkspec, 215static struct clk_hw *_ti_omap4_clkctrl_xlate(struct of_phandle_args *clkspec,
@@ -438,6 +440,21 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
438 440
439 provider->base = of_iomap(node, 0); 441 provider->base = of_iomap(node, 0);
440 442
443 provider->clkdm_name = kmalloc(strlen(node->parent->name) + 3,
444 GFP_KERNEL);
445 if (!provider->clkdm_name) {
446 kfree(provider);
447 return;
448 }
449
450 /*
451 * Create default clkdm name, replace _cm from end of parent node
452 * name with _clkdm
453 */
454 strcpy(provider->clkdm_name, node->parent->name);
455 provider->clkdm_name[strlen(provider->clkdm_name) - 2] = 0;
456 strcat(provider->clkdm_name, "clkdm");
457
441 INIT_LIST_HEAD(&provider->clocks); 458 INIT_LIST_HEAD(&provider->clocks);
442 459
443 /* Generate clocks */ 460 /* Generate clocks */
@@ -460,6 +477,11 @@ static void __init _ti_omap4_clkctrl_setup(struct device_node *node)
460 if (reg_data->flags & CLKF_NO_IDLEST) 477 if (reg_data->flags & CLKF_NO_IDLEST)
461 hw->flags |= NO_IDLEST; 478 hw->flags |= NO_IDLEST;
462 479
480 if (reg_data->clkdm_name)
481 hw->clkdm_name = reg_data->clkdm_name;
482 else
483 hw->clkdm_name = provider->clkdm_name;
484
463 init.parent_names = &reg_data->parent; 485 init.parent_names = &reg_data->parent;
464 init.num_parents = 1; 486 init.num_parents = 1;
465 init.flags = 0; 487 init.flags = 0;
diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h
index 561dbe99ced7..169241fd1edf 100644
--- a/drivers/clk/ti/clock.h
+++ b/drivers/clk/ti/clock.h
@@ -221,6 +221,7 @@ struct omap_clkctrl_reg_data {
221 const struct omap_clkctrl_bit_data *bit_data; 221 const struct omap_clkctrl_bit_data *bit_data;
222 u16 flags; 222 u16 flags;
223 const char *parent; 223 const char *parent;
224 const char *clkdm_name;
224}; 225};
225 226
226struct omap_clkctrl_data { 227struct omap_clkctrl_data {