diff options
| author | Tero Kristo <t-kristo@ti.com> | 2016-09-30 07:13:38 -0400 |
|---|---|---|
| committer | Tero Kristo <t-kristo@ti.com> | 2017-03-08 05:59:30 -0500 |
| commit | 2e1a294c0f2273a6d3537c91965ca46a6483bd8c (patch) | |
| tree | fd86e63e66a63af0aaebbd221140d8fcb1010a54 | |
| parent | b6f27b2db2df395d65b02a758861c7fc54edbec1 (diff) | |
clk: ti: move omap2_init_clk_clkdm under TI clock driver
This is not needed outside the driver, so move it inside it and remove
the prototype from the public header also.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Acked-by: Tony Lindgren <tony@atomide.com>
| -rw-r--r-- | arch/arm/mach-omap2/clock.c | 32 | ||||
| -rw-r--r-- | drivers/clk/ti/clock.h | 1 | ||||
| -rw-r--r-- | drivers/clk/ti/clockdomain.c | 30 | ||||
| -rw-r--r-- | include/linux/clk/ti.h | 1 |
4 files changed, 31 insertions, 33 deletions
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 6fac82609c96..ae5b23c19b83 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
| @@ -79,38 +79,6 @@ int __init omap2_clk_setup_ll_ops(void) | |||
| 79 | * OMAP2+ specific clock functions | 79 | * OMAP2+ specific clock functions |
| 80 | */ | 80 | */ |
| 81 | 81 | ||
| 82 | /* Public functions */ | ||
| 83 | |||
| 84 | /** | ||
| 85 | * omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk | ||
| 86 | * @clk: OMAP clock struct ptr to use | ||
| 87 | * | ||
| 88 | * Convert a clockdomain name stored in a struct clk 'clk' into a | ||
| 89 | * clockdomain pointer, and save it into the struct clk. Intended to be | ||
| 90 | * called during clk_register(). No return value. | ||
| 91 | */ | ||
| 92 | void omap2_init_clk_clkdm(struct clk_hw *hw) | ||
| 93 | { | ||
| 94 | struct clk_hw_omap *clk = to_clk_hw_omap(hw); | ||
| 95 | struct clockdomain *clkdm; | ||
| 96 | const char *clk_name; | ||
| 97 | |||
| 98 | if (!clk->clkdm_name) | ||
| 99 | return; | ||
| 100 | |||
| 101 | clk_name = __clk_get_name(hw->clk); | ||
| 102 | |||
| 103 | clkdm = clkdm_lookup(clk->clkdm_name); | ||
| 104 | if (clkdm) { | ||
| 105 | pr_debug("clock: associated clk %s to clkdm %s\n", | ||
| 106 | clk_name, clk->clkdm_name); | ||
| 107 | clk->clkdm = clkdm; | ||
| 108 | } else { | ||
| 109 | pr_debug("clock: could not associate clk %s to clkdm %s\n", | ||
| 110 | clk_name, clk->clkdm_name); | ||
| 111 | } | ||
| 112 | } | ||
| 113 | |||
| 114 | /** | 82 | /** |
| 115 | * ti_clk_init_features - init clock features struct for the SoC | 83 | * ti_clk_init_features - init clock features struct for the SoC |
| 116 | * | 84 | * |
diff --git a/drivers/clk/ti/clock.h b/drivers/clk/ti/clock.h index ee6d22507a3d..ecf82d86118c 100644 --- a/drivers/clk/ti/clock.h +++ b/drivers/clk/ti/clock.h | |||
| @@ -228,6 +228,7 @@ extern const struct clk_hw_omap_ops clkhwops_am35xx_ipss_wait; | |||
| 228 | extern const struct clk_ops ti_clk_divider_ops; | 228 | extern const struct clk_ops ti_clk_divider_ops; |
| 229 | extern const struct clk_ops ti_clk_mux_ops; | 229 | extern const struct clk_ops ti_clk_mux_ops; |
| 230 | 230 | ||
| 231 | void omap2_init_clk_clkdm(struct clk_hw *hw); | ||
| 231 | int omap2_clkops_enable_clkdm(struct clk_hw *hw); | 232 | int omap2_clkops_enable_clkdm(struct clk_hw *hw); |
| 232 | void omap2_clkops_disable_clkdm(struct clk_hw *hw); | 233 | void omap2_clkops_disable_clkdm(struct clk_hw *hw); |
| 233 | 234 | ||
diff --git a/drivers/clk/ti/clockdomain.c b/drivers/clk/ti/clockdomain.c index 6cf9dd189a92..704157d8c0b7 100644 --- a/drivers/clk/ti/clockdomain.c +++ b/drivers/clk/ti/clockdomain.c | |||
| @@ -103,6 +103,36 @@ void omap2_clkops_disable_clkdm(struct clk_hw *hw) | |||
| 103 | ti_clk_ll_ops->clkdm_clk_disable(clk->clkdm, hw->clk); | 103 | ti_clk_ll_ops->clkdm_clk_disable(clk->clkdm, hw->clk); |
| 104 | } | 104 | } |
| 105 | 105 | ||
| 106 | /** | ||
| 107 | * omap2_init_clk_clkdm - look up a clockdomain name, store pointer in clk | ||
| 108 | * @clk: OMAP clock struct ptr to use | ||
| 109 | * | ||
| 110 | * Convert a clockdomain name stored in a struct clk 'clk' into a | ||
| 111 | * clockdomain pointer, and save it into the struct clk. Intended to be | ||
| 112 | * called during clk_register(). No return value. | ||
| 113 | */ | ||
| 114 | void omap2_init_clk_clkdm(struct clk_hw *hw) | ||
| 115 | { | ||
| 116 | struct clk_hw_omap *clk = to_clk_hw_omap(hw); | ||
| 117 | struct clockdomain *clkdm; | ||
| 118 | const char *clk_name; | ||
| 119 | |||
| 120 | if (!clk->clkdm_name) | ||
| 121 | return; | ||
| 122 | |||
| 123 | clk_name = __clk_get_name(hw->clk); | ||
| 124 | |||
| 125 | clkdm = ti_clk_ll_ops->clkdm_lookup(clk->clkdm_name); | ||
| 126 | if (clkdm) { | ||
| 127 | pr_debug("clock: associated clk %s to clkdm %s\n", | ||
| 128 | clk_name, clk->clkdm_name); | ||
| 129 | clk->clkdm = clkdm; | ||
| 130 | } else { | ||
| 131 | pr_debug("clock: could not associate clk %s to clkdm %s\n", | ||
| 132 | clk_name, clk->clkdm_name); | ||
| 133 | } | ||
| 134 | } | ||
| 135 | |||
| 106 | static void __init of_ti_clockdomain_setup(struct device_node *node) | 136 | static void __init of_ti_clockdomain_setup(struct device_node *node) |
| 107 | { | 137 | { |
| 108 | struct clk *clk; | 138 | struct clk *clk; |
diff --git a/include/linux/clk/ti.h b/include/linux/clk/ti.h index bc7fd8f0fb5d..626ae94b7444 100644 --- a/include/linux/clk/ti.h +++ b/include/linux/clk/ti.h | |||
| @@ -238,7 +238,6 @@ struct ti_clk_ll_ops { | |||
| 238 | 238 | ||
| 239 | #define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw) | 239 | #define to_clk_hw_omap(_hw) container_of(_hw, struct clk_hw_omap, hw) |
| 240 | 240 | ||
| 241 | void omap2_init_clk_clkdm(struct clk_hw *clk); | ||
| 242 | int omap2_clk_disable_autoidle_all(void); | 241 | int omap2_clk_disable_autoidle_all(void); |
| 243 | int omap2_clk_enable_autoidle_all(void); | 242 | int omap2_clk_enable_autoidle_all(void); |
| 244 | int omap2_clk_allow_idle(struct clk *clk); | 243 | int omap2_clk_allow_idle(struct clk *clk); |
