summaryrefslogtreecommitdiffstats
path: root/sound/soc/cirrus
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-06-26 12:45:59 +0100
committerMark Brown <broonie@linaro.org>2013-06-27 09:48:42 +0100
commitb047e1cce8fe32475ab61846772943a5e4c0a908 (patch)
tree9d04d8101d161b96f96c2e2e5bd03900011828ec /sound/soc/cirrus
parentb49dff8cb61cd4715991612e2eb6905b73a0be78 (diff)
downloadlinux-b047e1cce8fe32475ab61846772943a5e4c0a908.tar.bz2
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/cirrus')
-rw-r--r--sound/soc/cirrus/ep93xx-ac97.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/sound/soc/cirrus/ep93xx-ac97.c b/sound/soc/cirrus/ep93xx-ac97.c
index d49e0556e381..4bc9490e2c84 100644
--- a/sound/soc/cirrus/ep93xx-ac97.c
+++ b/sound/soc/cirrus/ep93xx-ac97.c
@@ -237,13 +237,12 @@ static irqreturn_t ep93xx_ac97_interrupt(int irq, void *dev_id)
return IRQ_HANDLED;
}
-struct snd_ac97_bus_ops soc_ac97_ops = {
+static struct snd_ac97_bus_ops ep93xx_ac97_ops = {
.read = ep93xx_ac97_read,
.write = ep93xx_ac97_write,
.reset = ep93xx_ac97_cold_reset,
.warm_reset = ep93xx_ac97_warm_reset,
};
-EXPORT_SYMBOL_GPL(soc_ac97_ops);
static int ep93xx_ac97_trigger(struct snd_pcm_substream *substream,
int cmd, struct snd_soc_dai *dai)
@@ -395,6 +394,10 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
ep93xx_ac97_info = info;
platform_set_drvdata(pdev, info);
+ ret = snd_soc_set_ac97_ops(&ep93xx_ac97_ops);
+ if (ret)
+ goto fail;
+
ret = snd_soc_register_component(&pdev->dev, &ep93xx_ac97_component,
&ep93xx_ac97_dai, 1);
if (ret)
@@ -405,6 +408,7 @@ static int ep93xx_ac97_probe(struct platform_device *pdev)
fail:
platform_set_drvdata(pdev, NULL);
ep93xx_ac97_info = NULL;
+ snd_soc_set_ac97_ops(NULL);
return ret;
}
@@ -420,6 +424,8 @@ static int ep93xx_ac97_remove(struct platform_device *pdev)
platform_set_drvdata(pdev, NULL);
ep93xx_ac97_info = NULL;
+ snd_soc_set_ac97_ops(NULL);
+
return 0;
}