aboutsummaryrefslogtreecommitdiffstats
path: root/sound/soc/soc-dapm.c
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2009-08-17 12:39:22 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2009-08-18 11:06:08 -0400
commit010ff262269c6ad84acba98eab2d7843919c7ccf (patch)
treec78ac453debd029144d4ca2a3c8a150bddd5c974 /sound/soc/soc-dapm.c
parent1ca04065c3569beb42b9376952df8c96f430f753 (diff)
ASoC: Add input and output AIF widgets
Currently DAPM interfaces with the audio streams to and from the processor at the DAC and ADC widgets. As the digital capabilities of parts increases this is becoming a less and less able to meet the needs of parts. To meet the needs of these devices create new widgets interfacing with the TDM bus but not integrated into any other functionality. Audio can then be routed to and from these widgets using existing routing widgets. A slot number is provided in the definition but this is currently not used yet. This is intended to support devices which can use more than one TDM slot on a single interface. Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
Diffstat (limited to 'sound/soc/soc-dapm.c')
-rw-r--r--sound/soc/soc-dapm.c58
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
71static int dapm_down_seq[] = { 73static 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
88static void pop_wait(u32 pop_time) 92static 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: