ASoC: add new DAPM control
Subsystems (3)
PATCH 1/1 ASoC: add new DAPM control
Hi.
The attached patch adds a new mixer control that allows cleaner support for the wm9705 codec Im working on. I think it probably has wider uses though.
It saves a few bytes too in shorter names :-)
If you prefer I have it available in:
git://git.mnementh.co.uk/linux-2.6-im.git asoc
and on gitweb at:
http://git.mnementh.co.uk/cgi-bin/gitweb.cgi?p=linux-2.6-im.git;a=shortlog;h=refs/heads/asoc
Quoted 1 line
From
301ed82738ca0210ec0885554edabe0090ec2f9cMon Sep 17 00:00:00 2001
From: Ian Molton <[email protected]>
Date: Tue, 6 Jan 2009 20:11:51 +0000
Subject: [PATCH] ASoC: dapm: Allow explictly named mixer controls
This patch allows you to define the mixer paths as having the same name as the paths they represent.
This is required to support codecs such as the wm9705 neatly without extra controls in the alsa mixer.
--- Documentation/sound/alsa/soc/dapm.txt | 3 ++ include/sound/soc-dapm.h | 11 ++++++++ sound/soc/soc-dapm.c | 46 +++++++++++++++++++++++++-------- 3 files changed, 49 insertions(+), 11 deletions(-)
Documentation/sound/alsa/soc/dapm.txt +3 -0
@@ -116,6 +116,9 @@ SOC_DAPM_SINGLE("HiFi Playback Switch", WM8731_APANA, 4, 1, 0), SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, wm8731_output_mixer_controls, ARRAY_SIZE(wm8731_output_mixer_controls)), +If you dont want the mixer elements prefixed with the name of the mixer widget, +you can use SND_SOC_DAPM_MIXER_NAMED_CTL instead. the parameters are the same +as for SND_SOC_DAPM_MIXER. 2.3 Platform/Machine domain Widgets -----------------------------------
include/sound/soc-dapm.h +11 -0
@@ -76,6 +76,11 @@ wcontrols, wncontrols)\ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols} +#define SND_SOC_DAPM_MIXER_NAMED_CTL (wname, wreg, wshift, winvert, \ + wcontrols, wncontrols)\ +{ .id = snd_soc_dapm_mixer_named_ctl, .name = wname, .reg = wreg, \ + .shift = wshift, .invert = winvert, .kcontrols = wcontrols, \ + .num_kcontrols = wncontrols}#define SND_SOC_DAPM_MICBIAS (wname, wreg, wshift, winvert) \ { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0}
@@ -101,6 +106,11 @@ { .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ .invert = winvert, .kcontrols = wcontrols, .num_kcontrols = wncontrols, \ .event = wevent, .event_flags = wflags} +#define SND_SOC_DAPM_MIXER_NAMED_CTL_E (wname, wreg, wshift, winvert, \ + wcontrols, wncontrols, wevent, wflags) \ +{ .id = snd_soc_dapm_mixer, .name = wname, .reg = wreg, .shift = wshift, \ + .invert = winvert, .kcontrols = wcontrols, \ + .num_kcontrols = wncontrols, .event = wevent, .event_flags = wflags}#define SND_SOC_DAPM_MICBIAS_E (wname, wreg, wshift, winvert, wevent, wflags) \ { .id = snd_soc_dapm_micbias, .name = wname, .reg = wreg, .shift = wshift, \ .invert = winvert, .kcontrols = NULL, .num_kcontrols = 0, \
@@ -263,6 +273,7 @@ enum snd_soc_dapm_type { snd_soc_dapm_mux,/* selects 1 analog signal from many inputs */ snd_soc_dapm_value_mux,/* selects 1 analog signal from many inputs */ 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_adc,/* analog to digital converter */ snd_soc_dapm_dac, /* digital to analog converter */
sound/soc/soc-dapm.c +35 -11
101 lines not on this page · raw message
Signature · 1 line
1.5.6.5
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Mark Brown
AppliedQuoted 3 lines · Ian Molton
The attached patch adds a new mixer control that allows cleaner support for the wm9705 codec Im working on. I think it probably has wider uses though.
Applied, thanks.
It'd be handy if you could post patches in the format suggested by Documentation/SubmittingPatches (unless your e-mail client would mangle them) with descriptive text after the ---. This helps with automated tools like git am.