[PATCH v6 1/5] clk: Introduce devm_clk_hw_register_gate_parent_data()

Peng Fan peng.fan at oss.nxp.com
Tue Feb 28 18:34:32 PST 2023



On 3/1/2023 5:57 AM, Marek Vasut wrote:
> Add an API for clock gate that uses parent_data for the parent instead of
> a string parent_name.
> 
> Reviewed-by: Fabio Estevam <festevam at gmail.com>
> Tested-by: Adam Ford <aford173 at gmail.com> #imx8mp-beacon-kit
> Tested-by: Alexander Stein <alexander.stein at ew.tq-group.com>
> Signed-off-by: Marek Vasut <marex at denx.de>

Reviewed-by: Peng Fan <peng.fan at nxp.com>

> ---
> Cc: Abel Vesa <abelvesa at kernel.org>
> Cc: Alexander Stein <alexander.stein at ew.tq-group.com>
> Cc: Fabio Estevam <festevam at gmail.com>
> Cc: Jacky Bai <ping.bai at nxp.com>
> Cc: Krzysztof Kozlowski <krzysztof.kozlowski+dt at linaro.org>
> Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Cc: Luca Ceresoli <luca.ceresoli at bootlin.com>
> Cc: Lucas Stach <l.stach at pengutronix.de>
> Cc: Marco Felsch <m.felsch at pengutronix.de>
> Cc: Michael Turquette <mturquette at baylibre.com>
> Cc: NXP Linux Team <linux-imx at nxp.com>
> Cc: Peng Fan <peng.fan at nxp.com>
> Cc: Pengutronix Kernel Team <kernel at pengutronix.de>
> Cc: Richard Cochran <richardcochran at gmail.com>
> Cc: Rob Herring <robh+dt at kernel.org>
> Cc: Sascha Hauer <s.hauer at pengutronix.de>
> Cc: Shawn Guo <shawnguo at kernel.org>
> Cc: Stephen Boyd <sboyd at kernel.org>
> Cc: devicetree at vger.kernel.org
> Cc: linux-arm-kernel at lists.infradead.org
> Cc: linux-clk at vger.kernel.org
> ---
> V3: New patch
> V4: - Rebase on next 20230223
> V5: Add TB from Adam and Alexander
> V6: Add RB from Fabio
> ---
>   include/linux/clk-provider.h | 19 +++++++++++++++++++
>   1 file changed, 19 insertions(+)
> 
> diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
> index 842e72a5348fa..92b7c794c6272 100644
> --- a/include/linux/clk-provider.h
> +++ b/include/linux/clk-provider.h
> @@ -608,6 +608,25 @@ struct clk *clk_register_gate(struct device *dev, const char *name,
>   	__devm_clk_hw_register_gate((dev), NULL, (name), (parent_name), NULL, \
>   			       NULL, (flags), (reg), (bit_idx),		      \
>   			       (clk_gate_flags), (lock))
> +
> +/**
> + * devm_clk_hw_register_gate - register a gate clock with the clock framework
> + * @dev: device that is registering this clock
> + * @name: name of this clock
> + * @parent_data: parent clk data
> + * @flags: framework-specific flags for this clock
> + * @reg: register address to control gating of this clock
> + * @bit_idx: which bit in the register controls gating of this clock
> + * @clk_gate_flags: gate-specific flags for this clock
> + * @lock: shared register lock for this clock
> + */
> +#define devm_clk_hw_register_gate_parent_data(dev, name, parent_data, flags,  \
> +					      reg, bit_idx, clk_gate_flags,   \
> +					      lock)			      \
> +	__devm_clk_hw_register_gate((dev), NULL, (name), NULL, NULL,	      \
> +				    (parent_data), (flags), (reg), (bit_idx), \
> +				    (clk_gate_flags), (lock))
> +
>   void clk_unregister_gate(struct clk *clk);
>   void clk_hw_unregister_gate(struct clk_hw *hw);
>   int clk_gate_is_enabled(struct clk_hw *hw);



More information about the linux-arm-kernel mailing list