Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 106854
b: refs/heads/master
c: 1312994
h: refs/heads/master
v: v3
  • Loading branch information
Magnus Damm authored and Paul Mundt committed Jul 28, 2008
1 parent 2b09254 commit 840e9f7
Show file tree
Hide file tree
Showing 4 changed files with 42 additions and 131 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: aea167cbb5c9056295109e5e171d27e30e2be5bc
refs/heads/master: 1312994c8008d66806d9452c15d50df86a031437
2 changes: 1 addition & 1 deletion trunk/arch/sh/kernel/cpu/sh4a/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ clock-$(CONFIG_CPU_SUBTYPE_SH7763) := clock-sh7763.o
clock-$(CONFIG_CPU_SUBTYPE_SH7770) := clock-sh7770.o
clock-$(CONFIG_CPU_SUBTYPE_SH7780) := clock-sh7780.o
clock-$(CONFIG_CPU_SUBTYPE_SH7785) := clock-sh7785.o
clock-$(CONFIG_CPU_SUBTYPE_SH7343) := clock-sh7343.o
clock-$(CONFIG_CPU_SUBTYPE_SH7343) := clock-sh7722.o
clock-$(CONFIG_CPU_SUBTYPE_SH7722) := clock-sh7722.o
clock-$(CONFIG_CPU_SUBTYPE_SH7723) := clock-sh7722.o
clock-$(CONFIG_CPU_SUBTYPE_SH7366) := clock-sh7722.o
Expand Down
99 changes: 0 additions & 99 deletions trunk/arch/sh/kernel/cpu/sh4a/clock-sh7343.c

This file was deleted.

70 changes: 40 additions & 30 deletions trunk/arch/sh/kernel/cpu/sh4a/clock-sh7722.c
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/*
* arch/sh/kernel/cpu/sh4a/clock-sh7722.c
*
* SH7722 & SH7366 support for the clock framework
* SH7343, SH7722, SH7723 & SH7366 support for the clock framework
*
* Copyright (c) 2006-2007 Nomad Global Solutions Inc
* Based on code for sh7343 by Paul Mundt
Expand Down Expand Up @@ -413,6 +413,30 @@ static struct clk_ops sh7722_frqcr_clk_ops = {
*
*/

#ifndef CONFIG_CPU_SUBTYPE_SH7343

static int sh7722_siu_set_rate(struct clk *clk, unsigned long rate, int algo_id)
{
unsigned long r;
int div;

r = ctrl_inl(clk->arch_flags);
div = sh7722_find_divisors(clk->parent->rate, rate);
if (div < 0)
return div;
r = (r & ~0xF) | div;
ctrl_outl(r, clk->arch_flags);
return 0;
}

static void sh7722_siu_recalc(struct clk *clk)
{
unsigned long r;

r = ctrl_inl(clk->arch_flags);
clk->rate = clk->parent->rate * 2 / divisors2[r & 0xF];
}

static int sh7722_siu_start_stop(struct clk *clk, int enable)
{
unsigned long r;
Expand All @@ -435,6 +459,15 @@ static void sh7722_siu_disable(struct clk *clk)
sh7722_siu_start_stop(clk, 0);
}

static struct clk_ops sh7722_siu_clk_ops = {
.recalc = sh7722_siu_recalc,
.set_rate = sh7722_siu_set_rate,
.enable = sh7722_siu_enable,
.disable = sh7722_siu_disable,
};

#endif /* CONFIG_CPU_SUBTYPE_SH7343 */

static void sh7722_video_enable(struct clk *clk)
{
unsigned long r;
Expand Down Expand Up @@ -471,35 +504,6 @@ static void sh7722_video_recalc(struct clk *clk)
clk->rate = clk->parent->rate / ((r & 0x3F) + 1);
}

static int sh7722_siu_set_rate(struct clk *clk, unsigned long rate, int algo_id)
{
unsigned long r;
int div;

r = ctrl_inl(clk->arch_flags);
div = sh7722_find_divisors(clk->parent->rate, rate);
if (div < 0)
return div;
r = (r & ~0xF) | div;
ctrl_outl(r, clk->arch_flags);
return 0;
}

static void sh7722_siu_recalc(struct clk *clk)
{
unsigned long r;

r = ctrl_inl(clk->arch_flags);
clk->rate = clk->parent->rate * 2 / divisors2[r & 0xF];
}

static struct clk_ops sh7722_siu_clk_ops = {
.recalc = sh7722_siu_recalc,
.set_rate = sh7722_siu_set_rate,
.enable = sh7722_siu_enable,
.disable = sh7722_siu_disable,
};

static struct clk_ops sh7722_video_clk_ops = {
.recalc = sh7722_video_recalc,
.set_rate = sh7722_video_set_rate,
Expand Down Expand Up @@ -529,6 +533,9 @@ static struct clk sh7722_sdram_clock = {
.ops = &sh7722_frqcr_clk_ops,
};


#ifndef CONFIG_CPU_SUBTYPE_SH7343

/*
* these three clocks - SIU A, SIU B, IrDA - share the same clk_ops
* methods of clk_ops determine which register they should access by
Expand All @@ -553,6 +560,7 @@ static struct clk sh7722_irda_clock = {
.ops = &sh7722_siu_clk_ops,
};
#endif
#endif /* CONFIG_CPU_SUBTYPE_SH7343 */

static struct clk sh7722_video_clock = {
.name = "video_clk",
Expand Down Expand Up @@ -673,10 +681,12 @@ static struct clk *sh7722_clocks[] = {
&sh7722_sh_clock,
&sh7722_peripheral_clock,
&sh7722_sdram_clock,
#ifndef CONFIG_CPU_SUBTYPE_SH7343
&sh7722_siu_a_clock,
&sh7722_siu_b_clock,
#if defined(CONFIG_CPU_SUBTYPE_SH7722)
&sh7722_irda_clock,
#endif
#endif
&sh7722_video_clock,
};
Expand Down

0 comments on commit 840e9f7

Please sign in to comment.