]> git.ipfire.org Git - people/ms/u-boot.git/blobdiff - include/clk.h
Convert CONFIG_BOOTCOUNT_ENV to Kconfig
[people/ms/u-boot.git] / include / clk.h
index e7ce3e8576883f8e6df0d21d19347bfd9d7047be..a7d95d32c9185541a1df91001691198e32926bbb 100644 (file)
@@ -133,6 +133,23 @@ static inline int clk_release_all(struct clk *clk, int count)
 
 #endif
 
+#if (CONFIG_IS_ENABLED(OF_CONTROL) && !CONFIG_IS_ENABLED(OF_PLATDATA)) && \
+       CONFIG_IS_ENABLED(CLK)
+/**
+ * clk_set_defaults - Process 'assigned-{clocks/clock-parents/clock-rates}'
+ *                    properties to configure clocks
+ *
+ * @dev:        A device to process (the ofnode associated with this device
+ *              will be processed).
+ */
+int clk_set_defaults(struct udevice *dev);
+#else
+static inline int clk_set_defaults(struct udevice *dev)
+{
+       return 0;
+}
+#endif
+
 /**
  * clk_request - Request a clock by provider-specific ID.
  *
@@ -177,6 +194,17 @@ ulong clk_get_rate(struct clk *clk);
  */
 ulong clk_set_rate(struct clk *clk, ulong rate);
 
+/**
+ * clk_set_parent() - Set current clock parent.
+ *
+ * @clk:       A clock struct that was previously successfully requested by
+ *             clk_request/get_by_*().
+ * @parent:    A clock struct that was previously successfully requested by
+ *             clk_request/get_by_*().
+ * @return new rate, or -ve error code.
+ */
+int clk_set_parent(struct clk *clk, struct clk *parent);
+
 /**
  * clk_enable() - Enable (turn on) a clock.
  *