summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAhmad Fatoum <a.fatoum@pengutronix.de>2022-01-31 08:57:18 +0100
committerSascha Hauer <s.hauer@pengutronix.de>2022-02-01 09:01:34 +0100
commit917d7d7a94f7dc1a086270981a356a50e633839a (patch)
tree0de5285485d3fcf93e60b93da983b7752d70e18f
parent9cf9eb8bd03666c01023dd8e15fdb539bc3bc74c (diff)
downloadbarebox-917d7d7a94f7dc1a086270981a356a50e633839a.tar.gz
barebox-917d7d7a94f7dc1a086270981a356a50e633839a.tar.xz
clk: clk-fixed: 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-6-a.fatoum@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r--drivers/clk/clk-fixed.c8
-rw-r--r--include/linux/clk.h4
2 files changed, 12 insertions, 0 deletions
diff --git a/drivers/clk/clk-fixed.c b/drivers/clk/clk-fixed.c
index e813f31d76..9e5a07817b 100644
--- a/drivers/clk/clk-fixed.c
+++ b/drivers/clk/clk-fixed.c
@@ -63,6 +63,14 @@ struct clk *clk_register_fixed_rate(const char *name,
return &fix->hw.clk;
}
+struct clk_hw *clk_hw_register_fixed_rate(struct device_d *dev,
+ const char *name, const char *parent_name,
+ unsigned long flags, unsigned long rate)
+{
+ return clk_to_clk_hw(clk_register_fixed_rate(xstrdup(name), parent_name,
+ flags, rate));
+}
+
/**
* of_fixed_clk_setup() - Setup function for simple fixed rate clock
*/
diff --git a/include/linux/clk.h b/include/linux/clk.h
index e28d4afb56..390bead99a 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -449,6 +449,10 @@ struct clk *clk_register_fixed_rate(const char *name,
const char *parent_name, unsigned long flags,
unsigned long fixed_rate);
+struct clk_hw *clk_hw_register_fixed_rate(struct device_d *dev, const char *name,
+ const char *parent_name, unsigned long flags,
+ unsigned long rate);
+
static inline struct clk *clk_fixed(const char *name, int rate)
{
return clk_register_fixed_rate(name, NULL, 0, rate);