Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b5d7f668 authored by Vikram Mulukutla's avatar Vikram Mulukutla Committed by Matt Wagantall
Browse files

clk: Separate OF clock code from COMMON_CLK



Clock providers may wish to use the device tree
functionality of the clock framework without using
the COMMON_CLOCK framework. Unconditionally compile
drivers/clk/clk.c and #ifdef out the COMMON_CLK
related code.

Change-Id: I0ba03bbd57879ae17bedcb8c436e031834626673
Signed-off-by: default avatarVikram Mulukutla <markivx@codeaurora.org>
(cherry picked from commit 70275397a2592031611ae1af711dc5cea65cd2ae)
[joshc: Dropped mach-msm changes, extend seperation to
drivers/clk/clk.h]
Signed-off-by: default avatarJosh Cartwright <joshc@codeaurora.org>
[abhimany: Minor merge conflict resolution]
Signed-off-by: default avatarAbhimanyu Kapur <abhimany@codeaurora.org>
parent ed0fd58d
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
# common clock types
obj-$(CONFIG_HAVE_CLK)		+= clk-devres.o
obj-$(CONFIG_CLKDEV_LOOKUP)	+= clkdev.o
obj-$(CONFIG_COMMON_CLK)	+= clk.o
obj-$(CONFIG_OF)		+= clk.o
obj-$(CONFIG_COMMON_CLK)	+= clk-divider.o
obj-$(CONFIG_COMMON_CLK)	+= clk-fixed-factor.o
obj-$(CONFIG_COMMON_CLK)	+= clk-fixed-rate.o
+16 −0
Original line number Diff line number Diff line
@@ -24,6 +24,8 @@

#include "clk.h"

#if defined(CONFIG_COMMON_CLK)

static DEFINE_SPINLOCK(enable_lock);
static DEFINE_MUTEX(prepare_lock);

@@ -2664,6 +2666,8 @@ int clk_notifier_unregister(struct clk *clk, struct notifier_block *nb)
}
EXPORT_SYMBOL_GPL(clk_notifier_unregister);

#endif /* CONFIG_COMMON_CLK */

#ifdef CONFIG_OF
/**
 * struct of_clk_provider - Clock provider registration structure
@@ -2705,6 +2709,8 @@ struct clk *of_clk_src_simple_get(struct of_phandle_args *clkspec,
}
EXPORT_SYMBOL_GPL(of_clk_src_simple_get);

#if defined(CONFIG_COMMON_CLK)

struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data)
{
	struct clk_onecell_data *clk_data = data;
@@ -2719,6 +2725,11 @@ struct clk *of_clk_src_onecell_get(struct of_phandle_args *clkspec, void *data)
}
EXPORT_SYMBOL_GPL(of_clk_src_onecell_get);

#endif /* CONFIG_COMMON_CLK */

/* forward declaration */
void of_clk_del_provider(struct device_node *np);

/**
 * of_clk_add_provider() - Register a clock provider for a node
 * @np: Device node pointer associated with clock provider
@@ -2850,6 +2861,8 @@ const char *of_clk_get_parent_name(struct device_node *np, int index)
}
EXPORT_SYMBOL_GPL(of_clk_get_parent_name);

#if defined(CONFIG_COMMON_CLK)

struct clock_provider {
	of_clk_init_cb_t clk_init_cb;
	struct device_node *np;
@@ -2947,4 +2960,7 @@ void __init of_clk_init(const struct of_device_id *matches)
			force = true;
	}
}

#endif /* CONFIG_COMMON_CLK */

#endif
+1 −1
Original line number Diff line number Diff line
@@ -9,7 +9,7 @@
 * published by the Free Software Foundation.
 */

#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
#if defined(CONFIG_OF)
struct clk *of_clk_get_by_clkspec(struct of_phandle_args *clkspec);
struct clk *__of_clk_get_from_provider(struct of_phandle_args *clkspec);
void of_clk_lock(void);
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@
static LIST_HEAD(clocks);
static DEFINE_MUTEX(clocks_mutex);

#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
#if defined(CONFIG_OF)

/**
 * of_clk_get_by_clkspec() - Lookup a clock form a clock provider
+1 −1
Original line number Diff line number Diff line
@@ -424,7 +424,7 @@ int clk_add_alias(const char *alias, const char *alias_dev_name, char *id,
struct device_node;
struct of_phandle_args;

#if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK)
#if defined(CONFIG_OF)
struct clk *of_clk_get(struct device_node *np, int index);
struct clk *of_clk_get_by_name(struct device_node *np, const char *name);
struct clk *of_clk_get_from_provider(struct of_phandle_args *clkspec);
Loading