diff options
author | Guennadi Liakhovetski <g.liakhovetski@gmx.de> | 2010-09-17 06:30:11 -0400 |
---|---|---|
committer | Mark Brown <broonie@opensource.wolfsonmicro.com> | 2010-09-19 11:02:47 -0400 |
commit | cbfa5184cc5f58627f08c7fad225424f565b439d (patch) | |
tree | e3e5083c1179fd72d567afd03f39f7b548a62d33 /sound | |
parent | 708fafb3c54039caa5dadc8e9d2dfd999f88f190 (diff) |
ASoC: fix clkdev API usage in sh/migor.c
The clkdev API doesn't use .name and .id members of struct clk for clock
lookup. Instead clocks should be added to a lookup list. Without this patch
audio om the Migo-R board fails silently.
Signed-off-by: Guennadi Liakhovetski <g.liakhovetski@gmx.de>
Acked-by: Liam Girdwood <lrg@slimlogic.co.uk>
Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound')
-rw-r--r-- | sound/soc/sh/migor.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/sound/soc/sh/migor.c b/sound/soc/sh/migor.c index b823a5c9b9bc..87e2b7fcbf17 100644 --- a/sound/soc/sh/migor.c +++ b/sound/soc/sh/migor.c | |||
@@ -12,6 +12,7 @@ | |||
12 | #include <linux/firmware.h> | 12 | #include <linux/firmware.h> |
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | 14 | ||
15 | #include <asm/clkdev.h> | ||
15 | #include <asm/clock.h> | 16 | #include <asm/clock.h> |
16 | 17 | ||
17 | #include <cpu/sh7722.h> | 18 | #include <cpu/sh7722.h> |
@@ -40,12 +41,12 @@ static struct clk_ops siumckb_clk_ops = { | |||
40 | }; | 41 | }; |
41 | 42 | ||
42 | static struct clk siumckb_clk = { | 43 | static struct clk siumckb_clk = { |
43 | .name = "siumckb_clk", | ||
44 | .id = -1, | ||
45 | .ops = &siumckb_clk_ops, | 44 | .ops = &siumckb_clk_ops, |
46 | .rate = 0, /* initialised at run-time */ | 45 | .rate = 0, /* initialised at run-time */ |
47 | }; | 46 | }; |
48 | 47 | ||
48 | static struct clk_lookup *siumckb_lookup; | ||
49 | |||
49 | static int migor_hw_params(struct snd_pcm_substream *substream, | 50 | static int migor_hw_params(struct snd_pcm_substream *substream, |
50 | struct snd_pcm_hw_params *params) | 51 | struct snd_pcm_hw_params *params) |
51 | { | 52 | { |
@@ -180,6 +181,13 @@ static int __init migor_init(void) | |||
180 | if (ret < 0) | 181 | if (ret < 0) |
181 | return ret; | 182 | return ret; |
182 | 183 | ||
184 | siumckb_lookup = clkdev_alloc(&siumckb_clk, "siumckb_clk", NULL); | ||
185 | if (!siumckb_lookup) { | ||
186 | ret = -ENOMEM; | ||
187 | goto eclkdevalloc; | ||
188 | } | ||
189 | clkdev_add(siumckb_lookup); | ||
190 | |||
183 | /* Port number used on this machine: port B */ | 191 | /* Port number used on this machine: port B */ |
184 | migor_snd_device = platform_device_alloc("soc-audio", 1); | 192 | migor_snd_device = platform_device_alloc("soc-audio", 1); |
185 | if (!migor_snd_device) { | 193 | if (!migor_snd_device) { |
@@ -200,12 +208,15 @@ static int __init migor_init(void) | |||
200 | epdevadd: | 208 | epdevadd: |
201 | platform_device_put(migor_snd_device); | 209 | platform_device_put(migor_snd_device); |
202 | epdevalloc: | 210 | epdevalloc: |
211 | clkdev_drop(siumckb_lookup); | ||
212 | eclkdevalloc: | ||
203 | clk_unregister(&siumckb_clk); | 213 | clk_unregister(&siumckb_clk); |
204 | return ret; | 214 | return ret; |
205 | } | 215 | } |
206 | 216 | ||
207 | static void __exit migor_exit(void) | 217 | static void __exit migor_exit(void) |
208 | { | 218 | { |
219 | clkdev_drop(siumckb_lookup); | ||
209 | clk_unregister(&siumckb_clk); | 220 | clk_unregister(&siumckb_clk); |
210 | platform_device_unregister(migor_snd_device); | 221 | platform_device_unregister(migor_snd_device); |
211 | } | 222 | } |