|
@@ -312,7 +312,26 @@ struct clk *clk_get(struct device *dev, const char *id);
|
|
|
*/
|
|
|
int __must_check clk_bulk_get(struct device *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 *dev,
|
|
|
+ struct clk_bulk_data **clks);
|
|
|
/**
|
|
|
* devm_clk_bulk_get - managed get multiple clk consumers
|
|
|
* @dev: device for clock "consumer"
|
|
@@ -487,6 +506,19 @@ void clk_put(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);
|
|
|
+
|
|
|
/**
|
|
|
* devm_clk_put - "free" a managed clock source
|
|
|
* @dev: device used to acquire the clock
|
|
@@ -642,6 +674,12 @@ static inline int __must_check clk_bulk_get(struct device *dev, int num_clks,
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static inline int __must_check clk_bulk_get_all(struct device *dev,
|
|
|
+ struct clk_bulk_data **clks)
|
|
|
+{
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static inline struct clk *devm_clk_get(struct device *dev, const char *id)
|
|
|
{
|
|
|
return NULL;
|
|
@@ -663,6 +701,8 @@ static inline void clk_put(struct clk *clk) {}
|
|
|
|
|
|
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 void devm_clk_put(struct device *dev, struct clk *clk) {}
|
|
|
|
|
|
|