mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
clk: Add clk_bulk_get_optional() function
clk_bulk_get_optional() allows to get a group of clocks where one or more is optional. For a not available clock, e.g. not specifed in the clock consumer node in DT, its respective struct clk pointer will be NULL. This allows for operating on a group of returned clocks (struct clk_bulk_data array) with existing clk_bulk* APIs. Signed-off-by: Sylwester Nawrocki <s.nawrocki@samsung.com> Signed-off-by: Stephen Boyd <sboyd@kernel.org>
This commit is contained in:
parent
a188339ca5
commit
2f25528e4e
2 changed files with 39 additions and 3 deletions
|
@ -332,6 +332,19 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks,
|
|||
*/
|
||||
int __must_check clk_bulk_get_all(struct device *dev,
|
||||
struct clk_bulk_data **clks);
|
||||
|
||||
/**
|
||||
* clk_bulk_get_optional - lookup and obtain a number of references to clock producer
|
||||
* @dev: device for clock "consumer"
|
||||
* @num_clks: the number of clk_bulk_data
|
||||
* @clks: the clk_bulk_data table of consumer
|
||||
*
|
||||
* Behaves the same as clk_bulk_get() except where there is no clock producer.
|
||||
* In this case, instead of returning -ENOENT, the function returns 0 and
|
||||
* NULL for a clk for which a clock producer could not be determined.
|
||||
*/
|
||||
int __must_check clk_bulk_get_optional(struct device *dev, int num_clks,
|
||||
struct clk_bulk_data *clks);
|
||||
/**
|
||||
* devm_clk_bulk_get - managed get multiple clk consumers
|
||||
* @dev: device for clock "consumer"
|
||||
|
@ -718,6 +731,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_optional(struct device *dev,
|
||||
int num_clks, struct clk_bulk_data *clks)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
static inline int __must_check clk_bulk_get_all(struct device *dev,
|
||||
struct clk_bulk_data **clks)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue