From: Brian Masney <bmasney@redhat.com>
To: "Benoît Monin" <benoit.monin@bootlin.com>
Cc: "Vladimir Kondratiev" <vladimir.kondratiev@mobileye.com>,
"Gregory CLEMENT" <gregory.clement@bootlin.com>,
"Théo Lebrun" <theo.lebrun@bootlin.com>,
"Rob Herring" <robh@kernel.org>,
"Krzysztof Kozlowski" <krzk+dt@kernel.org>,
"Conor Dooley" <conor+dt@kernel.org>,
"Michael Turquette" <mturquette@baylibre.com>,
"Stephen Boyd" <sboyd@kernel.org>,
"Philipp Zabel" <p.zabel@pengutronix.de>,
"Paul Walmsley" <pjw@kernel.org>,
"Palmer Dabbelt" <palmer@dabbelt.com>,
"Albert Ou" <aou@eecs.berkeley.edu>,
"Alexandre Ghiti" <alex@ghiti.fr>,
"Thomas Petazzoni" <thomas.petazzoni@bootlin.com>,
"Tawfik Bayouk" <tawfik.bayouk@mobileye.com>,
linux-riscv@lists.infradead.org, devicetree@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-clk@vger.kernel.org,
linux-mips@vger.kernel.org
Subject: Re: [PATCH v4 04/10] clk: fixed-factor: Export __clk_hw_register_fixed_factor()
Date: Mon, 9 Mar 2026 11:05:51 -0400 [thread overview]
Message-ID: <aa7hz_psKK6lZC29@redhat.com> (raw)
In-Reply-To: <20260304-clk-eyeq7-v4-4-9d6bd9d24bec@bootlin.com>
On Wed, Mar 04, 2026 at 04:25:18PM +0100, Benoît Monin wrote:
> Make the base registration function for fixed-factor clocks public and
> re-implement the various registration functions that are a direct call
> to __clk_hw_register_fixed_factor() as macros.
>
> This is similar to how the registration functions of divider, mux and
> other clocks are implemented.
>
> Add a new macro clk_hw_register_fixed_factor_pdata() to register
> a fixed-factor clock with its parent clock passed as a struct
> clk_parent_data.
>
> Signed-off-by: Benoît Monin <benoit.monin@bootlin.com>
> ---
> drivers/clk/clk-fixed-factor.c | 52 ++-------------------------------------
> include/linux/clk-provider.h | 56 +++++++++++++++++++++++++++++++++---------
> 2 files changed, 46 insertions(+), 62 deletions(-)
>
> diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
> index 359e91441c74..6116f878fc8f 100644
> --- a/drivers/clk/clk-fixed-factor.c
> +++ b/drivers/clk/clk-fixed-factor.c
> @@ -90,7 +90,7 @@ static void devm_clk_hw_register_fixed_factor_release(struct device *dev, void *
> clk_hw_unregister(&fix->hw);
> }
>
> -static struct clk_hw *
> +struct clk_hw *
> __clk_hw_register_fixed_factor(struct device *dev, struct device_node *np,
> const char *name, const char *parent_name,
> const struct clk_hw *parent_hw, const struct clk_parent_data *pdata,
> @@ -148,6 +148,7 @@ __clk_hw_register_fixed_factor(struct device *dev, struct device_node *np,
>
> return hw;
> }
> +EXPORT_SYMBOL_GPL(__clk_hw_register_fixed_factor);
>
> /**
> * devm_clk_hw_register_fixed_factor_index - Register a fixed factor clock with
> @@ -173,46 +174,6 @@ struct clk_hw *devm_clk_hw_register_fixed_factor_index(struct device *dev,
> }
> EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor_index);
>
> -/**
> - * devm_clk_hw_register_fixed_factor_parent_hw - Register a fixed factor clock with
> - * pointer to parent clock
> - * @dev: device that is registering this clock
> - * @name: name of this clock
> - * @parent_hw: pointer to parent clk
> - * @flags: fixed factor flags
> - * @mult: multiplier
> - * @div: divider
> - *
> - * Return: Pointer to fixed factor clk_hw structure that was registered or
> - * an error pointer.
> - */
> -struct clk_hw *devm_clk_hw_register_fixed_factor_parent_hw(struct device *dev,
> - const char *name, const struct clk_hw *parent_hw,
> - unsigned long flags, unsigned int mult, unsigned int div)
> -{
> - return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, parent_hw,
> - NULL, flags, mult, div, 0, 0, true);
> -}
> -EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor_parent_hw);
> -
> -struct clk_hw *clk_hw_register_fixed_factor_parent_hw(struct device *dev,
> - const char *name, const struct clk_hw *parent_hw,
> - unsigned long flags, unsigned int mult, unsigned int div)
> -{
> - return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, parent_hw,
> - NULL, flags, mult, div, 0, 0, false);
> -}
> -EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor_parent_hw);
> -
> -struct clk_hw *clk_hw_register_fixed_factor(struct device *dev,
> - const char *name, const char *parent_name, unsigned long flags,
> - unsigned int mult, unsigned int div)
> -{
> - return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL,
> - NULL, flags, mult, div, 0, 0, false);
> -}
> -EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor);
> -
> struct clk_hw *clk_hw_register_fixed_factor_fwname(struct device *dev,
> struct device_node *np, const char *name, const char *fw_name,
> unsigned long flags, unsigned int mult, unsigned int div)
> @@ -286,15 +247,6 @@ void clk_hw_unregister_fixed_factor(struct clk_hw *hw)
> }
> EXPORT_SYMBOL_GPL(clk_hw_unregister_fixed_factor);
>
> -struct clk_hw *devm_clk_hw_register_fixed_factor(struct device *dev,
> - const char *name, const char *parent_name, unsigned long flags,
> - unsigned int mult, unsigned int div)
> -{
> - return __clk_hw_register_fixed_factor(dev, NULL, name, parent_name, NULL,
> - NULL, flags, mult, div, 0, 0, true);
> -}
> -EXPORT_SYMBOL_GPL(devm_clk_hw_register_fixed_factor);
> -
> struct clk_hw *devm_clk_hw_register_fixed_factor_fwname(struct device *dev,
> struct device_node *np, const char *name, const char *fw_name,
> unsigned long flags, unsigned int mult, unsigned int div)
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 630705a47129..614abb396a6e 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -1146,13 +1146,16 @@ struct clk_fixed_factor {
> #define to_clk_fixed_factor(_hw) container_of(_hw, struct clk_fixed_factor, hw)
>
> extern const struct clk_ops clk_fixed_factor_ops;
> +struct clk_hw *
> +__clk_hw_register_fixed_factor(struct device *dev, struct device_node *np,
> + const char *name, const char *parent_name,
> + const struct clk_hw *parent_hw, const struct clk_parent_data *pdata,
> + unsigned long flags, unsigned int mult, unsigned int div,
> + unsigned long acc, unsigned int fixflags, bool devm);
> struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
> const char *parent_name, unsigned long flags,
> unsigned int mult, unsigned int div);
> void clk_unregister_fixed_factor(struct clk *clk);
> -struct clk_hw *clk_hw_register_fixed_factor(struct device *dev,
> - const char *name, const char *parent_name, unsigned long flags,
> - unsigned int mult, unsigned int div);
> struct clk_hw *clk_hw_register_fixed_factor_fwname(struct device *dev,
> struct device_node *np, const char *name, const char *fw_name,
> unsigned long flags, unsigned int mult, unsigned int div);
> @@ -1164,9 +1167,6 @@ struct clk_hw *clk_hw_register_fixed_factor_index(struct device *dev,
> const char *name, unsigned int index, unsigned long flags,
> unsigned int mult, unsigned int div);
> void clk_hw_unregister_fixed_factor(struct clk_hw *hw);
> -struct clk_hw *devm_clk_hw_register_fixed_factor(struct device *dev,
> - const char *name, const char *parent_name, unsigned long flags,
> - unsigned int mult, unsigned int div);
> struct clk_hw *devm_clk_hw_register_fixed_factor_fwname(struct device *dev,
> struct device_node *np, const char *name, const char *fw_name,
> unsigned long flags, unsigned int mult, unsigned int div);
> @@ -1178,13 +1178,45 @@ struct clk_hw *devm_clk_hw_register_fixed_factor_index(struct device *dev,
> const char *name, unsigned int index, unsigned long flags,
> unsigned int mult, unsigned int div);
>
> -struct clk_hw *devm_clk_hw_register_fixed_factor_parent_hw(struct device *dev,
> - const char *name, const struct clk_hw *parent_hw,
> - unsigned long flags, unsigned int mult, unsigned int div);
> +# define clk_hw_register_fixed_factor(dev, name, parent_name, \
> + flags, mult, div) \
> + __clk_hw_register_fixed_factor((dev), NULL, (name), (parent_name), \
> + NULL, NULL, (flags), (mult), (div), \
> + 0, 0, false)
Why the extra space between # and define? It's not used below.
With that fixed:
Reviewed-by: Brian Masney <bmasney@redhat.com>
> +#define clk_hw_register_fixed_factor_pdata(dev, np, name, pdata, \
> + flags, mult, div, acc, fixflags) \
> + __clk_hw_register_fixed_factor((dev), (np), (name), NULL, NULL, \
> + (pdata), (flags), (mult), (div), \
> + (acc), (fixflags), false)
> +#define devm_clk_hw_register_fixed_factor(dev, name, parent_name, flags, \
> + mult, div) \
> + __clk_hw_register_fixed_factor((dev), NULL, (name), (parent_name), \
> + NULL, NULL, (flags), (mult), (div), 0, \
> + 0, true)
next prev parent reply other threads:[~2026-03-09 15:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-04 15:25 [PATCH v4 00/10] Add clock and reset support for Mobileye EyeQ7H Benoît Monin
2026-03-04 15:25 ` [PATCH v4 01/10] dt-bindings: soc: mobileye: Add EyeQ7H OLB Benoît Monin
2026-03-04 15:25 ` [PATCH v4 02/10] reset: eyeq: Add EyeQ7H compatibles Benoît Monin
2026-03-09 11:14 ` Philipp Zabel
2026-03-04 15:25 ` [PATCH v4 03/10] clk: fixed-factor: Rework initialization with parent clocks Benoît Monin
2026-03-09 14:58 ` Brian Masney
2026-03-04 15:25 ` [PATCH v4 04/10] clk: fixed-factor: Export __clk_hw_register_fixed_factor() Benoît Monin
2026-03-09 15:05 ` Brian Masney [this message]
2026-03-04 15:25 ` [PATCH v4 05/10] clk: eyeq: Prefix the PLL registers with the PLL type Benoît Monin
2026-03-04 15:25 ` [PATCH v4 06/10] clk: eyeq: Introduce a generic clock type Benoît Monin
2026-03-04 15:25 ` [PATCH v4 07/10] clk: eyeq: Convert clocks declaration to eqc_clock Benoît Monin
2026-03-04 15:25 ` [PATCH v4 08/10] clk: eyeq: Drop PLL, dividers, and fixed factors structs Benoît Monin
2026-03-04 15:25 ` [PATCH v4 09/10] clk: eyeq: Add EyeQ7H compatibles Benoît Monin
2026-03-04 15:25 ` [PATCH v4 10/10] MAINTAINERS: Add entry for Mobileye RISC-V SoCs Benoît Monin
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=aa7hz_psKK6lZC29@redhat.com \
--to=bmasney@redhat.com \
--cc=alex@ghiti.fr \
--cc=aou@eecs.berkeley.edu \
--cc=benoit.monin@bootlin.com \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=gregory.clement@bootlin.com \
--cc=krzk+dt@kernel.org \
--cc=linux-clk@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=mturquette@baylibre.com \
--cc=p.zabel@pengutronix.de \
--cc=palmer@dabbelt.com \
--cc=pjw@kernel.org \
--cc=robh@kernel.org \
--cc=sboyd@kernel.org \
--cc=tawfik.bayouk@mobileye.com \
--cc=theo.lebrun@bootlin.com \
--cc=thomas.petazzoni@bootlin.com \
--cc=vladimir.kondratiev@mobileye.com \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox