aboutsummaryrefslogtreecommitdiffstats
path: root/sound
diff options
context:
space:
mode:
authorMark Brown <broonie@linaro.org>2013-08-30 06:04:14 -0400
committerMark Brown <broonie@linaro.org>2013-08-30 06:04:14 -0400
commitc79c33af8f867e57ad4b84102db7901aee67485a (patch)
treeaa619736b89a143cfc48f9647493c929523a928a /sound
parent1c9a341bbdc14051a4d8c74ea67269786c7d3736 (diff)
parent824ef826f3c4d83d1925a5e351313bfd3e5ca6cb (diff)
Merge remote-tracking branch 'asoc/topic/core' into tmp
Diffstat (limited to 'sound')
-rw-r--r--sound/soc/codecs/dmic.c17
-rw-r--r--sound/soc/codecs/tlv320aic32x4.c22
-rw-r--r--sound/soc/generic/simple-card.c2
-rw-r--r--sound/soc/soc-core.c9
-rw-r--r--sound/soc/soc-dapm.c9
-rw-r--r--sound/soc/soc-jack.c2
6 files changed, 19 insertions, 42 deletions
diff --git a/sound/soc/codecs/dmic.c b/sound/soc/codecs/dmic.c
index 66967ba6f757..b2090b2a5e2d 100644
--- a/sound/soc/codecs/dmic.c
+++ b/sound/soc/codecs/dmic.c
@@ -50,20 +50,11 @@ static const struct snd_soc_dapm_route intercon[] = {
50 {"DMIC AIF", NULL, "DMic"}, 50 {"DMIC AIF", NULL, "DMic"},
51}; 51};
52 52
53static int dmic_probe(struct snd_soc_codec *codec)
54{
55 struct snd_soc_dapm_context *dapm = &codec->dapm;
56
57 snd_soc_dapm_new_controls(dapm, dmic_dapm_widgets,
58 ARRAY_SIZE(dmic_dapm_widgets));
59 snd_soc_dapm_add_routes(dapm, intercon, ARRAY_SIZE(intercon));
60 snd_soc_dapm_new_widgets(dapm);
61
62 return 0;
63}
64
65static struct snd_soc_codec_driver soc_dmic = { 53static struct snd_soc_codec_driver soc_dmic = {
66 .probe = dmic_probe, 54 .dapm_widgets = dmic_dapm_widgets,
55 .num_dapm_widgets = ARRAY_SIZE(dmic_dapm_widgets),
56 .dapm_routes = intercon,
57 .num_dapm_routes = ARRAY_SIZE(intercon),
67}; 58};
68 59
69static int dmic_dev_probe(struct platform_device *pdev) 60static int dmic_dev_probe(struct platform_device *pdev)
diff --git a/sound/soc/codecs/tlv320aic32x4.c b/sound/soc/codecs/tlv320aic32x4.c
index 17df4e32feac..2ed57d4aa445 100644
--- a/sound/soc/codecs/tlv320aic32x4.c
+++ b/sound/soc/codecs/tlv320aic32x4.c
@@ -338,18 +338,6 @@ static inline int aic32x4_get_divs(int mclk, int rate)
338 return -EINVAL; 338 return -EINVAL;
339} 339}
340 340
341static int aic32x4_add_widgets(struct snd_soc_codec *codec)
342{
343 snd_soc_dapm_new_controls(&codec->dapm, aic32x4_dapm_widgets,
344 ARRAY_SIZE(aic32x4_dapm_widgets));
345
346 snd_soc_dapm_add_routes(&codec->dapm, aic32x4_dapm_routes,
347 ARRAY_SIZE(aic32x4_dapm_routes));
348
349 snd_soc_dapm_new_widgets(&codec->dapm);
350 return 0;
351}
352
353static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai, 341static int aic32x4_set_dai_sysclk(struct snd_soc_dai *codec_dai,
354 int clk_id, unsigned int freq, int dir) 342 int clk_id, unsigned int freq, int dir)
355{ 343{
@@ -683,9 +671,6 @@ static int aic32x4_probe(struct snd_soc_codec *codec)
683 } 671 }
684 672
685 aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY); 673 aic32x4_set_bias_level(codec, SND_SOC_BIAS_STANDBY);
686 snd_soc_add_codec_controls(codec, aic32x4_snd_controls,
687 ARRAY_SIZE(aic32x4_snd_controls));
688 aic32x4_add_widgets(codec);
689 674
690 /* 675 /*
691 * Workaround: for an unknown reason, the ADC needs to be powered up 676 * Workaround: for an unknown reason, the ADC needs to be powered up
@@ -714,6 +699,13 @@ static struct snd_soc_codec_driver soc_codec_dev_aic32x4 = {
714 .suspend = aic32x4_suspend, 699 .suspend = aic32x4_suspend,
715 .resume = aic32x4_resume, 700 .resume = aic32x4_resume,
716 .set_bias_level = aic32x4_set_bias_level, 701 .set_bias_level = aic32x4_set_bias_level,
702
703 .controls = aic32x4_snd_controls,
704 .num_controls = ARRAY_SIZE(aic32x4_snd_controls),
705 .dapm_widgets = aic32x4_dapm_widgets,
706 .num_dapm_widgets = ARRAY_SIZE(aic32x4_dapm_widgets),
707 .dapm_routes = aic32x4_dapm_routes,
708 .num_dapm_routes = ARRAY_SIZE(aic32x4_dapm_routes),
717}; 709};
718 710
719static int aic32x4_i2c_probe(struct i2c_client *i2c, 711static int aic32x4_i2c_probe(struct i2c_client *i2c,
diff --git a/sound/soc/generic/simple-card.c b/sound/soc/generic/simple-card.c
index 6cf8355a8542..8c49147db84c 100644
--- a/sound/soc/generic/simple-card.c
+++ b/sound/soc/generic/simple-card.c
@@ -105,6 +105,7 @@ static int asoc_simple_card_remove(struct platform_device *pdev)
105static struct platform_driver asoc_simple_card = { 105static struct platform_driver asoc_simple_card = {
106 .driver = { 106 .driver = {
107 .name = "asoc-simple-card", 107 .name = "asoc-simple-card",
108 .owner = THIS_MODULE,
108 }, 109 },
109 .probe = asoc_simple_card_probe, 110 .probe = asoc_simple_card_probe,
110 .remove = asoc_simple_card_remove, 111 .remove = asoc_simple_card_remove,
@@ -112,6 +113,7 @@ static struct platform_driver asoc_simple_card = {
112 113
113module_platform_driver(asoc_simple_card); 114module_platform_driver(asoc_simple_card);
114 115
116MODULE_ALIAS("platform:asoc-simple-card");
115MODULE_LICENSE("GPL"); 117MODULE_LICENSE("GPL");
116MODULE_DESCRIPTION("ASoC Simple Sound Card"); 118MODULE_DESCRIPTION("ASoC Simple Sound Card");
117MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>"); 119MODULE_AUTHOR("Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>");
diff --git a/sound/soc/soc-core.c b/sound/soc/soc-core.c
index 5471940dc0f7..4d0561312f3b 100644
--- a/sound/soc/soc-core.c
+++ b/sound/soc/soc-core.c
@@ -1245,9 +1245,6 @@ static int soc_post_component_init(struct snd_soc_card *card,
1245 } 1245 }
1246 rtd->card = card; 1246 rtd->card = card;
1247 1247
1248 /* Make sure all DAPM widgets are instantiated */
1249 snd_soc_dapm_new_widgets(&codec->dapm);
1250
1251 /* machine controls, routes and widgets are not prefixed */ 1248 /* machine controls, routes and widgets are not prefixed */
1252 temp = codec->name_prefix; 1249 temp = codec->name_prefix;
1253 codec->name_prefix = NULL; 1250 codec->name_prefix = NULL;
@@ -1743,8 +1740,6 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
1743 snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes, 1740 snd_soc_dapm_add_routes(&card->dapm, card->dapm_routes,
1744 card->num_dapm_routes); 1741 card->num_dapm_routes);
1745 1742
1746 snd_soc_dapm_new_widgets(&card->dapm);
1747
1748 for (i = 0; i < card->num_links; i++) { 1743 for (i = 0; i < card->num_links; i++) {
1749 dai_link = &card->dai_link[i]; 1744 dai_link = &card->dai_link[i];
1750 dai_fmt = dai_link->dai_fmt; 1745 dai_fmt = dai_link->dai_fmt;
@@ -1823,12 +1818,12 @@ static int snd_soc_instantiate_card(struct snd_soc_card *card)
1823 } 1818 }
1824 } 1819 }
1825 1820
1826 snd_soc_dapm_new_widgets(&card->dapm);
1827
1828 if (card->fully_routed) 1821 if (card->fully_routed)
1829 list_for_each_entry(codec, &card->codec_dev_list, card_list) 1822 list_for_each_entry(codec, &card->codec_dev_list, card_list)
1830 snd_soc_dapm_auto_nc_codec_pins(codec); 1823 snd_soc_dapm_auto_nc_codec_pins(codec);
1831 1824
1825 snd_soc_dapm_new_widgets(card);
1826
1832 ret = snd_card_register(card->snd_card); 1827 ret = snd_card_register(card->snd_card);
1833 if (ret < 0) { 1828 if (ret < 0) {
1834 dev_err(card->dev, "ASoC: failed to register soundcard %d\n", 1829 dev_err(card->dev, "ASoC: failed to register soundcard %d\n",
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index d84bd0f167b6..548b1c9e875e 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -2374,6 +2374,9 @@ static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
2374 wsource->ext = 1; 2374 wsource->ext = 1;
2375 } 2375 }
2376 2376
2377 dapm_mark_dirty(wsource, "Route added");
2378 dapm_mark_dirty(wsink, "Route added");
2379
2377 /* connect static paths */ 2380 /* connect static paths */
2378 if (control == NULL) { 2381 if (control == NULL) {
2379 list_add(&path->list, &dapm->card->paths); 2382 list_add(&path->list, &dapm->card->paths);
@@ -2436,9 +2439,6 @@ static int snd_soc_dapm_add_path(struct snd_soc_dapm_context *dapm,
2436 return 0; 2439 return 0;
2437 } 2440 }
2438 2441
2439 dapm_mark_dirty(wsource, "Route added");
2440 dapm_mark_dirty(wsink, "Route added");
2441
2442 return 0; 2442 return 0;
2443err: 2443err:
2444 kfree(path); 2444 kfree(path);
@@ -2712,9 +2712,8 @@ EXPORT_SYMBOL_GPL(snd_soc_dapm_weak_routes);
2712 * 2712 *
2713 * Returns 0 for success. 2713 * Returns 0 for success.
2714 */ 2714 */
2715int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm) 2715int snd_soc_dapm_new_widgets(struct snd_soc_card *card)
2716{ 2716{
2717 struct snd_soc_card *card = dapm->card;
2718 struct snd_soc_dapm_widget *w; 2717 struct snd_soc_dapm_widget *w;
2719 unsigned int val; 2718 unsigned int val;
2720 2719
diff --git a/sound/soc/soc-jack.c b/sound/soc/soc-jack.c
index 7aa26b5178aa..71358e3b54d9 100644
--- a/sound/soc/soc-jack.c
+++ b/sound/soc/soc-jack.c
@@ -183,8 +183,6 @@ int snd_soc_jack_add_pins(struct snd_soc_jack *jack, int count,
183 list_add(&(pins[i].list), &jack->pins); 183 list_add(&(pins[i].list), &jack->pins);
184 } 184 }
185 185
186 snd_soc_dapm_new_widgets(&jack->codec->card->dapm);
187
188 /* Update to reflect the last reported status; canned jack 186 /* Update to reflect the last reported status; canned jack
189 * implementations are likely to set their state before the 187 * implementations are likely to set their state before the
190 * card has an opportunity to associate pins. 188 * card has an opportunity to associate pins.