diff options
author | Paul Walmsley <paul@pwsan.com> | 2010-10-08 13:40:17 -0400 |
---|---|---|
committer | Paul Walmsley <paul@pwsan.com> | 2010-10-08 13:40:17 -0400 |
commit | 1bccb345bd8c5652017013d7e963fdd158ead600 (patch) | |
tree | c6aaeca8b361cd2f1e79e89d89981289706dea42 /arch/arm | |
parent | 54164bb2927edd9f183a108a0d037d80639c8429 (diff) |
OMAP2420: clock: add MCBSP_CLKS node and clkdev aliases
Add the MCBSP_CLKS clock and the clksel structures needed to support clock
framework-based source switching for McBSP 1 and 2. Also, add clkdev
aliases on the parent clocks for the McBSP source switching code, added
in a subsequent patch.
Signed-off-by: Paul Walmsley <paul@pwsan.com>
Diffstat (limited to 'arch/arm')
-rw-r--r-- | arch/arm/mach-omap2/clock2420_data.c | 40 |
1 files changed, 38 insertions, 2 deletions
diff --git a/arch/arm/mach-omap2/clock2420_data.c b/arch/arm/mach-omap2/clock2420_data.c index 5f2066a6ba74..7086fe4fb7af 100644 --- a/arch/arm/mach-omap2/clock2420_data.c +++ b/arch/arm/mach-omap2/clock2420_data.c | |||
@@ -18,6 +18,7 @@ | |||
18 | #include <linux/list.h> | 18 | #include <linux/list.h> |
19 | 19 | ||
20 | #include <plat/clkdev_omap.h> | 20 | #include <plat/clkdev_omap.h> |
21 | #include <plat/control.h> | ||
21 | 22 | ||
22 | #include "clock.h" | 23 | #include "clock.h" |
23 | #include "clock2xxx.h" | 24 | #include "clock2xxx.h" |
@@ -89,6 +90,12 @@ static struct clk alt_ck = { /* Typical 54M or 48M, may not exist */ | |||
89 | .clkdm_name = "wkup_clkdm", | 90 | .clkdm_name = "wkup_clkdm", |
90 | }; | 91 | }; |
91 | 92 | ||
93 | /* Optional external clock input for McBSP CLKS */ | ||
94 | static struct clk mcbsp_clks = { | ||
95 | .name = "mcbsp_clks", | ||
96 | .ops = &clkops_null, | ||
97 | }; | ||
98 | |||
92 | /* | 99 | /* |
93 | * Analog domain root source clocks | 100 | * Analog domain root source clocks |
94 | */ | 101 | */ |
@@ -1135,14 +1142,34 @@ static struct clk mcbsp1_ick = { | |||
1135 | .recalc = &followparent_recalc, | 1142 | .recalc = &followparent_recalc, |
1136 | }; | 1143 | }; |
1137 | 1144 | ||
1145 | static const struct clksel_rate common_mcbsp_96m_rates[] = { | ||
1146 | { .div = 1, .val = 0, .flags = RATE_IN_24XX }, | ||
1147 | { .div = 0 } | ||
1148 | }; | ||
1149 | |||
1150 | static const struct clksel_rate common_mcbsp_mcbsp_rates[] = { | ||
1151 | { .div = 1, .val = 1, .flags = RATE_IN_24XX }, | ||
1152 | { .div = 0 } | ||
1153 | }; | ||
1154 | |||
1155 | static const struct clksel mcbsp_fck_clksel[] = { | ||
1156 | { .parent = &func_96m_ck, .rates = common_mcbsp_96m_rates }, | ||
1157 | { .parent = &mcbsp_clks, .rates = common_mcbsp_mcbsp_rates }, | ||
1158 | { .parent = NULL } | ||
1159 | }; | ||
1160 | |||
1138 | static struct clk mcbsp1_fck = { | 1161 | static struct clk mcbsp1_fck = { |
1139 | .name = "mcbsp1_fck", | 1162 | .name = "mcbsp1_fck", |
1140 | .ops = &clkops_omap2_dflt_wait, | 1163 | .ops = &clkops_omap2_dflt_wait, |
1141 | .parent = &func_96m_ck, | 1164 | .parent = &func_96m_ck, |
1165 | .init = &omap2_init_clksel_parent, | ||
1142 | .clkdm_name = "core_l4_clkdm", | 1166 | .clkdm_name = "core_l4_clkdm", |
1143 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1167 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1144 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, | 1168 | .enable_bit = OMAP24XX_EN_MCBSP1_SHIFT, |
1145 | .recalc = &followparent_recalc, | 1169 | .clksel_reg = OMAP242X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), |
1170 | .clksel_mask = OMAP2_MCBSP1_CLKS_MASK, | ||
1171 | .clksel = mcbsp_fck_clksel, | ||
1172 | .recalc = &omap2_clksel_recalc, | ||
1146 | }; | 1173 | }; |
1147 | 1174 | ||
1148 | static struct clk mcbsp2_ick = { | 1175 | static struct clk mcbsp2_ick = { |
@@ -1159,10 +1186,14 @@ static struct clk mcbsp2_fck = { | |||
1159 | .name = "mcbsp2_fck", | 1186 | .name = "mcbsp2_fck", |
1160 | .ops = &clkops_omap2_dflt_wait, | 1187 | .ops = &clkops_omap2_dflt_wait, |
1161 | .parent = &func_96m_ck, | 1188 | .parent = &func_96m_ck, |
1189 | .init = &omap2_init_clksel_parent, | ||
1162 | .clkdm_name = "core_l4_clkdm", | 1190 | .clkdm_name = "core_l4_clkdm", |
1163 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), | 1191 | .enable_reg = OMAP_CM_REGADDR(CORE_MOD, CM_FCLKEN1), |
1164 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, | 1192 | .enable_bit = OMAP24XX_EN_MCBSP2_SHIFT, |
1165 | .recalc = &followparent_recalc, | 1193 | .clksel_reg = OMAP242X_CTRL_REGADDR(OMAP2_CONTROL_DEVCONF0), |
1194 | .clksel_mask = OMAP2_MCBSP2_CLKS_MASK, | ||
1195 | .clksel = mcbsp_fck_clksel, | ||
1196 | .recalc = &omap2_clksel_recalc, | ||
1166 | }; | 1197 | }; |
1167 | 1198 | ||
1168 | static struct clk mcspi1_ick = { | 1199 | static struct clk mcspi1_ick = { |
@@ -1721,6 +1752,9 @@ static struct omap_clk omap2420_clks[] = { | |||
1721 | CLK(NULL, "osc_ck", &osc_ck, CK_242X), | 1752 | CLK(NULL, "osc_ck", &osc_ck, CK_242X), |
1722 | CLK(NULL, "sys_ck", &sys_ck, CK_242X), | 1753 | CLK(NULL, "sys_ck", &sys_ck, CK_242X), |
1723 | CLK(NULL, "alt_ck", &alt_ck, CK_242X), | 1754 | CLK(NULL, "alt_ck", &alt_ck, CK_242X), |
1755 | CLK("omap-mcbsp.1", "pad_fck", &mcbsp_clks, CK_242X), | ||
1756 | CLK("omap-mcbsp.2", "pad_fck", &mcbsp_clks, CK_242X), | ||
1757 | CLK(NULL, "mcbsp_clks", &mcbsp_clks, CK_242X), | ||
1724 | /* internal analog sources */ | 1758 | /* internal analog sources */ |
1725 | CLK(NULL, "dpll_ck", &dpll_ck, CK_242X), | 1759 | CLK(NULL, "dpll_ck", &dpll_ck, CK_242X), |
1726 | CLK(NULL, "apll96_ck", &apll96_ck, CK_242X), | 1760 | CLK(NULL, "apll96_ck", &apll96_ck, CK_242X), |
@@ -1728,6 +1762,8 @@ static struct omap_clk omap2420_clks[] = { | |||
1728 | /* internal prcm root sources */ | 1762 | /* internal prcm root sources */ |
1729 | CLK(NULL, "func_54m_ck", &func_54m_ck, CK_242X), | 1763 | CLK(NULL, "func_54m_ck", &func_54m_ck, CK_242X), |
1730 | CLK(NULL, "core_ck", &core_ck, CK_242X), | 1764 | CLK(NULL, "core_ck", &core_ck, CK_242X), |
1765 | CLK("omap-mcbsp.1", "prcm_fck", &func_96m_ck, CK_242X), | ||
1766 | CLK("omap-mcbsp.2", "prcm_fck", &func_96m_ck, CK_242X), | ||
1731 | CLK(NULL, "func_96m_ck", &func_96m_ck, CK_242X), | 1767 | CLK(NULL, "func_96m_ck", &func_96m_ck, CK_242X), |
1732 | CLK(NULL, "func_48m_ck", &func_48m_ck, CK_242X), | 1768 | CLK(NULL, "func_48m_ck", &func_48m_ck, CK_242X), |
1733 | CLK(NULL, "func_12m_ck", &func_12m_ck, CK_242X), | 1769 | CLK(NULL, "func_12m_ck", &func_12m_ck, CK_242X), |