aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/codecs/ac97.c
diff options
context:
space:
mode:
Diffstat (limited to 'sound/soc/codecs/ac97.c')
-rw-r--r--sound/soc/codecs/ac97.c16
1 files changed, 10 insertions, 6 deletions
diff --git a/sound/soc/codecs/ac97.c b/sound/soc/codecs/ac97.c
index a1bbe16b7f96..1f5e57a4bb7a 100644
--- a/sound/soc/codecs/ac97.c
+++ b/sound/soc/codecs/ac97.c
@@ -13,6 +13,7 @@
13 */ 13 */
14 14
15#include <linux/init.h> 15#include <linux/init.h>
16#include <linux/slab.h>
16#include <linux/kernel.h> 17#include <linux/kernel.h>
17#include <linux/device.h> 18#include <linux/device.h>
18#include <sound/core.h> 19#include <sound/core.h>
@@ -80,9 +81,11 @@ static int ac97_write(struct snd_soc_codec *codec, unsigned int reg,
80static int ac97_soc_probe(struct platform_device *pdev) 81static int ac97_soc_probe(struct platform_device *pdev)
81{ 82{
82 struct snd_soc_device *socdev = platform_get_drvdata(pdev); 83 struct snd_soc_device *socdev = platform_get_drvdata(pdev);
84 struct snd_soc_card *card = socdev->card;
83 struct snd_soc_codec *codec; 85 struct snd_soc_codec *codec;
84 struct snd_ac97_bus *ac97_bus; 86 struct snd_ac97_bus *ac97_bus;
85 struct snd_ac97_template ac97_template; 87 struct snd_ac97_template ac97_template;
88 int i;
86 int ret = 0; 89 int ret = 0;
87 90
88 printk(KERN_INFO "AC97 SoC Audio Codec %s\n", AC97_VERSION); 91 printk(KERN_INFO "AC97 SoC Audio Codec %s\n", AC97_VERSION);
@@ -102,12 +105,6 @@ static int ac97_soc_probe(struct platform_device *pdev)
102 INIT_LIST_HEAD(&codec->dapm_widgets); 105 INIT_LIST_HEAD(&codec->dapm_widgets);
103 INIT_LIST_HEAD(&codec->dapm_paths); 106 INIT_LIST_HEAD(&codec->dapm_paths);
104 107
105 ret = snd_soc_new_ac97_codec(codec, &soc_ac97_ops, 0);
106 if (ret < 0) {
107 printk(KERN_ERR "ASoC: failed to init gen ac97 glue\n");
108 goto err;
109 }
110
111 /* register pcms */ 108 /* register pcms */
112 ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1); 109 ret = snd_soc_new_pcms(socdev, SNDRV_DEFAULT_IDX1, SNDRV_DEFAULT_STR1);
113 if (ret < 0) 110 if (ret < 0)
@@ -123,6 +120,13 @@ static int ac97_soc_probe(struct platform_device *pdev)
123 if (ret < 0) 120 if (ret < 0)
124 goto bus_err; 121 goto bus_err;
125 122
123 for (i = 0; i < card->num_links; i++) {
124 if (card->dai_link[i].codec_dai->ac97_control) {
125 snd_ac97_dev_add_pdata(codec->ac97,
126 card->dai_link[i].cpu_dai->ac97_pdata);
127 }
128 }
129
126 return 0; 130 return 0;
127 131
128bus_err: 132bus_err: