Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 257572
b: refs/heads/master
c: cb2cf61
h: refs/heads/master
v: v3
  • Loading branch information
Liam Girdwood authored and Mark Brown committed Jul 5, 2011
1 parent 9ab3864 commit f5e86ff
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: b7950641374ddb41e9a03ff61b43f9ab3fcf763d
refs/heads/master: cb2cf612fbdf457291b6e47064fed24f0dfdd9a5
8 changes: 8 additions & 0 deletions trunk/include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -651,6 +651,14 @@ struct snd_soc_platform_driver {
int (*pcm_new)(struct snd_soc_pcm_runtime *);
void (*pcm_free)(struct snd_pcm *);

/* Default control and setup, added after probe() is run */
const struct snd_kcontrol_new *controls;
int num_controls;
const struct snd_soc_dapm_widget *dapm_widgets;
int num_dapm_widgets;
const struct snd_soc_dapm_route *dapm_routes;
int num_dapm_routes;

/*
* For platform caused delay reporting.
* Optional.
Expand Down
11 changes: 11 additions & 0 deletions trunk/sound/soc/soc-core.c
Original file line number Diff line number Diff line change
Expand Up @@ -998,6 +998,10 @@ static int soc_probe_platform(struct snd_soc_card *card,
if (!try_module_get(platform->dev->driver->owner))
return -ENODEV;

if (driver->dapm_widgets)
snd_soc_dapm_new_controls(&platform->dapm,
driver->dapm_widgets, driver->num_dapm_widgets);

if (driver->probe) {
ret = driver->probe(platform);
if (ret < 0) {
Expand All @@ -1008,6 +1012,13 @@ static int soc_probe_platform(struct snd_soc_card *card,
}
}

if (driver->controls)
snd_soc_add_platform_controls(platform, driver->controls,
driver->num_controls);
if (driver->dapm_routes)
snd_soc_dapm_add_routes(&platform->dapm, driver->dapm_routes,
driver->num_dapm_routes);

/* mark platform as probed and add to card platform list */
platform->probed = 1;
list_add(&platform->card_list, &card->platform_dev_list);
Expand Down

0 comments on commit f5e86ff

Please sign in to comment.