Loading drivers/clk/qcom/clock-generic.c +10 −0 Original line number Diff line number Diff line Loading @@ -515,6 +515,15 @@ static int ext_set_parent(struct clk *c, struct clk *p) return clk_set_parent(c->parent, p); } static struct clk *ext_get_parent(struct clk *c) { struct ext_clk *ext = to_ext_clk(c); if (!IS_ERR_OR_NULL(c->parent)) return c->parent; return clk_get(ext->dev, ext->clk_id); } static enum handoff ext_handoff(struct clk *c) { c->rate = clk_get_rate(c->parent); Loading @@ -528,6 +537,7 @@ struct clk_ops clk_ops_ext = { .set_rate = ext_set_rate, .get_rate = parent_get_rate, .set_parent = ext_set_parent, .get_parent = ext_get_parent, }; Loading include/linux/clk/msm-clock-generic.h +9 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #define __MSM_CLOCK_GENERIC_H #include <linux/clk/msm-clk-provider.h> #include <linux/of.h> /** * struct fixed_clk - fixed rate clock Loading Loading @@ -138,10 +139,18 @@ extern struct clk_ops clk_ops_slave_div; struct ext_clk { struct clk c; struct device *dev; char *clk_id; }; long parent_round_rate(struct clk *c, unsigned long rate); unsigned long parent_get_rate(struct clk *c); static inline struct ext_clk *to_ext_clk(struct clk *c) { return container_of(c, struct ext_clk, c); } extern struct clk_ops clk_ops_ext; #define DEFINE_FIXED_DIV_CLK(clk_name, _div, _parent) \ Loading Loading
drivers/clk/qcom/clock-generic.c +10 −0 Original line number Diff line number Diff line Loading @@ -515,6 +515,15 @@ static int ext_set_parent(struct clk *c, struct clk *p) return clk_set_parent(c->parent, p); } static struct clk *ext_get_parent(struct clk *c) { struct ext_clk *ext = to_ext_clk(c); if (!IS_ERR_OR_NULL(c->parent)) return c->parent; return clk_get(ext->dev, ext->clk_id); } static enum handoff ext_handoff(struct clk *c) { c->rate = clk_get_rate(c->parent); Loading @@ -528,6 +537,7 @@ struct clk_ops clk_ops_ext = { .set_rate = ext_set_rate, .get_rate = parent_get_rate, .set_parent = ext_set_parent, .get_parent = ext_get_parent, }; Loading
include/linux/clk/msm-clock-generic.h +9 −0 Original line number Diff line number Diff line Loading @@ -15,6 +15,7 @@ #define __MSM_CLOCK_GENERIC_H #include <linux/clk/msm-clk-provider.h> #include <linux/of.h> /** * struct fixed_clk - fixed rate clock Loading Loading @@ -138,10 +139,18 @@ extern struct clk_ops clk_ops_slave_div; struct ext_clk { struct clk c; struct device *dev; char *clk_id; }; long parent_round_rate(struct clk *c, unsigned long rate); unsigned long parent_get_rate(struct clk *c); static inline struct ext_clk *to_ext_clk(struct clk *c) { return container_of(c, struct ext_clk, c); } extern struct clk_ops clk_ops_ext; #define DEFINE_FIXED_DIV_CLK(clk_name, _div, _parent) \ Loading