Loading arch/arm/mach-msm/include/mach/clk-provider.h +7 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <linux/err.h> #include <linux/list.h> #include <linux/clkdev.h> #include <linux/of.h> #include <linux/spinlock.h> #include <linux/mutex.h> #include <linux/regulator/consumer.h> Loading Loading @@ -226,4 +227,10 @@ static inline bool is_better_rate(unsigned long req, unsigned long best, return (req <= new && new < best) || (best < req && best < new); } extern int of_clk_add_provider(struct device_node *np, struct clk *(*clk_src_get)(struct of_phandle_args *args, void *data), void *data); extern void of_clk_del_provider(struct device_node *np); #endif drivers/clk/Makefile +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 Loading drivers/clk/clk.c +13 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ #include <linux/init.h> #include <linux/sched.h> #if defined(CONFIG_COMMON_CLK) static DEFINE_SPINLOCK(enable_lock); static DEFINE_MUTEX(prepare_lock); Loading Loading @@ -1969,6 +1971,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 Loading Loading @@ -2001,6 +2005,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; Loading @@ -2015,6 +2021,8 @@ 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 */ /** * of_clk_add_provider() - Register a clock provider for a node * @np: Device node pointer associated with clock provider Loading Loading @@ -2108,6 +2116,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) /** * of_clk_init() - Scan and init clock providers from the DT * @matches: array of compatible values and init functions for providers. Loading @@ -2128,4 +2138,7 @@ void __init of_clk_init(const struct of_device_id *matches) clk_init_cb(np); } } #endif /* CONFIG_COMMON_CLK */ #endif drivers/clk/clkdev.c +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ static LIST_HEAD(clocks); static DEFINE_MUTEX(clocks_mutex); #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) #if defined(CONFIG_OF) struct clk *of_clk_get(struct device_node *np, int index) { struct of_phandle_args clkspec; Loading include/linux/clk.h +1 −1 Original line number Diff line number Diff line Loading @@ -364,7 +364,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 Loading
arch/arm/mach-msm/include/mach/clk-provider.h +7 −0 Original line number Diff line number Diff line Loading @@ -20,6 +20,7 @@ #include <linux/err.h> #include <linux/list.h> #include <linux/clkdev.h> #include <linux/of.h> #include <linux/spinlock.h> #include <linux/mutex.h> #include <linux/regulator/consumer.h> Loading Loading @@ -226,4 +227,10 @@ static inline bool is_better_rate(unsigned long req, unsigned long best, return (req <= new && new < best) || (best < req && best < new); } extern int of_clk_add_provider(struct device_node *np, struct clk *(*clk_src_get)(struct of_phandle_args *args, void *data), void *data); extern void of_clk_del_provider(struct device_node *np); #endif
drivers/clk/Makefile +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 Loading
drivers/clk/clk.c +13 −0 Original line number Diff line number Diff line Loading @@ -21,6 +21,8 @@ #include <linux/init.h> #include <linux/sched.h> #if defined(CONFIG_COMMON_CLK) static DEFINE_SPINLOCK(enable_lock); static DEFINE_MUTEX(prepare_lock); Loading Loading @@ -1969,6 +1971,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 Loading Loading @@ -2001,6 +2005,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; Loading @@ -2015,6 +2021,8 @@ 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 */ /** * of_clk_add_provider() - Register a clock provider for a node * @np: Device node pointer associated with clock provider Loading Loading @@ -2108,6 +2116,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) /** * of_clk_init() - Scan and init clock providers from the DT * @matches: array of compatible values and init functions for providers. Loading @@ -2128,4 +2138,7 @@ void __init of_clk_init(const struct of_device_id *matches) clk_init_cb(np); } } #endif /* CONFIG_COMMON_CLK */ #endif
drivers/clk/clkdev.c +1 −1 Original line number Diff line number Diff line Loading @@ -24,7 +24,7 @@ static LIST_HEAD(clocks); static DEFINE_MUTEX(clocks_mutex); #if defined(CONFIG_OF) && defined(CONFIG_COMMON_CLK) #if defined(CONFIG_OF) struct clk *of_clk_get(struct device_node *np, int index) { struct of_phandle_args clkspec; Loading
include/linux/clk.h +1 −1 Original line number Diff line number Diff line Loading @@ -364,7 +364,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