diff options
author | Tero Kristo <t-kristo@ti.com> | 2014-02-21 08:33:05 -0500 |
---|---|---|
committer | Tero Kristo <t-kristo@ti.com> | 2014-07-02 08:06:31 -0400 |
commit | a37f05ac094fb0474ddaea8bcfa2c18e0df8cb2e (patch) | |
tree | 6c0f54d4706abfcabcda4738eeb237ae25a5b360 /arch | |
parent | 944ee5dc154b1618d4c794376af237f370c1e6b3 (diff) |
ARM: OMAP2420: clock: get rid of fixed-div property use
Cleans up the code a bit and is useful for clock data DT conversion.
Signed-off-by: Tero Kristo <t-kristo@ti.com>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm/mach-omap2/cclock2420_data.c | 15 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.c | 21 | ||||
-rw-r--r-- | arch/arm/mach-omap2/clock.h | 3 |
3 files changed, 4 insertions, 35 deletions
diff --git a/arch/arm/mach-omap2/cclock2420_data.c b/arch/arm/mach-omap2/cclock2420_data.c index 3e46ac188533..3b0beea8440d 100644 --- a/arch/arm/mach-omap2/cclock2420_data.c +++ b/arch/arm/mach-omap2/cclock2420_data.c | |||
@@ -1025,18 +1025,12 @@ DEFINE_CLK_OMAP_MUX_GATE(iva1_ifck, "iva1_clkdm", dsp_fck_clksel, | |||
1025 | OMAP2420_EN_IVA_COP_SHIFT, &clkhwops_wait, | 1025 | OMAP2420_EN_IVA_COP_SHIFT, &clkhwops_wait, |
1026 | dsp_fck_parent_names, dsp_fck_ops); | 1026 | dsp_fck_parent_names, dsp_fck_ops); |
1027 | 1027 | ||
1028 | DEFINE_CLK_FIXED_FACTOR(iva1_ifck_div, "iva1_ifck", &iva1_ifck, 0x0, 1, 2); | ||
1029 | |||
1028 | static struct clk iva1_mpu_int_ifck; | 1030 | static struct clk iva1_mpu_int_ifck; |
1029 | 1031 | ||
1030 | static const char *iva1_mpu_int_ifck_parent_names[] = { | 1032 | static const char *iva1_mpu_int_ifck_parent_names[] = { |
1031 | "iva1_ifck", | 1033 | "iva1_ifck_div", |
1032 | }; | ||
1033 | |||
1034 | static const struct clk_ops iva1_mpu_int_ifck_ops = { | ||
1035 | .init = &omap2_init_clk_clkdm, | ||
1036 | .enable = &omap2_dflt_clk_enable, | ||
1037 | .disable = &omap2_dflt_clk_disable, | ||
1038 | .is_enabled = &omap2_dflt_clk_is_enabled, | ||
1039 | .recalc_rate = &omap_fixed_divisor_recalc, | ||
1040 | }; | 1034 | }; |
1041 | 1035 | ||
1042 | static struct clk_hw_omap iva1_mpu_int_ifck_hw = { | 1036 | static struct clk_hw_omap iva1_mpu_int_ifck_hw = { |
@@ -1047,11 +1041,10 @@ static struct clk_hw_omap iva1_mpu_int_ifck_hw = { | |||
1047 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), | 1041 | .enable_reg = OMAP_CM_REGADDR(OMAP24XX_DSP_MOD, CM_FCLKEN), |
1048 | .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT, | 1042 | .enable_bit = OMAP2420_EN_IVA_MPU_SHIFT, |
1049 | .clkdm_name = "iva1_clkdm", | 1043 | .clkdm_name = "iva1_clkdm", |
1050 | .fixed_div = 2, | ||
1051 | }; | 1044 | }; |
1052 | 1045 | ||
1053 | DEFINE_STRUCT_CLK(iva1_mpu_int_ifck, iva1_mpu_int_ifck_parent_names, | 1046 | DEFINE_STRUCT_CLK(iva1_mpu_int_ifck, iva1_mpu_int_ifck_parent_names, |
1054 | iva1_mpu_int_ifck_ops); | 1047 | aes_ick_ops); |
1055 | 1048 | ||
1056 | static struct clk mailboxes_ick; | 1049 | static struct clk mailboxes_ick; |
1057 | 1050 | ||
diff --git a/arch/arm/mach-omap2/clock.c b/arch/arm/mach-omap2/clock.c index 591581a66532..4ac6e3d2df03 100644 --- a/arch/arm/mach-omap2/clock.c +++ b/arch/arm/mach-omap2/clock.c | |||
@@ -82,27 +82,6 @@ u32 omap2_clk_readl(struct clk_hw_omap *clk, void __iomem *reg) | |||
82 | } | 82 | } |
83 | 83 | ||
84 | /* | 84 | /* |
85 | * Used for clocks that have the same value as the parent clock, | ||
86 | * divided by some factor | ||
87 | */ | ||
88 | unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw, | ||
89 | unsigned long parent_rate) | ||
90 | { | ||
91 | struct clk_hw_omap *oclk; | ||
92 | |||
93 | if (!hw) { | ||
94 | pr_warn("%s: hw is NULL\n", __func__); | ||
95 | return -EINVAL; | ||
96 | } | ||
97 | |||
98 | oclk = to_clk_hw_omap(hw); | ||
99 | |||
100 | WARN_ON(!oclk->fixed_div); | ||
101 | |||
102 | return parent_rate / oclk->fixed_div; | ||
103 | } | ||
104 | |||
105 | /* | ||
106 | * OMAP2+ specific clock functions | 85 | * OMAP2+ specific clock functions |
107 | */ | 86 | */ |
108 | 87 | ||
diff --git a/arch/arm/mach-omap2/clock.h b/arch/arm/mach-omap2/clock.h index 12f54d428d7c..bb6723842c4a 100644 --- a/arch/arm/mach-omap2/clock.h +++ b/arch/arm/mach-omap2/clock.h | |||
@@ -178,9 +178,6 @@ struct clksel { | |||
178 | const struct clksel_rate *rates; | 178 | const struct clksel_rate *rates; |
179 | }; | 179 | }; |
180 | 180 | ||
181 | unsigned long omap_fixed_divisor_recalc(struct clk_hw *hw, | ||
182 | unsigned long parent_rate); | ||
183 | |||
184 | /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ | 181 | /* CM_CLKSEL2_PLL.CORE_CLK_SRC bits (2XXX) */ |
185 | #define CORE_CLK_SRC_32K 0x0 | 182 | #define CORE_CLK_SRC_32K 0x0 |
186 | #define CORE_CLK_SRC_DPLL 0x1 | 183 | #define CORE_CLK_SRC_DPLL 0x1 |