diff options
author | Ahmad Fatoum <a.fatoum@pengutronix.de> | 2022-01-31 08:57:23 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2022-02-01 09:02:04 +0100 |
commit | 6e8f41b475ecbfc8cfe8eaddf2c99897bf0698ff (patch) | |
tree | 5472240db05ff1b1e3a7baca23c6953cfd59d3a2 | |
parent | 61db7299af30c56dd35eede858e8be701d1ee376 (diff) | |
download | barebox-6e8f41b475ecbfc8cfe8eaddf2c99897bf0698ff.tar.gz barebox-6e8f41b475ecbfc8cfe8eaddf2c99897bf0698ff.tar.xz |
clk: gate: 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-11-a.fatoum@pengutronix.de
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | include/linux/clk.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h index dad0a9decc..887cd79009 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -13,6 +13,7 @@ #include <linux/err.h> #include <linux/spinlock.h> #include <linux/stringify.h> +#include <xfuncs.h> struct device_d; @@ -701,6 +702,16 @@ struct clk *clk_register_gate(struct device_d *dev, const char *name, void __iomem *reg, u8 bit_idx, u8 clk_gate_flags, spinlock_t *lock); +static inline struct clk_hw *clk_hw_register_gate(struct device_d *dev, + const char *name, const char *parent_name, + unsigned long flags, void __iomem *reg, u8 bit_idx, + u8 clk_gate_flags, spinlock_t *lock) +{ + return clk_to_clk_hw(clk_register_gate(dev, xstrdup(name), xstrdup(parent_name), + flags, reg, bit_idx, + clk_gate_flags, lock)); +} + int clk_is_enabled(struct clk *clk); int clk_hw_is_enabled(struct clk_hw *hw); |