mtd: nand: lpc32xx_slc: fix potential overflow over 4 bits
[linux-2.6/btrfs-unstable.git] / arch / arm / mach-shmobile / clock.h
blobcf3552ea10192d2a82502c1b0b9fe0b06704376c
1 #ifndef CLOCK_H
2 #define CLOCK_H
4 /* legacy clock implementation */
6 struct clk;
7 unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk);
8 extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops;
10 /* clock ratio */
11 struct clk_ratio {
12 int mul;
13 int div;
16 #define SH_CLK_RATIO(name, m, d) \
17 static struct clk_ratio name ##_ratio = { \
18 .mul = m, \
19 .div = d, \
22 #define SH_FIXED_RATIO_CLKg(name, p, r) \
23 struct clk name = { \
24 .parent = &p, \
25 .ops = &shmobile_fixed_ratio_clk_ops,\
26 .priv = &r ## _ratio, \
29 #define SH_FIXED_RATIO_CLK(name, p, r) \
30 static SH_FIXED_RATIO_CLKg(name, p, r)
32 #define SH_FIXED_RATIO_CLK_SET(name, p, m, d) \
33 SH_CLK_RATIO(name, m, d); \
34 SH_FIXED_RATIO_CLK(name, p, name)
36 #define SH_CLK_SET_RATIO(p, m, d) \
37 do { \
38 (p)->mul = m; \
39 (p)->div = d; \
40 } while (0)
42 #endif