* [PATCH v2] ASoC: dapm: Add output driver widget
@ 2010-12-11 3:11 Olaya, Margarita
2010-12-14 14:22 ` Mark Brown
0 siblings, 1 reply; 2+ messages in thread
From: Olaya, Margarita @ 2010-12-11 3:11 UTC (permalink / raw)
To: Mark Brown, Liam Girdwood; +Cc: alsa-devel
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>
---
include/sound/soc-dapm.h | 10 ++++++++++
sound/soc/soc-dapm.c | 6 ++++++
2 files changed, 16 insertions(+), 0 deletions(-)
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index 041e98b..2f76a51 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -71,6 +71,10 @@
wcontrols, wncontrols) \
{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
+#define SND_SOC_DAPM_OUT_DRV(wname, wreg, wshift, winvert,\
+ wcontrols, wncontrols) \
+{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
+ .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols}
#define SND_SOC_DAPM_MIXER(wname, wreg, wshift, winvert, \
wcontrols, wncontrols)\
{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
@@ -115,6 +119,11 @@
{ .id = snd_soc_dapm_pga, .name = wname, .reg = wreg, .shift = wshift, \
.invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
.event = wevent, .event_flags = wflags}
+#define SND_SOC_DAPM_OUT_DRV_E(wname, wreg, wshift, winvert, wcontrols, \
+ wncontrols, wevent, wflags) \
+{ .id = snd_soc_dapm_out_drv, .name = wname, .reg = wreg, .shift = wshift, \
+ .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \
+ .event = wevent, .event_flags = wflags}
#define SND_SOC_DAPM_MIXER_E(wname, wreg, wshift, winvert, wcontrols, \
wncontrols, wevent, wflags) \
{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \
@@ -368,6 +377,7 @@ enum snd_soc_dapm_type {
snd_soc_dapm_mixer, /* mixes several analog signals together */
snd_soc_dapm_mixer_named_ctl, /* mixer with named controls */
snd_soc_dapm_pga, /* programmable gain/attenuation (volume) */
+ snd_soc_dapm_out_drv, /* output driver */
snd_soc_dapm_adc, /* analog to digital converter */
snd_soc_dapm_dac, /* digital to analog converter */
snd_soc_dapm_micbias, /* microphone bias (power) */
diff --git a/sound/soc/soc-dapm.c b/sound/soc/soc-dapm.c
index 6a29d59..31e9681 100644
--- a/sound/soc/soc-dapm.c
+++ b/sound/soc/soc-dapm.c
@@ -62,6 +62,7 @@ static int dapm_up_seq[] = {
[snd_soc_dapm_mixer_named_ctl] = 7,
[snd_soc_dapm_pga] = 8,
[snd_soc_dapm_adc] = 9,
+ [snd_soc_dapm_out_drv] = 10,
[snd_soc_dapm_hp] = 10,
[snd_soc_dapm_spk] = 10,
[snd_soc_dapm_post] = 11,
@@ -72,6 +73,7 @@ static int dapm_down_seq[] = {
[snd_soc_dapm_adc] = 1,
[snd_soc_dapm_hp] = 2,
[snd_soc_dapm_spk] = 2,
+ [snd_soc_dapm_out_drv] = 2,
[snd_soc_dapm_pga] = 4,
[snd_soc_dapm_mixer_named_ctl] = 5,
[snd_soc_dapm_mixer] = 5,
@@ -231,6 +233,7 @@ static void dapm_set_path_status(struct snd_soc_dapm_widget *w,
break;
/* does not effect routing - always connected */
case snd_soc_dapm_pga:
+ case snd_soc_dapm_out_drv:
case snd_soc_dapm_output:
case snd_soc_dapm_adc:
case snd_soc_dapm_input:
@@ -1243,6 +1246,7 @@ static ssize_t dapm_widget_show(struct device *dev,
case snd_soc_dapm_dac:
case snd_soc_dapm_adc:
case snd_soc_dapm_pga:
+ case snd_soc_dapm_out_drv:
case snd_soc_dapm_mixer:
case snd_soc_dapm_mixer_named_ctl:
case snd_soc_dapm_supply:
@@ -1421,6 +1425,7 @@ static int snd_soc_dapm_add_route(struct snd_soc_dapm_context *dapm,
case snd_soc_dapm_adc:
case snd_soc_dapm_dac:
case snd_soc_dapm_pga:
+ case snd_soc_dapm_out_drv:
case snd_soc_dapm_input:
case snd_soc_dapm_output:
case snd_soc_dapm_micbias:
@@ -1538,6 +1543,7 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm)
w->power_check = dapm_dac_check_power;
break;
case snd_soc_dapm_pga:
+ case snd_soc_dapm_out_drv:
w->power_check = dapm_generic_check_power;
dapm_new_pga(dapm, w);
break;
--
1.7.0.4
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH v2] ASoC: dapm: Add output driver widget
2010-12-11 3:11 [PATCH v2] ASoC: dapm: Add output driver widget Olaya, Margarita
@ 2010-12-14 14:22 ` Mark Brown
0 siblings, 0 replies; 2+ messages in thread
From: Mark Brown @ 2010-12-14 14:22 UTC (permalink / raw)
To: Olaya, Margarita; +Cc: alsa-devel, Liam Girdwood
On Fri, Dec 10, 2010 at 09:11:44PM -0600, Olaya, Margarita wrote:
> 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>
Applied, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-12-14 14:22 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-11 3:11 [PATCH v2] ASoC: dapm: Add output driver widget Olaya, Margarita
2010-12-14 14:22 ` Mark Brown
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.