summaryrefslogtreecommitdiffstats
path: root/sound/soc
diff options
context:
space:
mode:
authorMark Brown2010-03-29 22:03:20 +0200
committerMark Brown2010-03-29 22:03:20 +0200
commit2c9504228fe4e4cc65f3debf6d2a6a0f44cf4c2d (patch)
tree72200e6f6f5877b35dab173ef47a463f98223dbb /sound/soc
parentASoC: ad193x: move codec register/unregister to bus probe/remove (diff)
parentASoC: Fix passing platform_data to ac97 bus users and fix a leak (diff)
downloadkernel-qcow2-linux-2c9504228fe4e4cc65f3debf6d2a6a0f44cf4c2d.tar.gz
kernel-qcow2-linux-2c9504228fe4e4cc65f3debf6d2a6a0f44cf4c2d.tar.xz
kernel-qcow2-linux-2c9504228fe4e4cc65f3debf6d2a6a0f44cf4c2d.zip
Merge branch 'for-2.6.34' into for-2.6.35
Diffstat (limited to 'sound/soc')
-rw-r--r--sound/soc/codecs/ac97.c15
-rw-r--r--sound/soc/codecs/wm8994.c2
-rw-r--r--sound/soc/soc-core.c3
3 files changed, 12 insertions, 8 deletions
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index a1bbe16b7f96..bcfa53271673 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -80,9 +80,11 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
static int ac97_soc_probe(struct platform_device *pdev)
{
struct snd_soc_device *socdev = platform_get_drvdata(pdev);
+ struct snd_soc_card *card = socdev->card;
struct snd_soc_codec *codec;
struct snd_ac97_bus *ac97_bus;
struct snd_ac97_template ac97_template;
+ int i;
int ret = 0;
printk(KERN_INFO "AC97 SoC Audio Codec %s\n", AC97_VERSION);
@@ -102,12 +104,6 @@ static int ac97_soc_probe(struct platform_device *pdev)
INIT_LIST_HEAD(&codec->dapm_widgets);
INIT_LIST_HEAD(&codec->dapm_paths);
- ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
- if (ret < 0) {
- printk(KERN_ERR "ASoC: failed to init gen ac97 glue\n");
- goto err;
- }
-
/* register pcms */
ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
if (ret < 0)
@@ -123,6 +119,13 @@ static int ac97_soc_probe(struct platform_device *pdev)
if (ret < 0)
goto bus_err;
+ for (i = 0; i < card->num_links; i++) {
+ if (card->dai_link[i].codec_dai->ac97_control) {
+ snd_ac97_dev_add_pdata(codec->ac97,
+ card->dai_link[i].cpu_dai->ac97_pdata);
+ }
+ }
+
return 0;
bus_err:
diff --git a/sound/soc/codecs/wm8994.c b/sound/soc/codecs/wm8994.c
index d01d3091fe81..bdda0936a404 100644
--- a/sound/soc/codecs/wm8994.c
+++ b/sound/soc/codecs/wm8994.c
@@ -3438,7 +3438,7 @@ struct snd_soc_dai wm8994_dai[] = {
.rates = WM8994_RATES,
.formats = WM8994_FORMATS,
},
- .playback = {
+ .capture = {
.stream_name = "AIF3 Capture",
.channels_min = 2,
.channels_max = 2,
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 1ff553bbc063..d59076e2ca84 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1597,7 +1597,8 @@ int snd_soc_new_pcms(struct snd_soc_device *socdev, int idx, const char *xid)
mutex_unlock(&codec->mutex);
return ret;
}
- if (card->dai_link[i].codec_dai->ac97_control) {
+ /* Check for codec->ac97 to handle the ac97.c fun */
+ if (card->dai_link[i].codec_dai->ac97_control && codec->ac97) {
snd_ac97_dev_add_pdata(codec->ac97,
card->dai_link[i].cpu_dai->ac97_pdata);
}