Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 181224
b: refs/heads/master
c: 0a5f337
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Feb 22, 2010
1 parent f14cb84 commit 3acba15
Show file tree
Hide file tree
Showing 10 changed files with 52 additions and 18 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: de7ca2144c36291a491bd39afad172f56432a4bb
refs/heads/master: 0a5f337ecd20e70e84a5cfc0f2c24d0366087026
10 changes: 7 additions & 3 deletions trunk/arch/sh/include/asm/clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,16 @@ int sh_clk_mstp32_register(struct clk *clks, int nr);
.flags = _flags, \
}

struct clk_div4_table {
struct clk_div_mult_table *div_mult_table;
};

int sh_clk_div4_register(struct clk *clks, int nr,
struct clk_div_mult_table *table);
struct clk_div4_table *table);
int sh_clk_div4_enable_register(struct clk *clks, int nr,
struct clk_div_mult_table *table);
struct clk_div4_table *table);
int sh_clk_div4_reparent_register(struct clk *clks, int nr,
struct clk_div_mult_table *table);
struct clk_div4_table *table);

#define SH_CLK_DIV6(_name, _parent, _reg, _flags) \
{ \
Expand Down
16 changes: 9 additions & 7 deletions trunk/arch/sh/kernel/cpu/clock-cpg.c
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ int __init sh_clk_div6_register(struct clk *clks, int nr)

static unsigned long sh_clk_div4_recalc(struct clk *clk)
{
struct clk_div_mult_table *table = clk->priv;
struct clk_div4_table *d4t = clk->priv;
struct clk_div_mult_table *table = d4t->div_mult_table;
unsigned int idx;

clk_rate_table_build(clk, clk->freq_table, table->nr_divisors,
Expand All @@ -162,7 +163,8 @@ static unsigned long sh_clk_div4_recalc(struct clk *clk)

static int sh_clk_div4_set_parent(struct clk *clk, struct clk *parent)
{
struct clk_div_mult_table *table = clk->priv;
struct clk_div4_table *d4t = clk->priv;
struct clk_div_mult_table *table = d4t->div_mult_table;
u32 value;
int ret;

Expand Down Expand Up @@ -234,11 +236,11 @@ static struct clk_ops sh_clk_div4_reparent_clk_ops = {
};

static int __init sh_clk_div4_register_ops(struct clk *clks, int nr,
struct clk_div_mult_table *table, struct clk_ops *ops)
struct clk_div4_table *table, struct clk_ops *ops)
{
struct clk *clkp;
void *freq_table;
int nr_divs = table->nr_divisors;
int nr_divs = table->div_mult_table->nr_divisors;
int freq_table_size = sizeof(struct cpufreq_frequency_table);
int ret = 0;
int k;
Expand Down Expand Up @@ -267,20 +269,20 @@ static int __init sh_clk_div4_register_ops(struct clk *clks, int nr,
}

int __init sh_clk_div4_register(struct clk *clks, int nr,
struct clk_div_mult_table *table)
struct clk_div4_table *table)
{
return sh_clk_div4_register_ops(clks, nr, table, &sh_clk_div4_clk_ops);
}

int __init sh_clk_div4_enable_register(struct clk *clks, int nr,
struct clk_div_mult_table *table)
struct clk_div4_table *table)
{
return sh_clk_div4_register_ops(clks, nr, table,
&sh_clk_div4_enable_clk_ops);
}

int __init sh_clk_div4_reparent_register(struct clk *clks, int nr,
struct clk_div_mult_table *table)
struct clk_div4_table *table)
{
return sh_clk_div4_register_ops(clks, nr, table,
&sh_clk_div4_reparent_clk_ops);
Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/sh/kernel/cpu/sh4a/clock-sh7343.c
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,17 @@ struct clk *main_clks[] = {
static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 };

static struct clk_div_mult_table div4_table = {
static struct clk_div_mult_table div4_div_mult_table = {
.divisors = divisors,
.nr_divisors = ARRAY_SIZE(divisors),
.multipliers = multipliers,
.nr_multipliers = ARRAY_SIZE(multipliers),
};

static struct clk_div4_table div4_table = {
.div_mult_table = &div4_div_mult_table,
};

enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P,
DIV4_SIUA, DIV4_SIUB, DIV4_NR };

Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/sh/kernel/cpu/sh4a/clock-sh7366.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,17 @@ struct clk *main_clks[] = {
static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 };

static struct clk_div_mult_table div4_table = {
static struct clk_div_mult_table div4_div_mult_table = {
.divisors = divisors,
.nr_divisors = ARRAY_SIZE(divisors),
.multipliers = multipliers,
.nr_multipliers = ARRAY_SIZE(multipliers),
};

static struct clk_div4_table div4_table = {
.div_mult_table = &div4_div_mult_table,
};

enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P,
DIV4_SIUA, DIV4_SIUB, DIV4_NR };

Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,17 @@ struct clk *main_clks[] = {
static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 };

static struct clk_div_mult_table div4_table = {
static struct clk_div_mult_table div4_div_mult_table = {
.divisors = divisors,
.nr_divisors = ARRAY_SIZE(divisors),
.multipliers = multipliers,
.nr_multipliers = ARRAY_SIZE(multipliers),
};

static struct clk_div4_table div4_table = {
.div_mult_table = &div4_div_mult_table,
};

#define DIV4(_str, _reg, _bit, _mask, _flags) \
SH_CLK_DIV4(_str, &pll_clk, _reg, _bit, _mask, _flags)

Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/sh/kernel/cpu/sh4a/clock-sh7723.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,17 @@ struct clk *main_clks[] = {
static int multipliers[] = { 1, 2, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
static int divisors[] = { 1, 3, 2, 5, 3, 4, 5, 6, 8, 10, 12, 16, 20 };

static struct clk_div_mult_table div4_table = {
static struct clk_div_mult_table div4_div_mult_table = {
.divisors = divisors,
.nr_divisors = ARRAY_SIZE(divisors),
.multipliers = multipliers,
.nr_multipliers = ARRAY_SIZE(multipliers),
};

static struct clk_div4_table div4_table = {
.div_mult_table = &div4_div_mult_table,
};

enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_B3, DIV4_P, DIV4_NR };

#define DIV4(_str, _reg, _bit, _mask, _flags) \
Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/sh/kernel/cpu/sh4a/clock-sh7724.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,15 @@ struct clk *main_clks[] = {

static int divisors[] = { 2, 3, 4, 6, 8, 12, 16, 0, 24, 32, 36, 48, 0, 72 };

static struct clk_div_mult_table div4_table = {
static struct clk_div_mult_table div4_div_mult_table = {
.divisors = divisors,
.nr_divisors = ARRAY_SIZE(divisors),
};

static struct clk_div4_table div4_table = {
.div_mult_table = &div4_div_mult_table,
};

enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_P, DIV4_M1, DIV4_NR };

#define DIV4(_str, _reg, _bit, _mask, _flags) \
Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/sh/kernel/cpu/sh4a/clock-sh7785.c
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,15 @@ static struct clk *clks[] = {
static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18,
24, 32, 36, 48 };

static struct clk_div_mult_table div4_table = {
static struct clk_div_mult_table div4_div_mult_table = {
.divisors = div2,
.nr_divisors = ARRAY_SIZE(div2),
};

static struct clk_div4_table div4_table = {
.div_mult_table = &div4_div_mult_table,
};

enum { DIV4_I, DIV4_U, DIV4_SH, DIV4_B, DIV4_DDR, DIV4_GA,
DIV4_DU, DIV4_P, DIV4_NR };

Expand Down
6 changes: 5 additions & 1 deletion trunk/arch/sh/kernel/cpu/sh4a/clock-sh7786.c
Original file line number Diff line number Diff line change
Expand Up @@ -59,11 +59,15 @@ static struct clk *clks[] = {
static unsigned int div2[] = { 1, 2, 4, 6, 8, 12, 16, 18,
24, 32, 36, 48 };

static struct clk_div_mult_table div4_table = {
static struct clk_div_mult_table div4_div_mult_table = {
.divisors = div2,
.nr_divisors = ARRAY_SIZE(div2),
};

static struct clk_div4_table div4_table = {
.div_mult_table = &div4_div_mult_table,
};

enum { DIV4_I, DIV4_SH, DIV4_B, DIV4_DDR, DIV4_DU, DIV4_P, DIV4_NR };

#define DIV4(_str, _bit, _mask, _flags) \
Expand Down

0 comments on commit 3acba15

Please sign in to comment.