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/blackfin | |
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/blackfin')
-rw-r--r-- | sound/soc/blackfin/bf5xx-ac97.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/sound/soc/blackfin/bf5xx-ac97.c b/sound/soc/blackfin/bf5xx-ac97.c index 024e2dbe6c7f..c5af677ba49c 100644 --- a/sound/soc/blackfin/bf5xx-ac97.c +++ b/sound/soc/blackfin/bf5xx-ac97.c | |||
@@ -198,13 +198,12 @@ static void bf5xx_ac97_cold_reset(struct snd_ac97 *ac97) | |||
198 | #endif | 198 | #endif |
199 | } | 199 | } |
200 | 200 | ||
201 | struct snd_ac97_bus_ops soc_ac97_ops = { | 201 | static struct snd_ac97_bus_ops bf5xx_ac97_ops = { |
202 | .read = bf5xx_ac97_read, | 202 | .read = bf5xx_ac97_read, |
203 | .write = bf5xx_ac97_write, | 203 | .write = bf5xx_ac97_write, |
204 | .warm_reset = bf5xx_ac97_warm_reset, | 204 | .warm_reset = bf5xx_ac97_warm_reset, |
205 | .reset = bf5xx_ac97_cold_reset, | 205 | .reset = bf5xx_ac97_cold_reset, |
206 | }; | 206 | }; |
207 | EXPORT_SYMBOL_GPL(soc_ac97_ops); | ||
208 | 207 | ||
209 | #ifdef CONFIG_PM | 208 | #ifdef CONFIG_PM |
210 | static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) | 209 | static int bf5xx_ac97_suspend(struct snd_soc_dai *dai) |
@@ -336,6 +335,12 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev) | |||
336 | goto sport_config_err; | 335 | goto sport_config_err; |
337 | } | 336 | } |
338 | 337 | ||
338 | ret = snd_soc_set_ac97_ops(&bf5xx_ac97_ops); | ||
339 | if (ret != 0) { | ||
340 | dev_err(&pdev->dev, "Failed to set AC'97 ops: %d\n", ret); | ||
341 | goto sport_config_err; | ||
342 | } | ||
343 | |||
339 | ret = snd_soc_register_component(&pdev->dev, &bfin_ac97_component, | 344 | ret = snd_soc_register_component(&pdev->dev, &bfin_ac97_component, |
340 | &bfin_ac97_dai, 1); | 345 | &bfin_ac97_dai, 1); |
341 | if (ret) { | 346 | if (ret) { |
@@ -350,6 +355,7 @@ static int asoc_bfin_ac97_probe(struct platform_device *pdev) | |||
350 | sport_config_err: | 355 | sport_config_err: |
351 | sport_done(sport_handle); | 356 | sport_done(sport_handle); |
352 | sport_err: | 357 | sport_err: |
358 | snd_soc_set_ac97_ops(NULL); | ||
353 | 359 | ||
354 | return ret; | 360 | return ret; |
355 | } | 361 | } |
@@ -360,6 +366,7 @@ static int asoc_bfin_ac97_remove(struct platform_device *pdev) | |||
360 | 366 | ||
361 | snd_soc_unregister_component(&pdev->dev); | 367 | snd_soc_unregister_component(&pdev->dev); |
362 | sport_done(sport_handle); | 368 | sport_done(sport_handle); |
369 | snd_soc_set_ac97_ops(NULL); | ||
363 | 370 | ||
364 | return 0; | 371 | return 0; |
365 | } | 372 | } |