diff options
Diffstat (limited to 'sound/soc/soc-pcm.c')
-rw-r--r-- | sound/soc/soc-pcm.c | 195 |
1 files changed, 100 insertions, 95 deletions
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c index ef22d0bd9e9e..5c3ca2a34661 100644 --- a/sound/soc/soc-pcm.c +++ b/sound/soc/soc-pcm.c | |||
@@ -43,7 +43,7 @@ static int dpcm_dapm_stream_event(struct snd_soc_pcm_runtime *fe, int dir, | |||
43 | 43 | ||
44 | struct snd_soc_pcm_runtime *be = dpcm->be; | 44 | struct snd_soc_pcm_runtime *be = dpcm->be; |
45 | 45 | ||
46 | dev_dbg(be->dev, "pm: BE %s event %d dir %d\n", | 46 | dev_dbg(be->dev, "ASoC: BE %s event %d dir %d\n", |
47 | be->dai_link->name, event, dir); | 47 | be->dai_link->name, event, dir); |
48 | 48 | ||
49 | snd_soc_dapm_stream_event(be, dir, event); | 49 | snd_soc_dapm_stream_event(be, dir, event); |
@@ -70,18 +70,19 @@ static int soc_pcm_apply_symmetry(struct snd_pcm_substream *substream, | |||
70 | */ | 70 | */ |
71 | if (!soc_dai->rate) { | 71 | if (!soc_dai->rate) { |
72 | dev_warn(soc_dai->dev, | 72 | dev_warn(soc_dai->dev, |
73 | "Not enforcing symmetric_rates due to race\n"); | 73 | "ASoC: Not enforcing symmetric_rates due to race\n"); |
74 | return 0; | 74 | return 0; |
75 | } | 75 | } |
76 | 76 | ||
77 | dev_dbg(soc_dai->dev, "Symmetry forces %dHz rate\n", soc_dai->rate); | 77 | dev_dbg(soc_dai->dev, "ASoC: Symmetry forces %dHz rate\n", soc_dai->rate); |
78 | 78 | ||
79 | ret = snd_pcm_hw_constraint_minmax(substream->runtime, | 79 | ret = snd_pcm_hw_constraint_minmax(substream->runtime, |
80 | SNDRV_PCM_HW_PARAM_RATE, | 80 | SNDRV_PCM_HW_PARAM_RATE, |
81 | soc_dai->rate, soc_dai->rate); | 81 | soc_dai->rate, soc_dai->rate); |
82 | if (ret < 0) { | 82 | if (ret < 0) { |
83 | dev_err(soc_dai->dev, | 83 | dev_err(soc_dai->dev, |
84 | "Unable to apply rate symmetry constraint: %d\n", ret); | 84 | "ASoC: Unable to apply rate symmetry constraint: %d\n", |
85 | ret); | ||
85 | return ret; | 86 | return ret; |
86 | } | 87 | } |
87 | 88 | ||
@@ -118,7 +119,7 @@ static void soc_pcm_apply_msb(struct snd_pcm_substream *substream, | |||
118 | sample_sizes[i], bits); | 119 | sample_sizes[i], bits); |
119 | if (ret != 0) | 120 | if (ret != 0) |
120 | dev_warn(dai->dev, | 121 | dev_warn(dai->dev, |
121 | "Failed to set MSB %d/%d: %d\n", | 122 | "ASoC: Failed to set MSB %d/%d: %d\n", |
122 | bits, sample_sizes[i], ret); | 123 | bits, sample_sizes[i], ret); |
123 | } | 124 | } |
124 | } | 125 | } |
@@ -149,8 +150,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
149 | if (cpu_dai->driver->ops->startup) { | 150 | if (cpu_dai->driver->ops->startup) { |
150 | ret = cpu_dai->driver->ops->startup(substream, cpu_dai); | 151 | ret = cpu_dai->driver->ops->startup(substream, cpu_dai); |
151 | if (ret < 0) { | 152 | if (ret < 0) { |
152 | dev_err(cpu_dai->dev, "can't open interface %s: %d\n", | 153 | dev_err(cpu_dai->dev, "ASoC: can't open interface" |
153 | cpu_dai->name, ret); | 154 | " %s: %d\n", cpu_dai->name, ret); |
154 | goto out; | 155 | goto out; |
155 | } | 156 | } |
156 | } | 157 | } |
@@ -158,8 +159,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
158 | if (platform->driver->ops && platform->driver->ops->open) { | 159 | if (platform->driver->ops && platform->driver->ops->open) { |
159 | ret = platform->driver->ops->open(substream); | 160 | ret = platform->driver->ops->open(substream); |
160 | if (ret < 0) { | 161 | if (ret < 0) { |
161 | dev_err(platform->dev, "can't open platform %s: %d\n", | 162 | dev_err(platform->dev, "ASoC: can't open platform" |
162 | platform->name, ret); | 163 | " %s: %d\n", platform->name, ret); |
163 | goto platform_err; | 164 | goto platform_err; |
164 | } | 165 | } |
165 | } | 166 | } |
@@ -167,8 +168,8 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
167 | if (codec_dai->driver->ops->startup) { | 168 | if (codec_dai->driver->ops->startup) { |
168 | ret = codec_dai->driver->ops->startup(substream, codec_dai); | 169 | ret = codec_dai->driver->ops->startup(substream, codec_dai); |
169 | if (ret < 0) { | 170 | if (ret < 0) { |
170 | dev_err(codec_dai->dev, "can't open codec %s: %d\n", | 171 | dev_err(codec_dai->dev, "ASoC: can't open codec" |
171 | codec_dai->name, ret); | 172 | " %s: %d\n", codec_dai->name, ret); |
172 | goto codec_dai_err; | 173 | goto codec_dai_err; |
173 | } | 174 | } |
174 | } | 175 | } |
@@ -176,7 +177,7 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
176 | if (rtd->dai_link->ops && rtd->dai_link->ops->startup) { | 177 | if (rtd->dai_link->ops && rtd->dai_link->ops->startup) { |
177 | ret = rtd->dai_link->ops->startup(substream); | 178 | ret = rtd->dai_link->ops->startup(substream); |
178 | if (ret < 0) { | 179 | if (ret < 0) { |
179 | pr_err("asoc: %s startup failed: %d\n", | 180 | pr_err("ASoC: %s startup failed: %d\n", |
180 | rtd->dai_link->name, ret); | 181 | rtd->dai_link->name, ret); |
181 | goto machine_err; | 182 | goto machine_err; |
182 | } | 183 | } |
@@ -238,18 +239,18 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
238 | ret = -EINVAL; | 239 | ret = -EINVAL; |
239 | snd_pcm_limit_hw_rates(runtime); | 240 | snd_pcm_limit_hw_rates(runtime); |
240 | if (!runtime->hw.rates) { | 241 | if (!runtime->hw.rates) { |
241 | printk(KERN_ERR "asoc: %s <-> %s No matching rates\n", | 242 | printk(KERN_ERR "ASoC: %s <-> %s No matching rates\n", |
242 | codec_dai->name, cpu_dai->name); | 243 | codec_dai->name, cpu_dai->name); |
243 | goto config_err; | 244 | goto config_err; |
244 | } | 245 | } |
245 | if (!runtime->hw.formats) { | 246 | if (!runtime->hw.formats) { |
246 | printk(KERN_ERR "asoc: %s <-> %s No matching formats\n", | 247 | printk(KERN_ERR "ASoC: %s <-> %s No matching formats\n", |
247 | codec_dai->name, cpu_dai->name); | 248 | codec_dai->name, cpu_dai->name); |
248 | goto config_err; | 249 | goto config_err; |
249 | } | 250 | } |
250 | if (!runtime->hw.channels_min || !runtime->hw.channels_max || | 251 | if (!runtime->hw.channels_min || !runtime->hw.channels_max || |
251 | runtime->hw.channels_min > runtime->hw.channels_max) { | 252 | runtime->hw.channels_min > runtime->hw.channels_max) { |
252 | printk(KERN_ERR "asoc: %s <-> %s No matching channels\n", | 253 | printk(KERN_ERR "ASoC: %s <-> %s No matching channels\n", |
253 | codec_dai->name, cpu_dai->name); | 254 | codec_dai->name, cpu_dai->name); |
254 | goto config_err; | 255 | goto config_err; |
255 | } | 256 | } |
@@ -270,12 +271,12 @@ static int soc_pcm_open(struct snd_pcm_substream *substream) | |||
270 | goto config_err; | 271 | goto config_err; |
271 | } | 272 | } |
272 | 273 | ||
273 | pr_debug("asoc: %s <-> %s info:\n", | 274 | pr_debug("ASoC: %s <-> %s info:\n", |
274 | codec_dai->name, cpu_dai->name); | 275 | codec_dai->name, cpu_dai->name); |
275 | pr_debug("asoc: rate mask 0x%x\n", runtime->hw.rates); | 276 | pr_debug("ASoC: rate mask 0x%x\n", runtime->hw.rates); |
276 | pr_debug("asoc: min ch %d max ch %d\n", runtime->hw.channels_min, | 277 | pr_debug("ASoC: min ch %d max ch %d\n", runtime->hw.channels_min, |
277 | runtime->hw.channels_max); | 278 | runtime->hw.channels_max); |
278 | pr_debug("asoc: min rate %d max rate %d\n", runtime->hw.rate_min, | 279 | pr_debug("ASoC: min rate %d max rate %d\n", runtime->hw.rate_min, |
279 | runtime->hw.rate_max); | 280 | runtime->hw.rate_max); |
280 | 281 | ||
281 | dynamic: | 282 | dynamic: |
@@ -330,7 +331,7 @@ static void close_delayed_work(struct work_struct *work) | |||
330 | 331 | ||
331 | mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); | 332 | mutex_lock_nested(&rtd->pcm_mutex, rtd->pcm_subclass); |
332 | 333 | ||
333 | pr_debug("pop wq checking: %s status: %s waiting: %s\n", | 334 | dev_dbg(rtd->dev, "ASoC: pop wq checking: %s status: %s waiting: %s\n", |
334 | codec_dai->driver->playback.stream_name, | 335 | codec_dai->driver->playback.stream_name, |
335 | codec_dai->playback_active ? "active" : "inactive", | 336 | codec_dai->playback_active ? "active" : "inactive", |
336 | codec_dai->pop_wait ? "yes" : "no"); | 337 | codec_dai->pop_wait ? "yes" : "no"); |
@@ -444,7 +445,8 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) | |||
444 | if (rtd->dai_link->ops && rtd->dai_link->ops->prepare) { | 445 | if (rtd->dai_link->ops && rtd->dai_link->ops->prepare) { |
445 | ret = rtd->dai_link->ops->prepare(substream); | 446 | ret = rtd->dai_link->ops->prepare(substream); |
446 | if (ret < 0) { | 447 | if (ret < 0) { |
447 | pr_err("asoc: machine prepare error: %d\n", ret); | 448 | dev_err(rtd->card->dev, "ASoC: machine prepare error:" |
449 | " %d\n", ret); | ||
448 | goto out; | 450 | goto out; |
449 | } | 451 | } |
450 | } | 452 | } |
@@ -452,8 +454,8 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) | |||
452 | if (platform->driver->ops && platform->driver->ops->prepare) { | 454 | if (platform->driver->ops && platform->driver->ops->prepare) { |
453 | ret = platform->driver->ops->prepare(substream); | 455 | ret = platform->driver->ops->prepare(substream); |
454 | if (ret < 0) { | 456 | if (ret < 0) { |
455 | dev_err(platform->dev, "platform prepare error: %d\n", | 457 | dev_err(platform->dev, "ASoC: platform prepare error:" |
456 | ret); | 458 | " %d\n", ret); |
457 | goto out; | 459 | goto out; |
458 | } | 460 | } |
459 | } | 461 | } |
@@ -461,7 +463,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) | |||
461 | if (codec_dai->driver->ops->prepare) { | 463 | if (codec_dai->driver->ops->prepare) { |
462 | ret = codec_dai->driver->ops->prepare(substream, codec_dai); | 464 | ret = codec_dai->driver->ops->prepare(substream, codec_dai); |
463 | if (ret < 0) { | 465 | if (ret < 0) { |
464 | dev_err(codec_dai->dev, "DAI prepare error: %d\n", | 466 | dev_err(codec_dai->dev, "ASoC: DAI prepare error: %d\n", |
465 | ret); | 467 | ret); |
466 | goto out; | 468 | goto out; |
467 | } | 469 | } |
@@ -470,7 +472,7 @@ static int soc_pcm_prepare(struct snd_pcm_substream *substream) | |||
470 | if (cpu_dai->driver->ops->prepare) { | 472 | if (cpu_dai->driver->ops->prepare) { |
471 | ret = cpu_dai->driver->ops->prepare(substream, cpu_dai); | 473 | ret = cpu_dai->driver->ops->prepare(substream, cpu_dai); |
472 | if (ret < 0) { | 474 | if (ret < 0) { |
473 | dev_err(cpu_dai->dev, "DAI prepare error: %d\n", | 475 | dev_err(cpu_dai->dev, "ASoC: DAI prepare error: %d\n", |
474 | ret); | 476 | ret); |
475 | goto out; | 477 | goto out; |
476 | } | 478 | } |
@@ -512,7 +514,8 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, | |||
512 | if (rtd->dai_link->ops && rtd->dai_link->ops->hw_params) { | 514 | if (rtd->dai_link->ops && rtd->dai_link->ops->hw_params) { |
513 | ret = rtd->dai_link->ops->hw_params(substream, params); | 515 | ret = rtd->dai_link->ops->hw_params(substream, params); |
514 | if (ret < 0) { | 516 | if (ret < 0) { |
515 | pr_err("asoc: machine hw_params failed: %d\n", ret); | 517 | dev_err(rtd->card->dev, "ASoC: machine hw_params" |
518 | " failed: %d\n", ret); | ||
516 | goto out; | 519 | goto out; |
517 | } | 520 | } |
518 | } | 521 | } |
@@ -520,8 +523,8 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, | |||
520 | if (codec_dai->driver->ops->hw_params) { | 523 | if (codec_dai->driver->ops->hw_params) { |
521 | ret = codec_dai->driver->ops->hw_params(substream, params, codec_dai); | 524 | ret = codec_dai->driver->ops->hw_params(substream, params, codec_dai); |
522 | if (ret < 0) { | 525 | if (ret < 0) { |
523 | dev_err(codec_dai->dev, "can't set %s hw params: %d\n", | 526 | dev_err(codec_dai->dev, "ASoC: can't set %s hw params:" |
524 | codec_dai->name, ret); | 527 | " %d\n", codec_dai->name, ret); |
525 | goto codec_err; | 528 | goto codec_err; |
526 | } | 529 | } |
527 | } | 530 | } |
@@ -529,7 +532,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, | |||
529 | if (cpu_dai->driver->ops->hw_params) { | 532 | if (cpu_dai->driver->ops->hw_params) { |
530 | ret = cpu_dai->driver->ops->hw_params(substream, params, cpu_dai); | 533 | ret = cpu_dai->driver->ops->hw_params(substream, params, cpu_dai); |
531 | if (ret < 0) { | 534 | if (ret < 0) { |
532 | dev_err(cpu_dai->dev, "%s hw params failed: %d\n", | 535 | dev_err(cpu_dai->dev, "ASoC: %s hw params failed: %d\n", |
533 | cpu_dai->name, ret); | 536 | cpu_dai->name, ret); |
534 | goto interface_err; | 537 | goto interface_err; |
535 | } | 538 | } |
@@ -538,7 +541,7 @@ static int soc_pcm_hw_params(struct snd_pcm_substream *substream, | |||
538 | if (platform->driver->ops && platform->driver->ops->hw_params) { | 541 | if (platform->driver->ops && platform->driver->ops->hw_params) { |
539 | ret = platform->driver->ops->hw_params(substream, params); | 542 | ret = platform->driver->ops->hw_params(substream, params); |
540 | if (ret < 0) { | 543 | if (ret < 0) { |
541 | dev_err(platform->dev, "%s hw params failed: %d\n", | 544 | dev_err(platform->dev, "ASoC: %s hw params failed: %d\n", |
542 | platform->name, ret); | 545 | platform->name, ret); |
543 | goto platform_err; | 546 | goto platform_err; |
544 | } | 547 | } |
@@ -760,7 +763,7 @@ static void dpcm_be_disconnect(struct snd_soc_pcm_runtime *fe, int stream) | |||
760 | struct snd_soc_dpcm *dpcm, *d; | 763 | struct snd_soc_dpcm *dpcm, *d; |
761 | 764 | ||
762 | list_for_each_entry_safe(dpcm, d, &fe->dpcm[stream].be_clients, list_be) { | 765 | list_for_each_entry_safe(dpcm, d, &fe->dpcm[stream].be_clients, list_be) { |
763 | dev_dbg(fe->dev, "BE %s disconnect check for %s\n", | 766 | dev_dbg(fe->dev, "ASoC: BE %s disconnect check for %s\n", |
764 | stream ? "capture" : "playback", | 767 | stream ? "capture" : "playback", |
765 | dpcm->be->dai_link->name); | 768 | dpcm->be->dai_link->name); |
766 | 769 | ||
@@ -815,7 +818,7 @@ static struct snd_soc_pcm_runtime *dpcm_get_be(struct snd_soc_card *card, | |||
815 | } | 818 | } |
816 | } | 819 | } |
817 | 820 | ||
818 | dev_err(card->dev, "can't get %s BE for %s\n", | 821 | dev_err(card->dev, "ASoC: can't get %s BE for %s\n", |
819 | stream ? "capture" : "playback", widget->name); | 822 | stream ? "capture" : "playback", widget->name); |
820 | return NULL; | 823 | return NULL; |
821 | } | 824 | } |
@@ -866,7 +869,7 @@ static int dpcm_path_get(struct snd_soc_pcm_runtime *fe, | |||
866 | /* get number of valid DAI paths and their widgets */ | 869 | /* get number of valid DAI paths and their widgets */ |
867 | paths = snd_soc_dapm_dai_get_connected_widgets(cpu_dai, stream, &list); | 870 | paths = snd_soc_dapm_dai_get_connected_widgets(cpu_dai, stream, &list); |
868 | 871 | ||
869 | dev_dbg(fe->dev, "found %d audio %s paths\n", paths, | 872 | dev_dbg(fe->dev, "ASoC: found %d audio %s paths\n", paths, |
870 | stream ? "capture" : "playback"); | 873 | stream ? "capture" : "playback"); |
871 | 874 | ||
872 | *list_ = list; | 875 | *list_ = list; |
@@ -903,7 +906,7 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream, | |||
903 | if (widget && widget_in_list(list, widget)) | 906 | if (widget && widget_in_list(list, widget)) |
904 | continue; | 907 | continue; |
905 | 908 | ||
906 | dev_dbg(fe->dev, "pruning %s BE %s for %s\n", | 909 | dev_dbg(fe->dev, "ASoC: pruning %s BE %s for %s\n", |
907 | stream ? "capture" : "playback", | 910 | stream ? "capture" : "playback", |
908 | dpcm->be->dai_link->name, fe->dai_link->name); | 911 | dpcm->be->dai_link->name, fe->dai_link->name); |
909 | dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE; | 912 | dpcm->state = SND_SOC_DPCM_LINK_STATE_FREE; |
@@ -911,7 +914,7 @@ static int dpcm_prune_paths(struct snd_soc_pcm_runtime *fe, int stream, | |||
911 | prune++; | 914 | prune++; |
912 | } | 915 | } |
913 | 916 | ||
914 | dev_dbg(fe->dev, "found %d old BE paths for pruning\n", prune); | 917 | dev_dbg(fe->dev, "ASoC: found %d old BE paths for pruning\n", prune); |
915 | return prune; | 918 | return prune; |
916 | } | 919 | } |
917 | 920 | ||
@@ -932,7 +935,7 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, | |||
932 | /* is there a valid BE rtd for this widget */ | 935 | /* is there a valid BE rtd for this widget */ |
933 | be = dpcm_get_be(card, list->widgets[i], stream); | 936 | be = dpcm_get_be(card, list->widgets[i], stream); |
934 | if (!be) { | 937 | if (!be) { |
935 | dev_err(fe->dev, "no BE found for %s\n", | 938 | dev_err(fe->dev, "ASoC: no BE found for %s\n", |
936 | list->widgets[i]->name); | 939 | list->widgets[i]->name); |
937 | continue; | 940 | continue; |
938 | } | 941 | } |
@@ -948,7 +951,7 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, | |||
948 | /* newly connected FE and BE */ | 951 | /* newly connected FE and BE */ |
949 | err = dpcm_be_connect(fe, be, stream); | 952 | err = dpcm_be_connect(fe, be, stream); |
950 | if (err < 0) { | 953 | if (err < 0) { |
951 | dev_err(fe->dev, "can't connect %s\n", | 954 | dev_err(fe->dev, "ASoC: can't connect %s\n", |
952 | list->widgets[i]->name); | 955 | list->widgets[i]->name); |
953 | break; | 956 | break; |
954 | } else if (err == 0) /* already connected */ | 957 | } else if (err == 0) /* already connected */ |
@@ -959,7 +962,7 @@ static int dpcm_add_paths(struct snd_soc_pcm_runtime *fe, int stream, | |||
959 | new++; | 962 | new++; |
960 | } | 963 | } |
961 | 964 | ||
962 | dev_dbg(fe->dev, "found %d new BE paths\n", new); | 965 | dev_dbg(fe->dev, "ASoC: found %d new BE paths\n", new); |
963 | return new; | 966 | return new; |
964 | } | 967 | } |
965 | 968 | ||
@@ -998,7 +1001,7 @@ static void dpcm_be_dai_startup_unwind(struct snd_soc_pcm_runtime *fe, | |||
998 | snd_soc_dpcm_get_substream(be, stream); | 1001 | snd_soc_dpcm_get_substream(be, stream); |
999 | 1002 | ||
1000 | if (be->dpcm[stream].users == 0) | 1003 | if (be->dpcm[stream].users == 0) |
1001 | dev_err(be->dev, "no users %s at close - state %d\n", | 1004 | dev_err(be->dev, "ASoC: no users %s at close - state %d\n", |
1002 | stream ? "capture" : "playback", | 1005 | stream ? "capture" : "playback", |
1003 | be->dpcm[stream].state); | 1006 | be->dpcm[stream].state); |
1004 | 1007 | ||
@@ -1032,7 +1035,7 @@ static int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) | |||
1032 | 1035 | ||
1033 | /* first time the dpcm is open ? */ | 1036 | /* first time the dpcm is open ? */ |
1034 | if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) | 1037 | if (be->dpcm[stream].users == DPCM_MAX_BE_USERS) |
1035 | dev_err(be->dev, "too many users %s at open %d\n", | 1038 | dev_err(be->dev, "ASoC: too many users %s at open %d\n", |
1036 | stream ? "capture" : "playback", | 1039 | stream ? "capture" : "playback", |
1037 | be->dpcm[stream].state); | 1040 | be->dpcm[stream].state); |
1038 | 1041 | ||
@@ -1043,15 +1046,15 @@ static int dpcm_be_dai_startup(struct snd_soc_pcm_runtime *fe, int stream) | |||
1043 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) | 1046 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_CLOSE)) |
1044 | continue; | 1047 | continue; |
1045 | 1048 | ||
1046 | dev_dbg(be->dev, "dpcm: open BE %s\n", be->dai_link->name); | 1049 | dev_dbg(be->dev, "ASoC: open BE %s\n", be->dai_link->name); |
1047 | 1050 | ||
1048 | be_substream->runtime = be->dpcm[stream].runtime; | 1051 | be_substream->runtime = be->dpcm[stream].runtime; |
1049 | err = soc_pcm_open(be_substream); | 1052 | err = soc_pcm_open(be_substream); |
1050 | if (err < 0) { | 1053 | if (err < 0) { |
1051 | dev_err(be->dev, "BE open failed %d\n", err); | 1054 | dev_err(be->dev, "ASoC: BE open failed %d\n", err); |
1052 | be->dpcm[stream].users--; | 1055 | be->dpcm[stream].users--; |
1053 | if (be->dpcm[stream].users < 0) | 1056 | if (be->dpcm[stream].users < 0) |
1054 | dev_err(be->dev, "no users %s at unwind %d\n", | 1057 | dev_err(be->dev, "ASoC: no users %s at unwind %d\n", |
1055 | stream ? "capture" : "playback", | 1058 | stream ? "capture" : "playback", |
1056 | be->dpcm[stream].state); | 1059 | be->dpcm[stream].state); |
1057 | 1060 | ||
@@ -1076,7 +1079,7 @@ unwind: | |||
1076 | continue; | 1079 | continue; |
1077 | 1080 | ||
1078 | if (be->dpcm[stream].users == 0) | 1081 | if (be->dpcm[stream].users == 0) |
1079 | dev_err(be->dev, "no users %s at close %d\n", | 1082 | dev_err(be->dev, "ASoC: no users %s at close %d\n", |
1080 | stream ? "capture" : "playback", | 1083 | stream ? "capture" : "playback", |
1081 | be->dpcm[stream].state); | 1084 | be->dpcm[stream].state); |
1082 | 1085 | ||
@@ -1128,16 +1131,16 @@ static int dpcm_fe_dai_startup(struct snd_pcm_substream *fe_substream) | |||
1128 | 1131 | ||
1129 | ret = dpcm_be_dai_startup(fe, fe_substream->stream); | 1132 | ret = dpcm_be_dai_startup(fe, fe_substream->stream); |
1130 | if (ret < 0) { | 1133 | if (ret < 0) { |
1131 | dev_err(fe->dev,"dpcm: failed to start some BEs %d\n", ret); | 1134 | dev_err(fe->dev,"ASoC: failed to start some BEs %d\n", ret); |
1132 | goto be_err; | 1135 | goto be_err; |
1133 | } | 1136 | } |
1134 | 1137 | ||
1135 | dev_dbg(fe->dev, "dpcm: open FE %s\n", fe->dai_link->name); | 1138 | dev_dbg(fe->dev, "ASoC: open FE %s\n", fe->dai_link->name); |
1136 | 1139 | ||
1137 | /* start the DAI frontend */ | 1140 | /* start the DAI frontend */ |
1138 | ret = soc_pcm_open(fe_substream); | 1141 | ret = soc_pcm_open(fe_substream); |
1139 | if (ret < 0) { | 1142 | if (ret < 0) { |
1140 | dev_err(fe->dev,"dpcm: failed to start FE %d\n", ret); | 1143 | dev_err(fe->dev,"ASoC: failed to start FE %d\n", ret); |
1141 | goto unwind; | 1144 | goto unwind; |
1142 | } | 1145 | } |
1143 | 1146 | ||
@@ -1172,7 +1175,7 @@ static int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream) | |||
1172 | continue; | 1175 | continue; |
1173 | 1176 | ||
1174 | if (be->dpcm[stream].users == 0) | 1177 | if (be->dpcm[stream].users == 0) |
1175 | dev_err(be->dev, "no users %s at close - state %d\n", | 1178 | dev_err(be->dev, "ASoC: no users %s at close - state %d\n", |
1176 | stream ? "capture" : "playback", | 1179 | stream ? "capture" : "playback", |
1177 | be->dpcm[stream].state); | 1180 | be->dpcm[stream].state); |
1178 | 1181 | ||
@@ -1183,7 +1186,7 @@ static int dpcm_be_dai_shutdown(struct snd_soc_pcm_runtime *fe, int stream) | |||
1183 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) | 1186 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_OPEN)) |
1184 | continue; | 1187 | continue; |
1185 | 1188 | ||
1186 | dev_dbg(be->dev, "dpcm: close BE %s\n", | 1189 | dev_dbg(be->dev, "ASoC: close BE %s\n", |
1187 | dpcm->fe->dai_link->name); | 1190 | dpcm->fe->dai_link->name); |
1188 | 1191 | ||
1189 | soc_pcm_close(be_substream); | 1192 | soc_pcm_close(be_substream); |
@@ -1204,7 +1207,7 @@ static int dpcm_fe_dai_shutdown(struct snd_pcm_substream *substream) | |||
1204 | /* shutdown the BEs */ | 1207 | /* shutdown the BEs */ |
1205 | dpcm_be_dai_shutdown(fe, substream->stream); | 1208 | dpcm_be_dai_shutdown(fe, substream->stream); |
1206 | 1209 | ||
1207 | dev_dbg(fe->dev, "dpcm: close FE %s\n", fe->dai_link->name); | 1210 | dev_dbg(fe->dev, "ASoC: close FE %s\n", fe->dai_link->name); |
1208 | 1211 | ||
1209 | /* now shutdown the frontend */ | 1212 | /* now shutdown the frontend */ |
1210 | soc_pcm_close(substream); | 1213 | soc_pcm_close(substream); |
@@ -1243,7 +1246,7 @@ static int dpcm_be_dai_hw_free(struct snd_soc_pcm_runtime *fe, int stream) | |||
1243 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) | 1246 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) |
1244 | continue; | 1247 | continue; |
1245 | 1248 | ||
1246 | dev_dbg(be->dev, "dpcm: hw_free BE %s\n", | 1249 | dev_dbg(be->dev, "ASoC: hw_free BE %s\n", |
1247 | dpcm->fe->dai_link->name); | 1250 | dpcm->fe->dai_link->name); |
1248 | 1251 | ||
1249 | soc_pcm_hw_free(be_substream); | 1252 | soc_pcm_hw_free(be_substream); |
@@ -1262,12 +1265,12 @@ static int dpcm_fe_dai_hw_free(struct snd_pcm_substream *substream) | |||
1262 | mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); | 1265 | mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); |
1263 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE; | 1266 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE; |
1264 | 1267 | ||
1265 | dev_dbg(fe->dev, "dpcm: hw_free FE %s\n", fe->dai_link->name); | 1268 | dev_dbg(fe->dev, "ASoC: hw_free FE %s\n", fe->dai_link->name); |
1266 | 1269 | ||
1267 | /* call hw_free on the frontend */ | 1270 | /* call hw_free on the frontend */ |
1268 | err = soc_pcm_hw_free(substream); | 1271 | err = soc_pcm_hw_free(substream); |
1269 | if (err < 0) | 1272 | if (err < 0) |
1270 | dev_err(fe->dev,"dpcm: hw_free FE %s failed\n", | 1273 | dev_err(fe->dev,"ASoC: hw_free FE %s failed\n", |
1271 | fe->dai_link->name); | 1274 | fe->dai_link->name); |
1272 | 1275 | ||
1273 | /* only hw_params backends that are either sinks or sources | 1276 | /* only hw_params backends that are either sinks or sources |
@@ -1305,7 +1308,7 @@ static int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream) | |||
1305 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) | 1308 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_HW_FREE)) |
1306 | continue; | 1309 | continue; |
1307 | 1310 | ||
1308 | dev_dbg(be->dev, "dpcm: hw_params BE %s\n", | 1311 | dev_dbg(be->dev, "ASoC: hw_params BE %s\n", |
1309 | dpcm->fe->dai_link->name); | 1312 | dpcm->fe->dai_link->name); |
1310 | 1313 | ||
1311 | /* copy params for each dpcm */ | 1314 | /* copy params for each dpcm */ |
@@ -1318,7 +1321,7 @@ static int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream) | |||
1318 | &dpcm->hw_params); | 1321 | &dpcm->hw_params); |
1319 | if (ret < 0) { | 1322 | if (ret < 0) { |
1320 | dev_err(be->dev, | 1323 | dev_err(be->dev, |
1321 | "dpcm: hw_params BE fixup failed %d\n", | 1324 | "ASoC: hw_params BE fixup failed %d\n", |
1322 | ret); | 1325 | ret); |
1323 | goto unwind; | 1326 | goto unwind; |
1324 | } | 1327 | } |
@@ -1327,7 +1330,7 @@ static int dpcm_be_dai_hw_params(struct snd_soc_pcm_runtime *fe, int stream) | |||
1327 | ret = soc_pcm_hw_params(be_substream, &dpcm->hw_params); | 1330 | ret = soc_pcm_hw_params(be_substream, &dpcm->hw_params); |
1328 | if (ret < 0) { | 1331 | if (ret < 0) { |
1329 | dev_err(dpcm->be->dev, | 1332 | dev_err(dpcm->be->dev, |
1330 | "dpcm: hw_params BE failed %d\n", ret); | 1333 | "ASoC: hw_params BE failed %d\n", ret); |
1331 | goto unwind; | 1334 | goto unwind; |
1332 | } | 1335 | } |
1333 | 1336 | ||
@@ -1374,18 +1377,18 @@ static int dpcm_fe_dai_hw_params(struct snd_pcm_substream *substream, | |||
1374 | sizeof(struct snd_pcm_hw_params)); | 1377 | sizeof(struct snd_pcm_hw_params)); |
1375 | ret = dpcm_be_dai_hw_params(fe, substream->stream); | 1378 | ret = dpcm_be_dai_hw_params(fe, substream->stream); |
1376 | if (ret < 0) { | 1379 | if (ret < 0) { |
1377 | dev_err(fe->dev,"dpcm: hw_params BE failed %d\n", ret); | 1380 | dev_err(fe->dev,"ASoC: hw_params BE failed %d\n", ret); |
1378 | goto out; | 1381 | goto out; |
1379 | } | 1382 | } |
1380 | 1383 | ||
1381 | dev_dbg(fe->dev, "dpcm: hw_params FE %s rate %d chan %x fmt %d\n", | 1384 | dev_dbg(fe->dev, "ASoC: hw_params FE %s rate %d chan %x fmt %d\n", |
1382 | fe->dai_link->name, params_rate(params), | 1385 | fe->dai_link->name, params_rate(params), |
1383 | params_channels(params), params_format(params)); | 1386 | params_channels(params), params_format(params)); |
1384 | 1387 | ||
1385 | /* call hw_params on the frontend */ | 1388 | /* call hw_params on the frontend */ |
1386 | ret = soc_pcm_hw_params(substream, params); | 1389 | ret = soc_pcm_hw_params(substream, params); |
1387 | if (ret < 0) { | 1390 | if (ret < 0) { |
1388 | dev_err(fe->dev,"dpcm: hw_params FE failed %d\n", ret); | 1391 | dev_err(fe->dev,"ASoC: hw_params FE failed %d\n", ret); |
1389 | dpcm_be_dai_hw_free(fe, stream); | 1392 | dpcm_be_dai_hw_free(fe, stream); |
1390 | } else | 1393 | } else |
1391 | fe->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; | 1394 | fe->dpcm[stream].state = SND_SOC_DPCM_STATE_HW_PARAMS; |
@@ -1401,12 +1404,12 @@ static int dpcm_do_trigger(struct snd_soc_dpcm *dpcm, | |||
1401 | { | 1404 | { |
1402 | int ret; | 1405 | int ret; |
1403 | 1406 | ||
1404 | dev_dbg(dpcm->be->dev, "dpcm: trigger BE %s cmd %d\n", | 1407 | dev_dbg(dpcm->be->dev, "ASoC: trigger BE %s cmd %d\n", |
1405 | dpcm->fe->dai_link->name, cmd); | 1408 | dpcm->fe->dai_link->name, cmd); |
1406 | 1409 | ||
1407 | ret = soc_pcm_trigger(substream, cmd); | 1410 | ret = soc_pcm_trigger(substream, cmd); |
1408 | if (ret < 0) | 1411 | if (ret < 0) |
1409 | dev_err(dpcm->be->dev,"dpcm: trigger BE failed %d\n", ret); | 1412 | dev_err(dpcm->be->dev,"ASoC: trigger BE failed %d\n", ret); |
1410 | 1413 | ||
1411 | return ret; | 1414 | return ret; |
1412 | } | 1415 | } |
@@ -1517,12 +1520,12 @@ static int dpcm_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd) | |||
1517 | case SND_SOC_DPCM_TRIGGER_PRE: | 1520 | case SND_SOC_DPCM_TRIGGER_PRE: |
1518 | /* call trigger on the frontend before the backend. */ | 1521 | /* call trigger on the frontend before the backend. */ |
1519 | 1522 | ||
1520 | dev_dbg(fe->dev, "dpcm: pre trigger FE %s cmd %d\n", | 1523 | dev_dbg(fe->dev, "ASoC: pre trigger FE %s cmd %d\n", |
1521 | fe->dai_link->name, cmd); | 1524 | fe->dai_link->name, cmd); |
1522 | 1525 | ||
1523 | ret = soc_pcm_trigger(substream, cmd); | 1526 | ret = soc_pcm_trigger(substream, cmd); |
1524 | if (ret < 0) { | 1527 | if (ret < 0) { |
1525 | dev_err(fe->dev,"dpcm: trigger FE failed %d\n", ret); | 1528 | dev_err(fe->dev,"ASoC: trigger FE failed %d\n", ret); |
1526 | goto out; | 1529 | goto out; |
1527 | } | 1530 | } |
1528 | 1531 | ||
@@ -1533,11 +1536,11 @@ static int dpcm_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd) | |||
1533 | 1536 | ||
1534 | ret = dpcm_be_dai_trigger(fe, substream->stream, cmd); | 1537 | ret = dpcm_be_dai_trigger(fe, substream->stream, cmd); |
1535 | if (ret < 0) { | 1538 | if (ret < 0) { |
1536 | dev_err(fe->dev,"dpcm: trigger FE failed %d\n", ret); | 1539 | dev_err(fe->dev,"ASoC: trigger FE failed %d\n", ret); |
1537 | goto out; | 1540 | goto out; |
1538 | } | 1541 | } |
1539 | 1542 | ||
1540 | dev_dbg(fe->dev, "dpcm: post trigger FE %s cmd %d\n", | 1543 | dev_dbg(fe->dev, "ASoC: post trigger FE %s cmd %d\n", |
1541 | fe->dai_link->name, cmd); | 1544 | fe->dai_link->name, cmd); |
1542 | 1545 | ||
1543 | ret = soc_pcm_trigger(substream, cmd); | 1546 | ret = soc_pcm_trigger(substream, cmd); |
@@ -1545,17 +1548,17 @@ static int dpcm_fe_dai_trigger(struct snd_pcm_substream *substream, int cmd) | |||
1545 | case SND_SOC_DPCM_TRIGGER_BESPOKE: | 1548 | case SND_SOC_DPCM_TRIGGER_BESPOKE: |
1546 | /* bespoke trigger() - handles both FE and BEs */ | 1549 | /* bespoke trigger() - handles both FE and BEs */ |
1547 | 1550 | ||
1548 | dev_dbg(fe->dev, "dpcm: bespoke trigger FE %s cmd %d\n", | 1551 | dev_dbg(fe->dev, "ASoC: bespoke trigger FE %s cmd %d\n", |
1549 | fe->dai_link->name, cmd); | 1552 | fe->dai_link->name, cmd); |
1550 | 1553 | ||
1551 | ret = soc_pcm_bespoke_trigger(substream, cmd); | 1554 | ret = soc_pcm_bespoke_trigger(substream, cmd); |
1552 | if (ret < 0) { | 1555 | if (ret < 0) { |
1553 | dev_err(fe->dev,"dpcm: trigger FE failed %d\n", ret); | 1556 | dev_err(fe->dev,"ASoC: trigger FE failed %d\n", ret); |
1554 | goto out; | 1557 | goto out; |
1555 | } | 1558 | } |
1556 | break; | 1559 | break; |
1557 | default: | 1560 | default: |
1558 | dev_err(fe->dev, "dpcm: invalid trigger cmd %d for %s\n", cmd, | 1561 | dev_err(fe->dev, "ASoC: invalid trigger cmd %d for %s\n", cmd, |
1559 | fe->dai_link->name); | 1562 | fe->dai_link->name); |
1560 | ret = -EINVAL; | 1563 | ret = -EINVAL; |
1561 | goto out; | 1564 | goto out; |
@@ -1598,12 +1601,12 @@ static int dpcm_be_dai_prepare(struct snd_soc_pcm_runtime *fe, int stream) | |||
1598 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) | 1601 | (be->dpcm[stream].state != SND_SOC_DPCM_STATE_STOP)) |
1599 | continue; | 1602 | continue; |
1600 | 1603 | ||
1601 | dev_dbg(be->dev, "dpcm: prepare BE %s\n", | 1604 | dev_dbg(be->dev, "ASoC: prepare BE %s\n", |
1602 | dpcm->fe->dai_link->name); | 1605 | dpcm->fe->dai_link->name); |
1603 | 1606 | ||
1604 | ret = soc_pcm_prepare(be_substream); | 1607 | ret = soc_pcm_prepare(be_substream); |
1605 | if (ret < 0) { | 1608 | if (ret < 0) { |
1606 | dev_err(be->dev, "dpcm: backend prepare failed %d\n", | 1609 | dev_err(be->dev, "ASoC: backend prepare failed %d\n", |
1607 | ret); | 1610 | ret); |
1608 | break; | 1611 | break; |
1609 | } | 1612 | } |
@@ -1620,13 +1623,13 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream) | |||
1620 | 1623 | ||
1621 | mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); | 1624 | mutex_lock_nested(&fe->card->mutex, SND_SOC_CARD_CLASS_RUNTIME); |
1622 | 1625 | ||
1623 | dev_dbg(fe->dev, "dpcm: prepare FE %s\n", fe->dai_link->name); | 1626 | dev_dbg(fe->dev, "ASoC: prepare FE %s\n", fe->dai_link->name); |
1624 | 1627 | ||
1625 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE; | 1628 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_FE; |
1626 | 1629 | ||
1627 | /* there is no point preparing this FE if there are no BEs */ | 1630 | /* there is no point preparing this FE if there are no BEs */ |
1628 | if (list_empty(&fe->dpcm[stream].be_clients)) { | 1631 | if (list_empty(&fe->dpcm[stream].be_clients)) { |
1629 | dev_err(fe->dev, "dpcm: no backend DAIs enabled for %s\n", | 1632 | dev_err(fe->dev, "ASoC: no backend DAIs enabled for %s\n", |
1630 | fe->dai_link->name); | 1633 | fe->dai_link->name); |
1631 | ret = -EINVAL; | 1634 | ret = -EINVAL; |
1632 | goto out; | 1635 | goto out; |
@@ -1639,7 +1642,7 @@ static int dpcm_fe_dai_prepare(struct snd_pcm_substream *substream) | |||
1639 | /* call prepare on the frontend */ | 1642 | /* call prepare on the frontend */ |
1640 | ret = soc_pcm_prepare(substream); | 1643 | ret = soc_pcm_prepare(substream); |
1641 | if (ret < 0) { | 1644 | if (ret < 0) { |
1642 | dev_err(fe->dev,"dpcm: prepare FE %s failed\n", | 1645 | dev_err(fe->dev,"ASoC: prepare FE %s failed\n", |
1643 | fe->dai_link->name); | 1646 | fe->dai_link->name); |
1644 | goto out; | 1647 | goto out; |
1645 | } | 1648 | } |
@@ -1673,33 +1676,33 @@ static int dpcm_run_update_shutdown(struct snd_soc_pcm_runtime *fe, int stream) | |||
1673 | enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream]; | 1676 | enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream]; |
1674 | int err; | 1677 | int err; |
1675 | 1678 | ||
1676 | dev_dbg(fe->dev, "runtime %s close on FE %s\n", | 1679 | dev_dbg(fe->dev, "ASoC: runtime %s close on FE %s\n", |
1677 | stream ? "capture" : "playback", fe->dai_link->name); | 1680 | stream ? "capture" : "playback", fe->dai_link->name); |
1678 | 1681 | ||
1679 | if (trigger == SND_SOC_DPCM_TRIGGER_BESPOKE) { | 1682 | if (trigger == SND_SOC_DPCM_TRIGGER_BESPOKE) { |
1680 | /* call bespoke trigger - FE takes care of all BE triggers */ | 1683 | /* call bespoke trigger - FE takes care of all BE triggers */ |
1681 | dev_dbg(fe->dev, "dpcm: bespoke trigger FE %s cmd stop\n", | 1684 | dev_dbg(fe->dev, "ASoC: bespoke trigger FE %s cmd stop\n", |
1682 | fe->dai_link->name); | 1685 | fe->dai_link->name); |
1683 | 1686 | ||
1684 | err = soc_pcm_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_STOP); | 1687 | err = soc_pcm_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_STOP); |
1685 | if (err < 0) | 1688 | if (err < 0) |
1686 | dev_err(fe->dev,"dpcm: trigger FE failed %d\n", err); | 1689 | dev_err(fe->dev,"ASoC: trigger FE failed %d\n", err); |
1687 | } else { | 1690 | } else { |
1688 | dev_dbg(fe->dev, "dpcm: trigger FE %s cmd stop\n", | 1691 | dev_dbg(fe->dev, "ASoC: trigger FE %s cmd stop\n", |
1689 | fe->dai_link->name); | 1692 | fe->dai_link->name); |
1690 | 1693 | ||
1691 | err = dpcm_be_dai_trigger(fe, stream, SNDRV_PCM_TRIGGER_STOP); | 1694 | err = dpcm_be_dai_trigger(fe, stream, SNDRV_PCM_TRIGGER_STOP); |
1692 | if (err < 0) | 1695 | if (err < 0) |
1693 | dev_err(fe->dev,"dpcm: trigger FE failed %d\n", err); | 1696 | dev_err(fe->dev,"ASoC: trigger FE failed %d\n", err); |
1694 | } | 1697 | } |
1695 | 1698 | ||
1696 | err = dpcm_be_dai_hw_free(fe, stream); | 1699 | err = dpcm_be_dai_hw_free(fe, stream); |
1697 | if (err < 0) | 1700 | if (err < 0) |
1698 | dev_err(fe->dev,"dpcm: hw_free FE failed %d\n", err); | 1701 | dev_err(fe->dev,"ASoC: hw_free FE failed %d\n", err); |
1699 | 1702 | ||
1700 | err = dpcm_be_dai_shutdown(fe, stream); | 1703 | err = dpcm_be_dai_shutdown(fe, stream); |
1701 | if (err < 0) | 1704 | if (err < 0) |
1702 | dev_err(fe->dev,"dpcm: shutdown FE failed %d\n", err); | 1705 | dev_err(fe->dev,"ASoC: shutdown FE failed %d\n", err); |
1703 | 1706 | ||
1704 | /* run the stream event for each BE */ | 1707 | /* run the stream event for each BE */ |
1705 | dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_NOP); | 1708 | dpcm_dapm_stream_event(fe, stream, SND_SOC_DAPM_STREAM_NOP); |
@@ -1715,7 +1718,7 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream) | |||
1715 | enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream]; | 1718 | enum snd_soc_dpcm_trigger trigger = fe->dai_link->trigger[stream]; |
1716 | int ret; | 1719 | int ret; |
1717 | 1720 | ||
1718 | dev_dbg(fe->dev, "runtime %s open on FE %s\n", | 1721 | dev_dbg(fe->dev, "ASoC: runtime %s open on FE %s\n", |
1719 | stream ? "capture" : "playback", fe->dai_link->name); | 1722 | stream ? "capture" : "playback", fe->dai_link->name); |
1720 | 1723 | ||
1721 | /* Only start the BE if the FE is ready */ | 1724 | /* Only start the BE if the FE is ready */ |
@@ -1761,22 +1764,22 @@ static int dpcm_run_update_startup(struct snd_soc_pcm_runtime *fe, int stream) | |||
1761 | 1764 | ||
1762 | if (trigger == SND_SOC_DPCM_TRIGGER_BESPOKE) { | 1765 | if (trigger == SND_SOC_DPCM_TRIGGER_BESPOKE) { |
1763 | /* call trigger on the frontend - FE takes care of all BE triggers */ | 1766 | /* call trigger on the frontend - FE takes care of all BE triggers */ |
1764 | dev_dbg(fe->dev, "dpcm: bespoke trigger FE %s cmd start\n", | 1767 | dev_dbg(fe->dev, "ASoC: bespoke trigger FE %s cmd start\n", |
1765 | fe->dai_link->name); | 1768 | fe->dai_link->name); |
1766 | 1769 | ||
1767 | ret = soc_pcm_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_START); | 1770 | ret = soc_pcm_bespoke_trigger(substream, SNDRV_PCM_TRIGGER_START); |
1768 | if (ret < 0) { | 1771 | if (ret < 0) { |
1769 | dev_err(fe->dev,"dpcm: bespoke trigger FE failed %d\n", ret); | 1772 | dev_err(fe->dev,"ASoC: bespoke trigger FE failed %d\n", ret); |
1770 | goto hw_free; | 1773 | goto hw_free; |
1771 | } | 1774 | } |
1772 | } else { | 1775 | } else { |
1773 | dev_dbg(fe->dev, "dpcm: trigger FE %s cmd start\n", | 1776 | dev_dbg(fe->dev, "ASoC: trigger FE %s cmd start\n", |
1774 | fe->dai_link->name); | 1777 | fe->dai_link->name); |
1775 | 1778 | ||
1776 | ret = dpcm_be_dai_trigger(fe, stream, | 1779 | ret = dpcm_be_dai_trigger(fe, stream, |
1777 | SNDRV_PCM_TRIGGER_START); | 1780 | SNDRV_PCM_TRIGGER_START); |
1778 | if (ret < 0) { | 1781 | if (ret < 0) { |
1779 | dev_err(fe->dev,"dpcm: trigger FE failed %d\n", ret); | 1782 | dev_err(fe->dev,"ASoC: trigger FE failed %d\n", ret); |
1780 | goto hw_free; | 1783 | goto hw_free; |
1781 | } | 1784 | } |
1782 | } | 1785 | } |
@@ -1805,7 +1808,7 @@ static int dpcm_run_new_update(struct snd_soc_pcm_runtime *fe, int stream) | |||
1805 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; | 1808 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; |
1806 | ret = dpcm_run_update_startup(fe, stream); | 1809 | ret = dpcm_run_update_startup(fe, stream); |
1807 | if (ret < 0) | 1810 | if (ret < 0) |
1808 | dev_err(fe->dev, "failed to startup some BEs\n"); | 1811 | dev_err(fe->dev, "ASoC: failed to startup some BEs\n"); |
1809 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO; | 1812 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO; |
1810 | 1813 | ||
1811 | return ret; | 1814 | return ret; |
@@ -1818,7 +1821,7 @@ static int dpcm_run_old_update(struct snd_soc_pcm_runtime *fe, int stream) | |||
1818 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; | 1821 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_BE; |
1819 | ret = dpcm_run_update_shutdown(fe, stream); | 1822 | ret = dpcm_run_update_shutdown(fe, stream); |
1820 | if (ret < 0) | 1823 | if (ret < 0) |
1821 | dev_err(fe->dev, "failed to shutdown some BEs\n"); | 1824 | dev_err(fe->dev, "ASoC: failed to shutdown some BEs\n"); |
1822 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO; | 1825 | fe->dpcm[stream].runtime_update = SND_SOC_DPCM_UPDATE_NO; |
1823 | 1826 | ||
1824 | return ret; | 1827 | return ret; |
@@ -1853,7 +1856,7 @@ int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *widget) | |||
1853 | continue; | 1856 | continue; |
1854 | 1857 | ||
1855 | /* DAPM sync will call this to update DSP paths */ | 1858 | /* DAPM sync will call this to update DSP paths */ |
1856 | dev_dbg(fe->dev, "DPCM runtime update for FE %s\n", | 1859 | dev_dbg(fe->dev, "ASoC: DPCM runtime update for FE %s\n", |
1857 | fe->dai_link->name); | 1860 | fe->dai_link->name); |
1858 | 1861 | ||
1859 | /* skip if FE doesn't have playback capability */ | 1862 | /* skip if FE doesn't have playback capability */ |
@@ -1862,7 +1865,7 @@ int soc_dpcm_runtime_update(struct snd_soc_dapm_widget *widget) | |||
1862 | 1865 | ||
1863 | paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_PLAYBACK, &list); | 1866 | paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_PLAYBACK, &list); |
1864 | if (paths < 0) { | 1867 | if (paths < 0) { |
1865 | dev_warn(fe->dev, "%s no valid %s path\n", | 1868 | dev_warn(fe->dev, "ASoC: %s no valid %s path\n", |
1866 | fe->dai_link->name, "playback"); | 1869 | fe->dai_link->name, "playback"); |
1867 | mutex_unlock(&card->mutex); | 1870 | mutex_unlock(&card->mutex); |
1868 | return paths; | 1871 | return paths; |
@@ -1891,7 +1894,7 @@ capture: | |||
1891 | 1894 | ||
1892 | paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_CAPTURE, &list); | 1895 | paths = dpcm_path_get(fe, SNDRV_PCM_STREAM_CAPTURE, &list); |
1893 | if (paths < 0) { | 1896 | if (paths < 0) { |
1894 | dev_warn(fe->dev, "%s no valid %s path\n", | 1897 | dev_warn(fe->dev, "ASoC: %s no valid %s path\n", |
1895 | fe->dai_link->name, "capture"); | 1898 | fe->dai_link->name, "capture"); |
1896 | mutex_unlock(&card->mutex); | 1899 | mutex_unlock(&card->mutex); |
1897 | return paths; | 1900 | return paths; |
@@ -1934,7 +1937,7 @@ int soc_dpcm_be_digital_mute(struct snd_soc_pcm_runtime *fe, int mute) | |||
1934 | if (be->dai_link->ignore_suspend) | 1937 | if (be->dai_link->ignore_suspend) |
1935 | continue; | 1938 | continue; |
1936 | 1939 | ||
1937 | dev_dbg(be->dev, "BE digital mute %s\n", be->dai_link->name); | 1940 | dev_dbg(be->dev, "ASoC: BE digital mute %s\n", be->dai_link->name); |
1938 | 1941 | ||
1939 | if (drv->ops->digital_mute && dai->playback_active) | 1942 | if (drv->ops->digital_mute && dai->playback_active) |
1940 | drv->ops->digital_mute(dai, mute); | 1943 | drv->ops->digital_mute(dai, mute); |
@@ -1955,7 +1958,7 @@ static int dpcm_fe_dai_open(struct snd_pcm_substream *fe_substream) | |||
1955 | fe->dpcm[stream].runtime = fe_substream->runtime; | 1958 | fe->dpcm[stream].runtime = fe_substream->runtime; |
1956 | 1959 | ||
1957 | if (dpcm_path_get(fe, stream, &list) <= 0) { | 1960 | if (dpcm_path_get(fe, stream, &list) <= 0) { |
1958 | dev_dbg(fe->dev, "asoc: %s no valid %s route\n", | 1961 | dev_dbg(fe->dev, "ASoC: %s no valid %s route\n", |
1959 | fe->dai_link->name, stream ? "capture" : "playback"); | 1962 | fe->dai_link->name, stream ? "capture" : "playback"); |
1960 | } | 1963 | } |
1961 | 1964 | ||
@@ -2039,11 +2042,11 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) | |||
2039 | capture, &pcm); | 2042 | capture, &pcm); |
2040 | } | 2043 | } |
2041 | if (ret < 0) { | 2044 | if (ret < 0) { |
2042 | dev_err(rtd->card->dev, "can't create pcm for %s\n", | 2045 | dev_err(rtd->card->dev, "ASoC: can't create pcm for %s\n", |
2043 | rtd->dai_link->name); | 2046 | rtd->dai_link->name); |
2044 | return ret; | 2047 | return ret; |
2045 | } | 2048 | } |
2046 | dev_dbg(rtd->card->dev, "registered pcm #%d %s\n",num, new_name); | 2049 | dev_dbg(rtd->card->dev, "ASoC: registered pcm #%d %s\n",num, new_name); |
2047 | 2050 | ||
2048 | /* DAPM dai link stream work */ | 2051 | /* DAPM dai link stream work */ |
2049 | INIT_DELAYED_WORK(&rtd->delayed_work, close_delayed_work); | 2052 | INIT_DELAYED_WORK(&rtd->delayed_work, close_delayed_work); |
@@ -2097,7 +2100,9 @@ int soc_new_pcm(struct snd_soc_pcm_runtime *rtd, int num) | |||
2097 | if (platform->driver->pcm_new) { | 2100 | if (platform->driver->pcm_new) { |
2098 | ret = platform->driver->pcm_new(rtd); | 2101 | ret = platform->driver->pcm_new(rtd); |
2099 | if (ret < 0) { | 2102 | if (ret < 0) { |
2100 | dev_err(platform->dev, "pcm constructor failed\n"); | 2103 | dev_err(platform->dev, |
2104 | "ASoC: pcm constructor failed: %d\n", | ||
2105 | ret); | ||
2101 | return ret; | 2106 | return ret; |
2102 | } | 2107 | } |
2103 | } | 2108 | } |