2013-03-27 08:55:41 +01:00
|
|
|
#ifndef CLOCK_H
|
|
|
|
#define CLOCK_H
|
|
|
|
|
2014-03-13 00:36:17 +01:00
|
|
|
/* legacy clock implementation */
|
|
|
|
|
2014-05-14 03:10:16 +02:00
|
|
|
struct clk;
|
2013-03-27 08:55:41 +01:00
|
|
|
unsigned long shmobile_fixed_ratio_clk_recalc(struct clk *clk);
|
|
|
|
extern struct sh_clk_ops shmobile_fixed_ratio_clk_ops;
|
|
|
|
|
|
|
|
/* clock ratio */
|
|
|
|
struct clk_ratio {
|
|
|
|
int mul;
|
|
|
|
int div;
|
|
|
|
};
|
|
|
|
|
|
|
|
#define SH_CLK_RATIO(name, m, d) \
|
|
|
|
static struct clk_ratio name ##_ratio = { \
|
|
|
|
.mul = m, \
|
|
|
|
.div = d, \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define SH_FIXED_RATIO_CLKg(name, p, r) \
|
|
|
|
struct clk name = { \
|
|
|
|
.parent = &p, \
|
|
|
|
.ops = &shmobile_fixed_ratio_clk_ops,\
|
|
|
|
.priv = &r ## _ratio, \
|
|
|
|
}
|
|
|
|
|
|
|
|
#define SH_FIXED_RATIO_CLK(name, p, r) \
|
2013-04-04 09:05:42 +02:00
|
|
|
static SH_FIXED_RATIO_CLKg(name, p, r)
|
2013-03-27 08:55:41 +01:00
|
|
|
|
|
|
|
#define SH_FIXED_RATIO_CLK_SET(name, p, m, d) \
|
|
|
|
SH_CLK_RATIO(name, m, d); \
|
2013-04-04 09:05:42 +02:00
|
|
|
SH_FIXED_RATIO_CLK(name, p, name)
|
2013-03-27 08:55:41 +01:00
|
|
|
|
|
|
|
#define SH_CLK_SET_RATIO(p, m, d) \
|
2013-04-12 09:41:07 +02:00
|
|
|
do { \
|
2013-03-27 08:55:41 +01:00
|
|
|
(p)->mul = m; \
|
|
|
|
(p)->div = d; \
|
2013-04-12 09:41:07 +02:00
|
|
|
} while (0)
|
2013-03-27 08:55:41 +01:00
|
|
|
|
|
|
|
#endif
|