summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorSascha Hauer <s.hauer@pengutronix.de>2019-04-09 12:24:44 +0200
committerSascha Hauer <s.hauer@pengutronix.de>2019-04-09 12:24:44 +0200
commit731cc538f3bdce594095d31af9bc288dcd511ab9 (patch)
treec3e406d96834fc83b9fa605ee7c4088e48111649 /include
parenteed5f701ba73310020dc3ef2530944cb601f256c (diff)
parentf4634187cfda8db89121a5fbc88992ad79882db2 (diff)
downloadbarebox-731cc538f3bdce594095d31af9bc288dcd511ab9.tar.gz
barebox-731cc538f3bdce594095d31af9bc288dcd511ab9.tar.xz
Merge branch 'for-next/stm32'
Diffstat (limited to 'include')
-rw-r--r--include/linux/clk.h41
1 files changed, 27 insertions, 14 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h
index ee888dc083..b9c5e0ab04 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -285,6 +285,9 @@ static inline void clk_put(struct clk *clk)
#include <linux/list.h>
#define CLK_SET_RATE_PARENT (1 << 0) /* propagate rate change up one level */
+#define CLK_IGNORE_UNUSED (1 << 3) /* do not gate even if unused */
+#define CLK_SET_RATE_NO_REPARENT (1 << 7) /* don't re-parent on rate change */
+#define CLK_IS_CRITICAL (1 << 11) /* do not gate, ever */
/* parents need enable during gate/ungate, set rate and re-parent */
#define CLK_OPS_PARENT_ENABLE (1 << 12)
@@ -310,7 +313,7 @@ struct clk {
int enable_count;
struct list_head list;
const char *name;
- const char **parent_names;
+ const char * const *parent_names;
int num_parents;
struct clk **parents;
@@ -339,8 +342,10 @@ struct clk_divider {
#define CLK_DIVIDER_POWER_OF_TWO (1 << 1)
#define CLK_DIVIDER_HIWORD_MASK (1 << 3)
+#define CLK_DIVIDER_READ_ONLY (1 << 5)
#define CLK_MUX_HIWORD_MASK (1 << 2)
+#define CLK_MUX_READ_ONLY (1 << 3) /* mux can't be changed */
extern struct clk_ops clk_divider_ops;
@@ -350,15 +355,19 @@ unsigned long divider_recalc_rate(struct clk *clk, unsigned long parent_rate,
unsigned long flags, unsigned long width);
struct clk *clk_divider_alloc(const char *name, const char *parent,
- void __iomem *reg, u8 shift, u8 width, unsigned flags);
+ unsigned clk_flags, void __iomem *reg,
+ u8 shift, u8 width, unsigned div_flags);
void clk_divider_free(struct clk *clk_divider);
struct clk *clk_divider(const char *name, const char *parent,
- void __iomem *reg, u8 shift, u8 width, unsigned flags);
+ unsigned clk_flags, void __iomem *reg, u8 shift,
+ u8 width, unsigned div_flags);
struct clk *clk_divider_one_based(const char *name, const char *parent,
- void __iomem *reg, u8 shift, u8 width, unsigned flags);
-struct clk *clk_divider_table(const char *name,
- const char *parent, void __iomem *reg, u8 shift, u8 width,
- const struct clk_div_table *table, unsigned flags);
+ unsigned clk_flags, void __iomem *reg,
+ u8 shift, u8 width, unsigned div_flags);
+struct clk *clk_divider_table(const char *name, const char *parent,
+ unsigned clk_flags, void __iomem *reg, u8 shift,
+ u8 width, const struct clk_div_table *table,
+ unsigned div_flags);
struct clk *clk_fixed_factor(const char *name,
const char *parent, unsigned int mult, unsigned int div,
unsigned flags);
@@ -377,19 +386,21 @@ struct clk_mux {
void __iomem *reg;
int shift;
int width;
+ unsigned flags;
};
#define to_clk_mux(_clk) container_of(_clk, struct clk_mux, clk)
extern struct clk_ops clk_mux_ops;
-struct clk *clk_mux_alloc(const char *name, void __iomem *reg,
- u8 shift, u8 width, const char **parents, u8 num_parents,
- unsigned flags);
+struct clk *clk_mux_alloc(const char *name, unsigned clk_flags,
+ void __iomem *reg, u8 shift, u8 width,
+ const char * const *parents, u8 num_parents,
+ unsigned mux_flags);
void clk_mux_free(struct clk *clk_mux);
-struct clk *clk_mux(const char *name, void __iomem *reg,
- u8 shift, u8 width, const char **parents, u8 num_parents,
- unsigned flags);
+struct clk *clk_mux(const char *name, unsigned clk_flags, void __iomem *reg,
+ u8 shift, u8 width, const char * const *parents,
+ u8 num_parents, unsigned mux_flags);
struct clk_gate {
struct clk clk;
@@ -399,6 +410,8 @@ struct clk_gate {
unsigned flags;
};
+int clk_gate_is_enabled(struct clk *clk);
+
#define to_clk_gate(_clk) container_of(_clk, struct clk_gate, clk)
extern struct clk_ops clk_gate_ops;
@@ -429,7 +442,7 @@ struct clk *clk_lookup(const char *name);
void clk_dump(int verbose);
struct clk *clk_register_composite(const char *name,
- const char **parent_names, int num_parents,
+ const char * const *parent_names, int num_parents,
struct clk *mux_clk,
struct clk *rate_clk,
struct clk *gate_clk,