summaryrefslogtreecommitdiffstats
path: root/drivers/clk/samsung/clk-s3c2443.c
diff options
context:
space:
mode:
authorRahul Sharma <rahul.sharma@samsung.com>2014-03-12 20:26:44 +0530
committerTomasz Figa <t.figa@samsung.com>2014-05-14 19:15:38 +0200
commit976face4b46ab36b04312b4e404d160296716d46 (patch)
tree69952ba0f302faf76209e1e6da0aa8ceb32b97b3 /drivers/clk/samsung/clk-s3c2443.c
parent2916f9a2c6d9200b4c840a613cd1fa1dad04240f (diff)
downloadop-kernel-dev-976face4b46ab36b04312b4e404d160296716d46.zip
op-kernel-dev-976face4b46ab36b04312b4e404d160296716d46.tar.gz
clk/samsung: add support for multiple clock providers
Samsung CCF helper functions do not provide support to register multiple Clock Providers for a given SoC. Due to this limitation, SoC platforms are not able to use these helpers for registering multiple clock providers and are forced to bypass this layer. This layer is modified accordingly to enable the support for multiple clock providers. Clock file for exynos4, exynos5250, exynos5420, exynos5440, S3c64xx, S3c24xx are also modified as per changed helper functions. Signed-off-by: Rahul Sharma <rahul.sharma@samsung.com> [t.figa: Modified s3c2410 clock driver as well] Signed-off-by: Tomasz Figa <t.figa@samsung.com>
Diffstat (limited to 'drivers/clk/samsung/clk-s3c2443.c')
-rw-r--r--drivers/clk/samsung/clk-s3c2443.c46
1 files changed, 25 insertions, 21 deletions
diff --git a/drivers/clk/samsung/clk-s3c2443.c b/drivers/clk/samsung/clk-s3c2443.c
index 8e4f451..c4bbdab 100644
--- a/drivers/clk/samsung/clk-s3c2443.c
+++ b/drivers/clk/samsung/clk-s3c2443.c
@@ -365,10 +365,11 @@ struct samsung_fixed_rate_clock s3c2443_common_frate_clks[] __initdata = {
FRATE(0, "ext_uart", NULL, CLK_IS_ROOT, 0),
};
-static void __init s3c2443_common_clk_register_fixed_ext(unsigned long xti_f)
+static void __init s3c2443_common_clk_register_fixed_ext(
+ struct samsung_clk_provider *ctx, unsigned long xti_f)
{
s3c2443_common_frate_clks[0].fixed_rate = xti_f;
- samsung_clk_register_fixed_rate(s3c2443_common_frate_clks,
+ samsung_clk_register_fixed_rate(ctx, s3c2443_common_frate_clks,
ARRAY_SIZE(s3c2443_common_frate_clks));
}
@@ -376,6 +377,7 @@ void __init s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f,
int current_soc,
void __iomem *base)
{
+ struct samsung_clk_provider *ctx;
reg_base = base;
if (np) {
@@ -384,58 +386,60 @@ void __init s3c2443_common_clk_init(struct device_node *np, unsigned long xti_f,
panic("%s: failed to map registers\n", __func__);
}
- samsung_clk_init(np, reg_base, NR_CLKS);
+ ctx = samsung_clk_init(np, reg_base, NR_CLKS);
+ if (!ctx)
+ panic("%s: unable to allocate context.\n", __func__);
/* Register external clocks only in non-dt cases */
if (!np)
- s3c2443_common_clk_register_fixed_ext(xti_f);
+ s3c2443_common_clk_register_fixed_ext(ctx, xti_f);
/* Register PLLs. */
if (current_soc == S3C2416 || current_soc == S3C2450)
- samsung_clk_register_pll(s3c2416_pll_clks,
+ samsung_clk_register_pll(ctx, s3c2416_pll_clks,
ARRAY_SIZE(s3c2416_pll_clks), reg_base);
else
- samsung_clk_register_pll(s3c2443_pll_clks,
+ samsung_clk_register_pll(ctx, s3c2443_pll_clks,
ARRAY_SIZE(s3c2443_pll_clks), reg_base);
/* Register common internal clocks. */
- samsung_clk_register_mux(s3c2443_common_muxes,
+ samsung_clk_register_mux(ctx, s3c2443_common_muxes,
ARRAY_SIZE(s3c2443_common_muxes));
- samsung_clk_register_div(s3c2443_common_dividers,
+ samsung_clk_register_div(ctx, s3c2443_common_dividers,
ARRAY_SIZE(s3c2443_common_dividers));
- samsung_clk_register_gate(s3c2443_common_gates,
+ samsung_clk_register_gate(ctx, s3c2443_common_gates,
ARRAY_SIZE(s3c2443_common_gates));
- samsung_clk_register_alias(s3c2443_common_aliases,
+ samsung_clk_register_alias(ctx, s3c2443_common_aliases,
ARRAY_SIZE(s3c2443_common_aliases));
/* Register SoC-specific clocks. */
switch (current_soc) {
case S3C2450:
- samsung_clk_register_div(s3c2450_dividers,
+ samsung_clk_register_div(ctx, s3c2450_dividers,
ARRAY_SIZE(s3c2450_dividers));
- samsung_clk_register_mux(s3c2450_muxes,
+ samsung_clk_register_mux(ctx, s3c2450_muxes,
ARRAY_SIZE(s3c2450_muxes));
- samsung_clk_register_gate(s3c2450_gates,
+ samsung_clk_register_gate(ctx, s3c2450_gates,
ARRAY_SIZE(s3c2450_gates));
- samsung_clk_register_alias(s3c2450_aliases,
+ samsung_clk_register_alias(ctx, s3c2450_aliases,
ARRAY_SIZE(s3c2450_aliases));
/* fall through, as s3c2450 extends the s3c2416 clocks */
case S3C2416:
- samsung_clk_register_div(s3c2416_dividers,
+ samsung_clk_register_div(ctx, s3c2416_dividers,
ARRAY_SIZE(s3c2416_dividers));
- samsung_clk_register_mux(s3c2416_muxes,
+ samsung_clk_register_mux(ctx, s3c2416_muxes,
ARRAY_SIZE(s3c2416_muxes));
- samsung_clk_register_gate(s3c2416_gates,
+ samsung_clk_register_gate(ctx, s3c2416_gates,
ARRAY_SIZE(s3c2416_gates));
- samsung_clk_register_alias(s3c2416_aliases,
+ samsung_clk_register_alias(ctx, s3c2416_aliases,
ARRAY_SIZE(s3c2416_aliases));
break;
case S3C2443:
- samsung_clk_register_div(s3c2443_dividers,
+ samsung_clk_register_div(ctx, s3c2443_dividers,
ARRAY_SIZE(s3c2443_dividers));
- samsung_clk_register_gate(s3c2443_gates,
+ samsung_clk_register_gate(ctx, s3c2443_gates,
ARRAY_SIZE(s3c2443_gates));
- samsung_clk_register_alias(s3c2443_aliases,
+ samsung_clk_register_alias(ctx, s3c2443_aliases,
ARRAY_SIZE(s3c2443_aliases));
break;
}
OpenPOWER on IntegriCloud