Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 248261
b: refs/heads/master
c: b7af1da
h: refs/heads/master
i:
  248259: 323f16d
v: v3
  • Loading branch information
Mark Brown committed Apr 8, 2011
1 parent 72c6a05 commit 4f9ea06
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 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: d9b3e4c5156476a4baf0d7e0f47ba2816b4fff8e
refs/heads/master: b7af1dafdfaf8419065399d07fb7cbae14b286ef
7 changes: 6 additions & 1 deletion trunk/include/sound/soc.h
Original file line number Diff line number Diff line change
Expand Up @@ -577,7 +577,9 @@ struct snd_soc_codec_driver {
pm_message_t state);
int (*resume)(struct snd_soc_codec *);

/* Default DAPM setup, added after probe() is run */
/* 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;
Expand Down Expand Up @@ -747,6 +749,9 @@ struct snd_soc_card {
struct snd_soc_pcm_runtime *rtd_aux;
int num_aux_rtd;

const struct snd_kcontrol_new *controls;
int num_controls;

/*
* Card-specific routes and widgets.
*/
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 @@ -1493,6 +1493,9 @@ static int soc_probe_codec(struct snd_soc_card *card,
}
}

if (driver->controls)
snd_soc_add_controls(codec, driver->controls,
driver->num_controls);
if (driver->dapm_widgets)
snd_soc_dapm_new_controls(&codec->dapm, driver->dapm_widgets,
driver->num_dapm_widgets);
Expand Down Expand Up @@ -1890,6 +1893,14 @@ static void snd_soc_instantiate_card(struct snd_soc_card *card)
}
}

/* We should have a non-codec control add function but we don't */
if (card->controls)
snd_soc_add_controls(list_first_entry(&card->codec_dev_list,
struct snd_soc_codec,
card_list),
card->controls,
card->num_controls);

if (card->dapm_widgets)
snd_soc_dapm_new_controls(&card->dapm, card->dapm_widgets,
card->num_dapm_widgets);
Expand Down

0 comments on commit 4f9ea06

Please sign in to comment.