Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221150
b: refs/heads/master
c: d4b34c6
h: refs/heads/master
v: v3
  • Loading branch information
Seungwhan Youn authored and Kukjin Kim committed Oct 25, 2010
1 parent 5b11340 commit 832c79f
Show file tree
Hide file tree
Showing 9 changed files with 37 additions and 43 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: 900fa0196c564895bfa2eb412d2a83421d3f3444
refs/heads/master: d4b34c6c849d67b7afaa90d55dc7fab981c72950
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-s5p64x0/clock-s5p6440.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ static int s5p6440_epll_set_rate(struct clk *clk, unsigned long rate)
}

static struct clk_ops s5p6440_epll_ops = {
.get_rate = s5p64x0_epll_get_rate,
.get_rate = s5p_epll_get_rate,
.set_rate = s5p6440_epll_set_rate,
};

Expand Down Expand Up @@ -548,7 +548,7 @@ void __init_or_cpufreq s5p6440_setup_clocks(void)

/* Set S5P6440 functions for clk_fout_epll */

clk_fout_epll.enable = s5p64x0_epll_enable;
clk_fout_epll.enable = s5p_epll_enable;
clk_fout_epll.ops = &s5p6440_epll_ops;

clk_48m.enable = s5p64x0_clk48m_ctrl;
Expand Down
4 changes: 2 additions & 2 deletions trunk/arch/arm/mach-s5p64x0/clock-s5p6450.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ static int s5p6450_epll_set_rate(struct clk *clk, unsigned long rate)
}

static struct clk_ops s5p6450_epll_ops = {
.get_rate = s5p64x0_epll_get_rate,
.get_rate = s5p_epll_get_rate,
.set_rate = s5p6450_epll_set_rate,
};

Expand Down Expand Up @@ -581,7 +581,7 @@ void __init_or_cpufreq s5p6450_setup_clocks(void)

/* Set S5P6450 functions for clk_fout_epll */

clk_fout_epll.enable = s5p64x0_epll_enable;
clk_fout_epll.enable = s5p_epll_enable;
clk_fout_epll.ops = &s5p6450_epll_ops;

clk_48m.enable = s5p64x0_clk48m_ctrl;
Expand Down
18 changes: 0 additions & 18 deletions trunk/arch/arm/mach-s5p64x0/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,24 +73,6 @@ static const u32 clock_table[][3] = {
{L2 * 1000, (3 << ARM_DIV_RATIO_SHIFT), (0 << S5P64X0_CLKDIV0_HCLK_SHIFT)},
};

int s5p64x0_epll_enable(struct clk *clk, int enable)
{
unsigned int ctrlbit = clk->ctrlbit;
unsigned int epll_con = __raw_readl(S5P64X0_EPLL_CON) & ~ctrlbit;

if (enable)
__raw_writel(epll_con | ctrlbit, S5P64X0_EPLL_CON);
else
__raw_writel(epll_con, S5P64X0_EPLL_CON);

return 0;
}

unsigned long s5p64x0_epll_get_rate(struct clk *clk)
{
return clk->rate;
}

unsigned long s5p64x0_armclk_get_rate(struct clk *clk)
{
unsigned long rate = clk_get_rate(clk->parent);
Expand Down
2 changes: 2 additions & 0 deletions trunk/arch/arm/mach-s5p64x0/include/mach/regs-clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,4 +60,6 @@
#define ARM_DIV_RATIO_SHIFT 0
#define ARM_DIV_MASK (0xF << ARM_DIV_RATIO_SHIFT)

#define S5P_EPLL_CON S5P64X0_EPLL_CON

#endif /* __ASM_ARCH_REGS_CLOCK_H */
22 changes: 2 additions & 20 deletions trunk/arch/arm/mach-s5pc100/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -273,24 +273,6 @@ static struct clksrc_clk clk_div_hdmi = {
.reg_div = { .reg = S5P_CLK_DIV3, .shift = 28, .size = 4 },
};

static int s5pc100_epll_enable(struct clk *clk, int enable)
{
unsigned int ctrlbit = clk->ctrlbit;
unsigned int epll_con = __raw_readl(S5P_EPLL_CON) & ~ctrlbit;

if (enable)
__raw_writel(epll_con | ctrlbit, S5P_EPLL_CON);
else
__raw_writel(epll_con, S5P_EPLL_CON);

return 0;
}

static unsigned long s5pc100_epll_get_rate(struct clk *clk)
{
return clk->rate;
}

static u32 epll_div[][4] = {
{ 32750000, 131, 3, 4 },
{ 32768000, 131, 3, 4 },
Expand Down Expand Up @@ -347,7 +329,7 @@ static int s5pc100_epll_set_rate(struct clk *clk, unsigned long rate)
}

static struct clk_ops s5pc100_epll_ops = {
.get_rate = s5pc100_epll_get_rate,
.get_rate = s5p_epll_get_rate,
.set_rate = s5pc100_epll_set_rate,
};

Expand Down Expand Up @@ -1261,7 +1243,7 @@ void __init_or_cpufreq s5pc100_setup_clocks(void)
unsigned int ptr;

/* Set S5PC100 functions for clk_fout_epll */
clk_fout_epll.enable = s5pc100_epll_enable;
clk_fout_epll.enable = s5p_epll_enable;
clk_fout_epll.ops = &s5pc100_epll_ops;

printk(KERN_DEBUG "%s: registering clocks\n", __func__);
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/mach-s5pv310/include/mach/regs-clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@

#define S5P_CLKGATE_SCLKCPU S5P_CLKREG(0x14800)

/* Compatibility defines */

#define S5P_EPLL_CON S5P_EPLL_CON0

#endif /* __ASM_ARCH_REGS_CLOCK_H */
20 changes: 20 additions & 0 deletions trunk/arch/arm/plat-s5p/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#include <linux/io.h>
#include <asm/div64.h>

#include <mach/regs-clock.h>

#include <plat/clock.h>
#include <plat/clock-clksrc.h>
#include <plat/s5p-clock.h>
Expand Down Expand Up @@ -148,6 +150,24 @@ int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable)
return 0;
}

int s5p_epll_enable(struct clk *clk, int enable)
{
unsigned int ctrlbit = clk->ctrlbit;
unsigned int epll_con = __raw_readl(S5P_EPLL_CON) & ~ctrlbit;

if (enable)
__raw_writel(epll_con | ctrlbit, S5P_EPLL_CON);
else
__raw_writel(epll_con, S5P_EPLL_CON);

return 0;
}

unsigned long s5p_epll_get_rate(struct clk *clk)
{
return clk->rate;
}

static struct clk *s5p_clks[] __initdata = {
&clk_ext_xtal_mux,
&clk_48m,
Expand Down
4 changes: 4 additions & 0 deletions trunk/arch/arm/plat-s5p/include/plat/s5p-clock.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,8 @@ extern struct clksrc_sources clk_src_dpll;

extern int s5p_gatectrl(void __iomem *reg, struct clk *clk, int enable);

/* Common EPLL operations for S5P platform */
extern int s5p_epll_enable(struct clk *clk, int enable);
extern unsigned long s5p_epll_get_rate(struct clk *clk);

#endif /* __ASM_PLAT_S5P_CLOCK_H */

0 comments on commit 832c79f

Please sign in to comment.