summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-01-31 08:57:17 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-02-01 09:01:34 +0100
commit9cf9eb8bd03666c01023dd8e15fdb539bc3bc74c (patch)
treead14e57b6864eec05949041134a108b5e55bb569
parent450d00f58e80956177fd117dd95d4908e0b4ffae (diff)
downloadbarebox-9cf9eb8bd03666c01023dd8e15fdb539bc3bc74c.tar.gz
barebox-9cf9eb8bd03666c01023dd8e15fdb539bc3bc74c.tar.xz
clk: fixed-factor: add clk_hw registration functions
Save users the hassle of opencoding by providing wrappers with the same Linux semantics: names are duplicated, same arguments and struct clk_hw is returned. Signed-off-by: Ahmad Fatoum <a.fatoum@pengutronix.de> Link: https://lore.barebox.org/20220131075725.1873026-5-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/clk/clk-fixed-factor.c9
-rw-r--r--include/linux/clk.h4
2 files changed, 13 insertions, 0 deletions
diff --git a/drivers/clk/clk-fixed-factor.c b/drivers/clk/clk-fixed-factor.c
index fd4a3805f1..a6d3fdc6a1 100644
--- a/drivers/clk/clk-fixed-factor.c
+++ b/drivers/clk/clk-fixed-factor.c
@@ -84,6 +84,15 @@ struct clk *clk_register_fixed_factor(struct device_d *dev, const char *name,
return clk_fixed_factor(name, parent_name, mult, div, flags);
}
+struct clk_hw *clk_hw_register_fixed_factor(struct device_d *dev,
+ const char *name, const char *parent_name, unsigned long flags,
+ unsigned int mult, unsigned int div)
+{
+ return clk_to_clk_hw(clk_register_fixed_factor(dev, xstrdup(name),
+ xstrdup(parent_name),
+ flags, mult, div));
+}
+
/**
* of_fixed_factor_clk_setup() - Setup function for simple fixed factor clock
*/
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 7237911c6c..e28d4afb56 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -551,6 +551,10 @@ struct clk *clk_register_fixed_factor(struct device_d *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(struct device_d *dev,
+ const char *name, const char *parent_name, unsigned long flags,
+ unsigned int mult, unsigned int div);
+
/**
* struct clk_fractional_divider - adjustable fractional divider clock
*