Skip to content

Commit 4eb5e9c

Browse files
tlebbebarino
authored andcommitted
clk: fixed-factor: add clk_hw_register_fixed_factor_index() function
Add non-devres version of clk_hw_register_fixed_factor(), with parent targeted using its index. Signed-off-by: Théo Lebrun <theo.lebrun@bootlin.com> Link: https://lore.kernel.org/r/20241106-mbly-clk-v2-3-84cfefb3f485@bootlin.com Signed-off-by: Stephen Boyd <sboyd@kernel.org>
1 parent 6a46b75 commit 4eb5e9c

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

drivers/clk/clk-fixed-factor.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -241,6 +241,17 @@ struct clk_hw *clk_hw_register_fixed_factor_with_accuracy_fwname(struct device *
241241
}
242242
EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor_with_accuracy_fwname);
243243

244+
struct clk_hw *clk_hw_register_fixed_factor_index(struct device *dev,
245+
const char *name, unsigned int index, unsigned long flags,
246+
unsigned int mult, unsigned int div)
247+
{
248+
const struct clk_parent_data pdata = { .index = index };
249+
250+
return __clk_hw_register_fixed_factor(dev, NULL, name, NULL, NULL, &pdata,
251+
flags, mult, div, 0, 0, false);
252+
}
253+
EXPORT_SYMBOL_GPL(clk_hw_register_fixed_factor_index);
254+
244255
struct clk *clk_register_fixed_factor(struct device *dev, const char *name,
245256
const char *parent_name, unsigned long flags,
246257
unsigned int mult, unsigned int div)

include/linux/clk-provider.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,6 +1142,9 @@ struct clk_hw *clk_hw_register_fixed_factor_with_accuracy_fwname(struct device *
11421142
struct device_node *np, const char *name, const char *fw_name,
11431143
unsigned long flags, unsigned int mult, unsigned int div,
11441144
unsigned long acc);
1145+
struct clk_hw *clk_hw_register_fixed_factor_index(struct device *dev,
1146+
const char *name, unsigned int index, unsigned long flags,
1147+
unsigned int mult, unsigned int div);
11451148
void clk_hw_unregister_fixed_factor(struct clk_hw *hw);
11461149
struct clk_hw *devm_clk_hw_register_fixed_factor(struct device *dev,
11471150
const char *name, const char *parent_name, unsigned long flags,

0 commit comments

Comments
 (0)