[PATCH 7/7] clk: move struct clk_composite definition to header
Ahmad Fatoum
a.fatoum at pengutronix.de
Tue Apr 22 00:56:37 PDT 2025
From: Ahmad Fatoum <a.fatoum at barebox.org>
Linux defines struct clk_composite in a header, so clock drivers can
make direct use of it. Do the same for barebox.
Signed-off-by: Ahmad Fatoum <a.fatoum at barebox.org>
---
drivers/clk/clk-composite.c | 12 +-----------
include/linux/clk-provider.h | 18 ++++++++++++++++++
2 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/drivers/clk/clk-composite.c b/drivers/clk/clk-composite.c
index f69d90e72b4f..e8f1fa7a7250 100644
--- a/drivers/clk/clk-composite.c
+++ b/drivers/clk/clk-composite.c
@@ -8,19 +8,9 @@
#include <common.h>
#include <io.h>
#include <malloc.h>
-#include <linux/clk.h>
+#include <linux/clk-provider.h>
#include <linux/err.h>
-struct clk_composite {
- struct clk_hw hw;
-
- struct clk_hw *mux_hw;
- struct clk_hw *rate_hw;
- struct clk_hw *gate_hw;
-};
-
-#define to_clk_composite(_hw) container_of(_hw, struct clk_composite, hw)
-
static int clk_composite_get_parent(struct clk_hw *hw)
{
struct clk_composite *composite = to_clk_composite(hw);
diff --git a/include/linux/clk-provider.h b/include/linux/clk-provider.h
index 602e772a54bb..07ccf1d67515 100644
--- a/include/linux/clk-provider.h
+++ b/include/linux/clk-provider.h
@@ -31,6 +31,24 @@ static inline long divider_ro_round_rate(struct clk_hw *hw, unsigned long rate,
val);
}
+/***
+ * struct clk_composite - aggregate clock of mux, divider and gate clocks
+ *
+ * @hw: handle between common and hardware-specific interfaces
+ * @mux_hw: handle between composite and hardware-specific mux clock
+ * @rate_hw: handle between composite and hardware-specific rate clock
+ * @gate_hw: handle between composite and hardware-specific gate clock
+ */
+struct clk_composite {
+ struct clk_hw hw;
+
+ struct clk_hw *mux_hw;
+ struct clk_hw *rate_hw;
+ struct clk_hw *gate_hw;
+};
+
+#define to_clk_composite(_hw) container_of(_hw, struct clk_composite, hw)
+
/**
* struct clk_rate_request - Structure encoding the clk constraints that
* a clock user might require.
--
2.39.5
More information about the barebox
mailing list