History

Merge branches 'clk-bulk-optional', 'clk-kirkwood', 'clk-socfpga' and 'clk-docs' into clk-next

- 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/

Stephen Boyd committed 7 years ago

Commit dfe1d3a5 parents e02cb1f 179175d 88aa7af 16e3c57 65e22189 files · +120 −12Browse files

Showing the changes to include/linux (1 of 9 files). Show all

Unified · Split

include/linux/clk.h+47−0
@@ -332,6 +332,19 @@ int __must_check clk_bulk_get(struct device *dev, int num_clks, · 331 unmodified lines
332332 */
333333 int __must_check clk_bulk_get_all(struct device *dev,
334334 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);
335348 /**
336349 * devm_clk_bulk_get - managed get multiple clk consumers
337350 * @dev: device for clock "consumer"
@@ -346,6 +359,28 @@ int __must_check clk_bulk_get_all(struct device *dev, · 8 unmodified lines
346359 */
347360 int __must_check devm_clk_bulk_get(struct device *dev, int num_clks,
348361 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);
349384 /**
350385 * devm_clk_bulk_get_all - managed get multiple clk consumers
351386 * @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
718753 return 0;
719754 }
720755
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+
721762 static inline int __must_check clk_bulk_get_all(struct device *dev,
722763 struct clk_bulk_data **clks)
723764 {
@@ -741,6 +782,12 @@ static inline int __must_check devm_clk_bulk_get(struct device *dev, int num_clk · 17 unmodified lines
741782 return 0;
742783 }
743784
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+
744791 static inline int __must_check devm_clk_bulk_get_all(struct device *dev,
745792 struct clk_bulk_data **clks)
746793 {

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t