- Add a clk_bulk_get_optional() API (with devm too) - Support for Marvell 98DX1135 SoCs * clk-bulk-optional: clk: Document some devm_clk_bulk*() APIs clk: Add devm_clk_bulk_get_optional() function clk: Add clk_bulk_get_optional() function * clk-kirkwood: clk: kirkwood: Add support for MV98DX1135 dt-bindings: clock: mvebu: Add compatible string for 98dx1135 core clock * clk-socfpga: clk: socfpga: stratix10: fix divider entry for the emac clocks clk: socfpga: stratix10: add additional clocks needed for the NAND IP * clk-docs: clk: Grammar missing "and", Spelling s/statisfied/satisfied/
Showing the changes to include/linux (1 of 9 files). Show all
Unified · Split
| @@ -332,6 +332,19 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks, · 331 unmodified lines | |||
| 332 | */ | 332 | */ |
| 333 | int __must_check clk_bulk_get_all(struct device *dev, | 333 | int __must_check clk_bulk_get_all(struct device *dev, |
| 334 | struct clk_bulk_data **clks); | 334 | struct clk_bulk_data **clks); |
| 335 | |||
| 336 | /** | ||
| 337 | * clk_bulk_get_optional - lookup and obtain a number of references to clock producer | ||
| 338 | * @dev: device for clock "consumer" | ||
| 339 | * @num_clks: the number of clk_bulk_data | ||
| 340 | * @clks: the clk_bulk_data table of consumer | ||
| 341 | * | ||
| 342 | * Behaves the same as clk_bulk_get() except where there is no clock producer. | ||
| 343 | * In this case, instead of returning -ENOENT, the function returns 0 and | ||
| 344 | * NULL for a clk for which a clock producer could not be determined. | ||
| 345 | */ | ||
| 346 | int __must_check clk_bulk_get_optional(struct device *dev, int num_clks, | ||
| 347 | struct clk_bulk_data *clks); | ||
| 335 | /** | 348 | /** |
| 336 | * devm_clk_bulk_get - managed get multiple clk consumers | 349 | * devm_clk_bulk_get - managed get multiple clk consumers |
| 337 | * @dev: device for clock "consumer" | 350 | * @dev: device for clock "consumer" |
| @@ -346,6 +359,28 @@ int __must_check clk_bulk_get_all(struct device *dev, · 8 unmodified lines | |||
| 346 | */ | 359 | */ |
| 347 | int __must_check devm_clk_bulk_get(struct device *dev, int num_clks, | 360 | int __must_check devm_clk_bulk_get(struct device *dev, int num_clks, |
| 348 | struct clk_bulk_data *clks); | 361 | struct clk_bulk_data *clks); |
| 362 | /** | ||
| 363 | * devm_clk_bulk_get_optional - managed get multiple optional consumer clocks | ||
| 364 | * @dev: device for clock "consumer" | ||
| 365 | * @clks: pointer to the clk_bulk_data table of consumer | ||
| 366 | * | ||
| 367 | * Behaves the same as devm_clk_bulk_get() except where there is no clock | ||
| 368 | * producer. In this case, instead of returning -ENOENT, the function returns | ||
| 369 | * NULL for given clk. It is assumed all clocks in clk_bulk_data are optional. | ||
| 370 | * | ||
| 371 | * Returns 0 if all clocks specified in clk_bulk_data table are obtained | ||
| 372 | * successfully or for any clk there was no clk provider available, otherwise | ||
| 373 | * returns valid IS_ERR() condition containing errno. | ||
| 374 | * The implementation uses @dev and @clk_bulk_data.id to determine the | ||
| 375 | * clock consumer, and thereby the clock producer. | ||
| 376 | * The clock returned is stored in each @clk_bulk_data.clk field. | ||
| 377 | * | ||
| 378 | * Drivers must assume that the clock source is not enabled. | ||
| 379 | * | ||
| 380 | * clk_bulk_get should not be called from within interrupt context. | ||
| 381 | */ | ||
| 382 | int __must_check devm_clk_bulk_get_optional(struct device *dev, int num_clks, | ||
| 383 | struct clk_bulk_data *clks); | ||
| 349 | /** | 384 | /** |
| 350 | * devm_clk_bulk_get_all - managed get multiple clk consumers | 385 | * devm_clk_bulk_get_all - managed get multiple clk consumers |
| 351 | * @dev: device for clock "consumer" | 386 | * @dev: device for clock "consumer" |
| @@ -718,6 +753,12 @@ static inline int __must_check clk_bulk_get(struct device *dev, int num_clks, · 366 unmodified lines | |||
| 718 | return 0; | 753 | return 0; |
| 719 | } | 754 | } |
| 720 | 755 | ||
| 756 | static inline int __must_check clk_bulk_get_optional(struct device *dev, | ||
| 757 | int num_clks, struct clk_bulk_data *clks) | ||
| 758 | { | ||
| 759 | return 0; | ||
| 760 | } | ||
| 761 | |||
| 721 | static inline int __must_check clk_bulk_get_all(struct device *dev, | 762 | static inline int __must_check clk_bulk_get_all(struct device *dev, |
| 722 | struct clk_bulk_data **clks) | 763 | struct clk_bulk_data **clks) |
| 723 | { | 764 | { |
| @@ -741,6 +782,12 @@ static inline int __must_check devm_clk_bulk_get(struct device *dev, int num_clk · 17 unmodified lines | |||
| 741 | return 0; | 782 | return 0; |
| 742 | } | 783 | } |
| 743 | 784 | ||
| 785 | static inline int __must_check devm_clk_bulk_get_optional(struct device *dev, | ||
| 786 | int num_clks, struct clk_bulk_data *clks) | ||
| 787 | { | ||
| 788 | return 0; | ||
| 789 | } | ||
| 790 | |||
| 744 | static inline int __must_check devm_clk_bulk_get_all(struct device *dev, | 791 | static inline int __must_check devm_clk_bulk_get_all(struct device *dev, |
| 745 | struct clk_bulk_data **clks) | 792 | struct clk_bulk_data **clks) |
| 746 | { | 793 | { |