summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2021-06-02 11:54:56 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2021-06-07 12:46:13 +0200
commit37af93a347107a5448e00a2a8a969a83a9ab0eb2 (patch)
treee5502afef7883a0e4568258f389242b087f53fd4 /include
parent951e8e9cf592db968198957562324c49ab3e0670 (diff)
downloadbarebox-37af93a347107a5448e00a2a8a969a83a9ab0eb2.tar.gz
barebox-37af93a347107a5448e00a2a8a969a83a9ab0eb2.tar.xz
clk: Add lock to different clock types
The different clock types in Linux have a spinlock_t *lock field. Add the same in barebox to ease code porting from Linux. Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de> Link: https://lore.barebox.org/20210602095507.24609-14-s.hauer@pengutronix.de Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
Diffstat (limited to 'include')
-rw-r--r--include/linux/clk.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h
index 39288f5025..9d09738dda 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -11,6 +11,7 @@
#define __LINUX_CLK_H
#include <linux/err.h>
+#include <linux/spinlock.h>
#include <linux/stringify.h>
struct device_d;
@@ -437,6 +438,7 @@ struct clk_divider {
const struct clk_div_table *table;
int max_div_index;
int table_size;
+ spinlock_t *lock;
};
#define to_clk_divider(_hw) container_of(_hw, struct clk_divider, hw)
@@ -533,6 +535,7 @@ struct clk_fractional_divider {
void (*approximation)(struct clk_hw *hw,
unsigned long rate, unsigned long *parent_rate,
unsigned long *m, unsigned long *n);
+ spinlock_t *lock;
};
#define CLK_FRAC_DIVIDER_ZERO_BASED BIT(0)
@@ -558,6 +561,7 @@ struct clk_mux {
int shift;
int width;
unsigned flags;
+ spinlock_t *lock;
};
#define to_clk_mux(_hw) container_of(_hw, struct clk_mux, hw)
@@ -580,6 +584,7 @@ struct clk_gate {
int shift;
const char *parent;
unsigned flags;
+ spinlock_t *lock;
};
int clk_gate_is_enabled(struct clk_hw *hw);