diff options
Diffstat (limited to 'arch/arm/plat-s5p/clock.c')
-rw-r--r-- | arch/arm/plat-s5p/clock.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/arch/arm/plat-s5p/clock.c b/arch/arm/plat-s5p/clock.c index 8d081d968c58..02af235298e2 100644 --- a/arch/arm/plat-s5p/clock.c +++ b/arch/arm/plat-s5p/clock.c | |||
@@ -168,6 +168,41 @@ unsigned long s5p_epll_get_rate(struct clk *clk) | |||
168 | return clk->rate; | 168 | return clk->rate; |
169 | } | 169 | } |
170 | 170 | ||
171 | int s5p_spdif_set_rate(struct clk *clk, unsigned long rate) | ||
172 | { | ||
173 | struct clk *pclk; | ||
174 | int ret; | ||
175 | |||
176 | pclk = clk_get_parent(clk); | ||
177 | if (IS_ERR(pclk)) | ||
178 | return -EINVAL; | ||
179 | |||
180 | ret = pclk->ops->set_rate(pclk, rate); | ||
181 | clk_put(pclk); | ||
182 | |||
183 | return ret; | ||
184 | } | ||
185 | |||
186 | unsigned long s5p_spdif_get_rate(struct clk *clk) | ||
187 | { | ||
188 | struct clk *pclk; | ||
189 | int rate; | ||
190 | |||
191 | pclk = clk_get_parent(clk); | ||
192 | if (IS_ERR(pclk)) | ||
193 | return -EINVAL; | ||
194 | |||
195 | rate = pclk->ops->get_rate(clk); | ||
196 | clk_put(pclk); | ||
197 | |||
198 | return rate; | ||
199 | } | ||
200 | |||
201 | struct clk_ops s5p_sclk_spdif_ops = { | ||
202 | .set_rate = s5p_spdif_set_rate, | ||
203 | .get_rate = s5p_spdif_get_rate, | ||
204 | }; | ||
205 | |||
171 | static struct clk *s5p_clks[] __initdata = { | 206 | static struct clk *s5p_clks[] __initdata = { |
172 | &clk_ext_xtal_mux, | 207 | &clk_ext_xtal_mux, |
173 | &clk_48m, | 208 | &clk_48m, |