Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 221148
b: refs/heads/master
c: aa21ae3
h: refs/heads/master
v: v3
  • Loading branch information
Seungwhan Youn authored and Kukjin Kim committed Oct 25, 2010
1 parent a32f41b commit 4e495ba
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 10 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: 494edadd6290f6e5d36985e9d04a84ec92d2cea1
refs/heads/master: aa21ae3d87ce355f68c0b1cbc7a45ee03d423232
62 changes: 53 additions & 9 deletions trunk/arch/arm/mach-s5pv210/clock.c
Original file line number Diff line number Diff line change
Expand Up @@ -472,6 +472,12 @@ static struct clk init_clocks_disable[] = {
.parent = &clk_p,
.enable = s5pv210_clk_ip3_ctrl,
.ctrlbit = (1 << 6),
}, {
.name = "spdif",
.id = -1,
.parent = &clk_p,
.enable = s5pv210_clk_ip3_ctrl,
.ctrlbit = (1 << 0),
},
};

Expand Down Expand Up @@ -701,6 +707,53 @@ static struct clksrc_sources clkset_sclk_spdif = {
.nr_sources = ARRAY_SIZE(clkset_sclk_spdif_list),
};

static int s5pv210_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 s5pv210_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 s5pv210_sclk_spdif_ops = {
.set_rate = s5pv210_spdif_set_rate,
.get_rate = s5pv210_spdif_get_rate,
};

static struct clksrc_clk clk_sclk_spdif = {
.clk = {
.name = "sclk_spdif",
.id = -1,
.enable = s5pv210_clk_mask0_ctrl,
.ctrlbit = (1 << 27),
.ops = &s5pv210_sclk_spdif_ops,
},
.sources = &clkset_sclk_spdif,
.reg_src = { .reg = S5P_CLK_SRC6, .shift = 12, .size = 2 },
};

static struct clk *clkset_group2_list[] = {
[0] = &clk_ext_xtal_mux,
[1] = &clk_xusbxti,
Expand Down Expand Up @@ -784,15 +837,6 @@ static struct clksrc_clk clksrcs[] = {
},
.sources = &clkset_sclk_mixer,
.reg_src = { .reg = S5P_CLK_SRC1, .shift = 4, .size = 1 },
}, {
.clk = {
.name = "sclk_spdif",
.id = -1,
.enable = s5pv210_clk_mask0_ctrl,
.ctrlbit = (1 << 27),
},
.sources = &clkset_sclk_spdif,
.reg_src = { .reg = S5P_CLK_SRC6, .shift = 12, .size = 2 },
}, {
.clk = {
.name = "sclk_fimc",
Expand Down

0 comments on commit 4e495ba

Please sign in to comment.