diff options
| -rw-r--r-- | drivers/clk/ti/apll.c | 4 | ||||
| -rw-r--r-- | drivers/clk/ti/clk.c | 31 | ||||
| -rw-r--r-- | drivers/clk/ti/clock.h | 3 | ||||
| -rw-r--r-- | drivers/clk/ti/dpll.c | 11 | ||||
| -rw-r--r-- | drivers/clk/ti/gate.c | 2 | ||||
| -rw-r--r-- | drivers/clk/ti/interface.c | 4 |
6 files changed, 31 insertions, 24 deletions
diff --git a/drivers/clk/ti/apll.c b/drivers/clk/ti/apll.c index 222f68bc3f2a..015a657d3382 100644 --- a/drivers/clk/ti/apll.c +++ b/drivers/clk/ti/apll.c | |||
| @@ -165,7 +165,7 @@ static void __init omap_clk_register_apll(void *user, | |||
| 165 | 165 | ||
| 166 | ad->clk_bypass = __clk_get_hw(clk); | 166 | ad->clk_bypass = __clk_get_hw(clk); |
| 167 | 167 | ||
| 168 | clk = ti_clk_register(NULL, &clk_hw->hw, node->name); | 168 | clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name); |
| 169 | if (!IS_ERR(clk)) { | 169 | if (!IS_ERR(clk)) { |
| 170 | of_clk_add_provider(node, of_clk_src_simple_get, clk); | 170 | of_clk_add_provider(node, of_clk_src_simple_get, clk); |
| 171 | kfree(clk_hw->hw.init->parent_names); | 171 | kfree(clk_hw->hw.init->parent_names); |
| @@ -402,7 +402,7 @@ static void __init of_omap2_apll_setup(struct device_node *node) | |||
| 402 | if (ret) | 402 | if (ret) |
| 403 | goto cleanup; | 403 | goto cleanup; |
| 404 | 404 | ||
| 405 | clk = clk_register(NULL, &clk_hw->hw); | 405 | clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name); |
| 406 | if (!IS_ERR(clk)) { | 406 | if (!IS_ERR(clk)) { |
| 407 | of_clk_add_provider(node, of_clk_src_simple_get, clk); | 407 | of_clk_add_provider(node, of_clk_src_simple_get, clk); |
| 408 | kfree(init); | 408 | kfree(init); |
diff --git a/drivers/clk/ti/clk.c b/drivers/clk/ti/clk.c index 122af2680833..d1f948163d6a 100644 --- a/drivers/clk/ti/clk.c +++ b/drivers/clk/ti/clk.c | |||
| @@ -520,20 +520,31 @@ struct clk *ti_clk_register(struct device *dev, struct clk_hw *hw, | |||
| 520 | } | 520 | } |
| 521 | 521 | ||
| 522 | /** | 522 | /** |
| 523 | * omap2_init_clk_hw_omap_clocks - initialize an OMAP clock | 523 | * ti_clk_register_omap_hw - register a clk_hw_omap to the clock framework |
| 524 | * @hw: struct clk_hw * to initialize | 524 | * @dev: device for this clock |
| 525 | * @hw: hardware clock handle | ||
| 526 | * @con: connection ID for this clock | ||
| 525 | * | 527 | * |
| 526 | * Add an OMAP clock @clk to the internal list of OMAP clocks. Used | 528 | * Registers a clk_hw_omap clock to the clock framewor, adds a clock alias |
| 527 | * temporarily for autoidle handling, until this support can be | 529 | * for it, and adds the list to the available clk_hw_omap type clocks. |
| 528 | * integrated into the common clock framework code in some way. No | 530 | * Returns a handle to the registered clock if successful, ERR_PTR value |
| 529 | * return value. | 531 | * in failure. |
| 530 | */ | 532 | */ |
| 531 | void omap2_init_clk_hw_omap_clocks(struct clk_hw *hw) | 533 | struct clk *ti_clk_register_omap_hw(struct device *dev, struct clk_hw *hw, |
| 534 | const char *con) | ||
| 532 | { | 535 | { |
| 533 | struct clk_hw_omap *c; | 536 | struct clk *clk; |
| 537 | struct clk_hw_omap *oclk; | ||
| 534 | 538 | ||
| 535 | c = to_clk_hw_omap(hw); | 539 | clk = ti_clk_register(dev, hw, con); |
| 536 | list_add(&c->node, &clk_hw_omap_clocks); | 540 | if (IS_ERR(clk)) |
| 541 | return clk; | ||
| 542 | |||
| 543 | oclk = to_clk_hw_omap(hw); | ||
| 544 | |||
| 545 | list_add(&oclk->node, &clk_hw_omap_clocks); | ||
| 546 | |||
| 547 | return clk; | ||
| 537 | } | 548 | } |
| 538 | 549 | ||
| 539 | /** | 550 | /** |
diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h index 034ff6a2be07..1c0fac59d809 100644 --- a/drivers/clk/ti/clock.h +++ b/drivers/clk/ti/clock.h | |||
| @@ -203,6 +203,8 @@ typedef void (*ti_of_clk_init_cb_t)(void *, struct device_node *); | |||
| 203 | 203 | ||
| 204 | struct clk *ti_clk_register(struct device *dev, struct clk_hw *hw, | 204 | struct clk *ti_clk_register(struct device *dev, struct clk_hw *hw, |
| 205 | const char *con); | 205 | const char *con); |
| 206 | struct clk *ti_clk_register_omap_hw(struct device *dev, struct clk_hw *hw, | ||
| 207 | const char *con); | ||
| 206 | int ti_clk_add_alias(struct device *dev, struct clk *clk, const char *con); | 208 | int ti_clk_add_alias(struct device *dev, struct clk *clk, const char *con); |
| 207 | void ti_clk_add_aliases(void); | 209 | void ti_clk_add_aliases(void); |
| 208 | 210 | ||
| @@ -221,7 +223,6 @@ int ti_clk_retry_init(struct device_node *node, void *user, | |||
| 221 | ti_of_clk_init_cb_t func); | 223 | ti_of_clk_init_cb_t func); |
| 222 | int ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type); | 224 | int ti_clk_add_component(struct device_node *node, struct clk_hw *hw, int type); |
| 223 | 225 | ||
| 224 | void omap2_init_clk_hw_omap_clocks(struct clk_hw *hw); | ||
| 225 | int of_ti_clk_autoidle_setup(struct device_node *node); | 226 | int of_ti_clk_autoidle_setup(struct device_node *node); |
| 226 | void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); | 227 | void omap2_clk_enable_init_clocks(const char **clk_names, u8 num_clocks); |
| 227 | 228 | ||
diff --git a/drivers/clk/ti/dpll.c b/drivers/clk/ti/dpll.c index 6c3329bc116f..659dadb23279 100644 --- a/drivers/clk/ti/dpll.c +++ b/drivers/clk/ti/dpll.c | |||
| @@ -192,10 +192,9 @@ static void __init _register_dpll(void *user, | |||
| 192 | dd->clk_bypass = __clk_get_hw(clk); | 192 | dd->clk_bypass = __clk_get_hw(clk); |
| 193 | 193 | ||
| 194 | /* register the clock */ | 194 | /* register the clock */ |
| 195 | clk = ti_clk_register(NULL, &clk_hw->hw, node->name); | 195 | clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, node->name); |
| 196 | 196 | ||
| 197 | if (!IS_ERR(clk)) { | 197 | if (!IS_ERR(clk)) { |
| 198 | omap2_init_clk_hw_omap_clocks(&clk_hw->hw); | ||
| 199 | of_clk_add_provider(node, of_clk_src_simple_get, clk); | 198 | of_clk_add_provider(node, of_clk_src_simple_get, clk); |
| 200 | kfree(clk_hw->hw.init->parent_names); | 199 | kfree(clk_hw->hw.init->parent_names); |
| 201 | kfree(clk_hw->hw.init); | 200 | kfree(clk_hw->hw.init); |
| @@ -265,14 +264,12 @@ static void _register_dpll_x2(struct device_node *node, | |||
| 265 | #endif | 264 | #endif |
| 266 | 265 | ||
| 267 | /* register the clock */ | 266 | /* register the clock */ |
| 268 | clk = ti_clk_register(NULL, &clk_hw->hw, name); | 267 | clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name); |
| 269 | 268 | ||
| 270 | if (IS_ERR(clk)) { | 269 | if (IS_ERR(clk)) |
| 271 | kfree(clk_hw); | 270 | kfree(clk_hw); |
| 272 | } else { | 271 | else |
| 273 | omap2_init_clk_hw_omap_clocks(&clk_hw->hw); | ||
| 274 | of_clk_add_provider(node, of_clk_src_simple_get, clk); | 272 | of_clk_add_provider(node, of_clk_src_simple_get, clk); |
| 275 | } | ||
| 276 | } | 273 | } |
| 277 | #endif | 274 | #endif |
| 278 | 275 | ||
diff --git a/drivers/clk/ti/gate.c b/drivers/clk/ti/gate.c index 1c78fff5513c..504c0e91cdc7 100644 --- a/drivers/clk/ti/gate.c +++ b/drivers/clk/ti/gate.c | |||
| @@ -123,7 +123,7 @@ static struct clk *_register_gate(struct device *dev, const char *name, | |||
| 123 | 123 | ||
| 124 | init.flags = flags; | 124 | init.flags = flags; |
| 125 | 125 | ||
| 126 | clk = ti_clk_register(NULL, &clk_hw->hw, name); | 126 | clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name); |
| 127 | 127 | ||
| 128 | if (IS_ERR(clk)) | 128 | if (IS_ERR(clk)) |
| 129 | kfree(clk_hw); | 129 | kfree(clk_hw); |
diff --git a/drivers/clk/ti/interface.c b/drivers/clk/ti/interface.c index 87e00c2ee957..83e34429d3b1 100644 --- a/drivers/clk/ti/interface.c +++ b/drivers/clk/ti/interface.c | |||
| @@ -57,12 +57,10 @@ static struct clk *_register_interface(struct device *dev, const char *name, | |||
| 57 | init.num_parents = 1; | 57 | init.num_parents = 1; |
| 58 | init.parent_names = &parent_name; | 58 | init.parent_names = &parent_name; |
| 59 | 59 | ||
| 60 | clk = ti_clk_register(NULL, &clk_hw->hw, name); | 60 | clk = ti_clk_register_omap_hw(NULL, &clk_hw->hw, name); |
| 61 | 61 | ||
| 62 | if (IS_ERR(clk)) | 62 | if (IS_ERR(clk)) |
| 63 | kfree(clk_hw); | 63 | kfree(clk_hw); |
| 64 | else | ||
| 65 | omap2_init_clk_hw_omap_clocks(&clk_hw->hw); | ||
| 66 | 64 | ||
| 67 | return clk; | 65 | return clk; |
| 68 | } | 66 | } |
