summaryrefslogtreecommitdiff
path: root/include/clk.h
diff options
context:
space:
mode:
authorTom Rini <trini@konsulko.com>2020-01-16 09:40:09 -0500
committerTom Rini <trini@konsulko.com>2020-01-16 09:40:09 -0500
commitf47704d4ae494ebc8a25c95202e548ea32f98955 (patch)
tree1fe12b692cf15f97aafb17ab4261e8d8106a797a /include/clk.h
parent9d5d74c3ccdc78bac969d25e98eab96872e33b5c (diff)
parent7b2e07ad34170c82a098b47a756311dec5e8e04a (diff)
Merge branch '2020-01-15-master-imports'
- MediaTek improvements - Some generic clk improvements - A few assorted bugfixes
Diffstat (limited to 'include/clk.h')
-rw-r--r--include/clk.h40
1 files changed, 40 insertions, 0 deletions
diff --git a/include/clk.h b/include/clk.h
index a5ee53d94aa..3336301815f 100644
--- a/include/clk.h
+++ b/include/clk.h
@@ -155,6 +155,34 @@ int clk_get_bulk(struct udevice *dev, struct clk_bulk *bulk);
int clk_get_by_name(struct udevice *dev, const char *name, struct clk *clk);
/**
+ * clk_get_by_name_nodev - Get/request a clock by name without a device.
+ *
+ * This is a version of clk_get_by_name() that does not use a device.
+ *
+ * @node: The client ofnode.
+ * @name: The name of the clock to request, within the client's list of
+ * clocks.
+ * @clock: A pointer to a clock struct to initialize.
+ * @return 0 if OK, or a negative error code.
+ */
+int clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk);
+
+/**
+ * clock_get_optional_nodev - Get/request an optinonal clock by name
+ * without a device.
+ * @node: The client ofnode.
+ * @name: The name of the clock to request.
+ * @name: The name of the clock to request, within the client's list of
+ * clocks.
+ * @clock: A pointer to a clock struct to initialize.
+ *
+ * Behaves the same as clk_get_by_name_nodev() except where there is
+ * no clock producer, in this case, skip the error number -ENODATA, and
+ * the function returns 0.
+ */
+int clk_get_optional_nodev(ofnode node, const char *name, struct clk *clk);
+
+/**
* devm_clk_get - lookup and obtain a managed reference to a clock producer.
* @dev: device for clock "consumer"
* @id: clock consumer ID
@@ -230,6 +258,18 @@ static inline int clk_get_by_name(struct udevice *dev, const char *name,
return -ENOSYS;
}
+static inline int
+clk_get_by_name_nodev(ofnode node, const char *name, struct clk *clk)
+{
+ return -ENOSYS;
+}
+
+static inline int
+clk_get_optional_nodev(ofnode node, const char *name, struct clk *clk)
+{
+ return -ENOSYS;
+}
+
static inline int clk_release_all(struct clk *clk, int count)
{
return -ENOSYS;