diff options
author | Mark Brown <broonie@linaro.org> | 2013-06-26 07:45:59 -0400 |
---|---|---|
committer | Mark Brown <broonie@linaro.org> | 2013-06-27 04:48:42 -0400 |
commit | b047e1cce8fe32475ab61846772943a5e4c0a908 (patch) | |
tree | 9d04d8101d161b96f96c2e2e5bd03900011828ec /sound/soc/au1x/ac97c.c | |
parent | b49dff8cb61cd4715991612e2eb6905b73a0be78 (diff) |
ASoC: ac97: Support multi-platform AC'97
Currently we can only have a single platform built in with AC'97 support
due to the use of a global variable to provide the bus operations. Fix
this by making that variable a pointer and having the bus drivers set the
operations prior to registering.
This is not a particularly good or nice approach but it avoids blocking
multiplatform and a real fix involves fixing the fairly deep problems
with AC'97 support - we should be converting it to a real bus.
Acked-by: Arnd Bergmann <arnd@arndb.de>
Reviewed-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Diffstat (limited to 'sound/soc/au1x/ac97c.c')
-rw-r--r-- | sound/soc/au1x/ac97c.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/sound/soc/au1x/ac97c.c b/sound/soc/au1x/ac97c.c index a51dabe20cbb..d6f7694fcad4 100644 --- a/sound/soc/au1x/ac97c.c +++ b/sound/soc/au1x/ac97c.c | |||
@@ -179,13 +179,12 @@ static void au1xac97c_ac97_cold_reset(struct snd_ac97 *ac97) | |||
179 | } | 179 | } |
180 | 180 | ||
181 | /* AC97 controller operations */ | 181 | /* AC97 controller operations */ |
182 | struct snd_ac97_bus_ops soc_ac97_ops = { | 182 | static struct snd_ac97_bus_ops ac97c_bus_ops = { |
183 | .read = au1xac97c_ac97_read, | 183 | .read = au1xac97c_ac97_read, |
184 | .write = au1xac97c_ac97_write, | 184 | .write = au1xac97c_ac97_write, |
185 | .reset = au1xac97c_ac97_cold_reset, | 185 | .reset = au1xac97c_ac97_cold_reset, |
186 | .warm_reset = au1xac97c_ac97_warm_reset, | 186 | .warm_reset = au1xac97c_ac97_warm_reset, |
187 | }; | 187 | }; |
188 | EXPORT_SYMBOL_GPL(soc_ac97_ops); /* globals be gone! */ | ||
189 | 188 | ||
190 | static int alchemy_ac97c_startup(struct snd_pcm_substream *substream, | 189 | static int alchemy_ac97c_startup(struct snd_pcm_substream *substream, |
191 | struct snd_soc_dai *dai) | 190 | struct snd_soc_dai *dai) |
@@ -272,6 +271,10 @@ static int au1xac97c_drvprobe(struct platform_device *pdev) | |||
272 | 271 | ||
273 | platform_set_drvdata(pdev, ctx); | 272 | platform_set_drvdata(pdev, ctx); |
274 | 273 | ||
274 | ret = snd_soc_set_ac97_ops(&ac97c_bus_ops); | ||
275 | if (ret) | ||
276 | return ret; | ||
277 | |||
275 | ret = snd_soc_register_component(&pdev->dev, &au1xac97c_component, | 278 | ret = snd_soc_register_component(&pdev->dev, &au1xac97c_component, |
276 | &au1xac97c_dai_driver, 1); | 279 | &au1xac97c_dai_driver, 1); |
277 | if (ret) | 280 | if (ret) |