diff options
author | Dong Aisheng <aisheng.dong@nxp.com> | 2017-05-19 09:49:05 -0400 |
---|---|---|
committer | Stephen Boyd <sboyd@codeaurora.org> | 2017-06-02 18:37:49 -0400 |
commit | 618aee02e2f57042f4cdeab228caf631e524b281 (patch) | |
tree | 56721ee9aa6c4ddf7fb17ad136a7b113195b4a1d /include/linux/clk.h | |
parent | 266e4e9d9150e98141b85c7400f8aa3cd57a7f9b (diff) |
clk: add managed version of clk_bulk_get
This patch introduces the managed version of clk_bulk_get.
Cc: Michael Turquette <mturquette@baylibre.com>
Cc: Stephen Boyd <sboyd@codeaurora.org>
Cc: Russell King <linux@arm.linux.org.uk>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
Cc: Viresh Kumar <viresh.kumar@linaro.org>
Cc: Mark Brown <broonie@kernel.org>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Fabio Estevam <fabio.estevam@nxp.com>
Cc: Sascha Hauer <kernel@pengutronix.de>
Cc: Anson Huang <anson.huang@nxp.com>
Cc: Robin Gong <yibin.gong@nxp.com>
Cc: Bai Ping <ping.bai@nxp.com>
Cc: Leonard Crestez <leonard.crestez@nxp.com>
Cc: Octavian Purdila <octavian.purdila@nxp.com>
Signed-off-by: Dong Aisheng <aisheng.dong@nxp.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Diffstat (limited to 'include/linux/clk.h')
-rw-r--r-- | include/linux/clk.h | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index 72b0cfce9165..c673f0b91751 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h | |||
@@ -281,6 +281,21 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks, | |||
281 | struct clk_bulk_data *clks); | 281 | struct clk_bulk_data *clks); |
282 | 282 | ||
283 | /** | 283 | /** |
284 | * devm_clk_bulk_get - managed get multiple clk consumers | ||
285 | * @dev: device for clock "consumer" | ||
286 | * @num_clks: the number of clk_bulk_data | ||
287 | * @clks: the clk_bulk_data table of consumer | ||
288 | * | ||
289 | * Return 0 on success, an errno on failure. | ||
290 | * | ||
291 | * This helper function allows drivers to get several clk | ||
292 | * consumers in one operation with management, the clks will | ||
293 | * automatically be freed when the device is unbound. | ||
294 | */ | ||
295 | int __must_check devm_clk_bulk_get(struct device *dev, int num_clks, | ||
296 | struct clk_bulk_data *clks); | ||
297 | |||
298 | /** | ||
284 | * devm_clk_get - lookup and obtain a managed reference to a clock producer. | 299 | * devm_clk_get - lookup and obtain a managed reference to a clock producer. |
285 | * @dev: device for clock "consumer" | 300 | * @dev: device for clock "consumer" |
286 | * @id: clock consumer ID | 301 | * @id: clock consumer ID |
@@ -550,6 +565,12 @@ static inline struct clk *devm_clk_get(struct device *dev, const char *id) | |||
550 | return NULL; | 565 | return NULL; |
551 | } | 566 | } |
552 | 567 | ||
568 | static inline int devm_clk_bulk_get(struct device *dev, int num_clks, | ||
569 | struct clk_bulk_data *clks) | ||
570 | { | ||
571 | return 0; | ||
572 | } | ||
573 | |||
553 | static inline struct clk *devm_get_clk_from_child(struct device *dev, | 574 | static inline struct clk *devm_get_clk_from_child(struct device *dev, |
554 | struct device_node *np, const char *con_id) | 575 | struct device_node *np, const char *con_id) |
555 | { | 576 | { |