summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrian Masney <bmasney@redhat.com>2026-05-11 21:35:05 -0400
committerBrian Masney <bmasney@redhat.com>2026-06-29 17:51:43 -0400
commitd131daafa99ffb4ce47e1d0e8a01c8d61a7b7142 (patch)
tree16ee1b680f5cdb58393a0fef1bb8978a1914f40d
parentef9f74ee4ccc5f98108eb2dfbf293f64db61ccb1 (diff)
clk: add kernel docs for struct clk_core
Document all of the members of struct clk_core. Reviewed-by: Maxime Ripard <mripard@kernel.org> Acked-by: Randy Dunlap <rdunlap@infradead.org> Tested-by: Randy Dunlap <rdunlap@infradead.org> Signed-off-by: Brian Masney <bmasney@redhat.com>
-rw-r--r--drivers/clk/clk.c51
1 files changed, 51 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 83a80e5cff2e..f97a7cecb200 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -63,6 +63,57 @@ struct clk_parent_map {
int index;
};
+/**
+ * struct clk_core - The internal state of a clk in the clk tree.
+ * @name: Unique name of the clk for identification.
+ * @ops: Pointer to hardware-specific operations for this clk.
+ * @hw: Pointer for traversing from a struct clk to its
+ * corresponding hardware-specific structure.
+ * @owner: Kernel module owning this clk (for reference counting).
+ * @dev: Device associated with this clk (optional)
+ * @rpm_node: Node for runtime power management list management.
+ * @of_node: Device tree node associated with this clk (if applicable)
+ * @parent: Pointer to the current parent in the clock tree.
+ * @parents: Array of possible parents (for muxes/selectable parents).
+ * @num_parents: Number of possible parents.
+ * @new_parent_index: Index of the new parent during parent change operations.
+ * @rate: Current cached clock rate (Hz).
+ * @req_rate: The last rate requested by a call to clk_set_rate(). It's
+ * initialized to clk_core->rate. It's also updated to
+ * clk_core->rate every time the clock is reparented, and
+ * when we're doing the orphan -> !orphan transition.
+ * @new_rate: New rate to be set during a rate change operation.
+ * @new_parent: Pointer to new parent during parent change. This is also
+ * used when a clk's rate is changed.
+ * @new_child: Pointer to new child during reparenting. This is also
+ * used when a clk's rate is changed.
+ * @flags: Clock property and capability flags. See
+ * `clk framework flags`.
+ * @orphan: True if this clk is currently orphaned.
+ * @rpm_enabled: True if runtime power management is enabled for this clk.
+ * @enable_count: Reference count of enables.
+ * @prepare_count: Reference count of prepares.
+ * @protect_count: Protection reference count against disable.
+ * @min_rate: Minimum supported clock rate (Hz).
+ * @max_rate: Maximum supported clock rate (Hz).
+ * @accuracy: Accuracy of the clock rate (parts per billion).
+ * @phase: Current phase (degrees).
+ * @duty: Current duty cycle configuration (as ratio: num/den).
+ * @children: All of the children of this clk.
+ * @child_node: Node for linking as a child in the parent's list.
+ * @hashtable_node: Node for hash table that allows fast clk lookup by name.
+ * @clks: All of the clk consumers registered.
+ * @notifier_count: Number of notifiers registered for this clk.
+ * @dentry: DebugFS entry for this clk.
+ * @debug_node: DebugFS node for this clk.
+ * @ref: Reference count for structure lifetime management.
+ *
+ * Managed by the clk framework. Clk providers and consumers do not interact
+ * with this structure directly. Instead, clk operations flow through the
+ * framework and the framework manipulates this structure to keep track of
+ * parent/child relationships, rate, enable state, etc.
+ *
+ */
struct clk_core {
const char *name;
const struct clk_ops *ops;