Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 47081
b: refs/heads/master
c: 12e74f7
h: refs/heads/master
i:
  47079: 87dd81a
v: v3
  • Loading branch information
Liam Girdwood authored and Jaroslav Kysela committed Feb 9, 2007
1 parent b7d6098 commit 20ef1f9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 10 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: cbcc2c4c07bd34586c7fd8d7513d3a397d39ce3c
refs/heads/master: 12e74f7d430655f541b85018ea62bcd669094bd7
35 changes: 26 additions & 9 deletions trunk/sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -1438,12 +1438,18 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
{
struct snd_soc_codec *codec = socdev->codec;
struct snd_soc_machine *machine = socdev->machine;
int ret = 0, i, ac97 = 0;
int ret = 0, i, ac97 = 0, err = 0;

mutex_lock(&codec->mutex);
for(i = 0; i < machine->num_links; i++) {
if (socdev->machine->dai_link[i].init)
socdev->machine->dai_link[i].init(codec);
if (socdev->machine->dai_link[i].init) {
err = socdev->machine->dai_link[i].init(codec);
if (err < 0) {
printk(KERN_ERR "asoc: failed to init %s\n",
socdev->machine->dai_link[i].stream_name);
continue;
}
}
if (socdev->machine->dai_link[i].cpu_dai->type == SND_SOC_DAI_AC97)
ac97 = 1;
}
Expand All @@ -1456,17 +1462,28 @@ int snd_soc_register_card(struct snd_soc_device *socdev)
if (ret < 0) {
printk(KERN_ERR "asoc: failed to register soundcard for codec %s\n",
codec->name);
mutex_unlock(&codec->mutex);
return ret;
goto out;
}

#ifdef CONFIG_SND_SOC_AC97_BUS
if (ac97)
soc_ac97_dev_register(codec);
if (ac97) {
ret = soc_ac97_dev_register(codec);
if (ret < 0) {
printk(KERN_ERR "asoc: AC97 device register failed\n");
snd_card_free(codec->card);
goto out;
}
}
#endif

snd_soc_dapm_sys_add(socdev->dev);
device_create_file(socdev->dev, &dev_attr_codec_reg);
err = snd_soc_dapm_sys_add(socdev->dev);
if (err < 0)
printk(KERN_WARNING "asoc: failed to add dapm sysfs entries\n");

err = device_create_file(socdev->dev, &dev_attr_codec_reg);
if (err < 0)
printk(KERN_WARNING "asoc: failed to add codec sysfs entries\n");
out:
mutex_unlock(&codec->mutex);
return ret;
}
Expand Down

0 comments on commit 20ef1f9

Please sign in to comment.