diff options
Diffstat (limited to 'sound/soc')
-rw-r--r-- | sound/soc/soc-dapm.c | 58 |
1 files changed, 41 insertions, 17 deletions
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c index 88461310dc96..a225e5a290c6 100644 --- a/sound/soc/soc-dapm.c +++ b/sound/soc/soc-dapm.c | |||
@@ -55,17 +55,19 @@ static int dapm_up_seq[] = { | |||
55 | [snd_soc_dapm_pre] = 0, | 55 | [snd_soc_dapm_pre] = 0, |
56 | [snd_soc_dapm_supply] = 1, | 56 | [snd_soc_dapm_supply] = 1, |
57 | [snd_soc_dapm_micbias] = 2, | 57 | [snd_soc_dapm_micbias] = 2, |
58 | [snd_soc_dapm_mic] = 3, | 58 | [snd_soc_dapm_aif_in] = 3, |
59 | [snd_soc_dapm_mux] = 4, | 59 | [snd_soc_dapm_aif_out] = 3, |
60 | [snd_soc_dapm_value_mux] = 4, | 60 | [snd_soc_dapm_mic] = 4, |
61 | [snd_soc_dapm_dac] = 5, | 61 | [snd_soc_dapm_mux] = 5, |
62 | [snd_soc_dapm_mixer] = 6, | 62 | [snd_soc_dapm_value_mux] = 5, |
63 | [snd_soc_dapm_mixer_named_ctl] = 6, | 63 | [snd_soc_dapm_dac] = 6, |
64 | [snd_soc_dapm_pga] = 7, | 64 | [snd_soc_dapm_mixer] = 7, |
65 | [snd_soc_dapm_adc] = 8, | 65 | [snd_soc_dapm_mixer_named_ctl] = 7, |
66 | [snd_soc_dapm_hp] = 9, | 66 | [snd_soc_dapm_pga] = 8, |
67 | [snd_soc_dapm_spk] = 9, | 67 | [snd_soc_dapm_adc] = 9, |
68 | [snd_soc_dapm_post] = 10, | 68 | [snd_soc_dapm_hp] = 10, |
69 | [snd_soc_dapm_spk] = 10, | ||
70 | [snd_soc_dapm_post] = 11, | ||
69 | }; | 71 | }; |
70 | 72 | ||
71 | static int dapm_down_seq[] = { | 73 | static int dapm_down_seq[] = { |
@@ -81,8 +83,10 @@ static int dapm_down_seq[] = { | |||
81 | [snd_soc_dapm_micbias] = 8, | 83 | [snd_soc_dapm_micbias] = 8, |
82 | [snd_soc_dapm_mux] = 9, | 84 | [snd_soc_dapm_mux] = 9, |
83 | [snd_soc_dapm_value_mux] = 9, | 85 | [snd_soc_dapm_value_mux] = 9, |
84 | [snd_soc_dapm_supply] = 10, | 86 | [snd_soc_dapm_aif_in] = 10, |
85 | [snd_soc_dapm_post] = 11, | 87 | [snd_soc_dapm_aif_out] = 10, |
88 | [snd_soc_dapm_supply] = 11, | ||
89 | [snd_soc_dapm_post] = 12, | ||
86 | }; | 90 | }; |
87 | 91 | ||
88 | static void pop_wait(u32 pop_time) | 92 | static void pop_wait(u32 pop_time) |
@@ -224,6 +228,8 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w, | |||
224 | case snd_soc_dapm_micbias: | 228 | case snd_soc_dapm_micbias: |
225 | case snd_soc_dapm_vmid: | 229 | case snd_soc_dapm_vmid: |
226 | case snd_soc_dapm_supply: | 230 | case snd_soc_dapm_supply: |
231 | case snd_soc_dapm_aif_in: | ||
232 | case snd_soc_dapm_aif_out: | ||
227 | p->connect = 1; | 233 | p->connect = 1; |
228 | break; | 234 | break; |
229 | /* does effect routing - dynamically connected */ | 235 | /* does effect routing - dynamically connected */ |
@@ -497,8 +503,14 @@ static int is_connected_output_ep(struct snd_soc_dapm_widget *widget) | |||
497 | if (widget->id == snd_soc_dapm_supply) | 503 | if (widget->id == snd_soc_dapm_supply) |
498 | return 0; | 504 | return 0; |
499 | 505 | ||
500 | if (widget->id == snd_soc_dapm_adc && widget->active) | 506 | switch (widget->id) { |
501 | return 1; | 507 | case snd_soc_dapm_adc: |
508 | case snd_soc_dapm_aif_out: | ||
509 | if (widget->active) | ||
510 | return 1; | ||
511 | default: | ||
512 | break; | ||
513 | } | ||
502 | 514 | ||
503 | if (widget->connected) { | 515 | if (widget->connected) { |
504 | /* connected pin ? */ | 516 | /* connected pin ? */ |
@@ -537,8 +549,14 @@ static int is_connected_input_ep(struct snd_soc_dapm_widget *widget) | |||
537 | return 0; | 549 | return 0; |
538 | 550 | ||
539 | /* active stream ? */ | 551 | /* active stream ? */ |
540 | if (widget->id == snd_soc_dapm_dac && widget->active) | 552 | switch (widget->id) { |
541 | return 1; | 553 | case snd_soc_dapm_dac: |
554 | case snd_soc_dapm_aif_in: | ||
555 | if (widget->active) | ||
556 | return 1; | ||
557 | default: | ||
558 | break; | ||
559 | } | ||
542 | 560 | ||
543 | if (widget->connected) { | 561 | if (widget->connected) { |
544 | /* connected pin ? */ | 562 | /* connected pin ? */ |
@@ -1052,6 +1070,8 @@ static void dbg_dump_dapm(struct snd_soc_codec* codec, const char *action) | |||
1052 | case snd_soc_dapm_mixer: | 1070 | case snd_soc_dapm_mixer: |
1053 | case snd_soc_dapm_mixer_named_ctl: | 1071 | case snd_soc_dapm_mixer_named_ctl: |
1054 | case snd_soc_dapm_supply: | 1072 | case snd_soc_dapm_supply: |
1073 | case snd_soc_dapm_aif_in: | ||
1074 | case snd_soc_dapm_aif_out: | ||
1055 | if (w->name) { | 1075 | if (w->name) { |
1056 | in = is_connected_input_ep(w); | 1076 | in = is_connected_input_ep(w); |
1057 | dapm_clear_walk(w->codec); | 1077 | dapm_clear_walk(w->codec); |
@@ -1342,6 +1362,8 @@ static int snd_soc_dapm_add_route(struct snd_soc_codec *codec, | |||
1342 | case snd_soc_dapm_pre: | 1362 | case snd_soc_dapm_pre: |
1343 | case snd_soc_dapm_post: | 1363 | case snd_soc_dapm_post: |
1344 | case snd_soc_dapm_supply: | 1364 | case snd_soc_dapm_supply: |
1365 | case snd_soc_dapm_aif_in: | ||
1366 | case snd_soc_dapm_aif_out: | ||
1345 | list_add(&path->list, &codec->dapm_paths); | 1367 | list_add(&path->list, &codec->dapm_paths); |
1346 | list_add(&path->list_sink, &wsink->sources); | 1368 | list_add(&path->list_sink, &wsink->sources); |
1347 | list_add(&path->list_source, &wsource->sinks); | 1369 | list_add(&path->list_source, &wsource->sinks); |
@@ -1444,9 +1466,11 @@ int snd_soc_dapm_new_widgets(struct snd_soc_codec *codec) | |||
1444 | dapm_new_mux(codec, w); | 1466 | dapm_new_mux(codec, w); |
1445 | break; | 1467 | break; |
1446 | case snd_soc_dapm_adc: | 1468 | case snd_soc_dapm_adc: |
1469 | case snd_soc_dapm_aif_out: | ||
1447 | w->power_check = dapm_adc_check_power; | 1470 | w->power_check = dapm_adc_check_power; |
1448 | break; | 1471 | break; |
1449 | case snd_soc_dapm_dac: | 1472 | case snd_soc_dapm_dac: |
1473 | case snd_soc_dapm_aif_in: | ||
1450 | w->power_check = dapm_dac_check_power; | 1474 | w->power_check = dapm_dac_check_power; |
1451 | break; | 1475 | break; |
1452 | case snd_soc_dapm_pga: | 1476 | case snd_soc_dapm_pga: |