From: Brian Masney <bmasney@redhat.com>
To: Stephen Boyd <sboyd@kernel.org>
Cc: Maxime Ripard <mripard@kernel.org>,
Michael Turquette <mturquette@baylibre.com>,
linux-clk@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] clk: add kernel docs for struct clk_core
Date: Wed, 25 Mar 2026 13:36:20 -0400 [thread overview]
Message-ID: <acQdFMOp1HEJK4mA@redhat.com> (raw)
In-Reply-To: <177440586383.5403.6563786360526680278@localhost.localdomain>
On Tue, Mar 24, 2026 at 07:31:03PM -0700, Stephen Boyd wrote:
> Quoting Brian Masney (2026-03-04 14:51:03)
> > diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
> > index 47093cda9df32223c1120c3710261296027c4cd3..18b7a14e3f2c595d82401be9382a062fbca8a5c6 100644
> > --- a/drivers/clk/clk.c
> > +++ b/drivers/clk/clk.c
> > @@ -63,6 +63,65 @@ struct clk_parent_map {
> > int index;
> > };
> >
> > +/**
> > + * struct clk_core - This structure represents the internal state of a clk
> > + * within the kernel's clock tree. Drivers do not interact with this structure
> > + * directly. The clk_core is manipulated by the framework to manage clock
> > + * operations, parent/child relationships, rate, and other properties.
>
> Trim this down and use active voice please.
>
> /**
> * struct clk_core - The internal state of a clk in the clk tree.
> *
> * 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.
> *
>
> Does the longer paragraph description follow directly after the one line
> short description? Or does it come after all the members?
The longer paragraph goes after the description of the members.
https://docs.kernel.org/doc-guide/kernel-doc.html#function-documentation
> > + * 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.
>
> Can we somehow link this to the CLK_* defines in clk-provider.h?
The kerneldoc lists how to link to things at:
https://docs.kernel.org/doc-guide/kernel-doc.html#cross-referencing-from-restructuredtext
I don't see how to link to the #defines the way it is right now, unless
we link to each one individually, which we don't want to do. We should
be able to do something like this:
enum clk_flags {
CLK_SET_RATE_GATE = 0,
CLK_SET_PARENT_GATE = 1 << 0,
CLK_SET_RATE_PARENT = 1 << 1,
CLK_IGNORE_UNUSED = 1 << 2,
...
};
We could then refernece enum clk_flags in the description, and it'll
automatically link it for us. I'll try this and see how it turns out.
Brian
next prev parent reply other threads:[~2026-03-25 17:36 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 22:51 [PATCH 0/2] clk: add kernel docs for struct clk_core and update tests to use HZ_PER_MHZ Brian Masney
2026-03-04 22:51 ` [PATCH 1/2] clk: add kernel docs for struct clk_core Brian Masney
2026-03-25 2:31 ` Stephen Boyd
2026-03-25 17:36 ` Brian Masney [this message]
2026-03-04 22:51 ` [PATCH 2/2] clk: test: convert constants to use HZ_PER_MHZ Brian Masney
2026-03-05 12:12 ` [PATCH 0/2] clk: add kernel docs for struct clk_core and update tests " Maxime Ripard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=acQdFMOp1HEJK4mA@redhat.com \
--to=bmasney@redhat.com \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mripard@kernel.org \
--cc=mturquette@baylibre.com \
--cc=sboyd@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.