aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlaya, Margarita <magi.olaya@ti.com>2010-12-10 22:11:44 -0500
committerMark Brown <broonie@opensource.wolfsonmicro.com>2010-12-14 06:12:11 -0500
commitd88429a695a4a9ec66e90068956bbccb25d4ac6d (patch)
treec3f1460d15e9bade29d82bea42c9995398ef94e1
parent5a7743edac3d720a52e721229938d21d40f045ce (diff)
ASoC: dapm: Add output driver widget
In some cases it was not possible to follow the appropiate power ON/OFF sequence like in cases where the PGA needs to be enabled before the driver and disabled before the PGA for pop reduction. Add a widget to support output driver (speaker, haptic, vibra, etc) drivers where power ON/OFF ordering is important. Signed-off-by: Margarita Olaya Cabrera <magi.olaya@ti.com> Acked-by: Liam Girdwood <lrg@slimlogic.co.uk> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
-rw-r--r--include/sound/soc-dapm.h10
-rw-r--r--sound/soc/soc-dapm.c6
2 files changed, 16 insertions, 0 deletions
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 041e98b493b7..2f76a51bbaac 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -71,6 +71,10 @@
71 wcontrols, wncontrols) \ 71 wcontrols, wncontrols) \
72{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 72{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
73 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} 73 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
74#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
75 wcontrols, wncontrols) \
76{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
77 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
74#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \ 78#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
75 wcontrols, wncontrols)\ 79 wcontrols, wncontrols)\
76{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 80{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
@@ -115,6 +119,11 @@
115{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \ 119{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
116 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ 120 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
117 .event = wevent, .event_flags = wflags} 121 .event = wevent, .event_flags = wflags}
122#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
123 wncontrols, wevent, wflags) \
124{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
125 .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
126 .event = wevent, .event_flags = wflags}
118#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \ 127#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
119 wncontrols, wevent, wflags) \ 128 wncontrols, wevent, wflags) \
120{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ 129{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
@@ -368,6 +377,7 @@ enum snd_soc_dapm_type {
368 snd_soc_dapm_mixer, /* mixes several analog signals together */ 377 snd_soc_dapm_mixer, /* mixes several analog signals together */
369 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */ 378 snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */
370 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */ 379 snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
380 snd_soc_dapm_out_drv, /* output driver */
371 snd_soc_dapm_adc, /* analog to digital converter */ 381 snd_soc_dapm_adc, /* analog to digital converter */
372 snd_soc_dapm_dac, /* digital to analog converter */ 382 snd_soc_dapm_dac, /* digital to analog converter */
373 snd_soc_dapm_micbias, /* microphone bias (power) */ 383 snd_soc_dapm_micbias, /* microphone bias (power) */
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index b521a139305a..3d310af28907 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -62,6 +62,7 @@ static int dapm_up_seq[] = {
62 [snd_soc_dapm_mixer_named_ctl] = 7, 62 [snd_soc_dapm_mixer_named_ctl] = 7,
63 [snd_soc_dapm_pga] = 8, 63 [snd_soc_dapm_pga] = 8,
64 [snd_soc_dapm_adc] = 9, 64 [snd_soc_dapm_adc] = 9,
65 [snd_soc_dapm_out_drv] = 10,
65 [snd_soc_dapm_hp] = 10, 66 [snd_soc_dapm_hp] = 10,
66 [snd_soc_dapm_spk] = 10, 67 [snd_soc_dapm_spk] = 10,
67 [snd_soc_dapm_post] = 11, 68 [snd_soc_dapm_post] = 11,
@@ -72,6 +73,7 @@ static int dapm_down_seq[] = {
72 [snd_soc_dapm_adc] = 1, 73 [snd_soc_dapm_adc] = 1,
73 [snd_soc_dapm_hp] = 2, 74 [snd_soc_dapm_hp] = 2,
74 [snd_soc_dapm_spk] = 2, 75 [snd_soc_dapm_spk] = 2,
76 [snd_soc_dapm_out_drv] = 2,
75 [snd_soc_dapm_pga] = 4, 77 [snd_soc_dapm_pga] = 4,
76 [snd_soc_dapm_mixer_named_ctl] = 5, 78 [snd_soc_dapm_mixer_named_ctl] = 5,
77 [snd_soc_dapm_mixer] = 5, 79 [snd_soc_dapm_mixer] = 5,
@@ -235,6 +237,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
235 break; 237 break;
236 /* does not effect routing - always connected */ 238 /* does not effect routing - always connected */
237 case snd_soc_dapm_pga: 239 case snd_soc_dapm_pga:
240 case snd_soc_dapm_out_drv:
238 case snd_soc_dapm_output: 241 case snd_soc_dapm_output:
239 case snd_soc_dapm_adc: 242 case snd_soc_dapm_adc:
240 case snd_soc_dapm_input: 243 case snd_soc_dapm_input:
@@ -1250,6 +1253,7 @@ static ssize_t dapm_widget_show(struct device *dev,
1250 case snd_soc_dapm_dac: 1253 case snd_soc_dapm_dac:
1251 case snd_soc_dapm_adc: 1254 case snd_soc_dapm_adc:
1252 case snd_soc_dapm_pga: 1255 case snd_soc_dapm_pga:
1256 case snd_soc_dapm_out_drv:
1253 case snd_soc_dapm_mixer: 1257 case snd_soc_dapm_mixer:
1254 case snd_soc_dapm_mixer_named_ctl: 1258 case snd_soc_dapm_mixer_named_ctl:
1255 case snd_soc_dapm_supply: 1259 case snd_soc_dapm_supply:
@@ -1428,6 +1432,7 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm,
1428 case snd_soc_dapm_adc: 1432 case snd_soc_dapm_adc:
1429 case snd_soc_dapm_dac: 1433 case snd_soc_dapm_dac:
1430 case snd_soc_dapm_pga: 1434 case snd_soc_dapm_pga:
1435 case snd_soc_dapm_out_drv:
1431 case snd_soc_dapm_input: 1436 case snd_soc_dapm_input:
1432 case snd_soc_dapm_output: 1437 case snd_soc_dapm_output:
1433 case snd_soc_dapm_micbias: 1438 case snd_soc_dapm_micbias:
@@ -1545,6 +1550,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm)
1545 w->power_check = dapm_dac_check_power; 1550 w->power_check = dapm_dac_check_power;
1546 break; 1551 break;
1547 case snd_soc_dapm_pga: 1552 case snd_soc_dapm_pga:
1553 case snd_soc_dapm_out_drv:
1548 w->power_check = dapm_generic_check_power; 1554 w->power_check = dapm_generic_check_power;
1549 dapm_new_pga(dapm, w); 1555 dapm_new_pga(dapm, w);
1550 break; 1556 break;