diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-09 08:30:35 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2015-03-09 08:30:35 +0100 |
commit | 55ab01c7ff16e5fcb2d91870d0ab84399512ee3f (patch) | |
tree | 62effecfbc202bf8954de3bbfab50ecb9c7992db /include | |
parent | 5c8ced1a6dec754a757d730a0205d168728c7f96 (diff) | |
parent | 84fcb04367ccf9c89f442c8a5a716cceb34413e6 (diff) | |
download | barebox-55ab01c7ff16e5fcb2d91870d0ab84399512ee3f.tar.gz barebox-55ab01c7ff16e5fcb2d91870d0ab84399512ee3f.tar.xz |
Merge branch 'for-next/rockchip'
Conflicts:
arch/arm/Kconfig
Diffstat (limited to 'include')
-rw-r--r-- | include/init.h | 1 | ||||
-rw-r--r-- | include/linux/barebox-wrapper.h | 6 | ||||
-rw-r--r-- | include/linux/clk.h | 23 | ||||
-rw-r--r-- | include/linux/gcd.h | 8 | ||||
-rw-r--r-- | include/linux/kernel.h | 5 |
5 files changed, 43 insertions, 0 deletions
diff --git a/include/init.h b/include/init.h index 976f643af8..40cea55fb1 100644 --- a/include/init.h +++ b/include/init.h @@ -6,6 +6,7 @@ */ #define __init #define __initdata +#define __initconst /* For assembly routines */ #define __BARE_INIT .section ".text_bare_init.text","ax" diff --git a/include/linux/barebox-wrapper.h b/include/linux/barebox-wrapper.h index d34d1d1d0e..3859185186 100644 --- a/include/linux/barebox-wrapper.h +++ b/include/linux/barebox-wrapper.h @@ -73,4 +73,10 @@ typedef int irqreturn_t; #define IRQ_NONE 0 #define IRQ_HANDLED 0 +/* To ease clk drivers porting from Linux kernel */ +#define __clk_get_name(clk) (clk->name) +#define __clk_lookup clk_lookup +#define __clk_get_rate clk_get_rate +#define __clk_get_parent clk_get_parent + #endif /* __INCLUDE_LINUX_BAREBOX_WRAPPER_H */ diff --git a/include/linux/clk.h b/include/linux/clk.h index 49cb5a272b..56890a0d5e 100644 --- a/include/linux/clk.h +++ b/include/linux/clk.h @@ -248,8 +248,16 @@ struct clk_divider { int table_size; }; +#define CLK_DIVIDER_POWER_OF_TWO (1 << 1) +#define CLK_DIVIDER_HIWORD_MASK (1 << 3) + +#define CLK_MUX_HIWORD_MASK (1 << 2) + extern struct clk_ops clk_divider_ops; +struct clk *clk_divider_alloc(const char *name, const char *parent, + void __iomem *reg, u8 shift, u8 width, unsigned 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); struct clk *clk_divider_one_based(const char *name, const char *parent, @@ -260,6 +268,15 @@ struct clk *clk_divider_table(const char *name, struct clk *clk_fixed_factor(const char *name, const char *parent, unsigned int mult, unsigned int div, unsigned flags); +struct clk *clk_fractional_divider_alloc( + const char *name, const char *parent_name, unsigned long flags, + void __iomem *reg, u8 mshift, u8 mwidth, u8 nshift, u8 nwidth, + u8 clk_divider_flags); +struct clk *clk_fractional_divider( + const char *name, const char *parent_name, unsigned long flags, + void __iomem *reg, u8 mshift, u8 mwidth, u8 nshift, u8 nwidth, + u8 clk_divider_flags); +void clk_fractional_divider_free(struct clk *clk_fd); struct clk *clk_mux_alloc(const char *name, void __iomem *reg, u8 shift, u8 width, const char **parents, u8 num_parents, @@ -291,6 +308,12 @@ 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, + struct clk *mux_clk, + struct clk *rate_clk, + struct clk *gate_clk, + unsigned long flags); #endif struct device_node; diff --git a/include/linux/gcd.h b/include/linux/gcd.h new file mode 100644 index 0000000000..0ac262162d --- /dev/null +++ b/include/linux/gcd.h @@ -0,0 +1,8 @@ +#ifndef _GCD_H +#define _GCD_H + +#include <linux/kernel.h> + +unsigned long gcd(unsigned long a, unsigned long b) __attribute_const__; + +#endif /* _GCD_H */ diff --git a/include/linux/kernel.h b/include/linux/kernel.h index 3f2644cf65..5b6b448395 100644 --- a/include/linux/kernel.h +++ b/include/linux/kernel.h @@ -257,5 +257,10 @@ static inline char *hex_byte_pack_upper(char *buf, u8 byte) const typeof( ((type *)0)->member ) *__mptr = (ptr); \ (type *)( (char *)__mptr - offsetof(type,member) );}) +/* + * swap - swap value of @a and @b + */ +#define swap(a, b) \ + do { typeof(a) __tmp = (a); (a) = (b); (b) = __tmp; } while (0) #endif /* _LINUX_KERNEL_H */ |