summaryrefslogtreecommitdiffstats
path: root/include/linux/clk.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/clk.h')
-rw-r--r--include/linux/clk.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 868bf3e4ed..c49fe9a54c 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -83,6 +83,27 @@ int __must_check clk_bulk_get(struct device_d *dev, int num_clks,
struct clk_bulk_data *clks);
/**
+ * clk_bulk_get_all - lookup and obtain all available references to clock
+ * producer.
+ * @dev: device for clock "consumer"
+ * @clks: pointer to the clk_bulk_data table of consumer
+ *
+ * This helper function allows drivers to get all clk consumers in one
+ * operation. If any of the clk cannot be acquired then any clks
+ * that were obtained will be freed before returning to the caller.
+ *
+ * Returns a positive value for the number of clocks obtained while the
+ * clock references are stored in the clk_bulk_data table in @clks field.
+ * Returns 0 if there're none and a negative value if something failed.
+ *
+ * Drivers must assume that the clock source is not enabled.
+ *
+ * clk_bulk_get should not be called from within interrupt context.
+ */
+int __must_check clk_bulk_get_all(struct device_d *dev,
+ struct clk_bulk_data **clks);
+
+/**
* clk_enable - inform the system when the clock source should be running.
* @clk: clock source
*
@@ -156,6 +177,19 @@ unsigned long clk_get_rate(struct clk *clk);
*/
void clk_bulk_put(int num_clks, struct clk_bulk_data *clks);
+/**
+ * clk_bulk_put_all - "free" all the clock source
+ * @num_clks: the number of clk_bulk_data
+ * @clks: the clk_bulk_data table of consumer
+ *
+ * Note: drivers must ensure that all clk_bulk_enable calls made on this
+ * clock source are balanced by clk_bulk_disable calls prior to calling
+ * this function.
+ *
+ * clk_bulk_put_all should not be called from within interrupt context.
+ */
+void clk_bulk_put_all(int num_clks, struct clk_bulk_data *clks);
+
/*
* The remaining APIs are optional for machine class support.
*/
@@ -240,8 +274,16 @@ static inline int __must_check clk_bulk_get(struct device_d *dev, int num_clks,
return 0;
}
+static inline int __must_check clk_bulk_get_all(struct device_d *dev,
+ struct clk_bulk_data **clks)
+{
+ return 0;
+}
+
static inline void clk_bulk_put(int num_clks, struct clk_bulk_data *clks) {}
+static inline void clk_bulk_put_all(int num_clks, struct clk_bulk_data *clks) {}
+
static inline int clk_enable(struct clk *clk)
{
return 0;
@@ -456,6 +498,7 @@ int clk_register(struct clk *clk);
struct clk *clk_lookup(const char *name);
void clk_dump(int verbose);
+void clk_dump_one(struct clk *clk, int verbose);
struct clk *clk_register_composite(const char *name,
const char * const *parent_names, int num_parents,
@@ -535,6 +578,10 @@ static inline struct clk *of_clk_get_by_name(struct device_node *np,
{
return ERR_PTR(-ENOENT);
}
+static inline unsigned int of_clk_get_parent_count(struct device_node *np)
+{
+ return 0;
+}
static inline int of_clk_init(struct device_node *root,
const struct of_device_id *matches)
{