summaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/clk.h31
-rw-r--r--include/linux/err.h8
2 files changed, 30 insertions, 9 deletions
diff --git a/include/linux/clk.h b/include/linux/clk.h
index af38c720e8..07b27cf148 100644
--- a/include/linux/clk.h
+++ b/include/linux/clk.h
@@ -196,6 +196,9 @@ static inline int clk_set_rate(struct clk *clk, unsigned long rate)
#endif
#ifdef CONFIG_COMMON_CLK
+
+#define CLK_SET_RATE_PARENT (1 << 0) /* propagate rate change up one level */
+
struct clk_ops {
int (*enable)(struct clk *clk);
void (*disable)(struct clk *clk);
@@ -237,36 +240,46 @@ struct clk_divider {
const char *parent;
#define CLK_DIVIDER_ONE_BASED (1 << 0)
unsigned flags;
+ const struct clk_div_table *table;
+ int max_div_index;
+ int table_size;
};
extern struct clk_ops clk_divider_ops;
struct clk *clk_divider(const char *name, const char *parent,
- void __iomem *reg, u8 shift, u8 width);
+ void __iomem *reg, u8 shift, u8 width, unsigned flags);
struct clk *clk_divider_one_based(const char *name, const char *parent,
- void __iomem *reg, u8 shift, u8 width);
+ 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);
+ const struct clk_div_table *table, unsigned flags);
struct clk *clk_fixed_factor(const char *name,
- const char *parent, unsigned int mult, unsigned int div);
+ const char *parent, unsigned int mult, unsigned int div,
+ unsigned flags);
struct clk *clk_mux_alloc(const char *name, void __iomem *reg,
- u8 shift, u8 width, const char **parents, u8 num_parents);
+ u8 shift, u8 width, const char **parents, u8 num_parents,
+ unsigned 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);
+ u8 shift, u8 width, const char **parents, u8 num_parents,
+ unsigned flags);
struct clk *clk_gate_alloc(const char *name, const char *parent,
- void __iomem *reg, u8 shift);
+ void __iomem *reg, u8 shift, unsigned flags);
void clk_gate_free(struct clk *clk_gate);
struct clk *clk_gate(const char *name, const char *parent, void __iomem *reg,
- u8 shift);
+ u8 shift, unsigned flags);
struct clk *clk_gate_inverted(const char *name, const char *parent, void __iomem *reg,
- u8 shift);
+ u8 shift, unsigned flags);
int clk_is_enabled(struct clk *clk);
int clk_is_enabled_always(struct clk *clk);
+long clk_parent_round_rate(struct clk *clk, unsigned long rate,
+ unsigned long *prate);
+int clk_parent_set_rate(struct clk *clk, unsigned long rate,
+ unsigned long parent_rate);
int clk_register(struct clk *clk);
diff --git a/include/linux/err.h b/include/linux/err.h
index 19fb70dc08..ed563f2c4a 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -52,6 +52,14 @@ static inline void *ERR_CAST(const void *ptr)
return (void *) ptr;
}
+static inline int __must_check PTR_ERR_OR_ZERO(__force const void *ptr)
+{
+ if (IS_ERR(ptr))
+ return PTR_ERR(ptr);
+ else
+ return 0;
+}
+
#endif
#endif /* _LINUX_ERR_H */