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/pxa | |
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/pxa')
-rw-r--r-- | sound/soc/pxa/pxa2xx-ac97.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/sound/soc/pxa/pxa2xx-ac97.c b/sound/soc/pxa/pxa2xx-ac97.c index 57ea8e6c5488..a3c22ba25f08 100644 --- a/sound/soc/pxa/pxa2xx-ac97.c +++ b/sound/soc/pxa/pxa2xx-ac97.c | |||
@@ -41,13 +41,12 @@ static void pxa2xx_ac97_cold_reset(struct snd_ac97 *ac97) | |||
41 | pxa2xx_ac97_finish_reset(ac97); | 41 | pxa2xx_ac97_finish_reset(ac97); |
42 | } | 42 | } |
43 | 43 | ||
44 | struct snd_ac97_bus_ops soc_ac97_ops = { | 44 | static struct snd_ac97_bus_ops pxa2xx_ac97_ops = { |
45 | .read = pxa2xx_ac97_read, | 45 | .read = pxa2xx_ac97_read, |
46 | .write = pxa2xx_ac97_write, | 46 | .write = pxa2xx_ac97_write, |
47 | .warm_reset = pxa2xx_ac97_warm_reset, | 47 | .warm_reset = pxa2xx_ac97_warm_reset, |
48 | .reset = pxa2xx_ac97_cold_reset, | 48 | .reset = pxa2xx_ac97_cold_reset, |
49 | }; | 49 | }; |
50 | EXPORT_SYMBOL_GPL(soc_ac97_ops); | ||
51 | 50 | ||
52 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_out = { | 51 | static struct pxa2xx_pcm_dma_params pxa2xx_ac97_pcm_stereo_out = { |
53 | .name = "AC97 PCM Stereo out", | 52 | .name = "AC97 PCM Stereo out", |
@@ -244,6 +243,10 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) | |||
244 | return -ENXIO; | 243 | return -ENXIO; |
245 | } | 244 | } |
246 | 245 | ||
246 | ret = snd_soc_set_ac97_ops(&pxa2xx_ac97_ops); | ||
247 | if (ret != 0) | ||
248 | return ret; | ||
249 | |||
247 | /* Punt most of the init to the SoC probe; we may need the machine | 250 | /* Punt most of the init to the SoC probe; we may need the machine |
248 | * driver to do interesting things with the clocking to get us up | 251 | * driver to do interesting things with the clocking to get us up |
249 | * and running. | 252 | * and running. |
@@ -255,6 +258,7 @@ static int pxa2xx_ac97_dev_probe(struct platform_device *pdev) | |||
255 | static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) | 258 | static int pxa2xx_ac97_dev_remove(struct platform_device *pdev) |
256 | { | 259 | { |
257 | snd_soc_unregister_component(&pdev->dev); | 260 | snd_soc_unregister_component(&pdev->dev); |
261 | snd_soc_set_ac97_ops(NULL); | ||
258 | return 0; | 262 | return 0; |
259 | } | 263 | } |
260 | 264 | ||