Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221146
b: refs/heads/master
c: 04a4fd0
h: refs/heads/master
v: v3
  • Loading branch information
Seungwhan Youn authored and Kukjin Kim committed Oct 25, 2010
1 parent af0c431 commit aeec22c
Show file tree
Hide file tree
Showing 2 changed files with 60 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4cfd9c2530822860d745154e4e64a1c241a0a674
refs/heads/master: 04a4fd0ae2c58943a7435de879b9714c96a1e96a
59 changes: 59 additions & 0 deletions trunk/arch/arm/mach-s5pc100/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,6 +980,64 @@ struct clksrc_sources clk_src_pwi = {
.nr_sources = ARRAY_SIZE(clk_src_pwi_list),
};

static struct clk *clk_sclk_spdif_list[] = {
[0] = &clk_sclk_audio0.clk,
[1] = &clk_sclk_audio1.clk,
[2] = &clk_sclk_audio2.clk,
};

struct clksrc_sources clk_src_sclk_spdif = {
.sources = clk_sclk_spdif_list,
.nr_sources = ARRAY_SIZE(clk_sclk_spdif_list),
};

static int s5pc100_spdif_set_rate(struct clk *clk, unsigned long rate)
{
struct clk *pclk;
int ret;

pclk = clk_get_parent(clk);
if (IS_ERR(pclk))
return -EINVAL;

ret = pclk->ops->set_rate(pclk, rate);
clk_put(pclk);

return ret;
}

static unsigned long s5pc100_spdif_get_rate(struct clk *clk)
{
struct clk *pclk;
int rate;

pclk = clk_get_parent(clk);
if (IS_ERR(pclk))
return -EINVAL;

rate = pclk->ops->get_rate(clk);
clk_put(pclk);

return rate;
}

static struct clk_ops s5pc100_sclk_spdif_ops = {
.set_rate = s5pc100_spdif_set_rate,
.get_rate = s5pc100_spdif_get_rate,
};

static struct clksrc_clk clk_sclk_spdif = {
.clk = {
.name = "sclk_spdif",
.id = -1,
.ctrlbit = (1 << 11),
.enable = s5pc100_sclk1_ctrl,
.ops = &s5pc100_sclk_spdif_ops,
},
.sources = &clk_src_sclk_spdif,
.reg_src = { .reg = S5P_CLK_SRC3, .shift = 24, .size = 2 },
};

static struct clksrc_clk clksrcs[] = {
{
.clk = {
Expand Down Expand Up @@ -1185,6 +1243,7 @@ static struct clksrc_clk *sysclks[] = {
&clk_sclk_audio0,
&clk_sclk_audio1,
&clk_sclk_audio2,
&clk_sclk_spdif,
};

void __init_or_cpufreq s5pc100_setup_clocks(void)
Expand Down

0 comments on commit aeec22c

Please sign in to comment.